/* odyssey.css — the deep-scroll descent: eleven zones between the core
   sections. Every zone is a tall shell (.zone) with a viewport-sized stage
   (.zone__stage) that odyssey.js pins manually — position:sticky cannot work
   inside the transformed smooth-scroll container. */

/* ---- shared zone scaffolding ---- */
.zone {
  position: relative;
  width: 100%;
}
.zone__stage {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  will-change: transform;
}
.zone__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.zone__caption {
  position: absolute;
  bottom: clamp(2rem, 7vh, 4.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 88vw;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.zone__caption--end {
  opacity: 0;
  transition: opacity 1.2s var(--ease-out-expo), letter-spacing 1.2s var(--ease-out-expo);
  letter-spacing: 0.5em;
}
.zone__caption--end.is-lit {
  opacity: 1;
  letter-spacing: 0.28em;
  color: rgba(0, 245, 255, 0.75);
  text-shadow: 0 0 24px rgba(0, 245, 255, 0.35);
}

/* ---- depth HUD ---- */
.depth-hud {
  position: fixed;
  left: clamp(0.8rem, 2vw, 2rem);
  bottom: clamp(1rem, 3vh, 2.4rem);
  z-index: var(--z-nav);
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.38);
  padding: 0.55em 0.9em;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: rgba(0, 3, 8, 0.55);
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.6s;
}
.depth-hud__value {
  color: var(--cyan);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
  min-width: 4ch;
}
.depth-hud__unit { color: rgba(0, 245, 255, 0.45); }
.depth-hud__zone {
  padding-left: 0.9em;
  border-left: 1px solid var(--hairline);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}
@media (max-width: 820px) { .depth-hud { display: none; } }

/* ═══════ DEEP SIGNAL — terminal from the future ═══════ */
.zone--transmission { height: 300vh; }
.terminal {
  width: min(760px, 90vw);
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 6, 14, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 80px rgba(0, 245, 255, 0.06), inset 0 0 60px rgba(0, 20, 40, 0.4);
  overflow: hidden;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.8em 1.1em;
  border-bottom: 1px solid rgba(0, 245, 255, 0.12);
}
.terminal__bar span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.terminal__bar span:first-child { background: rgba(255, 45, 120, 0.55); }
.terminal__bar em {
  margin-left: auto;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: rgba(0, 245, 255, 0.4);
}
.terminal__body {
  padding: clamp(1.2rem, 3vw, 2.4rem);
  min-height: 15em;
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.6vw, 1.05rem);
  line-height: 2.1;
}
.t-line { display: block; white-space: pre-wrap; }
.t-line--meta  { color: rgba(0, 245, 255, 0.55); }
.t-line--quote { color: rgba(255, 255, 255, 0.88); font-size: 1.12em; }
.t-line .t-char { opacity: 0; }
.t-line .t-char.is-on { opacity: 1; }
.t-caret {
  display: inline-block;
  width: 0.6em; height: 1.15em;
  vertical-align: text-bottom;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: caretBlink 0.9s steps(1) infinite;
}

/* ═══════ STELLAR NURSERY ═══════ */
.zone--nursery { height: 380vh; }
.zone--nursery .zone__stage { background: radial-gradient(ellipse at 50% 60%, rgba(38, 10, 80, 0.35), transparent 70%); }
.nursery__copy {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 var(--gutter);
}
.nursery__line {
  grid-area: 1 / 1;
  max-width: 26ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo), filter 0.9s;
  text-shadow: 0 0 60px rgba(123, 47, 255, 0.45);
}
.nursery__line.is-on { opacity: 1; transform: none; filter: none; }
.nursery__line.is-past { opacity: 0; transform: translateY(-30px) scale(1.02); filter: blur(6px); }

/* ═══════ THE FORGE ═══════ */
.zone--forge { height: 340vh; }
.zone--forge .zone__stage { background: radial-gradient(ellipse at 50% 110%, rgba(80, 30, 0, 0.28), transparent 60%); }
.forge__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 3vh, 2.4rem);
}
.forge__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 200, 120, 0.55);
}
.forge__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-4);
  letter-spacing: 0.06em;
  line-height: 0.9;
  /* cold steel → molten metal; JS drives background-position with scroll */
  background: linear-gradient(180deg,
    #6a7585 0%, #3c4654 34%,
    #ffdba1 50%, #ff9d3f 62%, #ff5c2e 76%, #b81e12 100%);
  background-size: 100% 320%;
  background-position: 50% 0%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.forge__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.6rem, 1.6vw, 1.2rem);
  max-width: 700px;
}
.forge__chip {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  padding: 0.7em 1.3em;
  border: 1px solid rgba(255, 157, 63, 0.25);
  border-radius: 3px;
  color: rgba(255, 220, 180, 0.85);
  background: rgba(40, 16, 2, 0.35);
  opacity: 0;
  transform: scale(1.7);
  filter: blur(4px);
}
.forge__chip.is-struck {
  animation: chipStrike 0.5s var(--ease-out-expo) forwards;
}
@keyframes chipStrike {
  0%   { opacity: 0; transform: scale(1.7); filter: blur(4px); }
  55%  { opacity: 1; transform: scale(0.94); filter: blur(0); box-shadow: 0 0 40px rgba(255, 157, 63, 0.5); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); box-shadow: 0 0 14px rgba(255, 157, 63, 0.18); }
}

