/* ============================================================================
   Landing deck — full-viewport hero + how-it-works section whose five Figma
   beats animate IN PLACE (`.hiw`, one section, GSAP master timeline loop).
   Motion lives in js/08-landing-deck.js (GSAP + IntersectionObserver).
   ========================================================================== */

/* ── Scene / stage scaffold ───────────────────────────────────────────── */
.deck-flow {
  position: relative;
}
.deck-scene {
  position: relative;
  min-height: 100vh;
}
.deck-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 24px;
}
/* (.deck-stage--dark / --paper removed — only the hero remains a deck scene;
   the how-it-works section carries its own background on .hiw below.) */

/* ── Content centering ────────────────────────────────────────────────── */
.lx-content {
  text-align: center;
}
.lx-content > div {
  max-width: min(960px, 88vw);
}
/* Hero content block: Figma 546px wide, centered in 1440 frame. */
.c-hero > div {
  width: 546px;
  max-width: min(546px, 88vw);
}

/* grain leftover markers — no-op */
.lx-grain {
  display: none;
}

/* ── ocean (scene 1 bg) — reuses existing .hero__media video ───────────── */
.deck-stage .hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ── hero copy ─────────────────────────────────────────────────────────── */
.c-hero {
  position: relative;
  z-index: 2;
}
.c-hero .lx-h1,
.c-hero .lx-sub {
  opacity: 0;
  filter: blur(8px);
}
.lx-h1 {
  /* Reset the UA h1 margin — it collapsed over .lx-sub's 24px and opened the
     title→sub gap to 33px (Figma: 24). */
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: #f5f5f5;
  font-size: clamp(36px, 3.47vw, 50px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.lx-sub {
  margin-top: 24px;
  font-family: 'Instrument Serif', Georgia, serif;
  color: #f5f5f5;
  font-size: clamp(16px, 1.39vw, 20px);
  line-height: 1.45;
}
.lx-em {
  font-style: italic;
  font-weight: 400;
}

/* ── persistent deck header (eyebrow + "Not interpretation. Calculation.") ── */
.lx-eyebrow {
  font-family: 'TAY Makawao', 'Instrument Serif', serif;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: #f5f5f5;
  margin: 0 0 12px;
}
.lx-deckhead {
  margin: 0 auto 48px;
}
.lx-deckhead__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: #f5f5f5;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ── how-it-works section: five Figma beats step in place ───────────────
      One viewport-tall section in normal flow. JS locks downward wheel /
      touch / key input while the section fills the viewport and plays one
      beat per gesture at authored tempo; upward scrolling is never trapped.
      After the finale the lock releases. ─────────────────────────────── */
.hiw {
  position: relative;
  height: 100vh;
  /* iOS Safari: keep the pinned stage inside the visible viewport while the
     URL bar is expanded (same pattern as .deck-pin's dvh fallback). */
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 86px 24px;
  /* Figma section render (node 7521:21107) — dark starfield/noise. */
  background: #000000 url('/assets/landing/bg-figma-deck.webp') center top / cover no-repeat;
}
.hiw__inner {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hiw .lx-deckhead {
  opacity: 0;
}
.hiw__beats {
  position: relative;
  width: 100%;
  height: clamp(300px, 42vh, 360px);
}
.hiw__beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.hiw__captions {
  position: relative;
  width: 100%;
  margin-top: 56px;
  min-height: 84px;
}
.hiw__caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  color: #f5f5f5;
  font-size: clamp(20px, 1.94vw, 28px);
  line-height: 1.3;
  opacity: 0;
}
/* Figma frame 4 (7521:20069): finale caption stands alone in the beat zone. */
.hiw__finale {
  font-family: 'Instrument Serif', Georgia, serif;
  color: #f5f5f5;
  font-size: clamp(20px, 1.94vw, 28px);
  line-height: 1.2;
  margin: 0;
}

/* ── born-on label + date block ─────────────────────────────────────────── */
.lx-bornlabel {
  font-family: 'Instrument Serif', Georgia, serif;
  color: #f5f5f5;
  font-size: clamp(18px, 1.39vw, 20px);
  line-height: 1.2;
  margin: 0 0 16px;
  opacity: 0.78;
}
/* Figma frame 1 (7521:19834): date renders in the TAY Makawao display face. */
.lx-borndate {
  font-family: 'TAY Makawao', 'Instrument Serif', serif;
  text-transform: uppercase;
  color: #f5f5f5;
  font-size: clamp(32px, 3.33vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 auto;
}
/* Figma frame 2 (7521:19946): during the scramble the date sits in serif 60. */
.lx-borndate--serif {
  font-family: 'Instrument Serif', Georgia, serif;
  text-transform: none;
  font-size: clamp(40px, 4.17vw, 60px);
  line-height: 1;
}

/* ── pillar cards (dark theme — light strokes + light text) ───────────────
      Figma frame 3 (7521:19890): 120×300 columns, 12px gap, 1.5px #d4d4d4
      outline. Clean stroke — no grain filter. ─────────────────────────── */
.lx-cards {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  gap: 12px;
  justify-content: center;
}
.lx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  padding: 0 8px;
  will-change: transform, opacity;
}
.lx-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid #d4d4d4;
  pointer-events: none;
}
.lx-card__label {
  font-family: 'TAY Makawao', 'Instrument Serif', serif;
  text-transform: uppercase;
  font-size: 18px;
  line-height: 1.2; /* 21.6px */
  color: #f5f5f5;
  margin-bottom: 24px;
}
.lx-card__glyph {
  font-family: 'Hahmlet', 'Apple SD Gothic Neo', 'Noto Sans KR', serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2; /* 36px */
  letter-spacing: 0;
  color: #f5f5f5;
}
.lx-card__el {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-style: italic;
  font-size: 12px;
  line-height: 1.2; /* 14.4px */
  color: #f5f5f5;
  margin-top: 6px;
  white-space: nowrap;
}
.lx-card__el:not(:last-child) {
  margin-bottom: 32px;
}

/* ── shimmer: gradient sweep highlight across the settled cards ──────────── */
.lx-cards--shimmer .lx-card {
  overflow: hidden;
}
.lx-cards--shimmer .lx-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(245, 245, 245, 0.28) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 2;
}
.lx-cards--shimmer.is-shimmering .lx-card::after {
  animation: lx-shimmer-sweep 1.1s ease-out forwards;
}
.lx-cards--shimmer.is-shimmering .lx-card:nth-child(2)::after {
  animation-delay: 0.12s;
}
.lx-cards--shimmer.is-shimmering .lx-card:nth-child(3)::after {
  animation-delay: 0.24s;
}
.lx-cards--shimmer.is-shimmering .lx-card:nth-child(4)::after {
  animation-delay: 0.36s;
}
@keyframes lx-shimmer-sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

