/* ============================================================
   Refan — portfolio demo v3
   Theme tokens: "Teal Current" — teal -> sky -> soft periwinkle
   gradient, picked from the round-2 palette artifact.
   ============================================================ */

/* self-hosted from Google Fonts (latin + latin-ext only); Korean text falls back to the system Korean font */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-latin-ext-0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-latin-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-latin-ext-0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-latin-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-latin-ext-0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-latin-1.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f7f8;
  --bg-elev: #e9eff0;
  --bg-elev-2: #dde7e8;
  --text: #0f1c1f;
  --text-muted: #5c6d72;
  --border: rgba(15, 28, 31, 0.1);

  --accent-1: #0d9488;
  --accent-2: #0ea5e9;
  --accent-3: #818cf8;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  --glow-opacity: 0.18;
  --shadow: 0 10px 40px rgba(15, 40, 45, 0.08);

  --chrome-bg: rgba(9, 18, 20, 0.62);
  --chrome-border: rgba(255, 255, 255, 0.14);
  --chrome-text: rgba(255, 255, 255, 0.6);
  --chrome-text-active: #ffffff;

  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0a1315;
  --bg-elev: #101c1e;
  --bg-elev-2: #1c2a2c;
  --text: #e9f4f4;
  --text-muted: #82989b;
  --border: rgba(255, 255, 255, 0.08);

  --accent-1: #14b8a6;
  --accent-2: #38bdf8;
  --accent-3: #a5b4fc;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  --glow-opacity: 0.26;
  --shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; /* iOS: no font inflation in landscape */
  text-size-adjust: 100%;
}
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body.lock-scroll { overflow: hidden; height: 100vh; height: 100svh; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.05; }

p { margin: 0; color: var(--text-muted); line-height: 1.6; }

a { color: inherit; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- glow blobs ----------------
   Each blob drifts and breathes on its own slow keyframe loop
   (`transform`), while initGlowField in script.js eases --px/--py
   toward the cursor; the separate `translate` property composes
   with `transform`, scaled by each blob's --depth for parallax.
   ---------------------------------------------- */
.glow-field {
  --px: 0;
  --py: 0;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.7s ease;
}
body.is-loading .glow-field { opacity: 0; }
.glow-blob {
  --depth: 50px;
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  background: var(--gradient);
  /* soft edge from a radial mask, not filter: blur(90px) — a blur this
     big over half the screen is one of the most expensive things a
     phone GPU can be asked to repaint every frame */
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.2) 82%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.2) 82%, transparent 100%);
  scale: 1.45; /* a blur spreads light past the circle's edge; the mask doesn't, so the blob is drawn larger */
  opacity: var(--glow-opacity);
  translate: calc(var(--px) * var(--depth)) calc(var(--py) * var(--depth));
  will-change: transform;
  transition: opacity 0.6s var(--ease-slow);
}
.glow-blob.a { top: -14vw; left: -10vw; animation: glow-drift-a 16s ease-in-out infinite alternate; }
.glow-blob.b {
  --depth: -70px;
  bottom: -18vw;
  right: -12vw;
  width: 38vw;
  height: 38vw;
  animation: glow-drift-b 19s ease-in-out infinite alternate;
}
.glow-blob.c {
  --depth: 90px;
  top: 38vh;
  left: 42vw;
  width: 26vw;
  height: 26vw;
  opacity: calc(var(--glow-opacity) * 0.85);
  animation: glow-drift-c 13s ease-in-out infinite alternate;
}
@keyframes glow-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(24vw, 18vh) scale(1.25); }
  100% { transform: translate(8vw, 42vh) scale(0.9); }
}
@keyframes glow-drift-b {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-28vw, -20vh) scale(0.85); }
  100% { transform: translate(-10vw, -46vh) scale(1.25); }
}
@keyframes glow-drift-c {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-32vw, -26vh) scale(1.45); }
  100% { transform: translate(26vw, 14vh) scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .glow-blob { animation: none; translate: none; }
}

/* ---------------- circuit field ----------------
   PCB traces + moving current pulses, drawn by initCircuitField in
   script.js. Sits just above the glow blobs and below all content;
   the radial mask thins it out toward the middle of the screen, where
   text usually sits, and keeps it strongest at the edges.
   ---------------------------------------------- */
