/* ============================================================
   FROM THE MOUNTAINS TO MILLIONS — story prototype styles
   ============================================================ */
:root {
  --ink: #070c16;
  --navy: #0b1220;
  --slate: #0e1726;
  --dusk: #2a3b57;
  --peri: #6d7fa3;
  --sand: #c9b89a;
  --cream: #f3e8d6;
  --sun: #fef3dd;
  --red: #e5484d;
  --text: #eef1f7;
  --mute: rgba(238, 241, 247, 0.62);
  --dim: rgba(238, 241, 247, 0.38);
  --line: rgba(238, 241, 247, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 4px; }

/* ---------- fixed layers ---------- */
.globe {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh;
  z-index: 0; display: block; pointer-events: none;
}
.mist {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background:
    radial-gradient(120% 80% at 50% 60%, rgba(243, 232, 214, 0.9), rgba(109, 127, 163, 0.75) 55%, rgba(14, 23, 38, 0.95) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); }
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  mix-blend-mode: normal;
}
.brand {
  font-family: var(--serif); font-size: 17px; letter-spacing: 0.01em; text-decoration: none;
}
.topbar__right { display: flex; align-items: center; gap: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(11, 18, 32, 0.55); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sand); }
.skip { font-size: 13px; color: var(--mute); text-decoration: none; }
.skip:hover { color: var(--text); }

.proto {
  position: fixed; top: 64px; right: var(--gutter); z-index: 55; width: min(420px, calc(100vw - 32px));
  padding: 18px 20px; border-radius: 14px;
  background: rgba(11, 18, 32, 0.92); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13px; color: var(--mute);
}
.proto h2 { margin: 0 0 10px; font: 600 13px var(--sans); color: var(--text); letter-spacing: 0.02em; }
.proto ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.proto b { display: inline-block; min-width: 62px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.proto .ok { color: #8fd3a8; }
.proto .wait { color: var(--sand); }
.proto code { font-size: 12px; color: var(--cream); }

/* ---------- progress nav ---------- */
.progress {
  position: fixed; left: calc(var(--gutter) - 12px); bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 14px; font-size: 12px;
  padding: 2px 14px 2px 8px; border-radius: 999px;
  background: rgba(7, 12, 22, 0.55); border: 1px solid rgba(238, 241, 247, 0.06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.progress__bar { position: fixed; top: 0; left: 0; right: 0; z-index: 51; height: 2px; pointer-events: none; }
.progress__bar span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--sand), var(--red)); }
.progress ol { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress li button {
  position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
}
.progress li button::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 12px; height: 2px; border-radius: 2px;
  background: var(--line); transition: background 0.3s var(--ease);
}
.progress li button i {
  position: absolute; left: 4px; top: 12px; height: 2px; width: calc(100% - 8px); border-radius: 2px;
  background: var(--cream); transform-origin: 0 50%; transform: scaleX(0);
}
.progress li.is-planned button::before { background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 5px); }
.progress li button span {
  position: absolute; bottom: 30px; left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; background: rgba(11, 18, 32, 0.9); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: 0.25s var(--ease);
}
.progress li button:hover span, .progress li button:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
.progress__now { margin: 0; display: flex; gap: 10px; color: var(--mute); letter-spacing: 0.04em; }
.progress__now #nowNum { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- scenes ---------- */
/* Scenes are scroll-length spacers; their stages are fixed and crossfaded by JS. */
main { position: relative; }
.scene { position: relative; height: 200vh; }
.stage {
  position: fixed; inset: 0; z-index: 2; overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
}
#scene-intro .stage { opacity: 1; visibility: visible; }

