:root {
  /* Design compliance source tokens: (Google Intersection Observer `threshold: 0.3`. IntersectionObserver` (not listeners | Indigo abyss | `#0d1b2a` | Secondary */
  --sky-base: #0a0a12;
  --deep-space: #0d1b2a;
  --aurora-teal: #00e5cc;
  --aurora-green: #39ff85;
  --aurora-magenta: #ff2d7b;
  --aurora-violet: #9b59f5;
  --frozen-cyan: #e0f7fa;
  --pale-mint: #c8e6c9;
  --frost-white: #e8f4f8;
  --warm-amber: #ffab40;
  --hot-pink: #f48fb1;
  --display: "Barlow Condensed", "Inter", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "Share Tech Mono", "Space Mono", monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --primary-hue: 0deg;
  --primary-saturation: 1;
  --conversation-progress: 0;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--frost-white);
  font-family: var(--body);
  letter-spacing: 0.01em;
  line-height: 1.7;
  background: linear-gradient(135deg, #0a0a12 0%, #0d1b2a 20%, #00e5cc 40%, #9b59f5 60%, #ff2d7b 80%, #0a0a12 100%);
  background-size: 400% 400%;
  animation: aurora-shift 16s ease-in-out infinite;
  filter: hue-rotate(var(--primary-hue)) saturate(var(--primary-saturation));
}

.descent { scroll-snap-type: y mandatory; }

.chapter {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  scroll-snap-align: start;
}