.circuit-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(0, 0, 0, 0.12), #000);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(0, 0, 0, 0.12), #000);
}
.circuit-field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------------- controls capsule ----------------
   One dark-glass capsule, independent of the page theme
   (adapted from the reference toggle image), holding the
   EN/KR segmented switch and the theme knob together.
   Two placements share this component: a small one fixed
   top-right once the site is entered (--floating), and a
   large centered one that IS the intro screen's focus (--lg).
   ---------------------------------------------- */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.controls-bar[hidden] { display: none; }
.controls-bar--floating {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 50;
}
.controls-bar--lg {
  padding: 9px;
  gap: 16px;
}
.controls-bar--lg .lang-switch button { padding: 15px 28px; font-size: 16px; }
.controls-bar--lg .controls-divider { height: 32px; }
.controls-bar--lg .theme-toggle { width: 54px; height: 54px; }
.controls-bar--lg .theme-toggle svg { width: 22px; height: 22px; }

.lang-switch {
  position: relative;
  display: flex;
  gap: 2px;
}
.lang-switch button {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--chrome-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s ease;
}
.lang-switch button.active { color: var(--chrome-text-active); }
.lang-switch .pill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  border-radius: 999px;
  background: var(--gradient);
  transition: transform 0.45s var(--ease-slow);
}

.controls-divider {
  width: 1px;
  height: 22px;
  background: var(--chrome-border);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-slow);
}
.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle svg {
  position: absolute;
  width: 17px;
  height: 17px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.3s ease, transform 0.4s var(--ease-slow);
}
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-40deg) scale(0.7); }
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(40deg) scale(0.7); }

.nav-toggle {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--chrome-border);
  background: var(--chrome-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle[hidden] { display: none; }
.nav-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--chrome-text-active);
  transition: transform 0.3s var(--ease-slow), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-menu {
  position: fixed;
  top: 74px;
  left: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 8px;
  border-radius: 16px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transform-origin: top left;
}
.nav-menu[hidden] { display: none; }
.nav-menu a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--chrome-text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-menu a:hover { color: var(--chrome-text-active); background: rgba(255, 255, 255, 0.08); }
.nav-menu__divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--chrome-border);
}

/* hand wave badge, positioned by JS next to the theme toggle,
   plays a wiggle whenever the theme changes — placeholder for
   the reference robot-hand asset until that's supplied */
.hand-wave {
  position: fixed;
  z-index: 51;
  width: 36px;
  height: 36px;
  pointer-events: none;
  opacity: 0;
  transform-origin: 60% 90%;
}
.hand-wave svg { width: 100%; height: 100%; fill: none; stroke: var(--accent-3); stroke-width: 1.6; }

/* ---------------- intro screen ---------------- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  overflow: hidden;
}

.intro-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  color: var(--text);
  margin-bottom: 10px;
}

.intro-subtext {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.enter-btn {
  margin-top: 40px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--bg);
  background: var(--gradient);
  border: none;
  padding: 16px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease-slow);
}
.enter-btn:hover { transform: translateY(-3px) scale(1.02); }

.scroll-hint-group {
  position: absolute;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-hint {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.trademark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.55;
}

/* ---------------- loader ---------------- */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  /* transparent: the circuit background shows through; the blue glow is
     faded out while body.is-loading (see runLoader) */
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-quote {
  max-width: 60ch;
  padding: 0 32px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  font-weight: 600;
  color: var(--text);
}
.loader-quote .attribution {
  display: block;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.loader-bar-track {
  width: min(280px, 60vw);
  height: 3px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient);
  border-radius: 999px;
}

/* ---------------- main content ---------------- */
#main-content {
  position: relative;
  z-index: 1;
  visibility: hidden;
}

.content-section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 8vw 8vw;
}

.content-section .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.content-section.reverse .grid { direction: rtl; }
.content-section.reverse .grid > * { direction: ltr; }


.photo-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
  background: var(--bg-elev);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.08);
  will-change: transform;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 18px;
  overflow: hidden;
}

