/* ==========================================================================
   Local Fonts (self-hosted, no CDN dependency)
   ========================================================================== */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-variable.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-variable.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Devanagari';
  src: url('fonts/noto-sans-devanagari-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans JP';
  src: url('fonts/noto-sans-jp-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans SC';
  src: url('fonts/noto-sans-sc-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Apple Fluid Design System & Surface Tokens (WWDC Designing Fluid Interfaces)
   ========================================================================== */
:root {
  /* Light Theme — Cupertino Warm Alabaster & Precision Glass */
  --bg-primary: #fbfbfd;
  --bg-secondary: #f2f2f7;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-solid: #f7f8fb;
  --bg-card-hover: rgba(255, 255, 255, 0.94);
  --bg-tertiary: rgba(0, 0, 0, 0.05);
  --bg-glass: rgba(255, 255, 255, 0.72);
  
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-muted: #515154;
  
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.1);
  --border-specular: rgba(255, 255, 255, 0.8);
  --border-glow: rgba(10, 132, 255, 0.35);

  --google-blue: #007aff;
  --google-blue-hover: #0062cc;
  --google-red: #ff3b30;
  --google-yellow: #ff9f0a;
  --google-green: #34c759;
  
  --accent-purple: #af52de;
  --accent-cyan: #32ade6;
  --accent-amber: #ff9f0a;

  --badge-bg: rgba(0, 122, 255, 0.12);
  --badge-text: #007aff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.14), 0 8px 16px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 35px rgba(0, 122, 255, 0.18);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

[data-theme="dark"] {
  /* Dark Theme — Apple Pure OLED Black (#000000) & Deep Space Slate (#090a0f) */
  --bg-primary: #000000;
  --bg-secondary: #090a0f;
  --bg-card: rgba(24, 24, 28, 0.76);
  --bg-card-solid: #16171c;
  --bg-card-hover: rgba(36, 36, 42, 0.88);
  --bg-tertiary: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(18, 18, 22, 0.72);
  
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-muted: #515154;
  
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-card: rgba(255, 255, 255, 0.14);
  --border-specular: rgba(255, 255, 255, 0.24);
  --border-glow: rgba(10, 132, 255, 0.45);

  --google-blue: #0a84ff;
  --google-blue-hover: #007aff;
  --google-red: #ff453a;
  --google-yellow: #ffd60a;
  --google-green: #30d158;

  --badge-bg: rgba(10, 132, 255, 0.16);
  --badge-text: #64d2ff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px -6px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 50px -10px rgba(0, 0, 0, 0.85), 0 8px 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(10, 132, 255, 0.28);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Background Visuals */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: -2;
  opacity: 0.45;
}

.bg-glow-1 {
  width: 550px;
  height: 550px;
  top: -120px;
  left: 15%;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.4), transparent 70%);
}

.bg-glow-2 {
  width: 450px;
  height: 450px;
  top: 35%;
  right: 5%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35), transparent 70%);
}

.bg-glow-3 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: 5%;
  background: radial-gradient(circle, rgba(52, 168, 83, 0.25), transparent 70%);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(8, 12, 20, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.88);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-logo:hover {
  transform: scale(1.08);
}

.logo-orb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.orb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: var(--transition);
}
.orb-blue { background: var(--google-blue); box-shadow: 0 0 6px rgba(66, 133, 244, 0.4); }
.orb-red { background: var(--google-red); box-shadow: 0 0 6px rgba(234, 67, 53, 0.4); }
.orb-yellow { background: var(--google-yellow); box-shadow: 0 0 6px rgba(251, 188, 4, 0.4); }
.orb-green { background: var(--google-green); box-shadow: 0 0 6px rgba(52, 168, 83, 0.4); }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-grow: 1;
  flex-wrap: nowrap;
}

.nav-link {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--google-blue);
  background: var(--badge-bg);
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.nav-cta-btn {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  background: var(--google-blue);
  color: #ffffff !important;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(66, 133, 244, 0.35);
  white-space: nowrap;
}

.nav-cta-btn:hover {
  background: var(--google-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.45);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--google-blue);
  transform: rotate(15deg);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-header-tags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid rgba(66, 133, 244, 0.25);
}

.polyglot-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: var(--google-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--google-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 3.35rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 1.25rem;
  max-width: 920px;
}