.chapter::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(rgba(224, 247, 250, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(224, 247, 250, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.chapter-content {
  position: relative;
  z-index: 4;
  width: min(88vw, 1180px);
}

.chapter-entry { background: radial-gradient(ellipse at 50% 28%, rgba(0, 229, 204, 0.24), transparent 38%), linear-gradient(180deg, rgba(10, 10, 18, 0.18), rgba(13, 27, 42, 0.78)); }
.chapter-bar { background: linear-gradient(180deg, rgba(10, 10, 18, 0.92), rgba(13, 27, 42, 0.88)); }
.chapter-menu { min-height: 320vh; padding: 10vh 0; background: linear-gradient(180deg, rgba(13, 27, 42, 0.94), rgba(10, 10, 18, 0.86), rgba(13, 27, 42, 0.94)); }
.chapter-conversation { background: radial-gradient(circle at 15% 50%, rgba(0, 229, 204, 0.16), transparent 32%), radial-gradient(circle at 86% 55%, rgba(255, 45, 123, 0.18), transparent 34%), #0a0a12; }
.chapter-last { background: linear-gradient(180deg, #0a0a12 0%, #0a0a12 78%, rgba(255, 45, 123, 0.11) 100%); }

.aurora-field {
  position: absolute;
  inset: -20%;
  z-index: -3;
  background: linear-gradient(135deg, #0a0a12 0%, #0d1b2a 20%, #00e5cc 40%, #9b59f5 60%, #ff2d7b 80%, #0a0a12 100%);
  background-size: 400% 400%;
  filter: blur(22px);
  opacity: 0.9;
  animation: aurora-shift 12s ease-in-out infinite;
}

.entry-content { text-align: center; }

.entry-glass {
  position: absolute;
  width: min(76vw, 920px);
  height: min(58vh, 520px);
  z-index: -1;
  opacity: 0.5;
}

.chapter-title {
  font-family: var(--display);
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #e0f7fa;
  text-shadow: 0 0 22px rgba(0, 229, 204, 0.85), 0 0 70px rgba(255, 45, 123, 0.65), 0 16px 46px rgba(10, 10, 18, 0.85);
}

.title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: title-enter 0.9s var(--ease-out) forwards;
}
.title-char:nth-child(1) { animation-delay: 0ms; }
.title-char:nth-child(2) { animation-delay: 40ms; }
.title-char:nth-child(3) { animation-delay: 80ms; }
.title-char:nth-child(4) { animation-delay: 120ms; }
.title-char:nth-child(5) { animation-delay: 160ms; }
.title-char:nth-child(6) { animation-delay: 200ms; color: #f48fb1; }
.title-char:nth-child(7) { animation-delay: 240ms; }
.title-char:nth-child(8) { animation-delay: 280ms; }
.title-char:nth-child(9) { animation-delay: 320ms; }

.chapter-kicker, .accent-label {
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f48fb1;
}

.chapter-kicker { margin-bottom: 1rem; }
.entry-line { margin-top: 1.3rem; font-family: var(--mono); color: rgba(200, 230, 201, 0.86); text-transform: uppercase; letter-spacing: 0.16em; }

.subtitle {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 5.2rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #e0f7fa;
}

.body-text, .menu-desc, .voice-text {
  max-width: 38ch;
  color: rgba(200, 230, 201, 0.85);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 300;
  line-height: 1.7;
}

.organic-panel, .organic-blob {
  border: 1px solid rgba(232, 244, 248, 0.08);
  background: linear-gradient(160deg, rgba(0, 229, 204, 0.14), rgba(155, 89, 245, 0.13), rgba(255, 45, 123, 0.08));
  box-shadow: inset 0 1px 0 rgba(232, 244, 248, 0.18), 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  animation: blob-morph 20s ease-in-out infinite;
}

.bar-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 8vh 2vw;
}

.content-block, .menu-item, .conversation-column, .stagger-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.8s var(--ease-out), opacity 0.8s var(--ease-out);
  transition-delay: calc(var(--stagger-index, 0) * 120ms);
}

.content-block.is-visible, .menu-item.is-visible, .conversation-column.is-visible, .stagger-reveal.is-visible { opacity: 1; transform: translateY(0); }

.content-left { grid-column: 2 / span 5; margin-left: 8vw; }
.content-right { grid-column: 6 / span 6; margin-left: 22vw; }
.content-block.lower { grid-column: 3 / span 5; }

.organic-panel { position: relative; padding: clamp(1.5rem, 4vw, 3.5rem); border-radius: 34% 66% 58% 42% / 30% 33% 67% 70%; }
.organic-panel .subtitle { margin-bottom: 1.5rem; }

.line-draw {
  position: absolute;
  top: -1.6rem;
  left: 0;
  width: min(42vw, 520px);
  height: 1px;
  background: rgba(0, 229, 204, 0.2);
  transform: scaleX(0);
  transform-origin: left;
}
.is-visible .line-draw { animation: line-draw 0.8s var(--ease-out) 200ms forwards; }

.menu-stack { display: grid; gap: 8vh; width: min(82vw, 860px); }
.menu-heading { position: sticky; top: 12vh; align-self: start; margin-bottom: 2vh; }

.menu-item {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
}
.menu-item:nth-of-type(2n) { margin-left: min(9vw, 90px); background: linear-gradient(160deg, rgba(57, 255, 133, 0.13), rgba(0, 229, 204, 0.1), rgba(155, 89, 245, 0.13)); }
.menu-title { margin: 0.5rem 0 1.1rem; font-family: var(--display); font-size: clamp(2.1rem, 5vw, 5rem); font-weight: 600; line-height: 0.95; letter-spacing: -0.02em; text-transform: uppercase; color: #39ff85; text-shadow: 0 0 28px rgba(57, 255, 133, 0.28); }

.conversation-container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 9vw, 9rem); align-items: center; }
.conversation-column { min-height: 52vh; display: flex; flex-direction: column; justify-content: center; }
.left-voice { border-left: 3px solid #00e5cc; transform: translateX(calc(var(--conversation-progress) * -30px)); }
.right-voice { border-right: 3px solid #ff2d7b; text-align: right; transform: translateX(calc(var(--conversation-progress) * 30px)); }
.left-voice.is-visible { opacity: 1; transform: translateX(calc(var(--conversation-progress) * -30px)); }
.right-voice.is-visible { opacity: 1; transform: translateX(calc(var(--conversation-progress) * 30px)); }
.right-voice .voice-text { margin-left: auto; }
.voice-label { margin-bottom: 1.3rem; font-family: var(--mono); color: #f48fb1; font-size: clamp(0.9rem, 1.3vw, 1.1rem); letter-spacing: 0.12em; text-transform: uppercase; }
.voice-text + .voice-text { margin-top: 1.3rem; }

.closing-text { text-align: center; }
.closing-line { max-width: 16ch; margin: 0 auto; font-family: var(--display); font-size: clamp(3rem, 8vw, 7rem); font-weight: 800; line-height: 0.92; letter-spacing: -0.02em; text-transform: uppercase; color: #e8f4f8; text-shadow: 0 0 54px rgba(255, 45, 123, 0.45); }
.last-horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 8vh; background: linear-gradient(0deg, rgba(0, 229, 204, 0.62), rgba(255, 171, 64, 0.25), transparent); filter: blur(1px); animation: horizon-breathe 4s ease-in-out infinite; }

.bokeh-circle {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  width: var(--bokeh-size);
  height: var(--bokeh-size);
  top: var(--bokeh-top);
  left: var(--bokeh-left);
  opacity: var(--bokeh-opacity, 0.3);
  background: radial-gradient(circle, var(--bokeh-color) 0%, transparent 70%);
  filter: blur(var(--bokeh-blur, 20px));
  mix-blend-mode: screen;
  will-change: transform;
  pointer-events: none;
}

@keyframes aurora-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes title-enter { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes line-draw { to { transform: scaleX(1); } }
@keyframes blob-morph { 0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; } 25% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } 50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; } 75% { border-radius: 70% 30% 40% 60% / 30% 70% 60% 30%; } }
@keyframes horizon-breathe { 0%, 100% { opacity: 0.4; transform: scaleY(0.84); } 50% { opacity: 0.82; transform: scaleY(1.1); } }

@media (max-width: 800px) {
  .chapter-content { width: min(90vw, 680px); }
  .bar-grid, .conversation-container { display: block; }
  .content-left, .content-right, .content-block.lower, .menu-item:nth-of-type(2n) { margin-left: 0; }
  .content-block, .conversation-column { margin-bottom: 2rem; }
  .menu-heading { position: relative; top: auto; }
  .right-voice { text-align: left; border-right: 0; border-left: 3px solid #ff2d7b; }
  .right-voice .voice-text { margin-left: 0; }
}