.section-title {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  font-weight: 800;
  overflow: hidden;
}
.section-title .line { overflow: hidden; }

.section-body {
  margin-top: 22px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 44ch;
}

/* ---------------- sticky-stacking transition ----------------
   The wrapper is taller than one viewport; the panel inside it is
   position:sticky, so it pins full-screen and holds while the user
   scrolls through the wrapper's extra height, then releases right
   as the wrapper ends — at which point Projects (next in normal
   document flow) is already positioned to rise up and cover it.
   Pure browser compositor work, no JS driving the motion.
   ---------------------------------------------- */
.sticky-chapter { position: relative; min-height: 120vh; }
.sticky-chapter__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.transition-panel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}
.transition-panel__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15) 55%, rgba(0, 0, 0, 0.35));
}
.transition-panel__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12vh;
  padding: 0 8vw;
  text-align: center;
}
.transition-panel__eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 14px;
}
.transition-panel__line {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: #fff;
  max-width: 20ch;
  margin: 0 auto;
}

/* ---------------- chip bridge (between transition + projects) ----------------
   No card, no background: the WebGL canvas is transparent, so the
   chrome chip floats straight on the page and its glow field. */
.chip-bridge {
  position: relative;
  padding: 12vh 0 0;
}
/* typed line above the chip (setupTypewriters in script.js); hidden
   until typing starts so it never flashes in fully first */
.chip-bridge__line {
  max-width: 26ch;
  margin: 0 auto;
  padding: 0 8vw;
  box-sizing: content-box;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.3;
  color: var(--text);
}
/* every [data-typewriter] line stays hidden until typeOut (script.js)
   starts on it, so it never flashes in fully first */
[data-typewriter]:not(.is-typing):not(.is-typed) { visibility: hidden; }
/* zero-width inline anchor, so moving it between characters never
   adds a line-break opportunity; the bar itself is the ::after */
.tw-caret { position: relative; }
.tw-caret::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: -0.12em;
  width: 2px;
  height: 1.05em;
  border-radius: 1px;
  background: var(--gradient);
  animation: tw-blink 1s steps(1) infinite;
}
.is-typing .tw-caret::after { animation: none; } /* solid while typing, like a real caret */
.is-typed .tw-caret::after { animation: tw-blink 1s steps(1) infinite, tw-fade 0.6s 1.2s forwards; }
@keyframes tw-blink { 50% { opacity: 0; } }
@keyframes tw-fade { to { visibility: hidden; } }
.chip-bridge__stage {
  width: 100%;
  height: clamp(360px, 68vh, 720px);
  height: clamp(360px, 68svh, 720px);
  cursor: grab;
}
.chip-bridge__stage:active { cursor: grabbing; }
/* pan-y: vertical swipes still scroll the page on touch; horizontal
   drags spin the chip */
.chip-bridge__stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.chip-bridge__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4vh;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-slow);
}
.chip-bridge.is-touched .chip-bridge__hint { opacity: 0; }
.chip-bridge.is-unsupported .chip-bridge__stage,
.chip-bridge.is-unsupported .chip-bridge__hint { display: none; }
.chip-bridge.is-unsupported { padding-bottom: 12vh; }

/* ---------------- projects section ---------------- */
.content-section--projects {
  flex-direction: column;
  align-items: stretch;
  gap: 6vw;
  padding: 5vw 8vw 10vw;
}
.projects-intro { max-width: 1200px; width: 100%; margin: 0 auto; }
.projects-intro .section-body { max-width: 640px; }

/* fanned card deck — cards are stacked dead-center here; their fan
   position (x/y/rotation/scale/z-index) is set entirely by GSAP from
   each card's distance to the selected one (setupProjectDeck in
   script.js). transform-origin at the bottom makes the fan pivot
   like a hand of cards. */
