/* ============================================================================
   SHE REIGNS — Ultimate Legacy Carnival Troupe · St. Thomas Carnival 2027
   Motion identity: TIDAL & SPECULAR. A fixed horizontal mirror axis (the
   waterline). Scroll lowers the water; the world is revealed by the tide
   receding and doubled in reflection. See PLAN.md §2.

   Six core mechanics: meniscus wipe · surfacing text · tide scrub ·
   caustic drift · specular parallax · sun-throne glow.
   ========================================================================= */

/* ── 1 · TOKENS ─────────────────────────────────────────────────────────── */
:root {
  /* ground — abyssal teal-black, tinted toward the water (never #000) */
  --ground:        #07141A;
  --ground-raised: #0E2029;
  --surface:       rgb(255 255 255 / .06);
  --line:          rgb(255 255 255 / .12);

  /* primary accent — lagoon aqua */
  --aqua:      #37C7BE;
  --aqua-deep: #1B7D78;

  /* hover-only second accent — legacy flame, from the Ultimate Legacy plumes.
     Appears NOWHERE else, so every interactive element identifies itself. */
  --flame: #FF5A3C;

  /* regalia — a MATERIAL, not an interactive accent */
  --gold:      #C9A24B;
  --gold-deep: #8A6B2E;
  --pearl:     #F3ECE0;

  /* the fixed low sun — hero + CTA back-light only */
  --sun: #E8863A;

  /* text — warm off-white, never #FFF at body size */
  --text:        #F1EBDE;
  --text-dim:    rgb(241 235 222 / .72);
  --text-strong: #FFFFFF;

  /* motion — measured (knowledge/design-systems/motion-tokens.md) */
  --dur-instant:  120ms;
  --dur-fast:     200ms;
  --dur-base:     300ms;
  --dur-slow:     500ms;
  --dur-slower:   700ms;
  --dur-entrance: 900ms;
  --dur-ambient:  2200ms;
  --dur-meniscus: 1000ms;
  --dur-specular: 600ms;

  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-out:      cubic-bezier(.16, 1, .3, 1);
  --ease-in-out:   cubic-bezier(.65, 0, .35, 1);
  --ease-soft:     cubic-bezier(.445, .05, .55, .95);

  /* the caustic texture, used by the hero drift and the card reflections */
  --caustic-src: url('../../img/texture-caustics-01-768.webp');
  --stone-src: url('../../img/texture-wet-stone-01-768.webp');

  --caustic-loop: 26s;
  --sun-breath:   4s;
  --marquee:      55s;

  /* type */
  --font-display: 'Cormorant', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* spacing / radius */
  --pad-page: clamp(1.25rem, 4vw, 4rem);
  --nav-h: clamp(58px, 8vh, 74px);
  --cue-h: 72px;            /* space the scroll cue occupies at the foot */
  --hero-fade: clamp(110px, 20vh, 190px);  /* distance the hero dissolves over */
  --gap-sect: clamp(4.5rem, 12vh, 10rem);
  --radius:   2px;

  /* z-index scale — explicit, so nothing fights */
  --z-media: 1;
  --z-scrim: 2;
  --z-content: 3;
  --z-frame: 40;
  --z-nav: 50;
  --z-menu: 60;
}

/* ── 2 · BASE ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--ground);
  /* a flat fill over this much area reads as an empty void — a slow vertical
     gradient plus ~4% stone grain gives it a surface to catch the light */
  background-image:
    linear-gradient(180deg, rgb(12 34 44 / .62) 0%, rgb(8 22 29 / .28) 40%, rgb(5 14 19 / .55) 100%),
    linear-gradient(rgb(7 20 26 / .955), rgb(7 20 26 / .955)),
    var(--stone-src);
  background-size: auto, auto, 460px auto;
  background-attachment: fixed, fixed, fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.u-vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100%; left: var(--pad-page); z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--gold); color: var(--ground);
  font-weight: 600; letter-spacing: .06em;
}
.skip-link:focus { top: 1rem; }

/* filters/masks live in an out-of-flow SVG — must never take layout or clicks */
.svg-defs {
  position: absolute; width: 0; height: 0;
  overflow: hidden; pointer-events: none;
}

/* ── 3 · TYPE ───────────────────────────────────────────────────────────── */
/* The light-display rule: size supplies emphasis, weight never does. */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.01em;
  text-wrap: balance;
  margin: 0;
}
.display--xl { font-size: clamp(2.75rem, 9vw, 7rem); }
.display--lg { font-size: clamp(2.25rem, 6.5vw, 4.75rem); }
.display--md { font-size: clamp(1.75rem, 4vw, 3rem); }

