html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #ffffff;
  color: #08090b;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display family — high opsz Fraunces with theatrical character */
.display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

/* ============== PAPER (light) ============== */
.bg-paper {
  background-color: #ffffff;
  background-image:
    radial-gradient(1200px 700px at 92% -8%, rgba(10,31,51,0.07), transparent 60%),
    radial-gradient(900px 600px at -8% 110%, rgba(10,31,51,0.06), transparent 60%);
  position: relative;
}
.bg-paper::before {
  content:"";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .03 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .55;
  mix-blend-mode: multiply;
}

/* ============== DEEP NIGHT (theater) ============== */
.bg-deepnight {
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(47,90,133,.22), transparent 60%),
    radial-gradient(900px 600px at 92% 100%, rgba(168,196,220,.10), transparent 60%),
    linear-gradient(180deg, #0a1f33 0%, #08090b 100%);
  position: relative;
}
.bg-deepnight::after {
  content:"";
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n2'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .04 0'/></filter><rect width='100%' height='100%' filter='url(%23n2)'/></svg>");
  mix-blend-mode: screen; opacity: .35;
}

/* ============== PLAYBILL NAV TABS ============== */
.nav-rail {
  display: inline-flex;
  align-items: stretch;
  border-top: 1px solid rgba(10,31,51,.18);
  border-bottom: 1px solid rgba(10,31,51,.18);
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  padding: .9rem 1.15rem;
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #0a1f33;
  transition: color 220ms cubic-bezier(.2,.8,.2,1), background-color 220ms ease;
}
.nav-link + .nav-link { border-left: 1px solid rgba(10,31,51,.12); }
.nav-link .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .62rem;
  font-weight: 500;
  color: #2f5a85;
  letter-spacing: 0;
  transition: color 220ms ease;
}
.nav-link::before {
  content:"";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: #0a1f33;
  transform: scaleX(0); transform-origin: 50% 50%;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
}
.nav-link:hover { color: #08090b; background: rgba(10,31,51,.04); }
.nav-link:hover .num { color: #08090b; }
.nav-link:hover::before,
.nav-link.is-active::before { transform: scaleX(1); }
.nav-link.is-active { color: #08090b; }
.nav-link.is-active .num { color: #08090b; }
.nav-link:focus-visible { outline: none; background: rgba(10,31,51,.06); }
.nav-link:focus-visible::before { transform: scaleX(1); }

/* Inline nav-link variant (used inside contact list) — no rail */
.nav-link-inline {
  position: relative;
  transition: color 220ms ease;
}
.nav-link-inline::after {
  content:""; position: absolute; left: 0; bottom: -3px;
  width: 0; height: 1px; background: currentColor;
  transition: width 260ms cubic-bezier(.2,.8,.2,1);
}
.nav-link-inline:hover::after,
.nav-link-inline:focus-visible::after { width: 100%; }
.nav-link-inline:focus-visible { outline: none; }

/* ============== HEADSHOT FRAMES ============== */
.headshot-frame {
  position: relative;
  overflow: hidden;
  background: #0a1f33;
}
.headshot-frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms cubic-bezier(.2,.8,.2,1), filter 600ms ease;
}
.headshot-frame::after {
  content:"";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,31,51,0) 58%, rgba(8,9,11,.42) 100%);
  pointer-events: none;
}
.headshot-frame:hover img,
.headshot-frame:focus-within img { transform: scale(1.025); }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.45rem;
  font-family: 'Inter', sans-serif;
  font-size: .76rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  border-radius: 0;
  white-space: nowrap;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), background-color 220ms ease, color 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.btn .arrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500; letter-spacing: 0; opacity: .85;
}
.btn-primary {
  background: #0a1f33; color: #ffffff;
  box-shadow: 0 14px 28px -18px rgba(10,31,51,.7);
}
.btn-primary:hover { background: #08090b; transform: translateY(-1px); box-shadow: 0 22px 36px -18px rgba(8,9,11,.7); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid #2f5a85; outline-offset: 3px; }

.btn-ghost {
  border: 1px solid rgba(10,31,51,.28); color: #0a1f33; background: transparent;
}
.btn-ghost:hover { border-color: #0a1f33; background: rgba(10,31,51,.04); transform: translateY(-1px); }
.btn-ghost:focus-visible { outline: 2px solid #2f5a85; outline-offset: 3px; }

/* ============== EYEBROW (mono futuristic accent) ============== */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .28em; text-transform: uppercase;
  color: #2f5a85; font-weight: 500;
  display: inline-flex; align-items: center; gap: .55rem;
}
.eyebrow::before {
  content:""; display: inline-block; width: 18px; height: 1px; background: currentColor; opacity: .55;
}

/* ============== RULES ============== */
.rule { width: 56px; height: 1px; background: #0a1f33; opacity: .22; }

/* ============== HEADINGS ============== */
.h-display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.02em;
  line-height: 1.02;
  font-weight: 400;
}
.h-name {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: .92;
  font-style: italic;
}
.h-name .amp {
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-style: italic; font-weight: 400;
  color: #2f5a85;
}

/* Tagline mono accent */
.tagline {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.05rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  font-weight: 500;
  color: #2f5a85;
  display: block;
}
@media (min-width: 768px) {
  .tagline {
    font-size: 1.35rem;
    letter-spacing: .58em;
  }
}
.tagline .dot { color: rgba(10,31,51,.35); margin: 0 .55em; }

/* Contact list label — matches tagline mono treatment */
.contact-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-weight: 500;
  color: #2f5a85;
}
.contact-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .9rem;
  letter-spacing: .04em;
  color: #08090b;
  font-weight: 500;
}
.contact-value.is-link { color: #0e2c47; }
.contact-dash {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 400;
  color: rgba(10,31,51,.45);
  letter-spacing: 0;
  flex-shrink: 0;
}
.contact-intro {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1rem;
  letter-spacing: .03em;
  line-height: 1.6;
  color: #2f5a85;
  font-weight: 600;
}
@media (min-width: 768px) {
  .contact-intro {
    font-size: 1.08rem;
  }
}

/* Compact button — for tight rows */
.btn-sm {
  padding: .65rem 1rem;
  font-size: .68rem;
  letter-spacing: .18em;
  gap: .45rem;
}

/* ============== BODY PROSE ============== */
.prose-body p { line-height: 1.78; }
.prose-body p + p { margin-top: 1.1em; }

/* ============== LIFT ============== */
.lift { transition: transform 320ms cubic-bezier(.2,.8,.2,1), box-shadow 320ms ease; }
.lift:hover { transform: translateY(-4px); }

/* ============== SOCIAL ICON ============== */
.icon-link {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0;
  border: 1px solid rgba(10,31,51,.20);
  color: #0a1f33;
  background: #ffffff;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.icon-link:hover { background: #0a1f33; color: #ffffff; border-color: #0a1f33; transform: translateY(-2px); }
.icon-link:focus-visible { outline: 2px solid #2f5a85; outline-offset: 3px; }

/* Logo variant — keep brand colors of the image, don't invert background on hover */
.icon-link-logo { padding: 6px; background: #ffffff; }
.icon-link-logo img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
.icon-link-logo:hover {
  background: #ffffff;
  border-color: #0a1f33;
  box-shadow: 0 10px 22px -14px rgba(10,31,51,.4);
}
.icon-link-logo:hover img { transform: scale(1.06); }

/* ============== SECTION ANCHORS ============== */
section[id] { scroll-margin-top: 96px; }

/* ============== FLOATED HERO HEADSHOT ============== */
.hero-float {
  float: left;
  width: 46%;
  max-width: 360px;
  margin: .35rem 2.25rem 1rem 0;
  aspect-ratio: 4 / 5;
  shape-outside: inset(0);
}
.hero-float img { object-position: center 30%; }
@media (max-width: 640px) {
  .hero-float {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1.75rem 0;
  }
}
.clearfix::after { content: ""; display: block; clear: both; }

/* ============== VIDEO ============== */
.video-frame {
  position: relative;
  border: 1px solid rgba(168,196,220,.18);
  background: #08090b;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* ============== RESUME ============== */
.resume-frame {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(10,31,51,.10);
  overflow: hidden;
  aspect-ratio: 8.5 / 11;
  margin: 0;
}
.resume-frame img,
.resume-frame object,
.resume-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
  object-fit: contain;
}

/* ============== HEADER SPOTLIGHT ============== */
.spotlight-stage {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.spotlight-stage::before {
  content: "";
  position: absolute;
  width: 720px; height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,222,168,0.32) 0%,
    rgba(255,196,128,0.16) 28%,
    rgba(255,196,128,0.06) 50%,
    transparent 70%);
  transform: translate(-50%, -50%);
  left: var(--spot-x, 50%);
  top: var(--spot-y, 38%);
  opacity: 0;
  transition: opacity 600ms cubic-bezier(.2,.8,.2,1);
  mix-blend-mode: multiply;
  filter: blur(2px);
}
.spotlight-stage.is-on::before { opacity: 1; }

/* ============== HERO PARALLAX ============== */
.hero-float {
  transition: transform 500ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.hero-float.tilt {
  transform: perspective(1100px)
             rotateX(var(--tilt-x, 0deg))
             rotateY(var(--tilt-y, 0deg))
             translateZ(0);
}

/* ============== SCROLL REVEAL ============== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms cubic-bezier(.2,.8,.2,1),
              transform 900ms cubic-bezier(.2,.8,.2,1);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 240ms; }
.reveal-d4 { transition-delay: 320ms; }
.reveal-d5 { transition-delay: 400ms; }
.reveal-d6 { transition-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .spotlight-stage::before { display: none; }
  .hero-float.tilt { transform: none !important; }
}

/* ============== LIGHTBOX ============== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(8,9,11,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 4vh 4vw;
  opacity: 0;
  transition: opacity 360ms cubic-bezier(.2,.8,.2,1);
}
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox-img {
  max-height: 90vh; max-width: min(720px, 92vw);
  object-fit: contain;
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.9),
              0 0 0 1px rgba(255,255,255,.05);
  animation: lightboxIn 480ms cubic-bezier(.2,.8,.2,1);
  background: #0a1f33;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-btn {
  position: absolute;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color 220ms ease,
              border-color 220ms ease,
              transform 260ms cubic-bezier(.2,.8,.2,1);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.lightbox-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.32);
}
.lightbox-btn:focus-visible { outline: 2px solid #a8c4dc; outline-offset: 3px; }
.lightbox-prev { left: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover  { transform: translateY(-50%) translateX(-3px); }
.lightbox-next { right: 3vw; top: 50%; transform: translateY(-50%); }
.lightbox-next:hover  { transform: translateY(-50%) translateX(3px); }
.lightbox-close { right: 3vw; top: 3vh; width: 42px; height: 42px; }
.lightbox-counter {
  position: absolute;
  bottom: 4vh; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .32em;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}
.headshot-frame.is-zoomable { cursor: zoom-in; }

/* ============== MARQUEE ID PLATE ============== */
.id-plate {
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .35rem .75rem;
  border: 1px solid rgba(10,31,51,.20);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .62rem; letter-spacing: .26em; text-transform: uppercase;
  color: #2f5a85;
}
.id-plate .led {
  width: 6px; height: 6px; border-radius: 999px;
  background: #2f5a85;
  box-shadow: 0 0 0 3px rgba(47,90,133,.18);
}

/* ============== PAGE TRANSITIONS ============== */
.page-fade-in {
  animation: pageIn 600ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-fade-in { animation: none; }
}

/* ============================================================
   MOBILE TUNING
   ============================================================ */
@media (max-width: 640px) {
  /* Tagline — was overflowing because of huge letter-spacing */
  .tagline {
    font-size: .78rem;
    letter-spacing: .28em;
  }
  .tagline .dot { margin: 0 .35em; }

  /* Footer tagline shrinks too */
  footer .tagline {
    font-size: .72rem;
    letter-spacing: .26em;
  }

  /* Name heading: keep two lines on the smallest phones, nudge size down */
  .h-name {
    letter-spacing: -0.025em;
  }

  /* Nav rail — pill-style chips on mobile so wraps look intentional */
  .nav-rail {
    border-top: none;
    border-bottom: none;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-link {
    padding: .5rem .8rem;
    font-size: .6rem;
    letter-spacing: .14em;
    gap: .4rem;
    border: 1px solid rgba(10,31,51,.18);
    background: rgba(255,255,255,.6);
  }
  .nav-link + .nav-link { border-left: 1px solid rgba(10,31,51,.18); }
  .nav-link .num { font-size: .54rem; }
  .nav-link::before { display: none; }
  .nav-link.is-active {
    background: #0a1f33;
    color: #ffffff;
    border-color: #0a1f33;
  }
  .nav-link.is-active .num { color: #a8c4dc; }

  /* Resume PDF embed: iOS Safari can't render <object>/<iframe> PDFs reliably.
     Hide the iframe and show a friendly tap-to-open card instead. */
  .resume-frame {
    aspect-ratio: auto;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  .resume-frame object,
  .resume-frame iframe { display: none; }
  .resume-frame::before {
    content: "Tap “Download Resume” above to open the PDF.";
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: .8rem;
    letter-spacing: .04em;
    line-height: 1.7;
    color: #2f5a85;
    max-width: 28ch;
  }

  /* Allow long button labels to wrap rather than overflow on phones */
  .btn { white-space: normal; line-height: 1.2; }

  /* Lightbox close/arrows pulled in slightly for thumb reach */
  .lightbox-prev { left: 2vw; }
  .lightbox-next { right: 2vw; }
  .lightbox-close { right: 2vw; top: 2vh; }
  .lightbox-img { max-width: 94vw; }
}