.project-deck {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: 460px;
  overflow: hidden; /* fallback for Safari < 16 */
  overflow: clip;
}
.deck-card {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 260px;
  margin-left: -130px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  transform-origin: 50% 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.deck-card:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.deck-card__media { position: absolute; inset: 0; display: block; }
.deck-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.deck-card__img:not([src]) { visibility: hidden; }
/* portrait phone screenshots: show the whole UI instead of cropping */
.deck-card--contain .deck-card__media { background: #0b1214; }
.deck-card--contain .deck-card__img { object-fit: contain; padding: 18px 18px 64px; }
.deck-card__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 36px 18px 16px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82) 45%);
}
.deck-card__tag {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 4px;
}
.deck-card__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.1;
  color: #fff;
}
.deck-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.deck-panels { max-width: 1200px; width: 100%; margin: 0 auto; }
[data-deck-panel][hidden] { display: none; }

.project-subsection {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.project-subsection__head { margin-bottom: 24px; }
.project-subsection__title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
}
.project-subsection__intro {
  margin-top: 10px;
  font-size: 1rem;
  max-width: 62ch;
}

.project-card {
  width: 100%;
}
.project-card__title-row { margin-bottom: 20px; }
.project-card__tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 2px;
}
.project-card__title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 800;
}
.project-card__body {
  margin-top: 20px;
  font-size: 1rem;
  max-width: 62ch;
}
.project-card__link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  text-decoration: none;
}
.project-card__link:hover { text-decoration: underline; }

/* project-preview — the overview-first default state: a static
   summary (thumbnail + headline result + CTA). Collapses (via
   [hidden], see the override below) once its CTA is clicked and the
   photo strip below takes over — see setupProjectPreviews in
   script.js. */
.project-preview {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 8px 0 16px;
}
.project-preview[hidden] { display: none; }
.project-preview__media {
  flex: 0 0 auto;
  height: 280px;
  max-width: 46%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-elev);
}
/* 3D tilt + glare, driven by setupTilt in script.js: the glare is a
   soft light spot at the cursor (--gx/--gy), only while tilting */
.has-tilt { will-change: transform; }
.project-preview__media { position: relative; }
.has-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.has-tilt.is-tilting::after { opacity: 1; }
.project-preview__img {
  height: 100%;
  width: auto;
  display: block;
}
.project-preview__text { flex: 1 1 auto; min-width: 0; }
.project-preview__body {
  margin: 0 0 24px;
  font-size: 1.05rem;
  max-width: 52ch;
}
.project-preview__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.project-preview__cta:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}
.project-preview__arrow { transition: transform 0.25s ease; }
.project-preview__cta:hover .project-preview__arrow { transform: translateX(4px); }
.project-preview__hint {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* project-reveal — wraps an .app-gallery (and, for FOTRIX, its
   .app-video too) so both stay hidden until the preceding
   .project-preview's CTA is clicked. See setupProjectPreviews in
   script.js. */
.project-reveal[hidden] { display: none; }

/* toolbar on an open photo strip (built by setupProjectPreviews):
   counter on the left, prev/next + "Hide photos" on the right */
.reveal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.reveal-bar__count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.reveal-bar__actions { display: flex; align-items: center; gap: 8px; }
.reveal-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.reveal-bar__btn:hover:not(:disabled) { background: var(--gradient); border-color: transparent; color: #fff; }
.reveal-bar__btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.reveal-bar__btn:disabled { opacity: 0.35; cursor: default; }
.reveal-bar__nav { padding: 0; font-size: 16px; }
.reveal-bar__nav[hidden] { display: none; }

.app-showcase + .app-showcase { margin-top: 56px; }
.app-showcase[hidden] { display: none; }

/* app-gallery — a plain native horizontal swipe/scroll strip of phone
   screenshots (no ScrollTrigger lock: these are portrait UI shots,
   not a technical narrative, so a full-bleed scroll-hijack would be
   overkill). Each shot is sized by height alone so its own aspect
   ratio decides its width — no letterboxing or cropping of the UI. */
.app-gallery {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 0 4px;
}
.app-gallery::-webkit-scrollbar { display: none; }
.app-gallery__track {
  display: flex;
  gap: 20px;
  padding: 0 8vw;
  width: max-content;
}
.app-gallery__shot {
  position: relative;
  flex: 0 0 auto;
  height: 62vh;
  height: 62svh;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  scroll-snap-align: center;
  margin: 0;
}
.app-gallery__shot img { height: 100%; width: auto; display: block; }
.app-gallery__shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.78));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.app-gallery__desc {
  display: block;
  margin-top: 4px;
  max-width: 52ch;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.app-video {
  width: 100%;
  max-width: 720px;
  margin: 24px auto 0;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.app-video video { width: 100%; display: block; }

/* contact-hero — full-bleed photo hero for the final section, same
   breakout trick as .app-gallery. #contact.content-section
   strips the shared padding/centering below so this fully controls
   its own sizing. */
#contact.content-section,
#documents.content-section { padding: 0; align-items: stretch; min-height: 0; }
.contact-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}
.contact-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* reversed from the original bottom-anchored version: darkest at the
   top now, where the text sits, fading out toward the bottom so the
   photo itself (mostly sky up top, the subject lower down) still reads. */
.contact-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.35));
}
.contact-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8vw 8vw 8vw;
}
.contact-hero__content .eyebrow { color: rgba(255, 255, 255, 0.7); }
.contact-hero__content .section-title { color: #fff; }
.contact-hero__content .section-body { color: rgba(255, 255, 255, 0.85); max-width: 60ch; }
/* Email, LinkedIn, GitHub in one even row — a grid keeps the three
   the same width regardless of each link's text length. */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
/* long values (the email) wrap inside their card instead of spilling out */
.contact-link { min-width: 0; }
.contact-link__text { min-width: 0; }
.contact-link__value { overflow-wrap: break-word; }
.contact-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.contact-link:hover { background: var(--gradient); border-color: transparent; transform: translateY(-2px); }
.contact-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.contact-link__icon svg { width: 18px; height: 18px; }
.contact-link__text { display: flex; flex-direction: column; gap: 4px; }
.contact-link__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.contact-link:hover .contact-link__label { color: rgba(255, 255, 255, 0.85); }
.contact-link__value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 8vw 8vw 6vw;
  text-align: center;
}
/* static golden-angle spiral, drawn once by initFooterParticles in
   script.js — sits behind the footer text, never intercepts clicks. */
