:root {
  /* Design vocabulary: around breathe with subtle glow Mono** timestamp-like captions filmic learning ritual. Inter** brief explanatory copy */
  --phosphor-blue: #9DE7FF;
  --near-black-plum: #120718;
  --dream-violet: #5B4DFF;
  --soft-apricot: #FFD6A5;
  --ember-orange: #FF9B54;
  --deep-projector-indigo: #090B2F;
  --mist-white: #F4F1FF;
  --display: "Bebas Neue", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; overflow: hidden; background: #090B2F; color: #F4F1FF; }

body { font-family: var(--text); }

button { font: inherit; color: inherit; }

.cinema {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(91, 77, 255, 0.38), rgba(9, 11, 47, 0.42) 28%, rgba(18, 7, 24, 0.96) 76%),
    radial-gradient(circle at 84% 17%, rgba(255, 155, 84, 0.24), transparent 28%),
    radial-gradient(circle at 12% 82%, rgba(157, 231, 255, 0.14), transparent 32%),
    #090B2F;
}

.cinema::before {
  content: "";
  position: absolute;
  inset: -18vmax;
  background: conic-gradient(from 21deg, transparent, rgba(157, 231, 255, 0.08), transparent, rgba(255, 214, 165, 0.07), transparent);
  animation: slowRotate 46s linear infinite;
  filter: blur(18px);
}

.cinema::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 37%, rgba(18, 7, 24, 0.42) 68%, rgba(18, 7, 24, 0.9) 100%);
  pointer-events: none;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(244, 241, 255, 0.22) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(157, 231, 255, 0.17) 0 1px, transparent 1.5px),
    radial-gradient(circle at 43% 78%, rgba(255, 214, 165, 0.16) 0 1px, transparent 1.5px);
  background-size: 37px 37px, 53px 53px, 71px 71px;
  animation: grainDrift 1.1s steps(2) infinite;
}

.film-burn {
  position: absolute;
  inset: -12% auto auto -12%;
  width: 35vmax;
  height: 35vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 155, 84, 0.72), rgba(255, 214, 165, 0.24) 29%, transparent 64%);
  filter: blur(32px);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 700ms ease, transform 1100ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 5;
}

.film-burn.flash { opacity: 0.62; transform: scale(1.35); }

.collage-field { position: absolute; inset: 0; transform-style: preserve-3d; z-index: 1; }

.scrap {
  position: absolute;
  border: 1px solid rgba(157, 231, 255, 0.23);
  background: linear-gradient(135deg, rgba(244, 241, 255, 0.08), rgba(91, 77, 255, 0.08));
  box-shadow: 0 0 35px rgba(91, 77, 255, 0.16), inset 0 0 32px rgba(157, 231, 255, 0.06);
  backdrop-filter: blur(9px);
  color: rgba(244, 241, 255, 0.78);
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.75vw, 0.82rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
  animation: float 9s ease-in-out infinite;
}

