/* ================================================================
   ENTRAINMENT HOUSE — Brand Tokens & Global Styles
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700&family=Inter:wght@300;400;500&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Color */
  --eh-black: #030303;
  --eh-white: #ffffff;
  --eh-bone: #e9e4da;
  --eh-muted: #8f8a82;
  --eh-dim: #4a463f;
  --eh-ember: #b75a2a;
  --eh-deep-brown: #140c08;
  --eh-line: rgba(255,255,255,0.08);
  --eh-line-strong: rgba(255,255,255,0.15);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Type scale — Perfect Fourth (1.333) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.333rem;
  --text-xl: 1.777rem;
  --text-2xl: 2.369rem;
  --text-3xl: 3.157rem;
  --text-4xl: 4.209rem;
  --text-5xl: 5.61rem;
  --text-hero: clamp(3.5rem, 8vw, 7rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;
  --space-section: clamp(6rem, 12vh, 12rem);

  /* Line weights (matching logo system) */
  --weight-strong: 1.5px;
  --weight-medium: 1px;
  --weight-wisp: 0.5px;

  /* Motion */
  --ease-reveal: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-slow: 1.2s;
  --duration-medium: 0.6s;
  --duration-fast: 0.3s;
}

/* ================================================================
   Reset & Base
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--eh-black);
  color: var(--eh-bone);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--eh-ember);
  color: var(--eh-white);
}

/* ================================================================
   Typography Classes
   ================================================================ */

/* Display — editorial serif, titles and headings */
.display-hero {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--eh-white);
}

.display-large {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--eh-white);
}

.display-medium {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.15;
  color: var(--eh-white);
}

.display-small {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
  color: var(--eh-white);
}

/* Body text */
.body-text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.8;
  color: var(--eh-bone);
  max-width: 38em;
}

.body-large {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.7;
  color: var(--eh-bone);
  max-width: 36em;
}

/* Metadata — mono, small caps, labels */
.meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--eh-muted);
}

.meta-ember {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--eh-ember);
}

/* Editorial — large serif for pull quotes and position text */
.editorial {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: var(--eh-white);
}

/* ================================================================
   Layout
   ================================================================ */

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.shell-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-section) 0;
}

.section-border {
  border-top: var(--weight-wisp) solid var(--eh-line);
}

.section-center {
  text-align: center;
}

/* ================================================================
   Components — Plates (museum-label style)
   ================================================================ */

.plate {
  padding: var(--space-lg) var(--space-md);
  border: var(--weight-wisp) solid var(--eh-line);
  background: transparent;
  transition: border-color var(--duration-fast);
}

.plate:hover {
  border-color: var(--eh-line-strong);
}

.plate-grid {
  display: grid;
  gap: var(--weight-wisp);
}

.plate-grid-2 { grid-template-columns: repeat(2, 1fr); }
.plate-grid-3 { grid-template-columns: repeat(3, 1fr); }
.plate-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ================================================================
   Components — Links & CTAs
   ================================================================ */

/* Typographic link — not a button, elegant */
.link-quiet {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--eh-bone);
  border-bottom: var(--weight-wisp) solid var(--eh-dim);
  padding-bottom: 2px;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}

.link-quiet:hover {
  border-color: var(--eh-bone);
  color: var(--eh-white);
}

.link-ember {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--eh-ember);
  transition: color var(--duration-fast);
}

.link-ember:hover { color: var(--eh-white); }

/* ================================================================
   Components — Dividers
   ================================================================ */

.divider {
  width: 100%;
  height: var(--weight-wisp);
  background: var(--eh-line);
  margin: var(--space-lg) 0;
}

.divider-short {
  width: 60px;
  height: var(--weight-wisp);
  background: var(--eh-muted);
  margin: var(--space-md) 0;
}

/* ================================================================
   Entrance — Cinematic title sequence
   ================================================================ */

.entrance {
  min-height: 200vh;
  position: relative;
}

