/* ANEMION shell — responsive scaffold (CHUNK 1) */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--navy-void);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
}

/* Fixed world canvas behind everything */
#world-canvas, #world-poster {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
#world-poster { background: radial-gradient(ellipse at 50% 120%, var(--navy-raise), var(--navy-void) 70%); }

/* Scrims */
.scrim {
  position: fixed;
  left: 0; right: 0;
  height: 18vh;
  z-index: 1;
  pointer-events: none;
}
.scrim-top { top: 0; background: linear-gradient(to bottom, rgba(4,16,31,0.85), transparent); }
.scrim-bottom { bottom: 0; background: linear-gradient(to top, rgba(4,16,31,0.85), transparent); }

/* Chapter rail */
#chapter-rail {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 10;
  display: flex;
  align-items: center;
}
#chapter-rail ul { list-style: none; width: 100%; }
#chapter-rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 10px 18px;
  color: var(--text-dim);
  text-decoration: none;
}
#chapter-rail .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--text-dim);
  flex: none;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
#chapter-rail .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
#chapter-rail a:hover .label,
#chapter-rail a:focus-visible .label { opacity: 1; transform: translateX(0); }
#chapter-rail a.active .dot {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 8px var(--blue);
}
#chapter-rail a.active { color: var(--ice); }

/* Story chapters */
#story { position: relative; z-index: 2; }
.chapter {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--pad) * 2) var(--pad);
  padding-left: calc(var(--rail-w) + var(--pad));
}
.chapter.alt { justify-content: flex-end; }
.chapter .panel {
  max-width: 560px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: clamp(1.5rem, 4vw, 3rem);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Hero */
#hero .panel {
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}
#hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ice);
}
.whisper {
  font-family: var(--font-mono);
  font-weight: 300;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* Mobile */
@media (max-width: 720px) {
  #chapter-rail { left: auto; right: 0; top: auto; bottom: 0; width: 100%; height: 48px; }
  #chapter-rail ul { display: flex; justify-content: space-around; align-items: center; height: 100%; }
  #chapter-rail a { padding: 0; flex-direction: column; gap: 4px; }
  #chapter-rail .label { opacity: 1; transform: none; font-size: 8px; }
  .chapter { padding-left: var(--pad); padding-bottom: 72px; }
}

/* Chapter content typography + reveals (CHUNK 3) */
.chapter h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ice);
  margin-bottom: 1rem;
}
.chapter p { font-weight: 300; line-height: 1.7; font-size: clamp(0.95rem, 1.6vw, 1.1rem); color: var(--text); }
.chapter p + p { margin-top: 0.75rem; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.contact-line { margin-top: 1.25rem; }
.contact-line a {
  color: var(--blue);
  font-family: var(--font-mono);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,174,239,0.4);
}
.contact-line a:hover { color: var(--ice); border-bottom-color: var(--ice); }
.legal { margin-top: 2rem; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

/* Boot sequence (CHUNK 4) */
body.booting { overflow: hidden; }
#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--navy-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  transition: opacity 0.8s ease;
}
#boot.boot-out { opacity: 0; pointer-events: none; }
#boot-logo { width: clamp(120px, 16vw, 190px); height: auto; }
#boot-word {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: var(--ice);
}
#boot-log {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 11px;
  color: var(--text-dim);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.boot-line.final { color: var(--blue); }
#boot-bar {
  width: clamp(180px, 30vw, 320px);
  height: 2px;
  background: rgba(127, 215, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
#boot-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--ice));
  box-shadow: 0 0 8px var(--blue);
  transition: width 0.4s ease;
}