/* tracking + uppercase are a package — one without the other fails */
.eyebrow {
  font-size: clamp(.6875rem, 1.1vw, .8125rem);
  text-transform: uppercase;
  letter-spacing: .3em;
  font-weight: 500;
  color: var(--text-dim);
  margin: 0;
}
.eyebrow--gold { color: var(--gold); }

.lede {
  font-size: clamp(1.0625rem, 1.7vw, 1.375rem);
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0;
}

.serif-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--text-dim);
}

/* ── 4 · SITE FRAME + CORNER FILIGREE ───────────────────────────────────── */
/* The single most consequential finding in the knowledge base: every fixed
   decorative layer MUST pass clicks through. */
.frame {
  position: fixed; inset: 0; z-index: var(--z-frame);
  pointer-events: none;
}
.frame::before {
  content: ''; position: absolute;
  inset: clamp(.5rem, 1.2vw, 1rem);
  border: 1px solid rgb(201 162 75 / .22);
}
.frame__corner {
  position: absolute;
  width: clamp(74px, 11vw, 168px);
  aspect-ratio: 1;
  opacity: .5;
  filter: drop-shadow(0 0 10px rgb(7 20 26 / .8));
}
.frame__corner--tl { top: 0; left: 0; }
.frame__corner--tr { top: 0; right: 0; transform: scaleX(-1); }
.frame__corner--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.frame__corner--br { bottom: 0; right: 0; transform: scale(-1); }

/* ── 5 · NAV CLUSTER ────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: 0 var(--pad-page);
  pointer-events: none;
  transition: background var(--dur-base) var(--ease-standard),
              backdrop-filter var(--dur-base) var(--ease-standard);
}
.nav > * { pointer-events: auto; }

.nav.is-stuck {
  background: linear-gradient(rgb(7 20 26 / .88), rgb(7 20 26 / 0));
  backdrop-filter: blur(6px);
}

.nav__brand { display: flex; align-items: center; gap: .75rem; }
.nav__brand img {
  width: clamp(44px, 5vw, 62px); height: auto;
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / .55));
  transition: transform var(--dur-base) var(--ease-standard);
}
.nav__brand:hover img { transform: scale(1.06); }

.nav__wordmark {
  font-size: .6875rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500; line-height: 1.3;
}
@media (max-width: 560px) { .nav__wordmark { display: none; } }

.nav__actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  --size: 44px;
  inline-size: var(--size); block-size: var(--size);
  display: grid; place-items: center;
  background: rgb(7 20 26 / .5);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: color var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.icon-btn:hover { color: var(--flame); border-color: var(--flame); transform: scale(1.12); }
@media (hover: none) { .icon-btn:hover { transform: none; } }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

/* burger → X morph: the measured ±45° / ±8px */
.burger__bar {
  display: block; width: 20px; height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease-standard),
              opacity var(--dur-fast) var(--ease-standard);
}
.burger__bar + .burger__bar { margin-top: 5px; }
[aria-expanded='true'] .burger__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
[aria-expanded='true'] .burger__bar:nth-child(2) { opacity: 0; }
[aria-expanded='true'] .burger__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── 6 · FULLSCREEN MENU ────────────────────────────────────────────────── */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  display: grid; place-items: center;
  background: rgb(7 20 26 / .97);
  backdrop-filter: blur(14px);
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-slow) var(--ease-out);
  overscroll-behavior: contain;
}
.menu[data-open='true'] { clip-path: inset(0 0 0 0); }
.menu:not([data-open='true']) { pointer-events: none; }

.menu__inner { text-align: center; padding: var(--pad-page); }
.menu__list { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.menu__list li { overflow: hidden; }
.menu__list a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding-block: .2rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.9rem, 6vw, 3.4rem);
  line-height: 1.35;
  transform: translateY(110%);
  transition: transform var(--dur-slow) var(--ease-out),
              color var(--dur-base) var(--ease-standard);
}
.menu[data-open='true'] .menu__list a { transform: translateY(0); }
/* surfacing stagger — uneven delays beat a mechanical ladder */
.menu[data-open='true'] li:nth-child(1) a { transition-delay: 60ms; }
.menu[data-open='true'] li:nth-child(2) a { transition-delay: 130ms; }
.menu[data-open='true'] li:nth-child(3) a { transition-delay: 190ms; }
.menu[data-open='true'] li:nth-child(4) a { transition-delay: 265ms; }
.menu[data-open='true'] li:nth-child(5) a { transition-delay: 320ms; }
.menu__list a:hover { color: var(--flame); }

