:root {
  --void: #060607;
  --steel: #C8CBCE;
  --grey: #6E7276;
  --green: #0B4E33;
  --gold: #B99B5E;
  --font-display: 'Archivo', sans-serif;
  --font-body: 'Source Serif 4', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--void);
  color: var(--steel);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}

#stage {
  position: relative;
  height: 900vh; /* 9 chapters x 100vh */
}

#film-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#grain-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20vw 4vw rgba(0,0,0,0.55);
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
#preloader-pct {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--steel);
}
#preloader-bar-track {
  width: 240px;
  height: 1px;
  background: rgba(200,203,206,0.15);
}
#preloader-bar {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.2s ease;
}

/* ---------- nav ---------- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid rgba(200,203,206,0.12);
  background: rgba(6,6,7,0.55);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-word { color: var(--steel); font-weight: 500; }
.nav-chapters { display: flex; gap: 28px; }
.nav-chapters a { color: var(--grey); text-decoration: none; transition: color 0.2s ease; }
.nav-chapters a:hover, .nav-chapters a.active { color: var(--gold); }
.nav-chapters a:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.nav-right { display: flex; gap: 16px; color: var(--grey); }

/* ---------- chapter rail ---------- */
#chapter-rail {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-mono);
}
.rail-item {
  color: var(--grey);
  font-size: 12px;
  position: relative;
  padding-left: 14px;
}
.rail-item.active {
  color: var(--steel);
  font-size: 14px;
}
.rail-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 1px;
  background: var(--gold);
}

/* ---------- dive-bezel indicator ---------- */
#bezel-indicator {
  position: fixed;
  right: -140px;
  bottom: -140px;
  z-index: 5;
  width: 500px;
  height: 500px;
  pointer-events: none;
}
#bezel-svg { width: 100%; height: 100%; }
#bezel-pearl {
  filter: drop-shadow(0 0 6px var(--green)) drop-shadow(0 0 12px var(--green));
}
#bezel-readout {
  position: absolute;
  right: 170px;
  bottom: 170px;
  text-align: right;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--grey);
}
#bezel-chapter-num { color: var(--gold); margin-right: 0.5em; }

/* ---------- text blocks ---------- */
.text-block {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 38%;
  max-width: 620px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
.text-block.side-left { left: 6%; }
.text-block.side-right { right: 6%; }
.text-block::before {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: 52vw;
  z-index: -1;
  pointer-events: none;
}
.text-block.side-left::before {
  left: 0;
  background: linear-gradient(to right, rgba(6,6,7,0.82) 0%, rgba(6,6,7,0.6) 42%, rgba(6,6,7,0) 100%);
}
.text-block.side-right::before {
  right: 0;
  background: linear-gradient(to left, rgba(6,6,7,0.82) 0%, rgba(6,6,7,0.6) 42%, rgba(6,6,7,0) 100%);
}
.tb-eyebrow {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.2em;
}
.tb-headline {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.05;
  margin-bottom: 0.7em;
  color: var(--steel);
}
.tb-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--steel);
  opacity: 0.9;
  margin-bottom: 1.4em;
  max-width: 62ch;
}
.tb-spec {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--grey);
  text-transform: uppercase;
  padding-top: 0.8em;
  border-top: 1px solid rgba(185,155,94,0.35);
}

/* ---------- hotspots ---------- */
.hotspot {
  position: fixed;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--green);
  background: rgba(11,78,51,0.15);
  color: var(--steel);
  z-index: 4;
  cursor: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  animation: hotspot-pulse 2.6s ease-in-out infinite;
}
.hotspot.visible { opacity: 1; pointer-events: auto; }
.hotspot-plus { font-family: var(--font-mono); font-size: 14px; line-height: 26px; }
.hotspot-label {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--grey);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.hotspot:hover .hotspot-label { opacity: 1; }
@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11,78,51,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(11,78,51,0); }
}
.hotspot-card {
  position: fixed;
  top: 50%;
  right: -420px;
  transform: translateY(-50%);
  width: 320px;
  padding: 28px;
  background: rgba(6,6,7,0.92);
  border: 1px solid var(--gold);
  backdrop-filter: blur(6px);
  z-index: 10;
  transition: right 0.5s cubic-bezier(0.22,1,0.36,1);
}
.hotspot-card.open { right: 40px; }
.hc-label {
  font-family: var(--font-mono);
  color: var(--gold);
  letter-spacing: 0.1em;
  font-size: 12px;
  margin-bottom: 0.8em;
}
.hc-body { font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--steel); }

/* ---------- cursor + scroll hint ---------- */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border: 1px solid var(--steel);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
#cursor-dot.active { opacity: 1; }
#cursor-dot.near-hotspot {
  width: 34px; height: 34px;
  border-color: var(--gold);
}

#scroll-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--grey);
}

/* ---------- footer ---------- */
#site-footer {
  position: relative;
  z-index: 2;
  background: var(--void);
  padding: 100px 8% 60px;
  border-top: 1px solid rgba(200,203,206,0.12);
}
.footer-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.footer-credits, .footer-disclaimer {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--grey);
  max-width: 60ch;
  margin-top: 8px;
}

/* ---------- prefers-reduced-motion fallback ---------- */
.reduced-motion { height: auto !important; }
.reduced-motion #film-canvas { position: absolute; top: 0; height: 100vh; }
.reduced-motion #bezel-indicator,
.reduced-motion #scroll-hint,
.reduced-motion .hotspot { display: none; }
.reduced-motion .text-block {
  position: static;
  transform: none;
  width: 90%;
  max-width: 720px;
  margin: 100px auto;
  opacity: 1;
  filter: none;
}