.entrance__sigil {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.entrance__emblem {
  width: min(80vw, 600px);
  height: auto;
  /* Start with tight radial mask — only the center sigil is visible */
  mask-image: radial-gradient(circle, black var(--mask-radius, 12%), transparent var(--mask-edge, 18%));
  -webkit-mask-image: radial-gradient(circle, black var(--mask-radius, 12%), transparent var(--mask-edge, 18%));
  opacity: var(--emblem-opacity, 0);
  transition: none;
}

.entrance__wordmark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 200px));
  text-align: center;
  z-index: 3;
  opacity: var(--wordmark-opacity, 0);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entrance__word-entrainment {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--eh-white);
}

.entrance__word-house {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.6em;
  color: var(--eh-muted);
}

.entrance__scroll-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  opacity: var(--hint-opacity, 0.6);
  animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Hero section after entrance */
.hero-reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: heroRevealIn 1s var(--ease-reveal) 0.3s forwards;
}

@keyframes heroRevealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   Motion — Reveal animations
   ================================================================ */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: revealIn var(--duration-slow) var(--ease-reveal) forwards;
}

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

/* Stagger children */
.section:nth-child(2) .reveal { animation-delay: 0.1s; }
.section:nth-child(3) .reveal { animation-delay: 0.2s; }
.section:nth-child(4) .reveal { animation-delay: 0.3s; }
.section:nth-child(5) .reveal { animation-delay: 0.4s; }
.section:nth-child(6) .reveal { animation-delay: 0.5s; }
.section:nth-child(7) .reveal { animation-delay: 0.6s; }
.section:nth-child(8) .reveal { animation-delay: 0.7s; }

@keyframes revealIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slow emblem fade */
.emblem-reveal {
  opacity: 0;
  animation: emblemFade 2s var(--ease-reveal) forwards;
}

.emblem-reveal.visible {
  opacity: 1;
}

@keyframes emblemFade {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .emblem-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ================================================================
   Navigation
   ================================================================ */

.eh-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 var(--space-md);
  border-bottom: var(--weight-wisp) solid transparent;
  transition: border-color 0.6s, background 0.6s;
  background: transparent;
}

.eh-nav.scrolled {
  border-color: var(--eh-line);
  background: rgba(3,3,3,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Hide nav during entrance sequence */
.eh-nav.entrance-hidden {
  opacity: 0;
  pointer-events: none;
}

.eh-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.eh-nav__mark {
  display: flex;
  align-items: center;
}

.eh-nav__seal {
  height: 28px;
  width: auto;
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}

.eh-nav__seal:hover { opacity: 1; }

.eh-nav__links {
  display: flex;
  gap: 1.5rem;
}

.eh-nav__links a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--eh-muted);
  transition: color var(--duration-fast);
}

.eh-nav__links a:hover { color: var(--eh-bone); }

.eh-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
}

.eh-nav__toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--eh-bone);
  transition: all var(--duration-fast);
}

/* Mobile nav overlay */
.eh-nav__mobile-overlay {
  display: none;
}

/* ================================================================
   Forms
   ================================================================ */