.gradient-text {
  background: linear-gradient(135deg, #0a84ff 0%, #af52de 50%, #ff375f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-alt {
  background: linear-gradient(135deg, #32ade6 0%, #0a84ff 50%, #5e5ce6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 780px;
  line-height: 1.65;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Quick Telemetry Banner */
.quick-telemetry-banner {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.quick-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-card);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.quick-stat-pill:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.pill-metric {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--google-blue);
}

.pill-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Hero Actions */
.hero-actions {
  margin-bottom: 0.5rem;
}
.hero-actions .inner {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}


/* ==========================================================================
   Line-Mask Reveal Text Animation (Reverse-Engineered from recording)
   ========================================================================== */
.line-mask-reveal {
  overflow: hidden;
  display: block;
}

/* The animated inner element. Older markup used a bare > span; newer markup
   wraps the moving part in .inner. Both are supported. */
.line-mask-reveal > span,
.line-mask-reveal > .inner {
  display: inline-block;
  transform: translateY(118%);
  opacity: 0;
  filter: blur(6px);
  transition:
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
    opacity 0.6s ease var(--reveal-delay, 0ms),
    filter 0.6s ease var(--reveal-delay, 0ms);
}

.line-mask-reveal.revealed > span,
.line-mask-reveal.revealed > .inner {
  transform: translateY(0%);
  opacity: 1;
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .line-mask-reveal > span,
  .line-mask-reveal > .inner {
    transform: none;
    opacity: 1;
    filter: none;
    transition: none;
  }
}

/* ==========================================================================
   Airplane Window & Flight Hero Track (Reverse-Engineered 3D Experience)
   ========================================================================== */
.flight-hero-section {
  position: relative;
  height: 240vh; /* window reveal + mountain + opening line hold */
  background: transparent;
  width: 100%;
}

.flight-hero-sticky-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The WebGL window. Cabin wall, frame, bevel, shade and glass are all drawn
   by one fragment shader, with the mountain video as the view outside. The
   pre-reveal sky that used to run on a second 2D canvas (22 procedural clouds
   and 90 stars, 110 radial-gradient fills per frame) is now two gradient
   mixes inside that same shader. */
.hero-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* 3D Realistic Airplane Cabin Layer */
.airplane-cabin-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* The window moved into the shader, so this layer is now only the scroll
     prompt and no longer carries a per-frame transform. Opacity alone. */
  will-change: opacity;
  transition: opacity 0.1s linear;
}

/* Scroll prompt pill, positioned over the airplane window */
.cabin-editorial-text {
  position: absolute;
  left: 50%;
  top: 5.5rem;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: auto;
}

.flight-scroll-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  /* Opaque slate chip so the label stays legible over both the pale daytime
     sky (light theme) and the night sky (dark theme). */
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.flight-mouse-icon {
  width: 14px;
  height: 20px;
  border: 1.5px solid #38bdf8;
  border-radius: 8px;
  display: inline-block;
  position: relative;
}

.flight-wheel {
  width: 2px;
  height: 5px;
  background: #38bdf8;
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 1px;
  animation: mouse-scroll 1.5s infinite;
}

@keyframes mouse-scroll {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 8px); opacity: 0; }
}

/* No-WebGL fallback window. Never animated - it is a static frame behind the
   plain <video> when the GL context is unavailable or lost. The 3000px spread
   that used to be the cabin wall is fine here precisely because nothing scales
   it; in the WebGL path an SDF makes the wall infinite at any scale for free. */
.no-hero-gl .hero-mountain-video,
.hero-mountain-video.hero-video-visible {
  opacity: 1;
  z-index: 0;
}
.no-hero-gl .airplane-cabin-layer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(280px, 32vw, 380px);
  height: clamp(380px, 46vw, 540px);
  transform: translate(-50%, -50%);
  border-radius: 180px;
  border: clamp(12px, 1.6vw, 20px) solid #14181f;
  box-shadow: 0 0 0 4px #14181f, 0 0 0 3000px #14181f;
  pointer-events: none;
}
[data-theme="light"] .no-hero-gl .airplane-cabin-layer::after {
  border-color: #cfd6de;
  box-shadow: 0 0 0 4px #cfd6de, 0 0 0 3000px #cfd6de;
}

/* Hero Section Layer inside the Clouds */
.hero-clouds-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-clouds-layer.visible {
  opacity: 1;
  pointer-events: auto;
}

/* The hero content column: hangs on the left third, over the cloud video. No
   card. A soft radial scrim (see .hero-scrim, driven from JS) keeps the white
   type legible over any cloud frame without reading as a box. */
.hero-sky-content {
  position: relative;
  z-index: 2;
  width: min(820px, 90vw);
  margin-left: clamp(1.5rem, 9vw, 9rem);
  text-align: left;
}

/* The opening line: comes in once the peak is fully framed, and holds. */
.hero-opening {
  margin: 0;
  opacity: var(--opening-fade, 0);
}
.hero-opening .line {
  display: block;
  font-family: var(--font-sans);
  color: #ffffff;
  text-shadow: 0 2px 34px rgba(6, 10, 20, 0.55);
}
.hero-opening .line:first-child {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  max-width: 12ch;
}
.hero-opening .line.dim {
  margin-top: 1.1rem;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.9vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .hero-opening { opacity: 1; }
  .hero-scene-shade { opacity: 0.9 !important; }
}

/* ==========================================================================
   Intro section: name resolves word by word, driven by scroll position
   (scroll-controlled highlight, michaeltsirakis.com "ScrollColorText" style)
   ========================================================================== */
.intro-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  padding: 10rem clamp(1.5rem, 9vw, 9rem) 8rem;
  box-sizing: border-box;
}

.intro-inner {
  width: min(1000px, 100%);
}

/* "ABOUT" eyebrow, evenly spaced above the name (michaeltsirakis.com style) */
.intro-kicker {
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--google-blue);
}