/* prologue */
.intro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 var(--gutter);
}
.eyebrow { margin: 0 0 18px; font-size: 12px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand); }
.intro__title {
  margin: 0; font-family: var(--serif); font-weight: 300; line-height: 0.98; letter-spacing: -0.02em;
  font-size: clamp(44px, 8.4vw, 132px); text-shadow: 0 10px 60px rgba(7, 12, 22, 0.8);
}
.intro__title em { font-style: italic; font-weight: 400; color: var(--cream); }
.intro__by { margin: 26px 0 0; color: var(--mute); font-size: 14px; letter-spacing: 0.04em; }
.cue {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim);
}
.cue span { width: 1px; height: 44px; background: linear-gradient(var(--dim), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* beats (cinematic text) */
.beats { position: absolute; inset: 0; pointer-events: none; }
.beat {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  padding: 0 var(--gutter); text-align: center;
}
.beat__kicker {
  display: block; margin-bottom: 18px; font: 500 12px var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand);
}
.beat__line {
  margin: 0; font-family: var(--serif); font-weight: 300; letter-spacing: -0.015em; line-height: 1.08;
  font-size: clamp(30px, 5.2vw, 76px); text-shadow: 0 6px 40px rgba(7, 12, 22, 0.65);
}
.beat__line .w { display: inline-block; white-space: pre; will-change: transform, opacity, filter; }
.beats--side .beat { left: auto; right: 0; width: 50%; text-align: left; }
.beats--left .beat { right: auto; width: 46%; text-align: left; top: 50%; }
.beats--left .beat__line, .beats--side .beat__line { font-size: clamp(28px, 3.6vw, 56px); }
.beats--low .beat { top: auto; bottom: 15vh; transform: none; }
.beats--low .beat__line { font-size: clamp(28px, 4.2vw, 62px); }

/* geo labels */
.geo-label {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.geo-label i { width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(254, 243, 221, 0.18), 0 0 18px var(--sun); }
.geo-label--warm i { background: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.2), 0 0 18px var(--red); }

/* sequence */
.stage--seq { background: var(--slate); }
.seq { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.previs {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(640px, calc(100% - 32px));
  padding: 16px 18px; border-radius: 12px; z-index: 2;
  background: rgba(7, 12, 22, 0.5); border: 1px dashed rgba(201, 184, 154, 0.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; color: var(--mute);
}
.previs[hidden] { display: none; }
.previs__tag { margin: 0 0 6px; color: var(--sand); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.previs__shot { margin: 0; color: var(--text); font-weight: 600; }
.previs__note { margin: 2px 0 12px; }
.previs__strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.previs__strip span { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.previs__strip span i { display: block; height: 100%; background: var(--sand); transform-origin: 0 50%; transform: scaleX(0); }
.previs__frame { margin: 8px 0 0; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); }

/* archive photo */
.stage--photo { background: radial-gradient(90% 70% at 30% 50%, #15213a, var(--ink) 70%); }
.print {
  position: absolute; left: 27%; top: 50%; margin: 0; width: min(440px, 38vw);
  padding: 12px 12px 40px; background: #f1ebe0; border-radius: 3px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translate(-50%, -50%); will-change: transform, opacity, filter; pointer-events: none;
}
.print img { display: block; width: 100%; height: auto; filter: sepia(0.25) contrast(1.02) saturate(0.85); }
.print--ch2 { left: 66%; width: min(320px, 26vw); z-index: 1; }
.print figcaption { position: absolute; left: 14px; bottom: 12px; font: italic 13px var(--serif); color: #5c5246; }

/* layers */
.stage--layers { background: radial-gradient(80% 70% at 62% 50%, #121d33, var(--ink) 72%); }
.layers { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.layers.is-dragging { cursor: grabbing; }
.layer-tip {
  position: absolute; z-index: 3; pointer-events: none; max-width: 240px;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--mute);
  background: rgba(7, 12, 22, 0.85); border: 1px solid var(--line);
  transform: translate(14px, -50%);
}
.layer-tip[hidden] { display: none; }
.layer-tip b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.hint {
  position: absolute; right: var(--gutter); bottom: 26px; margin: 0; font-size: 12px; letter-spacing: 0.08em; color: var(--dim);
  opacity: 0; transition: opacity 0.6s var(--ease);
}
.hint.is-on { opacity: 1; }

/* ---------- upcoming ---------- */
.upcoming { position: relative; z-index: 4; padding: 18vh var(--gutter) 10vh; background: var(--ink); }
.upcoming__head { max-width: 760px; margin-bottom: 8vh; }
.upcoming__head h2, .end h2 {
  margin: 0 0 14px; font-family: var(--serif); font-weight: 300; letter-spacing: -0.02em; line-height: 1.02;
  font-size: clamp(36px, 5.6vw, 84px);
}
.upcoming__head p:last-child { margin: 0; color: var(--mute); max-width: 52ch; }
.ch {
  display: grid; grid-template-columns: 120px 1fr minmax(220px, 300px); gap: 32px; align-items: start;
  padding: 44px 0; border-top: 1px solid var(--line);
  opacity: 0; transform: translateY(30px);
}
.ch__n { font: 300 56px/1 var(--serif); color: var(--dim); }
.ch__body h3 { margin: 0 0 8px; font: 400 clamp(26px, 3vw, 40px)/1.1 var(--serif); }
.ch__body p { margin: 0 0 16px; color: var(--mute); font-size: 17px; }
.ch__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ch__tags li { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.ch__side { display: grid; gap: 16px; justify-items: start; }
.ch__status { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sand); border: 1px dashed rgba(201, 184, 154, 0.5); padding: 4px 9px; border-radius: 6px; }
.ch__metric b { display: block; font: 400 34px/1 var(--serif); color: var(--cream); }
.ch__metric span { font-size: 13px; color: var(--mute); }
.ch__metric em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.ch__logos { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.ch__logos img { height: 22px; width: auto; filter: grayscale(1) brightness(1.5); opacity: 0.7; }

.end { padding: 18vh var(--gutter) 22vh; text-align: center; background: var(--ink); position: relative; z-index: 4; }
.end p:last-child { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.cta, .ghost { padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 15px; }
.cta { background: var(--cream); color: var(--ink); }
.cta:hover { background: var(--sun); }
.ghost { border: 1px solid var(--line); color: var(--mute); }
.ghost:hover { color: var(--text); border-color: var(--dim); }
.nojs { position: fixed; inset: auto 16px 16px; z-index: 99; padding: 12px; background: var(--slate); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .skip { display: none; }
  .progress { left: 16px; right: 16px; bottom: 14px; justify-content: space-between; }
  .progress li button span { display: none; }
  .beat__line { font-size: clamp(28px, 8.4vw, 44px); }
  .beats--side .beat, .beats--left .beat { left: 0; right: 0; width: auto; text-align: center; }
  .beats--side .beat { top: auto; bottom: 18%; transform: none; }
  .beats--left .beat { top: 20%; transform: none; }
  .print { left: 50%; top: 36%; width: min(300px, 78vw); }
  .print--ch2 { top: 64%; width: min(240px, 60vw); }
  .previs { bottom: 64px; }
  .previs__note { display: none; }
  .hint { left: 16px; right: auto; bottom: 58px; }
  .ch { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
  .ch__n { font-size: 38px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .cue span { animation: none; }
  .beat__line .w { filter: none !important; }
}