.menu__divider { width: min(320px, 60vw); margin: 0 auto 1.5rem; opacity: .7; }

/* ── 7 · BUTTONS ────────────────────────────────────────────────────────── */
.pill {
  --fill: var(--aqua);
  display: inline-flex; align-items: center; gap: .7rem;
  min-height: 48px;
  padding: .85rem 2.1rem;
  border: 1px solid var(--fill);
  border-radius: 999px;
  background: transparent;
  color: var(--fill);
  font-family: var(--font-ui);
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer;
  position: relative; isolation: isolate; overflow: hidden;
  transition: color var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}
/* fill inversion — measured on 4 of 7 references */
.pill::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--fill);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform var(--dur-base) var(--ease-standard);
}
.pill:hover, .pill:focus-visible { color: var(--ground); border-color: var(--flame); }
.pill:hover { --fill: var(--flame); }
.pill:hover::before, .pill:focus-visible::before { transform: scaleY(1); }
.pill:active { transform: scale(.97); }
.pill--gold { --fill: var(--gold); }

/* ── 8 · HERO ───────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;      /* lockup gets the slack, cue sits under it */
  justify-items: center;
  overflow: clip;
  /* Only the nav is reserved at the top and a small frame margin at the
     bottom; the lockup is then centred in the remaining row, so the air above
     and below it is equal at any viewport height. */
  padding: var(--nav-h) var(--pad-page) clamp(.9rem, 2.6vh, 1.9rem);
}

/* Plate and its mirrored copy live in ONE transformed element. Moving them
   independently (the old "specular" offset) tore the mountains apart at the
   clip line — a mirror inverts, it does not slide. The water character now
   comes from the displacement filter alone, which cannot open a seam. */
.hero__stage {
  position: absolute;
  /* Oversized on purpose. The scroll parallax lifts this by up to ~0.054*vh
     and the pointer nudges it +/-14px; sized exactly to the hero it left a
     bare strip of ground at the foot, which read as a black bar. */
  inset: -9% -4%;
  z-index: var(--z-media);
  will-change: transform;
  transform:
    translate3d(var(--stage-px, 0px), calc(var(--stage-sy, 0px) + var(--stage-py, 0px)), 0)
    scale(var(--stage-sc, 1));
}
.hero__media, .hero__ripple {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.06);
}

/* The plate carries a real mirrored reflection in its lower half. The ripple
   copy is that half, displaced by the SVG turbulence filter — the amplitude
   eases to zero on load, so the water STILLS and reveals the scene rather
   than the scene fading in. This is the meniscus reflection-settle. */
/* Below 768px the base plate switches to the PORTRAIT recomposition while this
   mirrored copy only has landscape sources — the two don't line up and the
   clip edge shows as a hard horizontal seam. The portrait plate carries its own
   reflection, so drop the layer entirely there (also saves the download). */
@media (max-width: 767px) { .hero__ripple { display: none; } }
.hero__ripple {
  clip-path: inset(52% 0 0 0);
  filter: url(#meniscus-displace) saturate(1.2) contrast(1.06);
}

.hero__scrim {
  position: absolute; inset: 0; z-index: var(--z-scrim);
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 38%, rgb(232 134 58 / .10), transparent 70%),
    linear-gradient(rgb(7 20 26 / .34) 0%, rgb(7 20 26 / .02) 30%, rgb(7 20 26 / .12) 62%, rgb(7 20 26 / .3) 84%, rgb(7 20 26 / .46) 100%);
}

/* the fixed low sun behind the peak — the only warm element, one 4s breath */
.hero__sun {
  position: absolute; z-index: var(--z-scrim);
  top: 30%; left: 50%;
  width: min(46vw, 460px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 158 74 / .42), rgb(232 134 58 / .06) 56%, transparent 72%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: sun-breath var(--sun-breath) var(--ease-soft) infinite;
}
@keyframes sun-breath {
  0%, 100% { opacity: .62; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.07); }
}