.site-footer__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.site-footer__content { position: relative; z-index: 1; }
.site-footer p { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.back-to-top {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 820px) {
  .content-section .grid { grid-template-columns: 1fr; gap: 32px; }
  .content-section.reverse .grid { direction: ltr; }
  .photo-frame { aspect-ratio: 4 / 3; }
  .controls-bar--floating { top: 16px; right: 16px; }
  .controls-bar--lg { flex-direction: row; }
  .controls-bar--lg .lang-switch button { padding: 12px 20px; font-size: 14px; }
  .nav-toggle { top: 16px; left: 16px; }
  .nav-menu { top: 66px; left: 16px; }
  .project-preview { flex-direction: column; align-items: flex-start; gap: 24px; }
  .project-preview__media { height: 220px; max-width: 100%; }
  .project-preview__body { max-width: none; }
  .app-gallery__shot { height: 52vh; height: 52svh; }
  .app-gallery__track { padding: 0 6vw; }
  .reveal-bar__nav { display: none; }
  .project-deck { height: 360px; width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
  .deck-card { width: 190px; margin-left: -95px; border-radius: 18px; }
  .deck-card__title { font-size: 1.1rem; }
  .deck-card--contain .deck-card__img { padding: 12px 12px 54px; }
  .contact-hero__content { padding: 10vw 6vw; }
  .contact-links { flex-direction: column; }
}

/* notched / rounded-corner phones (viewport-fit=cover): floating
   controls stay inside the safe area */
@supports (top: env(safe-area-inset-top)) {
  .controls-bar--floating { top: max(24px, env(safe-area-inset-top)); right: max(24px, env(safe-area-inset-right)); }
  .nav-toggle { top: max(24px, env(safe-area-inset-top)); left: max(24px, env(safe-area-inset-left)); }
  .nav-menu { top: calc(max(24px, env(safe-area-inset-top)) + 50px); left: max(24px, env(safe-area-inset-left)); }
  @media (max-width: 820px) {
    .controls-bar--floating { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
    .nav-toggle { top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
    .nav-menu { top: calc(max(16px, env(safe-area-inset-top)) + 50px); left: max(16px, env(safe-area-inset-left)); }
  }
}

/* phones: backdrop blur is costly while scrolling; a smaller radius
   looks the same on these small capsules and scrolls smoother */
@media (max-width: 820px) {
  .controls-bar, .nav-toggle, .nav-menu { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}

/* ----------------------------------------------
   site header — full-width frosted bar: links on
   the left, CV pill + language + theme on the right.
   It follows the page theme (--bg / --text), unlike the
   dark-glass chrome used by the floating dropdowns.
   ---------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(32px, env(safe-area-inset-right)) 0 max(32px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  transition: box-shadow 0.3s ease;
}
.site-header[hidden] { display: none; }
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(15, 40, 45, 0.08); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a,
.site-nav__docs-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.site-nav > a:hover,
.site-nav__docs-btn:hover,
.site-nav__docs-btn[aria-expanded="true"] { color: var(--text); background: var(--border); }
.site-nav > a.is-active { color: var(--text); }
.site-nav > a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}
.site-nav__docs-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-slow);
}
.site-nav__docs-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.site-nav__docs { position: relative; }
.docs-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 16px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transform-origin: top left;
}
.docs-menu[hidden] { display: none; }
.docs-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--chrome-text-active);
  text-decoration: none;
  transition: background 0.2s ease;
}
.docs-menu a:hover { background: rgba(255, 255, 255, 0.08); }
.docs-menu svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: var(--gradient);
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.docs-menu span { display: flex; flex-direction: column; gap: 2px; }
.docs-menu strong { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.docs-menu small { font-size: 12px; color: var(--chrome-text); }

/* right cluster: the shared .controls-bar, flattened into the bar */
.controls-bar--header {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.controls-bar--header .controls-divider { background: var(--border); }
.controls-bar--header .lang-switch {
  padding: 3px;
  border-radius: 999px;
  background: var(--border);
}
.controls-bar--header .lang-switch .pill { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 4px); }
.controls-bar--header .lang-switch button { color: var(--text-muted); padding: 8px 16px; }
.controls-bar--header .lang-switch button.active { color: #fff; }

.cv-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-2) 35%, transparent);
  transition: transform 0.3s var(--ease-slow), box-shadow 0.3s ease;
}
.cv-pill:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-2) 45%, transparent); }
.cv-pill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the hamburger lives inside the bar now, phones only */
.site-header .nav-toggle {
  position: static;
  display: none;
  box-shadow: none;
}