/* ═══════ ORBITAL SYSTEMS ═══════ */
.zone--orbitals { height: 330vh; }
.orbitals__space {
  position: relative;
  width: min(78vmin, 720px);
  height: min(78vmin, 720px);
}
.orbitals__core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(84px, 14vmin, 130px);
  height: clamp(84px, 14vmin, 130px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--white);
  background: radial-gradient(circle at 38% 32%, rgba(190, 150, 255, 0.9), rgba(123, 47, 255, 0.55) 42%, rgba(30, 6, 80, 0.9) 100%);
  box-shadow: 0 0 60px rgba(123, 47, 255, 0.55), 0 0 140px rgba(123, 47, 255, 0.25);
  animation: corePulse 4.5s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 60px rgba(123, 47, 255, 0.55), 0 0 140px rgba(123, 47, 255, 0.25); }
  50% { box-shadow: 0 0 90px rgba(123, 47, 255, 0.8), 0 0 200px rgba(123, 47, 255, 0.35); }
}
.orb-ring {
  position: absolute;
  top: 50%; left: 50%;
  border: 1px solid rgba(0, 245, 255, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
}
.orb-ring.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.orb-chip {
  position: absolute;
  top: 0; left: 50%;
  /* odyssey.js drives left/top around the ring; this keeps the chip centered
     on its orbit point and the text always upright */
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.5em 1em;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: var(--cyan);
  background: rgba(0, 10, 18, 0.85);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.2);
  white-space: nowrap;
}

/* ═══════ NEW CONSTELLATIONS ═══════ */
.zone--signals { height: 320vh; }
.signals__labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.signal-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(140, 234, 255, 0.85);
  text-shadow: 0 0 14px rgba(0, 245, 255, 0.5);
  opacity: 0;
  transition: opacity 0.8s var(--ease-out-expo);
}
.signal-label.is-on { opacity: 1; }