/* ambient caustics — refracted light crawling across the lower frame */
.caustics {
  position: absolute; inset: auto 0 0 0; height: 62%;
  z-index: var(--z-scrim);
  pointer-events: none;
  background-image: var(--caustic-src);
  background-size: 46% auto;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
  opacity: .2;
  mask-image: linear-gradient(transparent, #000 45%, #000);
  animation: caustic-drift var(--caustic-loop) linear infinite;
}
@keyframes caustic-drift {
  0%   { background-position:   0% 0%; }
  100% { background-position: 100% 32%; }
}

/* spray video — screen-blended, black ground, < 300 particles so no renderer */
.spray {
  position: absolute; inset: 0; z-index: var(--z-scrim);
  width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: screen;
  opacity: .3;
  pointer-events: none;
}

.hero__lockup {
  align-self: center;
  position: relative; z-index: var(--z-content);
  isolation: isolate;
  will-change: transform, opacity;
  display: grid; justify-items: center; gap: clamp(.5rem, 1.4vh, 1rem);
  text-align: center;
  max-width: 62rem;
}

/* A photograph cannot be trusted to stay dark behind text. This is the local
   guarantee for the lockup specifically — the page scrim alone measured 3.6:1
   against the bright sky in the plate. */
.hero__lockup::before {
  content: ''; position: absolute; z-index: -1;
  inset: -12% -18% -34%;
  /* Both layers are ellipses, never a linear gradient: a linear ramp darkens
     the full width of this box uniformly and its left/right edges read as a
     visible rectangle over the plate. The lower ellipse seats the small type
     (context line + CTA); the upper one only faintly seats the mark. */
  background:
    radial-gradient(ellipse 44% 25% at 50% 72%,
      rgb(7 20 26 / .8), rgb(7 20 26 / .32) 50%, transparent 74%),
    radial-gradient(ellipse 42% 34% at 50% 38%,
      rgb(7 20 26 / .24), rgb(7 20 26 / .07) 56%, transparent 72%);
  pointer-events: none;
}

/* small → smaller → HUGE → small → action */
.hero__band {
  display: inline-flex; align-items: center; gap: .7rem;
  flex-wrap: wrap; justify-content: center;
  padding: .5rem 1.35rem;
  border-radius: 999px;
  background: rgb(7 20 26 / .72);
  border: 1px solid rgb(201 162 75 / .3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero__band .eyebrow, .hero__band .serif-italic { color: var(--text); }
.hero__band img { width: clamp(38px, 5vw, 54px); }

/* The lockup starts BELOW the clipped hero box, not at opacity 0. Same visual
   result — the plate reads clean and the figure's face is unobscured — but
   nothing is ever invisible-in-place, so a stalled reveal can't blank it. */
.hero.is-ready .hero__lockup { transform: translate3d(0, 92vh, 0); }
.hero.is-ready .hero__cue--intro { opacity: 1; }

.hero__mark {
  width: min(56vw, 23rem, 36svh);
  filter: drop-shadow(0 8px 34px rgb(7 20 26 / .75));
}

.hero__tagline {
  text-shadow: 0 2px 18px rgb(7 20 26 / .85);
  font-family: var(--font-display);
  font-style: italic; font-weight: 300;
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  color: var(--pearl);
  margin: 0;
}

.hero__context {
  color: var(--gold);
  text-shadow: 0 1px 2px rgb(7 20 26 / .95), 0 0 7px rgb(7 20 26 / .9),
               0 0 16px rgb(7 20 26 / .75);
}

.hero__cue {
  position: relative; z-index: var(--z-content);
  align-self: end;
  display: grid; justify-items: center; gap: .5rem;
  font-size: .625rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--text-dim);
}
.hero__cue span:last-child {
  width: 1px; height: 34px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue-fall var(--dur-ambient) var(--ease-soft) infinite;
  transform-origin: top;
}
@keyframes cue-fall {
  0%, 100% { transform: scaleY(.35); opacity: .45; }
  50%      { transform: scaleY(1);   opacity: 1; }
}
/* Below 768px the lockup fills the viewport and the cue would sit on the CTA —
   and a phone user needs no prompt to scroll. Must come AFTER the base rule. */
@media (max-width: 767px) { .hero__cue { display: none; } .hero { --cue-h: 8px; } }

/* ── 9 · SURFACING TEXT ─────────────────────────────────────────────────── */
/* Words rise through the waterline out of their own reflection. The resting
   state is a plausible static value (already surfaced) so a JS failure or a
   no-JS load leaves readable content, never a blank page. */
.surface-line { display: block; overflow: hidden; }
.surface-line > span { display: inline-block; will-change: transform; }

[data-surface]:not(.is-ready) .surface-line > span { transform: none; }
[data-surface].is-ready .surface-line > span { transform: translateY(105%); }
[data-surface].is-ready.is-in .surface-line > span {
  transform: translateY(0);
  transition: transform var(--dur-meniscus) var(--ease-out);
}
.is-ready.is-in .surface-line:nth-child(2) > span { transition-delay: 90ms; }
.is-ready.is-in .surface-line:nth-child(3) > span { transition-delay: 180ms; }
.is-ready.is-in .surface-line:nth-child(4) > span { transition-delay: 270ms; }

/* generic scroll reveal — 24–40px of travel, never more */
[data-reveal] { opacity: 1; }
[data-reveal].is-ready { opacity: 0; transform: translateY(28px); }
[data-reveal].is-ready.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-entrance) var(--ease-out),
              transform var(--dur-entrance) var(--ease-out);
}