.eh-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.eh-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eh-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.eh-input {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: var(--weight-wisp) solid var(--eh-line-strong);
  color: var(--eh-bone);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  transition: border-color var(--duration-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.eh-input:focus {
  border-color: var(--eh-ember);
}

.eh-input::placeholder {
  color: var(--eh-dim);
}

.eh-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

select.eh-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238f8a82' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.eh-button {
  padding: 16px 32px;
  background: transparent;
  border: var(--weight-medium) solid var(--eh-bone);
  color: var(--eh-bone);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all var(--duration-fast);
  align-self: flex-start;
}

.eh-button:hover {
  background: var(--eh-bone);
  color: var(--eh-black);
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
  .plate-grid-2,
  .plate-grid-3,
  .plate-grid-4 {
    grid-template-columns: 1fr;
  }

  .display-hero {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .display-large {
    font-size: var(--text-3xl);
  }

  .display-small {
    font-size: var(--text-lg);
  }

  .editorial {
    font-size: var(--text-xl);
  }

  .entrance__emblem {
    width: min(85vw, 320px);
  }

  .entrance__word-entrainment {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .eh-form__row {
    grid-template-columns: 1fr;
  }

  /* Mobile nav */
  .eh-nav__links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--eh-black);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 200;
  }

  .eh-nav.open .eh-nav__links {
    display: flex;
  }

  .eh-nav.open .eh-nav__links a {
    font-size: 18px;
    color: var(--eh-bone);
  }

  .eh-nav__toggle {
    display: flex;
    z-index: 201;
  }

  .eh-nav.open .eh-nav__toggle span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .eh-nav.open .eh-nav__toggle span:last-child {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  /* Ensure touch targets are at least 44px */
  .eh-button, .eh-input, select.eh-input {
    min-height: 44px;
  }

  .link-quiet, .link-ember {
    padding: 8px 0;
    display: inline-block;
  }
}

/* ================================================================
   SCENE3D INTRO — House Signal / Studio Ident
   ================================================================ */

.eh-intro {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050506;
}

.eh-intro__accessible {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.eh-intro__scene {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---- Cinematic reveal easing ---- */
/* Long deceleration — physical settling, not spring physics */

/* Mark container — holds logo + charge glow in same position */
.eh-intro__mark-container {
  position: relative;
  z-index: 6;
  pointer-events: none;
}

/* Phase 1: Brief darkness (0–0.5s), then mark emerges (0.5–2.5s) */
.eh-intro__mark {
  position: relative;
  width: 200px;
  height: auto;
  opacity: 0;
  animation:
    eh-mark-in 2s cubic-bezier(0.25, 0.0, 0.1, 1.0) 0.5s forwards,
    eh-mark-flash 0.4s cubic-bezier(0.0, 0.0, 0.2, 1.0) 2.6s forwards,
    eh-mark-charge-react 3.8s cubic-bezier(0.1, 0.0, 0.1, 1.0) 2.8s forwards,
    eh-mark-glitch 1.0s steps(1, end) 6.6s forwards;
}

/* Interior charge — radial glow centered on the alchemical symbol.
   Larger, brighter, pulses, spills light onto the whole mark. */
.eh-intro__mark-charge {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 245, 220, 0.3) 20%,
    rgba(200, 170, 100, 0.1) 45%,
    transparent 70%
  );
  mix-blend-mode: screen;
  animation:
    eh-charge 3.8s cubic-bezier(0.1, 0.0, 0.1, 1.0) 2.8s forwards,
    eh-charge-pulse 0.4s ease-in-out 5.0s 4;
  pointer-events: none;
}

@keyframes eh-charge {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3);
         filter: blur(12px); }
  10%  { opacity: 0.2; filter: blur(8px); }
  25%  { opacity: 0.5; transform: translate(-50%, -50%) scale(0.6);
         filter: blur(5px);
         background: radial-gradient(
           ellipse 100% 100% at 50% 50%,
           rgba(255, 255, 255, 0.6) 0%,
           rgba(255, 240, 200, 0.35) 18%,
           rgba(220, 190, 120, 0.12) 42%,
           transparent 68%
         ); }
  50%  { opacity: 0.8; transform: translate(-50%, -50%) scale(0.85);
         filter: blur(3px);
         background: radial-gradient(
           ellipse 100% 100% at 50% 50%,
           rgba(255, 255, 255, 0.8) 0%,
           rgba(255, 245, 210, 0.5) 15%,
           rgba(240, 210, 140, 0.2) 38%,
           transparent 65%
         ); }
  72%  { opacity: 1.0; transform: translate(-50%, -50%) scale(1.2);
         filter: blur(1px);
         background: radial-gradient(
           ellipse 100% 100% at 50% 50%,
           rgba(255, 255, 255, 0.95) 0%,
           rgba(255, 250, 230, 0.6) 12%,
           rgba(255, 230, 180, 0.3) 30%,
           rgba(200, 170, 100, 0.08) 55%,
           transparent 75%
         ); }
  82%  { opacity: 1.0; transform: translate(-50%, -50%) scale(1.3);
         filter: blur(0px); }
  90%  { opacity: 0.5; transform: translate(-50%, -50%) scale(1.15);
         filter: blur(3px); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.0);
         filter: blur(6px); }
}

/* Staccato flicker pulses at peak charge — electric instability */
@keyframes eh-charge-pulse {
  0%   { opacity: 1.0; }
  25%  { opacity: 0.4; }
  50%  { opacity: 1.0; }
  75%  { opacity: 0.7; }
  100% { opacity: 1.0; }
}

@keyframes eh-mark-in {
  0%   { opacity: 0; }
  20%  { opacity: 0.05; }
  50%  { opacity: 0.4; }
  80%  { opacity: 0.85; }
  100% { opacity: 0.88; }
}