.intro-headline {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(3.4rem, 11vw, 9rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.intro-headline .w {
  color: #b8b8bd;
  transition: color 0.18s linear;
}
[data-theme="dark"] .intro-headline .w { color: #45454b; }
.intro-headline .w.lit { color: var(--text-primary); }
.intro-headline .w.accent.lit { color: #0a84ff; }

/* Body: two short paragraphs + a pull quote, revealed when the section enters */
.intro-body {
  margin: clamp(2rem, 4vw, 3.25rem) 0 0;
  max-width: 60ch;
}

/* Body paragraph: each word switches from muted to full colour as the block
   scrolls up through the viewport (michaeltsirakis.com ScrollColorText). */
.intro-para {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.intro-para .rw {
  color: #c2c2c8;
  transition: color 0.12s linear;
}
[data-theme="dark"] .intro-para .rw { color: #3f3f45; }
.intro-para .rw.lit { color: var(--text-primary); }
/* Key phrases light up in the accent blue instead of ink. */
.intro-para .rw.key.lit { color: #0a84ff; }

.intro-quote {
  margin: 2.25rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--google-blue);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.intro-section.is-in .intro-quote { opacity: 1; transform: translateY(0); }

.intro-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: clamp(2.5rem, 4vw, 3.25rem);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease 0.1s, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}
.intro-section.is-in .intro-actions {
  opacity: 1;
  transform: translateY(0);
}

.intro-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--border-strong, rgba(120,120,120,0.5));
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.intro-text-link svg { transition: transform 0.2s ease; }
.intro-text-link:hover { border-color: currentColor; gap: 0.55rem; }
.intro-text-link:hover svg { transform: translate(2px, -2px); }
.intro-text-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  .intro-headline .w { color: var(--text-primary); transition: none; }
  .intro-headline .w.accent { color: #0a84ff; }
  .intro-para .rw { color: var(--text-primary); transition: none; }
  .intro-para .rw.key { color: #0a84ff; }
  .intro-quote, .intro-actions { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .intro-section { padding: 6rem 1.25rem; }
  .intro-headline { font-size: clamp(2.8rem, 15vw, 4.4rem); }
  .intro-body { font-size: 1rem; margin-top: 2rem; }
  .intro-body p { font-size: 1rem; }
  .intro-actions { gap: 1.25rem; margin-top: 2rem; }
}

.hero-actions {
  margin-top: 2.75rem;
}

/* Quiet secondary: a text link with a rising arrow, not a competing pill.
   Scaled-down echo of the big "Say hello" link at the end of the page. */
.hero-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.hero-text-link svg { transition: transform 0.2s ease; }
.hero-text-link:hover {
  border-color: #ffffff;
  gap: 0.55rem;
}
.hero-text-link:hover svg { transform: translate(2px, -2px); }
.hero-text-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Multilingual Greeting Curved SVG Preloader (Reverse-Engineered 3D Experience)
   ========================================================================== */
.intro-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #05070f;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  will-change: transform;
  overflow: visible;
}

.preloader-content {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 600;
  color: #F5F5F7;
  letter-spacing: -0.025em;
  user-select: none;
}

.preloader-dot {
  color: var(--google-blue);
  font-size: 1.25em;
  line-height: 1;
  text-shadow: 0 0 16px rgba(10, 132, 255, 0.7);
  animation: preloader-dot-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes preloader-dot-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

.preloader-word {
  display: inline-block;
  min-width: 180px;
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', 'Noto Sans JP', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translateZ(0);
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.preloader-word.fade-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.preloader-word.fade-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.preloader-curve {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 200px;
  transform: translateY(100%);
  fill: #05070f;
  pointer-events: none;
}

/* Replay Button in Nav */
.replay-btn {
  color: var(--text-secondary);
  transition: var(--transition);
}

.replay-btn:hover {
  color: var(--google-blue);
  transform: rotate(-30deg);
}

/* ==========================================================================
   Scroll-Driven 3D Card Deck Dealing & Flip Showcase (Awwwards/21st.dev)
   ========================================================================== */
.cards-3d-section {
  position: relative;
  height: 280vh; /* Scroll track for dealing and flipping */
  background-color: var(--bg-primary);
}

.cards-3d-sticky-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1600px;
  padding: 1.5rem;
}

.cards-ambient-glow {
  position: absolute;
  width: 800px;
  height: 450px;
  background: radial-gradient(circle at center, rgba(10, 132, 255, 0.18), rgba(191, 90, 242, 0.12), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.cards-3d-header {
  text-align: center;
  margin-bottom: 2rem;
  z-index: 5;
  pointer-events: none;
}

.cards-3d-title {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 0.5rem;
}

.cards-scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cards-3d-stage {
  position: relative;
  width: 100%;
  max-width: 1240px;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  z-index: 10;
}

.card-3d-item {
  position: absolute;
  width: clamp(230px, 21vw, 280px);
  height: clamp(330px, 31vw, 410px);
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 20px;
}

.card-3d-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: 20px;
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-sizing: border-box;
}

/* Card Back Face: Ornate Mandala Playing Card */
.card-face.card-back {
  background: #080c18;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(10, 132, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateY(0deg);
}

.playing-card-frame {
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(14, 165, 233, 0.6);
  background: 
    radial-gradient(circle at center, rgba(14, 165, 233, 0.15) 0%, transparent 60%),
    linear-gradient(135deg, #090e1f 0%, #030611 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ornate-pattern-overlay {
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.22) 1px, transparent 1px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 16px 16px, 20px 20px, 20px 20px;
  opacity: 0.85;
}

.card-center-medallion {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5), inset 0 0 15px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #0e1b38 0%, #050a18 100%);
}

.medallion-inner {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.medallion-symbol {
  font-size: 1.8rem;
  color: #38bdf8;
  text-shadow: 0 0 12px #38bdf8;
}

.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.corner-tl { top: 8px; left: 8px; }
.corner-br { bottom: 8px; right: 8px; transform: rotate(180deg); }

/* Card Front Face: Executive VisionOS Glass */
.card-face.card-front {
  transform: rotateY(180deg);
  background: #141826;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.75), 0 0 35px rgba(10, 132, 255, 0.16);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

[data-theme="light"] .card-face.card-front {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(66, 133, 244, 0.28);
  border-top-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 25px 60px -10px rgba(66, 133, 244, 0.2), 0 4px 20px rgba(0, 0, 0, 0.06);
}

.card-front-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.25) 0%,
    transparent 65%
  );
  opacity: 0.6;
  mix-blend-mode: overlay;
  transition: opacity 0.2s ease;
}

.card-front-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.card-kicker-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .card-kicker-pill {
  background: rgba(0, 0, 0, 0.06);
}

.card-kicker-pill.highlight-blue { color: var(--google-blue); border: 1px solid rgba(10, 132, 255, 0.3); }
.card-kicker-pill.highlight-purple { color: var(--accent-violet, #bf5af2); border: 1px solid rgba(191, 90, 242, 0.3); }
.card-kicker-pill.highlight-cyan { color: var(--accent-cyan, #64d2ff); border: 1px solid rgba(100, 210, 255, 0.3); }
.card-kicker-pill.highlight-green { color: var(--apple-green, #30d158); border: 1px solid rgba(48, 209, 88, 0.3); }

.card-rank {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
}

.card-front-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.card-stat-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

[data-theme="light"] .card-stat-box {
  background: rgba(240, 244, 250, 0.8);
}

.card-stat-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 40%, #86868b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .card-stat-num {
  background: linear-gradient(135deg, #1d1d1f 40%, #4285f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-front-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .cards-3d-stage {
    height: 480px;
  }
  .card-3d-item {
    width: clamp(200px, 42vw, 260px);
    height: clamp(300px, 60vw, 380px);
  }
}

@media (max-width: 640px) {
  .cards-3d-section {
    height: 240vh;
  }
  .cards-3d-title {
    font-size: 1.6rem;
  }
  .cards-3d-header {
    margin-bottom: 1rem;
  }
}
.tech-ticker-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 800px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.ticker-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tech-ticker {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.ticker-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: scale(0.97);
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.btn-lg {
  padding: 0.9rem 1.9rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
/* The hero primary sits on the bright sky: give it a stronger shadow so it
   lifts off the clouds. */
.hero-actions .btn-primary {
  box-shadow: 0 10px 30px rgba(6, 10, 20, 0.4), 0 2px 8px rgba(0, 99, 209, 0.4);
}

.btn-primary {
  /* Darker than the --google-blue text accent so white label copy clears
     WCAG AA (4.5:1) at the button's 0.92rem / 600 weight. */
  background: #0063d1;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: #0052ad;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(10, 132, 255, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-specular);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--google-blue);
  transform: translateY(-1px);
}

.btn-linkedin {
  background: #0077b5;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 119, 181, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-linkedin:hover {
  background: #006097;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 119, 181, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--google-blue);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--google-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Impact Telemetry Cards Grid
   ========================================================================== */
.impact-section {
  padding: 3rem 0 4.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-card);
  border-top: 1px solid var(--border-specular);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-glow);
}

.stat-card:active {
  transform: scale(0.97);
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-blue-light { background: rgba(66, 133, 244, 0.15); color: var(--google-blue); }
.bg-purple-light { background: rgba(124, 58, 237, 0.15); color: #a855f7; }
.bg-green-light { background: rgba(52, 168, 83, 0.15); color: var(--google-green); }
.bg-amber-light { background: rgba(251, 188, 4, 0.15); color: var(--google-yellow); }
.bg-red-light { background: rgba(234, 67, 53, 0.15); color: var(--google-red); }
.bg-cyan-light { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.stat-pill-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.stat-number-wrapper {
  margin-bottom: 0.75rem;
}

.stat-number {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-trend-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-top: 0.6rem;
  overflow: hidden;
}

.trend-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--google-blue), #8b5cf6);
  border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.stat-card-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   Experience Section & Tab Navigation
   ========================================================================== */

/* ==========================================================================
   Side-Gliding Career Journey Highlights Track (#experience)
   ========================================================================== */
.journey-experience-section,
.education-section {
  position: relative;
  background: var(--bg-primary);
  width: 100%;
  /* Section height is set at runtime (pin distance) by the scroll engine. */
}

.journey-sticky-viewport,
.edu-sticky-viewport {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* Header bar floats near the top; the text track is centred independently
   of it, so each entry lands in the true visual centre of the screen. */
.journey-header-bar {
  position: absolute;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(960px, calc(100% - 3rem));
  gap: 1rem;
  flex-wrap: wrap;
}

.journey-nav-indicators {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.3rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.journey-tab-pill {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.journey-tab-pill:hover {
  color: var(--text-primary);
}

.journey-tab-pill.active {
  background: var(--google-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}

.journey-counter {
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ==========================================================================
   Straight Scrubbed Text Track
   One role holds centred while its progress window is open, then fades out
   upward as the next one fades in from below. All driven 1:1 by scroll
   position in setupJourneyTextScroll / setupEducationTextScroll.
   ========================================================================== */
.journey-text-track,
.edu-text-track {
  position: absolute;
  /* Optically centred: nudged up from 50% so the block sits between the
     header pills (12vh) and the fold rather than reading low. */
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100% - 3rem));
  height: clamp(260px, 40vh, 340px);
}

.journey-entry,
.edu-entry {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
}

.journey-entry.active,
.edu-entry.active {
  pointer-events: auto;
}

.journey-entry-period,
.edu-entry-period {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* Explicit accessible blue: --google-blue (#007aff) only reaches 3.9:1 on
     the near-white section bg, short of AA for this small bold label. */
  color: #0057b8;
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .journey-entry-period,
[data-theme="dark"] .edu-entry-period {
  color: #4aa3ff;
}

.journey-entry-company,
.edu-entry-school {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.journey-entry-line,
.edu-entry-line {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.6;
  /* --text-muted (#515154 light) clears WCAG AA for body copy where
     --text-secondary (#86868b) does not. */
  color: var(--text-muted);
  margin: 0 0 0.65rem;
  max-width: 62ch;
}

[data-theme="dark"] .journey-entry-line,
[data-theme="dark"] .edu-entry-line {
  /* --text-muted is too dark on the near-black section bg in dark mode. */
  color: #a1a1a6;
}

.journey-entry-line:last-child,
.edu-entry-line:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  /* No pinning: the section and viewport return to normal flow so every entry
     is reachable by a plain scroll. */
  .journey-experience-section,
  .education-section {
    height: auto;
  }

  .journey-sticky-viewport,
  .edu-sticky-viewport {
    position: static;
    height: auto;
    overflow: visible;
    padding: 8rem 1.5rem 6rem;
  }

  .journey-header-bar {
    position: static;
    transform: none;
    margin: 0 auto 3rem;
  }

  .journey-text-track,
  .edu-text-track {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    height: auto;
    margin: 0 auto;
  }

  .journey-entry,
  .edu-entry {
    position: static;
    inset: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }
}

.competencies-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.bento-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.bento-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-glow);
}

.bento-core {
  grid-column: 1 / 2;
}

.bento-languages {
  grid-column: 2 / 4;
}

.bento-tools {
  grid-column: 1 / -1;
}

.bento-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bento-icon {
  font-size: 1.5rem;
  padding: 0.35rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.bento-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.bento-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Skill Meters */
.skill-meter-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.skill-meter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.skill-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--google-blue);
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--google-blue), #8b5cf6);
  border-radius: var(--radius-full);
}

/* Polyglot Grid */
.language-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.lang-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: var(--transition);
}

.lang-pill:hover {
  border-color: var(--google-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.lang-flag {
  font-size: 1.5rem;
}

.lang-details {
  display: flex;
  flex-direction: column;
}

.lang-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lang-level {
  font-size: 0.72rem;
  font-weight: 600;
}

.level-fluent { color: var(--google-green); }
.level-conv { color: var(--google-blue); }
.level-elem { color: #d97706; }

/* Tools Category Grid */
.tools-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.tool-cat-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-cat-header {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--google-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tool-pill {
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.tool-pill:hover {
  color: var(--text-primary);
  border-color: var(--google-blue);
  transform: translateY(-1px);
}

.tag-highlight {
  background: rgba(66, 133, 244, 0.12);
  color: var(--google-blue);
  border-color: rgba(66, 133, 244, 0.25);
}

/* ==========================================================================
   Education Section (scrubbed text track — shares the journey engine)
   ========================================================================== */
.education-section {
  border-top: 1px solid var(--border-subtle);
}

.edu-tab-pill {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.edu-tab-pill:hover {
  color: var(--text-primary);
}

.edu-tab-pill.active {
  background: var(--google-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}


/* ==========================================================================
   The Grand Finale: Sylva "Living Green" Organic World
   ========================================================================== */
.living-green-section {
  /* The Sylva WebGL scene is lit against a near-flat #4a4d44 ground. */
  --sylva-ground: #4a4d44;
  scroll-margin-top: 0;
  position: relative;
  width: 100%;
  height: 160vh; /* scroll track: vines grow across it */
  box-sizing: border-box;
  background: var(--sylva-ground);
  color: #f1f5f9;
  border-top: none;
}

/* Soft gradient bridge: fades from the page's own theme background into the
   Sylva ground so there is no visible line entering the section, in either
   light or dark mode. */
.living-green-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24vh;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(74, 77, 68, 0) 100%);
}

[data-theme="light"] .living-green-section {
  color: #f1f5f9;
}

[data-theme="light"] .living-green-section .living-subtitle {
  color: rgba(241, 245, 249, 0.85);
}

.sylva-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sylva-3d-scene-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: auto;
}

.sylva-3d-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: transparent;
  pointer-events: auto;
}

.sylva-canvas {
  display: none;
}

/* Text overlay: fills the pinned area on top of the WebGL scene. */
.sylva-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  max-width: 1180px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Title + a small "Say hi" pill, top-left */
.sylva-top {
  position: absolute;
  top: 12vh;
  left: clamp(1.5rem, 6vw, 5rem);
  right: clamp(1.5rem, 6vw, 5rem);
  pointer-events: auto;
}
.living-title {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  max-width: 18ch;
}
.emerald-text {
  background: linear-gradient(135deg, #34d399, #10b981, #059669);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Small pill pair (Mike nav style): ghost "Say hi" + filled "Book a call" */
.sylva-pill-pair {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sylva-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.sylva-pill svg { flex-shrink: 0; }
.sylva-pill-ghost {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sylva-pill-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.7);
}
.sylva-pill-solid {
  color: #0b140d;
  background: #eef4ec;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(6, 12, 6, 0.35);
}
.sylva-pill-solid:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Connect section: "Say hello" on a solid ground, after the Sylva roots
   ========================================================================== */
.connect-section {
  position: relative;
  z-index: 3;
  margin-top: -1px;
  min-height: 78vh;
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  padding: 8rem clamp(1.5rem, 9vw, 9rem);
  box-sizing: border-box;
  border-top: 1px solid var(--border-subtle);
}

.connect-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.connect-say-hello {
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
  font-family: var(--font-sans);
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--text-primary);
  text-decoration: none;
}
.connect-say-hello svg { transition: transform 0.25s ease; align-self: center; }
.connect-say-hello:hover svg { transform: translate(0.1em, -0.1em); }

/* Right-corner stack: LinkedIn text link on top, Download resume below,
   evenly spaced. */
.connect-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 0.6rem;
}
.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--border-subtle);
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}
.connect-link svg { flex-shrink: 0; transition: transform 0.2s ease; }
.connect-link:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  gap: 0.6rem;
}
.connect-link:hover svg { transform: translate(1px, -1px); }
.connect-link:focus-visible { outline: 2px solid var(--google-blue); outline-offset: 4px; border-radius: 2px; }

@media (max-width: 768px) {
  .sylva-top { top: 9vh; }
  .living-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .connect-section { padding: 5rem 1.25rem; min-height: 60vh; }
  .connect-inner { align-items: flex-start; }
  .connect-say-hello { font-size: clamp(2.8rem, 16vw, 4.5rem); }
  .connect-links { align-items: flex-start; }
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-skills-grid {
    grid-template-columns: 1fr;
  }

  .bento-core, .bento-languages, .bento-tools {
    grid-column: 1 / -1;
  }

  .language-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tools-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .panel-visual-grid,
  .interests-grid,
  .cert-chips-row {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .nav-links .nav-link {
    display: none;
  }

  .hero-sky-content {
    width: calc(100% - 2.5rem);
    margin-left: 1.25rem;
  }
  .hero-opening { max-width: 90%; }
  .hero-opening .line:first-child { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .hero-opening .line.dim { font-size: clamp(1rem, 4.4vw, 1.4rem); max-width: 26ch; }
  .hero-name { font-size: clamp(2.6rem, 13vw, 4rem); }
  .hero-line { font-size: 1.02rem; max-width: 30ch; margin-top: 1.25rem; }
  .hero-actions { margin-top: 2rem; }
  .hero-actions .reveal-fade { gap: 1.25rem; }
  .hero-scene-shade {
    background:
      linear-gradient(90deg, rgba(6, 10, 20, 0.72) 0%, rgba(6, 10, 20, 0.3) 42%, rgba(6, 10, 20, 0) 68%),
      linear-gradient(0deg, rgba(6, 10, 20, 0.4) 0%, rgba(6, 10, 20, 0) 34%);
  }

  .interactive-diagram {
    flex-direction: column;
  }

  .animated-pulse-line {
    width: 3px;
    height: 40px;
  }

  .hud-chip {
    padding: 0.35rem 0.65rem;
  }
  .hud-icon-wrap {
    font-size: 0.95rem;
    padding: 0.15rem;
  }
  .hud-label {
    font-size: 0.64rem;
  }
  .hud-val {
    font-size: 0.74rem;
  }
  .video-glass-footer {
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }
  .video-action-btn {
    font-size: 0.76rem;
    padding: 0.35rem 0.75rem;
  }
}

@media (max-width: 520px) {
  .hud-top-right, .hud-bottom-right {
    display: none;
  }
  .hud-top-left {
    top: 0.65rem;
    left: 0.65rem;
  }
  .hud-bottom-left {
    bottom: 0.65rem;
    left: 0.65rem;
  }
  .video-progress-container {
    width: 100%;
    order: 3;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .cta-box {
    padding: 2.25rem 1.25rem;
  }

  .language-cards-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   Hero cloud video + contrast scrim  (Phase 3)
   ========================================================================== */
/* Texture source for the WebGL window. It must stay attached and playing -
   iOS Safari will not decode a display:none video - but it is visually inert
   until the no-WebGL fallback promotes it with .hero-video-visible. */
.hero-mountain-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

/* Left-edge shading, baked into the scene so it reads as the mountain's own
   shadow side rather than a floating panel. Carries WCAG AA for the white
   headline over the peak. Fades in with the hero content (JS: --scene-shade). */
.hero-scene-shade {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: var(--scene-shade, 0);
  background:
    linear-gradient(95deg, rgba(6, 10, 20, 0.68) 0%, rgba(6, 10, 20, 0.28) 34%, rgba(6, 10, 20, 0) 56%),
    linear-gradient(0deg, rgba(6, 10, 20, 0.32) 0%, rgba(6, 10, 20, 0) 32%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-mountain-video {
    transform: none;
  }
}

/* ==========================================================================
   Ghost button + resume download  (shared CTA family)
   ========================================================================== */
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}
[data-theme="light"] .btn-ghost {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.22);
}
[data-theme="light"] .btn-ghost:hover {
  background: rgba(15, 23, 42, 0.1);
  border-color: rgba(15, 23, 42, 0.4);
}
/* Sylva section sits on the dark scene ground in both themes: keep ghost
   buttons and the resume link light there. */
.living-green-section .btn-ghost,
[data-theme="light"] .living-green-section .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.living-green-section .btn-ghost:hover,
[data-theme="light"] .living-green-section .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-download svg { flex-shrink: 0; }

.journey-resume-row {
  position: absolute;
  left: 50%;
  bottom: 8vh;
  transform: translateX(-50%);
  z-index: 5;
}

.section-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
}
.section-cta-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ==========================================================================
   Floating "Book a call" pill
   ========================================================================== */
.floating-cta {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  align-items: stretch;
  background: #0063d1;
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.3rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.floating-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.floating-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem 0.5rem 0.95rem;
}
.floating-cta-link svg { flex-shrink: 0; }
.floating-cta-divider {
  width: 1px;
  margin: 0.35rem 0;
  background: rgba(255, 255, 255, 0.28);
}
.floating-cta-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.floating-cta-dismiss:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .floating-cta { transition: opacity 0.2s ease; transform: none; }
  .floating-cta.is-visible { transform: none; }
}

@media (max-width: 768px) {
  /* Journey tab pills don't fit 6-across on a phone; the counter and the
     scrubbed company name already show position, so hide the pill strip. */
  .journey-nav-indicators { display: none; }
  .journey-header-bar { justify-content: center; }

  /* The nav keeps a persistent "Book a call" on mobile, so the floating pill
     is redundant and only collides with section CTAs. Hide it. */
  .floating-cta { display: none; }
  .journey-resume-row { bottom: 6vh; }
  .living-closing { margin-top: 3rem; gap: 1rem; }

  /* Scroll-prompt pill: clear of the fixed nav. */
  .cabin-editorial-text { top: 7.5rem; }

  /* Kill the olive bleed where the Sylva scene hands off to #connect. */
}

/* ==========================================================================
   Resume request gate (modal)
   ========================================================================== */
/* Root carries `hidden`; JS removes it, then adds .is-open on the next frame
   so the transition has a start state to animate from. */
.resume-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.resume-gate[hidden] { display: none; }

.resume-gate-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  /* No backdrop-filter: the page behind is scroll-locked and therefore
     static, so a blur would be invisible and still cost a full-area GPU
     pass every frame (PERF.md rule 7). */
}
.resume-gate.is-open .resume-gate-scrim { opacity: 1; }

.resume-gate-panel {
  position: relative;
  width: min(30rem, 100%);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  color: var(--text-primary);
  color-scheme: dark;
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  transform-origin: var(--rg-origin-x, 50%) var(--rg-origin-y, 50%);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
.resume-gate.is-open .resume-gate-panel { opacity: 1; transform: none; }
[data-theme="light"] .resume-gate-panel { color-scheme: light; }
.resume-gate-panel:focus { outline: none; }

.resume-gate-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.resume-gate-close:hover { color: var(--text-primary); }
.resume-gate-close:active {
  transform: scale(0.97);
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
.resume-gate-close:focus-visible { outline: 2px solid var(--google-blue); outline-offset: 2px; }

.resume-gate-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  padding-right: 2.5rem;
}
.resume-gate-sub {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin: 0 0 1.4rem;
}

.resume-gate-field { margin-bottom: 1rem; }
.resume-gate-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.resume-gate-field input,
.resume-gate-field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.resume-gate-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 55%, calc(100% - 0.75rem) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.resume-gate-field input:focus,
.resume-gate-field select:focus {
  outline: none;
  border-color: var(--google-blue);
  background: var(--bg-card-hover);
}
.resume-gate-field input[aria-invalid="true"],
.resume-gate-field select[aria-invalid="true"] { border-color: var(--google-red); }

/* Chrome forces a near-white autofill background that cannot be overridden
   directly; the long transition is the standard way to outrun it. */
.resume-gate-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 9999s ease-out;
}

.resume-gate-error {
  font-size: 0.8rem;
  color: var(--google-red);
  margin: 0.35rem 0 0;
}

/* Off-screen, not display:none - the better bots skip display:none fields. */
.resume-gate-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.resume-gate-submit {
  width: 100%;
  margin-top: 0.5rem;
  justify-content: center;
}
.resume-gate-submit[disabled] { opacity: 0.6; cursor: default; }

.resume-gate-result { text-align: left; padding-top: 1.4rem; }
.resume-gate-result-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  padding-right: 2.5rem;
}
.resume-gate-result-body {
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}
.resume-gate-result-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.resume-gate-result-cta:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--bg-tertiary);
}
.resume-gate-result-cta:active {
  transform: scale(0.97);
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
.resume-gate-result-cta:focus-visible { outline: 2px solid var(--google-blue); outline-offset: 3px; }

.resume-gate-toast {
  position: absolute;
  top: 0;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 2;
  opacity: 0;
  transform: translate(-50%, -0.5rem);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}
.resume-gate-toast.is-visible { opacity: 1; transform: translate(-50%, 0.85rem); }

/* The nav is fixed, so it needs the same scrollbar compensation as the body
   or it shifts when the modal locks scrolling. */
.nav-container { padding-right: var(--rg-scrollbar-comp, 0px); }

@media (prefers-reduced-motion: reduce) {
  .resume-gate-panel,
  .resume-gate-scrim,
  .resume-gate-toast {
    transition: opacity 0.15s linear;
    transform: none;
  }
  .resume-gate.is-open .resume-gate-panel { transform: none; }
  .resume-gate-toast.is-visible { transform: translate(-50%, 0.85rem); }
}

@media (max-width: 768px) {
  .resume-gate { padding: 0; align-items: flex-end; }
  .resume-gate-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1.25rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    transform: translateY(16px);
  }
  .resume-gate.is-open .resume-gate-panel { transform: none; }
}

/* Resume trigger under the telemetry cards. */
.impact-resume-row {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* ---- Resume gate: send animation -----------------------------------------
   Inline SVG, no GIF: crisp at any size, follows the theme, no extra asset.
   Runs once when the result view appears (JS adds .is-sent). Everything
   animated is transform, opacity or stroke-dashoffset, all compositor-cheap. */
.resume-gate-send {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
  color: var(--google-blue);
}
.resume-gate-send svg { overflow: visible; }

.resume-gate-send .rg-envelope,
.resume-gate-send .rg-trail,
.resume-gate-send .rg-check { opacity: 0; }

/* The flap and check are drawn on, so they start fully dashed out. */
.resume-gate-send .rg-flap { stroke-dasharray: 60; stroke-dashoffset: 60; }
.resume-gate-send .rg-tick { stroke-dasharray: 18; stroke-dashoffset: 18; }

.resume-gate-result.is-sent .rg-envelope {
  animation: rg-fly 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.resume-gate-result.is-sent .rg-flap {
  animation: rg-draw 0.44s cubic-bezier(0.16, 1, 0.3, 1) 0.30s forwards;
}
.resume-gate-result.is-sent .rg-check {
  animation: rg-badge 0.36s cubic-bezier(0.16, 1, 0.3, 1) 0.58s forwards;
  transform-origin: 74px 52px;
}
.resume-gate-result.is-sent .rg-tick {
  animation: rg-draw 0.34s cubic-bezier(0.16, 1, 0.3, 1) 0.74s forwards;
}
.resume-gate-result.is-sent .rg-trail-1 { animation: rg-streak 0.5s ease-out 0.16s; }
.resume-gate-result.is-sent .rg-trail-2 { animation: rg-streak 0.5s ease-out 0.24s; }
.resume-gate-result.is-sent .rg-trail-3 { animation: rg-streak 0.5s ease-out 0.20s; }

@keyframes rg-fly {
  0%   { opacity: 0; transform: translateX(-26px) scale(0.9); }
  55%  { opacity: 1; transform: translateX(3px) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes rg-draw { to { stroke-dashoffset: 0; } }
@keyframes rg-badge {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes rg-streak {
  0%   { opacity: 0; transform: translateX(14px); }
  35%  { opacity: 0.85; }
  100% { opacity: 0; transform: translateX(-16px); }
}

/* Reduced motion: show the finished state, never the flight. */
@media (prefers-reduced-motion: reduce) {
  .resume-gate-result.is-sent .rg-envelope,
  .resume-gate-result.is-sent .rg-check { opacity: 1; animation: none; }
  .resume-gate-result.is-sent .rg-flap,
  .resume-gate-result.is-sent .rg-tick { stroke-dashoffset: 0; animation: none; }
  .resume-gate-result.is-sent .rg-check { transform: none; }
  .resume-gate-result.is-sent .rg-trail { animation: none; }
}
