/* Cinematic landing — chrome, chapters, fallback switching.
   Planets render natural colors in WebGL; ALL UI here stays faboppa mint
   via the shared vars in styles.css (--text-primary/--text-secondary/--glow-rgb). */

/* ---- Mode switching ----
   Default = fallback mode: static hero visible, cinematic chrome hidden.
   body.webgl-on (set after first rendered frame) flips both. */

.scroll-spacer { height: 600vh; }
body:not(.webgl-on) .scroll-spacer,
body:not(.webgl-on) #scene,
body:not(.webgl-on) .chrome,
body:not(.webgl-on) .rail,
body:not(.webgl-on) .letterbox,
body:not(.webgl-on) .chapters { display: none; }
body.webgl-on .fallback { display: none; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Fallback reuses .stage/.wordmark/.manifesto/.about from styles.css. */
.fallback { min-height: 100vh; }

/* ---- Letterbox frame ---- */

.letterbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  box-shadow: inset 0 0 0 10px #000;
  border: 1px solid rgba(var(--glow-rgb), 0.07);
}

/* ---- Top chrome ---- */

.chrome {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 40px);
  pointer-events: none;
}

.chrome--top { top: 0; }
.chrome--bottom {
  bottom: 0;
  border-top: 1px solid rgba(var(--glow-rgb), 0.10);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  padding-top: 12px;
  padding-bottom: 16px;
}

.chrome a, .chrome button { pointer-events: auto; }

.chrome__brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5em;
  color: var(--text-primary);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(var(--glow-rgb), 0.55);
}

.chrome__pills { display: flex; gap: 10px; }

.pill {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid rgba(var(--glow-rgb), 0.25);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.35);
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.pill:hover, .pill:focus-visible, .pill[aria-current="page"] {
  color: var(--text-primary);
  border-color: rgba(var(--glow-rgb), 0.6);
  box-shadow: 0 0 14px rgba(var(--glow-rgb), 0.18);
  outline: none;
}

.pill__glyph { opacity: 0.7; margin-right: 2px; }

/* ---- Left rail ---- */

.rail {
  position: fixed;
  left: clamp(18px, 3vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: rgba(164, 202, 177, 0.45);
  transition: color 0.3s;
}

.rail__dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(var(--glow-rgb), 0.45);
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
}

.rail__item:hover { color: var(--text-secondary); }

.rail__item--active { color: var(--text-primary); }
.rail__item--active .rail__dot {
  background: rgb(var(--glow-rgb));
  box-shadow: 0 0 10px rgba(var(--glow-rgb), 0.8);
}

/* ---- Bottom bar ---- */

.chrome__sound, .chrome__chat {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s;
}

.chrome__sound:hover, .chrome__chat:hover { color: var(--text-primary); }

.chrome__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
}

#scrollHint { transition: opacity 0.6s; }
#scrollHint.hidden { opacity: 0; }

.progress {
  width: clamp(140px, 22vw, 300px);
  height: 2px;
  background: rgba(var(--glow-rgb), 0.12);
  overflow: hidden;
  display: block;
}

#progressFill {
  display: block;
  height: 100%;
  width: 100%;
  background: rgb(var(--glow-rgb));
  box-shadow: 0 0 8px rgba(var(--glow-rgb), 0.8);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---- Chapters overlay ---- */

.chapters {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;     /* keep CTAs at natural width */
  padding-left: clamp(80px, 14vw, 220px);
  padding-right: clamp(24px, 8vw, 120px);
  visibility: hidden;          /* toggled by JS; GSAP animates children */
}

.chapter__headline {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.06;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-shadow: 0 0 32px rgba(var(--glow-rgb), 0.35);
  will-change: transform, opacity;
}

.chapter__sub {
  margin: 22px 0 0;
  max-width: 46ch;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  will-change: transform, opacity;
}

.chapter__ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.cta {
  pointer-events: auto;
  display: inline-block;
  margin-top: 30px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid rgba(var(--glow-rgb), 0.4);
  padding: 13px 26px;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s, color 0.3s;
  will-change: transform, opacity;
}

.cta:hover, .cta:focus-visible {
  background: rgba(var(--glow-rgb), 0.16);
  box-shadow: 0 0 24px rgba(var(--glow-rgb), 0.35);
  outline: none;
}

/* ---- Small screens ---- */

@media (max-width: 720px) {
  .rail__label { display: none; }
  .rail { left: 14px; gap: 14px; }
  .chrome__chat { display: none; }
  .chapter { padding-left: 56px; }
  .chrome__brand { letter-spacing: 0.3em; }
}