/* ═══════ EVENT HORIZON ═══════ */
.zone--blackhole { height: 400vh; }
.zone--blackhole .zone__stage { background: #000104; }
.blackhole__lines {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 var(--gutter);
}
.bh-line {
  grid-area: 1 / 1;
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--white);
  opacity: 0;
  will-change: transform, opacity, filter;
}
.bh-line--last {
  font-weight: 700;
  background: linear-gradient(120deg, #fff, var(--gold) 55%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ═══════ CRYSTAL VAULT ═══════ */
.zone--prisms { height: 320vh; }
.zone--prisms .zone__stage { background: radial-gradient(ellipse at 50% 40%, rgba(20, 8, 52, 0.5), transparent 70%); }
.prisms__field {
  position: relative;
  width: min(1200px, 94vw);
  height: 78vh;
}
.prism {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2.5rem 1.6rem;
  clip-path: polygon(50% 0%, 100% 26%, 84% 100%, 16% 100%, 0% 26%);
  background: linear-gradient(160deg, rgba(123, 47, 255, 0.16), rgba(0, 245, 255, 0.07) 55%, rgba(255, 45, 120, 0.10));
  border: 1px solid rgba(160, 120, 255, 0.2);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 50px rgba(123, 47, 255, 0.14);
  will-change: transform;
  animation: prismFloat 9s ease-in-out infinite;
}
.prism:nth-child(2n) { animation-duration: 11s; animation-delay: -3s; }
.prism:nth-child(3n) { animation-delay: -6s; }
@keyframes prismFloat {
  0%, 100% { rotate: -2.5deg; }
  50% { rotate: 2.5deg; }
}
.prism__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: 0.04em;
  background: linear-gradient(150deg, #fff, #b39aff 70%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prism__line {
  margin-top: 0.7em;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  max-width: 18ch;
}

/* ═══════ OCEAN OF CODE ═══════ */
.zone--codefall { height: 300vh; }
.zone--codefall .zone__stage { background: #000308; }
.codefall__word {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--step-3);
  letter-spacing: 0.28em;
  color: rgba(210, 255, 250, 0.92);
  text-shadow: 0 0 30px rgba(0, 245, 255, 0.55), 0 0 90px rgba(0, 245, 255, 0.25);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.5s, transform 0.5s var(--ease-out-expo);
}
.codefall__word.is-on { opacity: 1; transform: scale(1); }

/* ═══════ SOLAR WINDS ═══════ */
.zone--aurorasea { height: 280vh; }
.zone--aurorasea .zone__stage { background: #010209; }
.aurorasea__ribbon {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 42vh;
  filter: blur(46px);
  opacity: 0.5;
  will-change: transform;
}
.aurorasea__ribbon--1 {
  top: 6%;
  background: linear-gradient(100deg, transparent 8%, rgba(0, 245, 255, 0.20) 30%, rgba(60, 255, 180, 0.16) 52%, transparent 88%);
  animation: ribbonDrift 17s ease-in-out infinite alternate;
}
.aurorasea__ribbon--2 {
  top: 30%;
  background: linear-gradient(95deg, transparent 12%, rgba(123, 47, 255, 0.22) 40%, rgba(0, 200, 255, 0.14) 66%, transparent 92%);
  animation: ribbonDrift 23s ease-in-out infinite alternate-reverse;
}
.aurorasea__ribbon--3 {
  top: 54%;
  background: linear-gradient(105deg, transparent 6%, rgba(255, 45, 120, 0.12) 36%, rgba(123, 47, 255, 0.16) 62%, transparent 90%);
  animation: ribbonDrift 29s ease-in-out infinite alternate;
}
@keyframes ribbonDrift {
  from { transform: translateX(-6%) skewY(-3.5deg) scaleY(0.9); }
  to   { transform: translateX(6%)  skewY(3deg)   scaleY(1.12); }
}
.aurorasea__line {
  position: relative;
  z-index: 2;
  max-width: min(22ch, 84vw);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--white);
  text-shadow: 0 0 50px rgba(0, 245, 255, 0.3);
}
.aurorasea__line .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(22px);
  filter: blur(5px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo), filter 0.7s;
}
.aurorasea__line .w.is-on { opacity: 1; transform: none; filter: none; }

/* ═══════ THE PULSE ═══════ */
.zone--pulse { height: 260vh; }
.zone--pulse .zone__stage { background: #000206; }
.pulse__meta {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
  transform: translateY(16vh);
}
.pulse__bpm {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.3em;
  color: rgba(255, 45, 120, 0.8);
}
.pulse__bpm b {
  font-size: 1.6em;
  color: var(--white);
  text-shadow: 0 0 20px rgba(255, 45, 120, 0.6);
}
.pulse__line {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: rgba(255, 255, 255, 0.85);
}

/* ═══════ THE UNWRITTEN ═══════ */
.zone--unwritten { height: 320vh; }
.unwritten__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1.4vw, 1.1rem);
  width: min(980px, 92vw);
}
@media (max-width: 820px) { .unwritten__grid { grid-template-columns: repeat(4, 1fr); } }
.u-card {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(10, 8, 24, 0.5);
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.4vw, 1.5rem);
  color: rgba(255, 255, 255, 0.22);
  animation: unwrittenFlicker 3.4s steps(2) infinite;
  transition: transform 0.7s var(--ease-out-expo), background 0.7s, border-color 0.7s, color 0.7s, box-shadow 0.7s;
}
@keyframes unwrittenFlicker { 0%,100% { opacity: 0.55; } 50% { opacity: 0.9; } }
.u-card.is-revealed {
  animation: none;
  color: rgba(140, 234, 255, 0.9);
  border-color: rgba(0, 245, 255, 0.25);
  background: rgba(0, 26, 40, 0.35);
  box-shadow: 0 0 26px rgba(0, 245, 255, 0.12);
  transform: rotateY(360deg);
}
.u-card.is-gold {
  animation: none;
  color: #1a0f00;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: clamp(0.66rem, 1.6vw, 0.95rem);
  border-color: rgba(255, 215, 0, 0.8);
  background: linear-gradient(140deg, #ffd700, #ff9d3f);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.45);
  transform: rotateY(360deg) scale(1.06);
}

/* ---- motion respect ---- */
@media (prefers-reduced-motion: reduce) {
  .zone *, .depth-hud { animation: none !important; transition: none !important; }
}