@keyframes eh-mark-flash {
  0%   { filter: brightness(1.0); }
  35%  { filter: brightness(1.5); }
  100% { filter: brightness(1.0); }
}

/* Mark reacts to interior charge — brightness spills through line work */
@keyframes eh-mark-charge-react {
  0%   { filter: brightness(1.0) drop-shadow(0 0 0px transparent); }
  30%  { filter: brightness(1.1) drop-shadow(0 0 4px rgba(255, 245, 220, 0.1)); }
  55%  { filter: brightness(1.25) drop-shadow(0 0 10px rgba(255, 245, 220, 0.2)); }
  72%  { filter: brightness(1.5) drop-shadow(0 0 20px rgba(255, 240, 200, 0.3)); }
  82%  { filter: brightness(1.6) drop-shadow(0 0 25px rgba(255, 240, 200, 0.35)); }
  92%  { filter: brightness(1.1) drop-shadow(0 0 6px rgba(255, 245, 220, 0.08)); }
  100% { filter: brightness(1.0) drop-shadow(0 0 0px transparent); }
}

@keyframes eh-mark-glitch {
  0%   { transform: translate(0, 0); opacity: 0.88; filter: brightness(1.0); }
  5%   { transform: translate(-3px, 1px); opacity: 0.4; filter: brightness(1.8); }
  8%   { transform: translate(2px, -1px); opacity: 0.88; filter: brightness(1.0); }
  12%  { transform: translate(0, 0); opacity: 0.88; }
  18%  { transform: translate(4px, 0); opacity: 0.2; filter: brightness(2.0); }
  20%  { transform: translate(-1px, 2px); opacity: 0.88; filter: brightness(1.0); }
  25%  { transform: translate(0, 0); opacity: 0.88; }
  40%  { transform: translate(0, 0); opacity: 0.88; }
  42%  { transform: translate(-2px, -1px); opacity: 0.5; filter: brightness(1.6); }
  44%  { transform: translate(1px, 0); opacity: 0.88; filter: brightness(1.0); }
  50%  { transform: translate(0, 0); opacity: 0.88; }
  65%  { transform: translate(0, 0); opacity: 0.88; }
  67%  { transform: translate(2px, 1px); opacity: 0.3; }
  69%  { transform: translate(0, 0); opacity: 0.88; }
  100% { transform: translate(0, 0); opacity: 0.88; filter: brightness(1.0); }
}

/* Phase 4: Wordmark assembles from scattered fragments.
   Individual letters arrive from geometric offsets, lock into place,
   then a brief optical flare pulses across the resolved wordmark. */
.eh-intro__wordmark {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  pointer-events: none;
}

.eh-intro__word-1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--eh-bone);
  display: flex;
}

.eh-intro__word-2 {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--eh-muted);
  display: flex;
}

/* Individual letter fragments — scattered start, precise lock */
.eh-l {
  display: inline-block;
  opacity: 0;
}

.eh-l--space {
  width: 0.35em;
}

/* ENTRAINMENT letters — assemble starting at 2.8s */
.eh-intro__word-1 .eh-l {
  animation: eh-letter-lock 1.8s cubic-bezier(0.15, 0.0, 0.1, 1.0) forwards;
  animation-delay: calc(2.8s + var(--i) * 0.07s);
}

/* HOUSE letters — assemble after ENTRAINMENT settles */
.eh-intro__word-2 .eh-l {
  animation: eh-letter-lock 1.5s cubic-bezier(0.15, 0.0, 0.1, 1.0) forwards;
  animation-delay: calc(4.8s + var(--i) * 0.08s);
}

/* Scatter offsets — alternating directions, slight rotations.
   Each letter arrives from a different angle. Odd from above-left,
   even from below-right. Varying distances by index. */
.eh-intro__word-1 .eh-l:nth-child(odd) {
  --scatter-x: calc(-12px - var(--i) * 3px);
  --scatter-y: calc(-18px - var(--i) * 2px);
  --scatter-r: calc(-8deg + var(--i) * 1.5deg);
}