/* ── 10 · SECTION SHELL ─────────────────────────────────────────────────── */
.section { position: relative; padding-block: var(--gap-sect); isolation: isolate; }
.section--lit::before {
  content: ''; position: absolute; z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse 52% 46% at 50% 34%,
              var(--glow, rgb(55 199 190 / .10)), transparent 72%);
  pointer-events: none;
}
.wrap { width: min(100% - var(--pad-page) * 2, 76rem); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--pad-page) * 2, 54rem); }

.section__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.divider { width: min(420px, 72%); margin-inline: auto; opacity: .8;
  filter: drop-shadow(0 0 16px rgb(201 162 75 / .28)); }

/* ── 11 · OVERTURE ──────────────────────────────────────────────────────── */
.overture { text-align: center; }
.overture .lede { margin-inline: auto; }
.overture__mark {
  width: clamp(88px, 13vw, 150px);
  margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
  opacity: .92;
}

/* ── 12 · THE TIDE (pinned scroll story) ────────────────────────────────── */
/* Scroll distance = water level. The visitor never moves; the tide does. */
.tide { position: relative; }
.tide__viewport {
  position: relative; min-height: 100svh; overflow: clip;
  display: grid; place-items: center;
  padding-block: var(--gap-sect);
}
/* JS is running: collapse to exactly one viewport and cross-fade the beats */
.tide__viewport.is-ready { height: 100svh; min-height: 0; padding-block: 0; }

.tide__plate {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--dur-slower) var(--ease-standard);
}
.tide__plate[data-active='true'] { opacity: 1; }
.tide__plate img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.22) contrast(1.07);
}

.tide__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgb(7 20 26 / .5) 0%, rgb(7 20 26 / .1) 38%, rgb(7 20 26 / .16) 62%, rgb(7 20 26 / .58) 100%);
}

/* the water itself: a translucent body with a wavy top edge. As it drops, the
   plate below comes clear. Transform-driven, so it composites on the GPU. */
/* The surface is ONE shape. Previously a backdrop-filtered rectangle
   (top:44px) and a straight 1px rule sat under a curved SVG — neither
   followed the curve, so the crest showed a hard step. Now every child is
   opaque and the translucency lives on the parent, so the body's straight
   top edge is always hidden beneath the wave's own solid fill. */
