/* ------------------------------------------------------------------
   Moonlit Straits — scroll journey
   Self-contained: the canvas rule, the scroll track and the hero.

   The hero starts hidden as a whole (opacity + visibility) and JS arms it
   once GSAP owns the transforms. Deliberately no transforms here: a CSS
   translateY(112%) resolves to px in the computed style, GSAP reads that
   as `y` and then *adds* an animated yPercent on top — so the element
   never comes back into view.
   ------------------------------------------------------------------ */

:root {
  --ink: #eafaf7;
  --ink-dim: #8fb6b8;
  --edge: rgba(190, 240, 235, 0.22);
  --accent-a: #5df2a0;
  --accent-b: #46d9f0;
}

* { box-sizing: border-box; }

html {
  /* GSAP scrubs the flight; native smooth scrolling would fight it. */
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: #02090c;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The scene is a fixed backdrop — the page scrolls over it. */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: linear-gradient(180deg, #00214f 0%, #045159 62%, #04222a 100%);
  opacity: 0;
  transition: opacity 1200ms ease;
}
#scene-canvas.is-ready { opacity: 1; }

/* Scroll length: 5 screens of scroll = the whole flight. Change this one number
   to make the ride longer or shorter. */
.track { height: 500vh; }
body.is-static .track { height: 100vh; }

/* ---------------------------------------------------------------- hero ---- */

.hero {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.6vh, 34px);
  padding: 6vh clamp(20px, 6vw, 80px);
  text-align: center;
  pointer-events: none; /* GSAP hands this back when the hero lands */

  /* Armed by JS the moment GSAP has set the start states. */
  opacity: 0;
  visibility: hidden;
}

.hero.is-armed {
  opacity: 1;
  visibility: visible;
}

.hero__title {
  margin: 0;
  font-family: "Anton", Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Narrow", sans-serif;
  font-weight: 400;
  font-size: clamp(44px, 8.4vw, 148px);
  line-height: 0.87;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}

/* Each line is a mask; the inner span is what rises through it. */
.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em; /* room for descenders inside the mask */
}

.hero__line > span {
  display: block;
  background: linear-gradient(100deg, var(--accent-a) 0%, #4fe3d0 54%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Iowan Old Style", serif;
  font-size: clamp(16px, 2.1vw, 30px);
  line-height: 1.3;
  color: var(--ink);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 1.5vw, 20px) clamp(24px, 2.6vw, 38px);
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(235, 255, 252, 0.07);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 220ms ease, border-color 220ms ease;
}

.hero__cta:hover {
  background: rgba(235, 255, 252, 0.14);
  border-color: rgba(190, 240, 235, 0.5);
}

.hero__cta svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}
.hero__cta:hover svg { transform: translateX(5px); }

/* Revealed state: only then can it be clicked. */
.hero.is-live { pointer-events: none; }
.hero.is-live .hero__cta { pointer-events: auto; }

/* ------------------------------------------------------- hint & badge ---- */

.hint {
  position: fixed;
  left: 50%;
  bottom: clamp(22px, 5vh, 54px);
  z-index: 2;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  pointer-events: none;
}

.hint i {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--ink-dim), transparent);
  animation: drift 2.4s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(-6px); opacity: 0.35; }
  50% { transform: translateY(6px); opacity: 1; }
}

.badge {
  position: fixed;
  left: clamp(16px, 3vw, 34px);
  bottom: clamp(14px, 2.4vh, 26px);
  z-index: 2;
  margin: 0;
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  font: inherit;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: auto 0 50% 0;
  z-index: 3;
  text-align: center;
}

@media (max-width: 640px) {
  .badge__keys { display: none; }
}

/* Someone who asked for less motion gets the destination, not the ride. */
@media (prefers-reduced-motion: reduce) {
  .hint { display: none; }
  .hint i { animation: none; }
}