/* ── reduced-motion / no-JS fallback: hero copy visible; the how-it-works
      section rests on the cards beat + caption C. ───────────────────────── */
html.deck-static .deck-scene {
  min-height: auto;
}
html.deck-static .deck-stage {
  position: static;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
html.deck-static .deck-stage .hero__media {
  position: absolute;
}
html.deck-static .hiw {
  position: static;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
html.deck-static .lx-h1,
html.deck-static .lx-sub,
html.deck-static .lx-deckhead,
html.deck-static .hiw__beat[data-beat='cards'],
html.deck-static .hiw__caption[data-cap='c'] {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

@media (max-width: 720px) {
  .hiw {
    /* 96px top clears the fixed site header (88px). */
    padding: 96px 20px 48px;
  }
  .lx-deckhead {
    margin-bottom: 32px;
  }
  .lx-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .lx-card {
    padding: 14px 6px 16px;
    height: auto;
    min-height: 260px;
  }
  .hiw__beats {
    height: clamp(280px, 38vh, 320px);
  }
  .hiw__captions {
    margin-top: 40px;
  }
}

/* Narrow phones: keep the four pillars on ONE row (a 2×2 stack bursts the
   fixed-height beat zone) — shrink card internals instead. */
@media (max-width: 360px) {
  .lx-card {
    min-height: 200px;
    padding: 12px 4px 14px;
  }
  .lx-card__label {
    font-size: 13px;
    margin-bottom: 14px;
  }
  .lx-card__glyph {
    font-size: 24px;
  }
  .lx-card__el {
    font-size: 10px;
  }
  .lx-card__el:not(:last-child) {
    margin-bottom: 18px;
  }
  .hiw .lx-deckhead {
    margin-bottom: 24px;
  }
  .hiw .lx-deckhead__title {
    font-size: 24px;
  }
  .hiw__beats {
    height: clamp(220px, 34vh, 240px);
  }
  .hiw__captions {
    margin-top: 20px;
    min-height: 64px;
  }
  .hiw__caption,
  .hiw__finale {
    font-size: 16px;
  }
}

/* Short viewports (landscape phones): compress the vertical rhythm so the
   header + beats + caption all fit inside the pinned stage. */
@media (max-height: 520px) {
  .hiw {
    /* 96px top clears the fixed site header (88px). */
    padding: 96px 20px 16px;
  }
  .hiw .lx-eyebrow {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .hiw .lx-deckhead {
    margin-bottom: 10px;
  }
  .hiw .lx-deckhead__title {
    font-size: 22px;
  }
  .hiw__beats {
    height: min(38vh, 180px);
  }
  .lx-card {
    height: auto;
    min-height: 140px;
    padding: 9px 4px 10px;
  }
  .lx-card__label {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .lx-card__glyph {
    font-size: 20px;
  }
  .lx-card__el {
    font-size: 10px;
  }
  .lx-card__el:not(:last-child) {
    margin-bottom: 10px;
  }
  .hiw__captions {
    margin-top: 16px;
    min-height: 48px;
  }
  .hiw__caption,
  .hiw__finale {
    font-size: 16px;
  }
  .lx-bornlabel {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .lx-borndate {
    font-size: clamp(22px, 6.5vh, 32px);
  }
  .lx-borndate--serif {
    font-size: clamp(26px, 7.5vh, 38px);
  }
}