.tide__water {
  position: absolute; inset: 0 -6% -60% -6%;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  opacity: .86;
}
.tide__water-body {
  position: absolute; inset: 42px 0 0 0;   /* under the wave's solid band */
  background: linear-gradient(#0C3E49 0%, #0A2A33 45%, #061318 100%);
}
.tide__wave {
  position: absolute; top: 0; left: 0;
  /* max-width:none is load-bearing: the base reset's `svg { max-width: 100% }`
     silently clamps this to 100% of the water, so the tile ran out before the
     right edge and the crest showed a hard step. Two tiles wide is what makes
     the -50% drift seamless. */
  width: 200%; max-width: none; height: 56px;
  overflow: visible;
  animation: wave-drift 11s linear infinite;
}
.tide__wave-fill  { fill: #0C3E49; }
.tide__wave-crest { stroke: rgb(120 226 218 / .55); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
@keyframes wave-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


.tide__beats {
  position: relative; z-index: var(--z-content);
  text-align: center;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 6vw, 5rem);
  isolation: isolate;
}
/* Beats III and IV sit over bright plates and need a local scrim. It lives on
   an oversized pseudo-element so the fade REACHES transparent inside its own
   box — painted on the beats box directly, the gradient was still ~visible at
   the edge and read as two vertical bands over the plate. */
.tide__beats::before {
  content: ''; position: absolute; z-index: -1;
  inset: -44% -54%;
  background: radial-gradient(ellipse 40% 38% at 50% 50%,
              rgb(7 20 26 / .78), rgb(7 20 26 / .42) 48%, transparent 72%);
  pointer-events: none;
}
/* resting state (no JS): a readable stacked list — never opacity 0 */
.tide__beats { display: grid; gap: clamp(2.5rem, 7vw, 4.5rem); }
.tide__beat {
  display: grid; justify-items: center; gap: 1.1rem;
  max-width: 46rem; margin-inline: auto;
}
/* JS ready: stack them in one cell and cross-fade */
.tide__beats.is-ready { gap: 0; }
.tide__beats.is-ready .tide__beat {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden;
  transform: translateY(22px);
  transition: opacity var(--dur-slower) var(--ease-out),
              transform var(--dur-slower) var(--ease-out),
              visibility 0s linear var(--dur-slower);
}
.tide__beats.is-ready .tide__beat[data-active='true'] {
  opacity: 1; visibility: visible; transform: none;
  transition-delay: 0s, 0s, 0s;
}
.tide__beat .lede { color: var(--text); text-shadow: 0 1px 3px rgb(7 20 26 / .9), 0 0 14px rgb(7 20 26 / .7); }
.tide__beat h3 { text-shadow: 0 2px 6px rgb(7 20 26 / .85), 0 0 22px rgb(7 20 26 / .6); }
.tide__beat .eyebrow { text-shadow: 0 1px 3px rgb(7 20 26 / .95), 0 0 12px rgb(7 20 26 / .8); }
.tide__cameo {
  width: clamp(88px, 12vw, 148px);
  filter: drop-shadow(0 6px 26px rgb(7 20 26 / .8));
  animation: cameo-float var(--dur-ambient) var(--ease-soft) infinite;
}
@keyframes cameo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* the rising-water gauge — scroll progress as a tide mark */
.gauge {
  position: absolute; z-index: var(--z-content);
  right: clamp(.9rem, 2.4vw, 2rem); top: 50%;
  transform: translateY(-50%);
  display: grid; gap: .8rem; justify-items: center;
}
.gauge__track {
  width: 2px; height: clamp(120px, 22vh, 210px);
  background: rgb(255 255 255 / .16);
  position: relative; overflow: hidden;
}
.gauge__fill {
  position: absolute; inset: auto 0 0 0; height: 0%;
  background: linear-gradient(var(--aqua), var(--gold));
}
.gauge__steps { display: grid; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.gauge__step {
  width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim);
  font-size: .625rem; letter-spacing: .1em;
  transition: color var(--dur-base) var(--ease-standard);
}
.gauge__step::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid currentColor;
  transition: background var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}
.gauge__step[aria-current='true'] { color: var(--gold); }
.gauge__step[aria-current='true']::after { background: var(--gold); transform: scale(1.35); }
.gauge__step:hover { color: var(--flame); }
@media (max-width: 640px) { .gauge__track { height: 96px; } }

/* ── 13 · THE CREED ─────────────────────────────────────────────────────── */
/* The emotional core. Biggest typographic moment on the page. */
.creed {
  position: relative; isolation: isolate;
  text-align: center;
  padding-block: clamp(6rem, 18vh, 12rem);
  overflow: clip;
}
.creed__crown {
  width: clamp(120px, 18vw, 230px);
  margin: 0 auto clamp(2rem, 5vw, 3.25rem);
  filter: drop-shadow(0 0 40px rgb(201 162 75 / .4));
  animation: cameo-float 5s var(--ease-soft) infinite;
}
.creed__lines { display: grid; gap: clamp(.9rem, 2.4vw, 1.6rem); }
.creed__line {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 5.2vw, 3.75rem);
  line-height: 1.15;
  margin: 0;
}
.creed__line--gold {
  color: var(--gold);
  font-style: italic;
}
.creed__glow {
  position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 40%, rgb(201 162 75 / .16), transparent 70%);
  pointer-events: none;
}

/* ── 14 · THE COLLECTION ────────────────────────────────────────────────── */
/* Deliberately the plainest layout on the page: this is where a visitor
   evaluates the product, so the mechanism must not compete with it.
   (knowledge/ux/signature-mechanic-restraint.md) */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