.eh-intro__word-1 .eh-l:nth-child(even) {
  --scatter-x: calc(10px + var(--i) * 2px);
  --scatter-y: calc(14px + var(--i) * 3px);
  --scatter-r: calc(6deg - var(--i) * 1deg);
}

.eh-intro__word-2 .eh-l:nth-child(odd) {
  --scatter-x: calc(-8px - var(--i) * 2px);
  --scatter-y: calc(12px + var(--i) * 2px);
  --scatter-r: calc(5deg - var(--i) * 1deg);
}

.eh-intro__word-2 .eh-l:nth-child(even) {
  --scatter-x: calc(6px + var(--i) * 3px);
  --scatter-y: calc(-10px - var(--i) * 2px);
  --scatter-r: calc(-4deg + var(--i) * 1.5deg);
}

@keyframes eh-letter-lock {
  0% {
    opacity: 0;
    filter: blur(6px) brightness(1.0);
    transform: translate(var(--scatter-x, 0), var(--scatter-y, 0)) rotate(var(--scatter-r, 0deg));
  }
  25% {
    opacity: 0.35;
    filter: blur(3px) brightness(1.0);
  }
  55% {
    opacity: 0.85;
    filter: blur(0.5px) brightness(1.0);
    transform: translate(0, 0) rotate(0deg);
  }
  70% {
    opacity: 1;
    filter: blur(0px) brightness(1.0);
    transform: translate(0, 0) rotate(0deg);
  }
  82% {
    filter: blur(0px) brightness(1.5);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
  }
  100% {
    opacity: 1;
    filter: blur(0px) brightness(1.0);
    transform: translate(0, 0) rotate(0deg);
    text-shadow: 0 0 0px transparent;
  }
}

/* Wordmark glitch — in sync with the mark, the assembled text
   jitters and flickers before settling into final stillness. */
.eh-intro__word-1 {
  animation: eh-word-glitch-a 0.9s steps(1, end) 6.5s forwards;
}

.eh-intro__word-2 {
  animation: eh-word-glitch-b 1.1s steps(1, end) 6.7s forwards;
}

@keyframes eh-word-glitch-a {
  0%   { transform: translate(0, 0); opacity: 1; }
  8%   { transform: translate(3px, -1px); opacity: 0.4; }
  11%  { transform: translate(-1px, 0); opacity: 1; }
  15%  { transform: translate(0, 0); }
  35%  { transform: translate(0, 0); }
  38%  { transform: translate(-2px, 1px); opacity: 0.5; }
  40%  { transform: translate(0, 0); opacity: 1; }
  70%  { transform: translate(0, 0); }
  72%  { transform: translate(1px, 0); opacity: 0.3; }
  74%  { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 1; }
}

@keyframes eh-word-glitch-b {
  0%   { transform: translate(0, 0); opacity: 1; }
  12%  { transform: translate(-2px, 0); opacity: 0.45; }
  14%  { transform: translate(1px, 1px); opacity: 1; }
  18%  { transform: translate(0, 0); }
  30%  { transform: translate(0, 0); }
  32%  { transform: translate(2px, -1px); opacity: 0.35; }
  35%  { transform: translate(0, 0); opacity: 1; }
  55%  { transform: translate(0, 0); }
  57%  { transform: translate(-1px, 0); opacity: 0.5; }
  59%  { transform: translate(0, 0); opacity: 1; }
  80%  { transform: translate(0, 0); }
  82%  { transform: translate(1px, 1px); opacity: 0.3; }
  84%  { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 1; }
}

/* Lock flash — brief flare across the whole wordmark when assembly completes.
   Fires once, 0.2s peak, sharp decay. White, not warm. Optical, not ambient. */
.eh-intro__wordmark::after {
  content: '';
  position: absolute;
  inset: -10%;
  z-index: 11;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 70%
  );
  opacity: 0;
  animation: eh-lock-flash 0.5s cubic-bezier(0.0, 0.0, 0.2, 1.0) 6.2s forwards;
}

@keyframes eh-lock-flash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Phase 5: Room opens (5.5–6.5s)
   Hero copy and CTA appear in place. Opacity only. */
.eh-intro__hero-copy {
  position: relative;
  z-index: 10;
  margin-top: 2rem;
  opacity: 0;
  animation: eh-fade 1.0s cubic-bezier(0.25, 0.0, 0.1, 1.0) 6.8s forwards;
  pointer-events: none;
}