.nav-menu a.nav-menu__dl { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.nav-menu__dl svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

@media (max-width: 900px) {
  .site-header { height: 60px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .site-nav { display: none; }
  .site-header .nav-toggle { display: flex; width: 40px; height: 40px; }
  .controls-bar--header { gap: 8px; }
  .controls-bar--header .lang-switch button { padding: 7px 12px; }
  .controls-bar--header .theme-toggle { width: 36px; height: 36px; }
  .cv-pill { height: 36px; padding: 0 13px 0 11px; }
  .nav-menu { top: calc(60px + 8px); left: max(16px, env(safe-area-inset-left)); }
}
@media (min-width: 901px) {
  .nav-menu { display: none; }
}

/* documents section — reuses .contact-hero; the helmet photo stays dark
   overall so the cards read, the visor still shows at the bottom */
.docs-hero { min-height: 0; }
.docs-hero .contact-hero__img { object-position: center 40%; }
.docs-hero .contact-hero__scrim {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.25));
}
.docs-hero .contact-hero__content { padding-top: 6vw; padding-bottom: 6vw; }
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
  max-width: 820px;
}
.doc-card {
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
}
.doc-card__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.doc-card__desc { margin: 0 0 18px; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.doc-card__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-btn {
  flex: 1 1 120px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.doc-btn span, .doc-btn small { white-space: nowrap; }
.doc-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-btn small { margin-left: auto; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; }
/* monochrome to match the photo: hover and current language go solid white */
.doc-btn:hover { background: #fff; border-color: #fff; color: #111; transform: translateY(-2px); }
.doc-btn.is-current { background: #f2f2f2; border-color: #f2f2f2; color: #111; }
.doc-btn.is-current:hover { background: #fff; }
.doc-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* breathing room between the two full-bleed photo sections */
#contact.content-section { margin-top: clamp(120px, 20vw, 280px); }