.card {
  min-inline-size: 0;
  position: relative;
  display: grid; gap: .9rem;
  padding: 0; border: 0; background: none;
  color: inherit; text-align: left; cursor: pointer;
  font: inherit;
}
.card__frame {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground-raised);
  box-shadow: 0 14px 34px rgb(0 0 0 / .38);
  transition: transform var(--dur-slow) var(--ease-standard),
              box-shadow var(--dur-slow) var(--ease-standard),
              border-color var(--dur-slow) var(--ease-standard);
}
.card__img {
  width: 100%; aspect-ratio: 1664 / 2496; object-fit: cover;
  transition: transform var(--dur-slower) var(--ease-standard);
}

/* reflection bloom: at rest the mirrored copy below is dim and near-mono; on
   hover it gains full colour and a caustic shimmer while the card only lifts.
   The card performs the site's thesis — doubled in water — on interaction. */
.card__pool {
  position: relative; height: 78px; overflow: hidden;
  margin-top: -1px;
  border-radius: var(--radius);
}
.card__pool img {
  position: absolute; left: 0; bottom: 100%;
  width: 100%; aspect-ratio: 1664 / 2496; object-fit: cover;
  transform: scaleY(-1);
  transform-origin: bottom;
  filter: saturate(.38) brightness(.62) blur(1.2px);
  opacity: .72;
  /* strongest directly under the card, falling away downward — the previous
     `#000 190%` stop meant the mask never reached full opacity inside the box */
  mask-image: linear-gradient(to bottom, #000, rgb(0 0 0 / .35) 62%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, rgb(0 0 0 / .35) 62%, transparent);
  transition: filter var(--dur-slow) var(--ease-standard),
              opacity var(--dur-slow) var(--ease-standard);
}
.card__pool::after {
  content: ''; position: absolute; inset: 0;
  background-image: var(--caustic-src);
  background-size: 120% auto;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-standard);
  animation: caustic-drift 14s linear infinite;
}

.card:hover .card__frame,
.card:focus-visible .card__frame {
  transform: translateY(-16px) scale(1.05);
  border-color: var(--flame);
  box-shadow: 0 26px 60px rgb(7 20 26 / .75);
}
.card:hover .card__img { transform: scale(1.1); }
.card:hover .card__pool img,
.card:focus-visible .card__pool img { filter: saturate(1) brightness(.92) blur(.4px); opacity: .96; }
.card:hover .card__pool::after { opacity: .55; }

/* touch counterpart — no hover, so give the lift on press instead */
@media (hover: none) {
  .card:hover .card__frame { transform: none; box-shadow: none; }
  .card:hover .card__img { transform: none; }
  .card:active .card__frame { transform: scale(.98); }
  .card__pool img { filter: saturate(.7) brightness(.62) blur(1px); opacity: .75; }
}

.card__meta { display: grid; gap: .3rem; }
.card__name {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.1vw, 1.6rem);
  font-weight: 400; line-height: 1.2; margin: 0;
  transition: color var(--dur-base) var(--ease-standard);
}
.card:hover .card__name { color: var(--flame); }
.card__note { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }

/* ── 15 · REFLECTING POOL (detail dialog) ───────────────────────────────── */
dialog.pool {
  width: min(94vw, 68rem);
  max-height: 92svh;
  padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground-raised);
  color: var(--text);
  overflow: hidden;
}
dialog.pool::backdrop { background: rgb(7 20 26 / .88); backdrop-filter: blur(8px); }
dialog.pool[open] { animation: pool-rise var(--dur-slow) var(--ease-out); }
@keyframes pool-rise {
  from { opacity: 0; clip-path: inset(100% 0 0 0); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
.pool__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 760px) { .pool__grid { grid-template-columns: 1fr; } }
.pool__media { background: var(--ground); }
.pool__media img { width: 100%; height: 100%; max-height: 70svh; object-fit: cover; }
.pool__body { padding: clamp(1.5rem, 3.5vw, 2.75rem); display: grid; gap: 1.1rem; align-content: center; }
.pool__close {
  position: absolute; top: .85rem; right: .85rem;
  z-index: 2;
}
.pool__list { margin: 0; padding-left: 1.1rem; color: var(--text-dim); font-size: .9375rem; }
.pool__list li { margin-block: .3rem; }

/* ── 16 · MARQUEE ───────────────────────────────────────────────────────── */
.marquee {
  position: relative; z-index: 3;
  overflow: hidden; white-space: nowrap;
  /* Overlaps the hero and finishes the dissolve in px, not %, so the fade
     distance never depends on how tall the marquee's content happens to be. */
  margin-top: calc(var(--hero-fade) * -1);
  padding-top: calc(var(--hero-fade) + clamp(.9rem, 2vw, 1.4rem));
  padding-bottom: clamp(.9rem, 2vw, 1.4rem);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(
      rgb(7 20 26 / 0) 0px,
      rgb(7 20 26 / .55) calc(var(--hero-fade) * .55),
      var(--ground) var(--hero-fade));
  border-bottom-color: rgb(201 162 75 / .16);
}
.marquee__track { display: inline-flex; gap: 2.5rem; animation: marquee var(--marquee) linear infinite; }
.marquee span {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); opacity: .8;
}
.marquee span::after { content: '·'; margin-left: 2.5rem; color: var(--aqua); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── 17 · THE RITE (countdown) ──────────────────────────────────────────── */
.rite { text-align: center; }
.countdown {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: clamp(.75rem, 3vw, 2.75rem);
  margin-block: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem);
  border: 1px solid rgb(201 162 75 / .3);
  border-radius: var(--radius);
  background:
    linear-gradient(rgb(18 42 52 / .72), rgb(9 24 31 / .72));
  box-shadow: 0 24px 60px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .05);
  width: fit-content; margin-inline: auto;
}
.countdown__unit { display: grid; gap: .35rem; min-width: 4.5rem; }
@media (max-width: 560px) {
  .countdown {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem; width: min(100%, 20rem);
  }
}
.countdown__num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 300; line-height: 1; color: var(--pearl);
}
.countdown__label { font-size: .625rem; letter-spacing: .24em; text-transform: uppercase; color: var(--text-dim); }