.eh-intro__hero-copy p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--eh-muted);
  text-align: center;
  max-width: 28rem;
  line-height: 1.7;
}

.eh-intro__cta {
  position: relative;
  z-index: 10;
  margin-top: 2rem;
  opacity: 0;
  animation: eh-fade 0.8s cubic-bezier(0.25, 0.0, 0.1, 1.0) 7.5s forwards;
}

@keyframes eh-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Skip button ---- */
.eh-intro__skip {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  z-index: 20;
  background: none;
  border: 1px solid var(--eh-line);
  color: var(--eh-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  opacity: 0;
  animation: eh-fade 0.6s ease-out 1.5s forwards;
}

.eh-intro__skip:hover,
.eh-intro__skip:focus-visible {
  color: var(--eh-bone);
  border-color: var(--eh-line-strong);
}

.eh-intro__skip:focus-visible {
  outline: 2px solid var(--eh-ember);
  outline-offset: 3px;
}

/* ---- Fallback wordmark (skipped state only) ---- */
.eh-intro__fallback {
  position: relative;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.eh-intro__fallback-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  color: var(--eh-bone);
  letter-spacing: 0.15em;
}

.eh-intro__fallback-wordmark span:first-child {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
}

.eh-intro__fallback-wordmark span:last-child {
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.5em;
  color: var(--eh-muted);
}

/* ---- Skipped state — everything resolves immediately ---- */
.eh-intro.skipped .eh-intro__scene { display: none; }
.eh-intro.skipped .eh-intro__mark { opacity: 0.88; animation: none; filter: none; transform: none; }
.eh-intro.skipped .eh-intro__mark-charge { display: none; }
.eh-intro.skipped .eh-l { opacity: 1; animation: none; transform: none; filter: none; }
.eh-intro.skipped .eh-intro__word-1 { animation: none; transform: none; opacity: 1; }
.eh-intro.skipped .eh-intro__word-2 { animation: none; transform: none; opacity: 1; }
.eh-intro.skipped .eh-intro__wordmark::after { display: none; }
.eh-intro.skipped .eh-intro__hero-copy { opacity: 1; animation: none; }
.eh-intro.skipped .eh-intro__cta { opacity: 1; animation: none; }
.eh-intro.skipped .eh-intro__skip { display: none; }

/* ---- Short intro — compressed, no darkness hold ---- */
.eh-intro[data-mode="short"] .eh-intro__mark {
  animation-duration: 0.8s;
  animation-delay: 0.1s;
}

.eh-intro[data-mode="short"] .eh-intro__word-1 .eh-l {
  animation-duration: 0.3s;
  animation-delay: calc(0.8s + var(--i) * 0.025s);
}

.eh-intro[data-mode="short"] .eh-intro__word-2 .eh-l {
  animation-duration: 0.25s;
  animation-delay: calc(1.1s + var(--i) * 0.03s);
}

.eh-intro[data-mode="short"] .eh-intro__wordmark::after {
  animation-delay: 1.4s;
}

.eh-intro[data-mode="short"] .eh-intro__hero-copy {
  animation-delay: 1.5s;
  animation-duration: 0.4s;
}

.eh-intro[data-mode="short"] .eh-intro__cta {
  animation-delay: 1.7s;
  animation-duration: 0.4s;
}

.eh-intro[data-mode="short"] .eh-intro__skip {
  animation-delay: 0.1s;
}

/* ---- Reduced motion — everything visible, no animation ---- */
@media (prefers-reduced-motion: reduce) {
  .eh-intro__mark { opacity: 0.88; animation: none; }
  .eh-intro__mark-charge { display: none; }
  .eh-l { opacity: 1; animation: none; transform: none; }
  .eh-intro__wordmark::after { display: none; }
  .eh-intro__hero-copy { opacity: 1; animation: none; }
  .eh-intro__cta { opacity: 1; animation: none; }
  .eh-intro__scene { display: none; }
  .eh-intro__skip { display: none; animation: none; }
}

/* Grain overlay */
.eh-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* Vignette via CSS (lighter than PostFX) */
.eh-intro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, rgba(5,5,6,0.6) 100%);
}
