/* ============================================
   PERSONAL HOMEPAGE — "PRINT MEETS SCREEN"
   Halftone editorial aesthetic
   ============================================ */

/* --- Custom Properties --- */
:root {
  --teal-deep: #003D3D;
  --teal-primary: #004D4D;
  --teal-accent: #008080;
  --teal-light: #00A3A3;
  --white: #FFFFFF;
  --off-white: #FAFAF8;
  --gray-subtle: #E8E8E4;
  --gray-text: #6B6B65;

  --font-display: 'Bodoni Moda', Georgia, serif;
  --font-body: 'Instrument Sans', -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-2xl: 12rem;

  --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--teal-primary);
  background-color: var(--off-white);
  overflow-x: hidden;
}

::selection {
  background-color: var(--teal-accent);
  color: var(--white);
}

/* --- Noise Overlay --- */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(to bottom, var(--off-white) 60%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: opacity 0.3s var(--transition-smooth);
}

.nav-logo:hover {
  opacity: 0.7;
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--transition-smooth),
              transform 0.8s var(--transition-smooth);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Hero Section --- */
.hero {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-lg);
  padding: 5rem var(--space-md);
  position: relative;
  overflow: hidden;
}

.hero-content {
  padding-left: var(--space-md);
  z-index: 2;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
  margin-bottom: var(--space-md);
}

.hero-name em {
  font-style: italic;
  font-weight: 400;
  color: var(--teal-accent);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray-text);
  max-width: 32ch;
  margin-bottom: var(--space-lg);
}

.hero-contact {
  display: flex;
  align-items: center;
}

/* --- Hero Image with Halftone Frame --- */
.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.halftone-frame {
  position: relative;
  width: min(340px, 35vw);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.halftone-image {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.halftone-image svg,
.halftone-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.halftone-dots {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: radial-gradient(circle, var(--teal-primary) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.12;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.halftone-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid var(--teal-primary);
  pointer-events: none;
}

.halftone-frame::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  z-index: -1;
  border: 1px solid var(--teal-accent);
  opacity: 0.3;
}

/* --- Hero Background Halftone Pattern --- */
.hero-halftone-bg {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 140%;
  z-index: 0;
  background-image: radial-gradient(circle, var(--teal-accent) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  opacity: 0.06;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
}

/* --- Hero Copyright Credit --- */
.hero-credit {
  position: absolute;
  bottom: var(--space-md);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-text);
  letter-spacing: 0.05em;
  z-index: 2;
}

/* --- Contact Email in Hero --- */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  font-weight: 500;
  color: var(--teal-deep);
  text-decoration: none;
  position: relative;
  transition: color 0.3s var(--transition-smooth);
}

.contact-email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--teal-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--transition-smooth);
}

.contact-email:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.contact-email:hover {
  color: var(--teal-accent);
}

.arrow-icon {
  width: 0.75em;
  height: 0.75em;
  transition: transform 0.3s var(--transition-bounce);
}

.contact-email:hover .arrow-icon {
  transform: translate(4px, -4px);
}

/* --- Responsive: Tablet --- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding-top: var(--space-xl);
    text-align: center;
  }

  .hero-content {
    padding-left: 0;
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-contact {
    justify-content: center;
  }

  .hero-halftone-bg {
    width: 80%;
    right: -20%;
  }

  .halftone-frame {
    width: min(300px, 70vw);
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 600px) {
  :root {
    --space-xl: 5rem;
    --space-lg: 3rem;
  }

  .nav {
    padding: var(--space-xs) var(--space-sm);
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .nav-links a {
    font-size: 0.75rem;
  }

  .hero {
    padding: calc(var(--space-xl) + 2rem) var(--space-sm) var(--space-lg);
  }

  .hero-name {
    font-size: clamp(2.75rem, 12vw, 4rem);
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .hero-contact {
    justify-content: center;
  }

  .halftone-frame {
    width: min(260px, 75vw);
  }

  .halftone-frame::after {
    top: 8px;
    left: 8px;
    right: -8px;
    bottom: -8px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }

  .contact-email::after,
  .contact-email:hover .arrow-icon {
    transition: none;
  }
}

/* --- Print --- */
@media print {
  .noise-overlay,
  .hero-halftone-bg,
  .nav {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