/* ── 18 · THE LEGACY (CTA band) ─────────────────────────────────────────── */
/* The ONLY place the Ultimate Legacy flame appears. Water world, fire lineage. */
.legacy {
  position: relative; isolation: isolate;
  min-height: 78svh;
  display: grid; place-items: center;
  text-align: center;
  overflow: clip;
  padding: var(--gap-sect) var(--pad-page);
}
.legacy__media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.2) contrast(1.06);
}
.legacy__scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgb(7 20 26 / .62), rgb(7 20 26 / .26) 42%, rgb(7 20 26 / .72) 88%, var(--ground));
}
.legacy__inner { display: grid; justify-items: center; gap: 1.4rem; max-width: 48rem; }
.legacy__logo {
  width: clamp(150px, 24vw, 290px);
  filter: drop-shadow(0 0 46px rgb(255 90 60 / .42));
  animation: ember 6s var(--ease-soft) infinite;
}
@keyframes ember {
  0%, 100% { filter: drop-shadow(0 0 34px rgb(255 90 60 / .3)); transform: translateY(0); }
  50%      { filter: drop-shadow(0 0 58px rgb(255 90 60 / .55)); transform: translateY(-7px); }
}
.legacy__note {
  font-size: .8125rem; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px dashed rgb(241 235 222 / .28);
  padding: .55rem 1rem; border-radius: 999px;
}

/* ── 19 · FOOTER ────────────────────────────────────────────────────────── */
.footer {
  padding: clamp(3rem, 7vw, 5rem) var(--pad-page) clamp(2rem, 4vw, 3rem);
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--ground);
}
.footer__inner { display: grid; justify-items: center; gap: 1.5rem; }
.footer__logo { width: clamp(74px, 10vw, 118px); opacity: .92; }
.footer__social { display: flex; gap: .6rem; }
.footer__legal { font-size: .75rem; color: var(--text-dim); line-height: 1.9; }
.footer__legal a:hover { color: var(--flame); }

/* ── 20 · REDUCED MOTION ────────────────────────────────────────────────── */
/* Redefining the duration tokens handles every component that uses them at
   once. JS-driven motion is gated separately in landing.js — a media query
   cannot stop GSAP, a video, or a rAF loop. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: .01ms; --dur-fast: .01ms; --dur-base: .01ms;
    --dur-slow: .01ms; --dur-slower: .01ms; --dur-entrance: .01ms;
    --dur-meniscus: .01ms; --dur-specular: .01ms;
  }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* content must remain visible, never mid-reveal */
  [data-reveal].is-ready { opacity: 1; transform: none; }
  [data-surface].is-ready .surface-line > span { transform: none; }
  .hero__ripple { filter: none; }
  .tide__beats.is-ready .tide__beat { opacity: 1; visibility: visible; transform: none; }
  .tide__beats.is-ready .tide__beat:not([data-active='true']) { display: none; }
  /* leave the marquee at its start, not snapped to the end of one cycle */
  .marquee__track { animation: none !important; }
  .caustics, .card__pool::after { animation: none !important; }
  .tide__wave { animation: none !important; }
}