.scrap-note { left: 10%; top: 18%; width: 16rem; min-height: 7rem; padding: 1rem; transform: rotate(-8deg); border-color: rgba(255, 214, 165, 0.32); }
.scrap-note b { display: block; margin-top: 1.1rem; color: #FFD6A5; font-family: var(--text); font-weight: 300; text-transform: none; letter-spacing: 0.02em; line-height: 1.6; }
.scrap-code { right: 8%; top: 22%; width: 20rem; padding: 1.2rem; transform: rotate(7deg); animation-delay: -2s; }
.scrap-code code { display: block; margin-top: 1rem; color: #9DE7FF; text-transform: none; }
.scrap-chart { left: 15%; bottom: 16%; width: 12rem; height: 12rem; border-radius: 50%; animation-delay: -4s; }
.scrap-chart i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #9DE7FF; box-shadow: 0 0 16px #9DE7FF; }
.scrap-chart i:nth-child(1) { left: 22%; top: 34%; } .scrap-chart i:nth-child(2) { left: 52%; top: 18%; } .scrap-chart i:nth-child(3) { left: 72%; top: 58%; } .scrap-chart i:nth-child(4) { left: 38%; top: 76%; }
.scrap-chart span { position: absolute; left: 20%; bottom: 18%; color: #F4F1FF; }
.scrap-slide { right: 14%; bottom: 18%; width: 15rem; height: 8rem; padding: 1rem; transform: rotate(-4deg); background: rgba(255, 214, 165, 0.08); border-color: rgba(255, 155, 84, 0.35); animation-delay: -6s; }
.scrap-slide strong { display: block; margin-top: 2rem; font-family: var(--display); font-size: 2.2rem; color: #FF9B54; font-weight: 400; letter-spacing: 0.04em; }
.scrap-wave { left: 50%; top: 7%; width: 22rem; height: 7rem; transform: translateX(-50%) rotate(2deg); background: repeating-radial-gradient(ellipse at center, transparent 0 14px, rgba(157, 231, 255, 0.18) 15px 16px); animation-delay: -1s; }
.scrap-pinout { left: 50%; bottom: 5%; width: 18rem; height: 4rem; padding: 1.2rem; transform: translateX(-50%); background-image: repeating-linear-gradient(90deg, transparent 0 12px, rgba(157, 231, 255, 0.18) 13px 14px); animation-delay: -5s; }

.chapter-orbit {
  position: absolute;
  width: min(78vmin, 720px);
  height: min(78vmin, 720px);
  border: 1px solid rgba(157, 231, 255, 0.11);
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
}

.orbit-tick {
  position: absolute;
  left: 50%; top: 50%;
  width: 3.3rem; height: 1.9rem;
  margin: -0.95rem 0 0 -1.65rem;
  border: 1px solid rgba(157, 231, 255, 0.22);
  background: rgba(9, 11, 47, 0.36);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: rgba(244, 241, 255, 0.7);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 300ms ease, color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}
.orbit-tick:nth-child(1) { transform: rotate(-90deg) translateX(calc(min(39vmin, 360px))) rotate(90deg); }
.orbit-tick:nth-child(2) { transform: rotate(-18deg) translateX(calc(min(39vmin, 360px))) rotate(18deg); }
.orbit-tick:nth-child(3) { transform: rotate(54deg) translateX(calc(min(39vmin, 360px))) rotate(-54deg); }
.orbit-tick:nth-child(4) { transform: rotate(126deg) translateX(calc(min(39vmin, 360px))) rotate(-126deg); }
.orbit-tick:nth-child(5) { transform: rotate(198deg) translateX(calc(min(39vmin, 360px))) rotate(-198deg); }
.orbit-tick.active { border-color: #FF9B54; color: #FFD6A5; background: rgba(255, 155, 84, 0.12); box-shadow: 0 0 28px rgba(255, 155, 84, 0.32); }

.study-aperture {
  position: relative;
  width: min(63vmin, 620px);
  height: min(63vmin, 620px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  isolation: isolate;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(157, 231, 255, 0.2), 0 0 80px rgba(91, 77, 255, 0.48), inset 0 0 70px rgba(157, 231, 255, 0.08);
  background: radial-gradient(circle at 50% 45%, rgba(244, 241, 255, 0.08), rgba(91, 77, 255, 0.12) 44%, rgba(18, 7, 24, 0.5) 78%);
  overflow: hidden;
}

.aperture-glass { position: absolute; inset: 0; border-radius: inherit; background: repeating-radial-gradient(circle at center, transparent 0 31px, rgba(157, 231, 255, 0.08) 32px 33px), linear-gradient(140deg, rgba(244, 241, 255, 0.1), transparent 44%, rgba(255, 155, 84, 0.08)); animation: aperturePulse 7s ease-in-out infinite; }
.aperture-glass::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid rgba(244, 241, 255, 0.11); box-shadow: inset 0 0 45px rgba(9, 11, 47, 0.66); }

.ripple-layer { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4; }
.ripple { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 1px solid rgba(157, 231, 255, 0.9); box-shadow: 0 0 28px rgba(157, 231, 255, 0.45), inset 0 0 18px rgba(157, 231, 255, 0.22); animation: rippleOut 1300ms cubic-bezier(.12,.72,.18,1) forwards; }

.coordinates { position: absolute; inset: 0; font-family: var(--mono); font-size: clamp(0.58rem, 0.78vw, 0.76rem); letter-spacing: 0.09em; color: rgba(157, 231, 255, 0.72); text-transform: uppercase; z-index: 5; pointer-events: none; }
.coordinates span { position: absolute; text-shadow: 0 0 14px rgba(157, 231, 255, 0.7); animation: flicker 3.8s steps(2) infinite; }
.coordinates span:nth-child(1) { left: 9%; top: 18%; } .coordinates span:nth-child(2) { right: 8%; top: 24%; } .coordinates span:nth-child(3) { left: 13%; bottom: 18%; } .coordinates span:nth-child(4) { right: 11%; bottom: 16%; }

.scene { position: absolute; inset: 13%; display: grid; place-items: center; align-content: center; text-align: center; opacity: 0; transform: scale(0.96); filter: blur(14px); transition: opacity 760ms ease, transform 900ms cubic-bezier(.2,.8,.2,1), filter 760ms ease; z-index: 3; }
.scene.active { opacity: 1; transform: scale(1); filter: blur(0); }
.scene.wave { filter: blur(8px); transform: scale(1.025); }
.scene-kicker { margin: 0 0 0.8rem; font-family: var(--mono); font-size: clamp(0.62rem, 1vw, 0.82rem); letter-spacing: 0.18em; text-transform: uppercase; color: #9DE7FF; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 0.86; letter-spacing: 0.035em; text-transform: lowercase; color: #F4F1FF; text-shadow: 0 0 26px rgba(157, 231, 255, 0.38); }
h1 { font-size: clamp(5rem, 14vw, 10.7rem); }
h2 { font-size: clamp(4.2rem, 10.5vw, 8.4rem); }
.scene-caption { max-width: 31rem; margin: 1.2rem auto 0; color: rgba(244, 241, 255, 0.78); font-size: clamp(0.94rem, 1.25vw, 1.1rem); font-weight: 300; line-height: 1.75; }
.mono-line { margin: 1rem 0 0; font-family: var(--mono); color: #FFD6A5; font-size: 0.78rem; letter-spacing: 0.08em; }

.index-cards { display: grid; gap: 0.65rem; width: min(100%, 27rem); margin-top: 1.4rem; perspective: 800px; }
.index-cards div { padding: 0.85rem 1rem; border: 1px solid rgba(255, 214, 165, 0.24); background: rgba(255, 214, 165, 0.08); color: #FFD6A5; font-family: var(--mono); font-size: 0.75rem; text-align: left; transform: rotateX(10deg); box-shadow: 0 0 20px rgba(255, 155, 84, 0.09); }
.constellation { position: relative; width: min(88%, 24rem); height: 12rem; margin-top: 1rem; border: 1px solid rgba(157, 231, 255, 0.16); background: linear-gradient(135deg, rgba(157, 231, 255, 0.05), transparent); }
.constellation::before { content: ""; position: absolute; inset: 22% 12%; border-top: 1px solid rgba(157, 231, 255, 0.24); border-bottom: 1px solid rgba(91, 77, 255, 0.22); transform: skewY(-14deg); }
.constellation span { position: absolute; left: var(--x); top: var(--y); width: 8px; height: 8px; border-radius: 50%; background: #9DE7FF; box-shadow: 0 0 20px #9DE7FF; }
.lab-fragments { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; max-width: 24rem; margin-top: 1.5rem; }
.lab-fragments span { border: 1px solid rgba(157, 231, 255, 0.18); background: rgba(91, 77, 255, 0.13); padding: 0.7rem 0.9rem; font-family: var(--mono); font-size: 0.72rem; color: rgba(244, 241, 255, 0.8); }

.lower-caption { position: absolute; left: 50%; bottom: 5vh; transform: translateX(-50%); z-index: 4; text-align: center; display: grid; gap: 0.35rem; color: rgba(244, 241, 255, 0.62); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.lower-caption b { font-family: var(--display); font-weight: 400; color: #FFD6A5; font-size: 1.65rem; letter-spacing: 0.08em; }

body.scene-1 .study-aperture { border-radius: 38%; }
body.scene-2 .study-aperture { border-radius: 50% 45% 52% 42%; }
body.scene-3 .study-aperture { border-radius: 30%; }
body.scene-4 .study-aperture { border-radius: 50%; }
body.scene-1 .cinema { background: radial-gradient(circle at 50% 50%, rgba(255, 155, 84, 0.12), rgba(91, 77, 255, 0.28) 36%, rgba(18, 7, 24, 0.96) 78%), #090B2F; }
body.scene-3 .cinema { background: radial-gradient(circle at 50% 50%, rgba(157, 231, 255, 0.21), rgba(91, 77, 255, 0.26) 42%, rgba(18, 7, 24, 0.97) 80%), #090B2F; }

@keyframes rippleOut { to { width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; opacity: 0; } }
@keyframes slowRotate { to { transform: rotate(360deg); } }
@keyframes grainDrift { 50% { transform: translate(1.5%, -1%); } }
@keyframes aperturePulse { 50% { opacity: 0.72; transform: scale(1.015); } }
@keyframes flicker { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } 52% { opacity: 0.2; } 54% { opacity: 0.9; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -18px; } }

@media (max-width: 760px) {
  .study-aperture { width: 82vmin; height: 82vmin; }
  .chapter-orbit { width: 95vmin; height: 95vmin; }
  .orbit-tick:nth-child(n) { transform: none; }
  .orbit-tick:nth-child(1) { left: 50%; top: 0%; } .orbit-tick:nth-child(2) { left: 92%; top: 34%; } .orbit-tick:nth-child(3) { left: 76%; top: 88%; } .orbit-tick:nth-child(4) { left: 24%; top: 88%; } .orbit-tick:nth-child(5) { left: 8%; top: 34%; }
  .scrap { opacity: 0.36; }
  .scrap-note, .scrap-code, .scrap-slide { width: 12rem; }
  .coordinates span:nth-child(2), .coordinates span:nth-child(3) { display: none; }
}
