:root {
  /* Implementation cues: IntersectionObserver threshold changes IntersectionObserver IntersectionObserver */
  --onyx: #0B0C10;
  --gunmetal: #1A1E27;
  --silver: #C8CDD5;
  --steel: #6B8A9E;
  --amber: #E8A524;
  --vermillion: #D4342E;
  --cerulean: #1E6F9F;
  --gold: #F2D98C;
}

* { box-sizing: border-box; }

html { scroll-snap-type: y mandatory; background: var(--onyx); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--silver);
  background:
    radial-gradient(circle at 18% 22%, rgba(30, 111, 159, 0.18), transparent 32%),
    radial-gradient(circle at 78% 72%, rgba(212, 52, 46, 0.09), transparent 28%),
    linear-gradient(115deg, #0B0C10 0%, #11141B 48%, #0B0C10 100%);
  font-family: "Libre Baskerville", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(200, 205, 213, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(200, 205, 213, 0.018) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 74%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.24;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

.scene-reel { position: relative; z-index: 2; }

.scene {
  position: relative;
  height: 100vh;
  min-height: 720px;
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--onyx);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(11,12,16,0.92) 0%, rgba(11,12,16,0.35) 42%, rgba(11,12,16,0.86) 100%),
    radial-gradient(ellipse at var(--glow-x, 50%) var(--glow-y, 50%), rgba(232, 165, 36, 0.09), transparent 34%);
}

.scene-one { --glow-x: 64%; --glow-y: 38%; }
.scene-two { --glow-x: 42%; --glow-y: 28%; background: linear-gradient(145deg, #0B0C10, #10151D 58%, #0B0C10); }
.scene-three { --glow-x: 35%; --glow-y: 68%; background: linear-gradient(165deg, #0B0C10, #15131A 48%, #0B0C10); }
.scene-four { --glow-x: 72%; --glow-y: 46%; background: linear-gradient(120deg, #0B0C10, #0D1720 56%, #0B0C10); }
.scene-five { --glow-x: 50%; --glow-y: 31%; background: linear-gradient(150deg, #0B0C10, #141823 50%, #0B0C10); }
.scene-six { --glow-x: 24%; --glow-y: 55%; background: linear-gradient(120deg, #0B0C10, #111722 48%, #0B0C10); }
.scene-seven { --glow-x: 62%; --glow-y: 62%; background: linear-gradient(140deg, #0B0C10, #151A1E 48%, #0B0C10); }

.cinema-stage {
  position: relative;
  height: 100%;
  width: 100%;
  padding: 8rem 8vw;
}

.scene-title {
  position: absolute;
  z-index: 5;
  margin: 0;
  max-width: 9ch;
  font-family: "Poiret One", cursive;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--silver);
  text-shadow: 0 0 24px rgba(107, 138, 158, 0.35), 0 0 2px var(--gold);
}

.scene-copy {
  position: absolute;
  z-index: 5;
  max-width: 38ch;
  margin: 0;
  color: var(--silver);
  font-family: "Libre Baskerville", serif;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.scene:nth-child(odd) .scene-title { left: 10vw; top: 22vh; }
.scene:nth-child(odd) .scene-copy { right: 11vw; bottom: 19vh; }
.scene:nth-child(even) .scene-title { right: 8vw; top: 18vh; text-align: right; }
.scene:nth-child(even) .scene-copy { left: 11vw; bottom: 18vh; }
.scene-three .scene-title, .scene-six .scene-title { top: 56vh; }
.scene-three .scene-copy, .scene-six .scene-copy { top: 19vh; bottom: auto; }

.line-figure {
  position: absolute;
  z-index: 3;
  width: min(72vw, 980px);
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 24px rgba(30, 111, 159, 0.18));
  opacity: 0.92;
}

.scene:nth-child(even) .line-figure { transform: translate(-52%, -47%) scale(1.05); }
.scene-three .line-figure, .scene-six .line-figure { transform: translate(-46%, -48%) scale(0.98); }

.drawing-lines path,
.drawing-lines rect,
.drawing-lines circle {
  fill: none;
  stroke: var(--steel);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.8s ease;
}

.scene.is-visible .drawing-lines path,
.scene.is-visible .drawing-lines rect,
.scene.is-visible .drawing-lines circle { stroke-dashoffset: 0; }

.accent-fills path,
.accent-fills rect,
.accent-fills circle {
  fill: var(--amber);
  opacity: 0;
  transition: opacity 0.55s ease 2.1s;
}

.scene.is-visible .accent-fills path,
.scene.is-visible .accent-fills rect,
.scene.is-visible .accent-fills circle { opacity: 0.78; }

.hud-frame {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--steel);
}

.hud-strip { position: absolute; background: rgba(26, 30, 39, 0.18); }
.hud-top, .hud-bottom { left: 0; right: 0; height: 60px; display: flex; align-items: center; padding: 0 34px; }
.hud-top { top: 0; justify-content: space-between; border-bottom: 1px solid rgba(30, 111, 159, 0.52); }
.hud-bottom { bottom: 0; justify-content: center; border-top: 1px solid rgba(30, 111, 159, 0.52); }
.hud-left, .hud-right { top: 60px; bottom: 60px; width: 60px; display: grid; place-items: center; border-color: rgba(30, 111, 159, 0.36); }
.hud-left { left: 0; border-right: 1px solid rgba(30, 111, 159, 0.4); }
.hud-right { right: 0; border-left: 1px solid rgba(30, 111, 159, 0.4); }
.hud-left span, .hud-right span { display: block; white-space: nowrap; color: var(--amber); text-shadow: 0 0 14px rgba(232, 165, 36, 0.22); }
.hud-left span { transform: rotate(-90deg); }
.hud-right span { transform: rotate(90deg); }
.hud-brand, .hud-counter { color: var(--amber); }

.hud-top::before,
.hud-top::after,
.hud-bottom::before,
.hud-bottom::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 148px;
  height: 18px;
  transform: translateX(-50%);
  opacity: 0.6;
  background:
    linear-gradient(90deg, transparent 0 10px, var(--cerulean) 10px 11px, transparent 11px 28px, var(--cerulean) 28px 29px, transparent 29px 100%),
    linear-gradient(135deg, transparent 0 42%, var(--cerulean) 42% 45%, transparent 45% 55%, var(--cerulean) 55% 58%, transparent 58%);
  clip-path: polygon(0 0, 38% 0, 50% 70%, 62% 0, 100% 0, 100% 25%, 66% 25%, 50% 100%, 34% 25%, 0 25%);
}
.hud-top::before { bottom: -18px; }
.hud-top::after { bottom: -30px; width: 92px; opacity: 0.38; }
.hud-bottom::before { top: -18px; transform: translateX(-50%) rotate(180deg); }
.hud-bottom::after { top: -30px; width: 92px; transform: translateX(-50%) rotate(180deg); opacity: 0.38; }

.hud-progress { position: absolute; left: 60px; right: 60px; top: 0; height: 1px; background: rgba(107, 138, 158, 0.22); }
.hud-progress span { display: block; width: 0%; height: 100%; background: var(--amber); box-shadow: 0 0 16px rgba(232, 165, 36, 0.6); }
.hud-coordinate { position: absolute; bottom: 18px; color: rgba(107, 138, 158, 0.78); }

.fragment {
  position: absolute;
  z-index: 4;
  color: rgba(232, 165, 36, 0.4);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  mix-blend-mode: screen;
  animation: driftA 8s ease-in-out infinite;
}
.f1,.f4,.f7,.f10,.f13,.f16,.f19 { left: 18%; top: 66%; }
.f2,.f5,.f8,.f11,.f14,.f17,.f20 { right: 18%; top: 28%; animation-name: driftB; animation-duration: 10s; }
.f3,.f6,.f9,.f12,.f15,.f18,.f21 { right: 28%; bottom: 16%; animation-name: driftC; animation-duration: 12s; }
.f4,.f13 { top: 20%; left: 22%; } .f5,.f14 { top: 70%; } .f6,.f15 { bottom: 30%; right: 12%; }
.f7,.f16 { top: 74%; } .f8,.f17 { top: 22%; right: 26%; } .f9,.f18 { right: 38%; bottom: 12%; }
.f10,.f19 { top: 60%; left: 14%; } .f11,.f20 { top: 18%; right: 16%; } .f12,.f21 { bottom: 24%; right: 20%; }

@keyframes driftA { 0%,100% { transform: translate(0,0); } 50% { transform: translate(6px,-5px); } }
@keyframes driftB { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-7px,4px); } }
@keyframes driftC { 0%,100% { transform: translate(0,0); } 50% { transform: translate(4px,8px); } }

#spotlight {
  position: fixed;
  z-index: 25;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(232, 165, 36, 0.06) 0%, transparent 70%);
}

#blackout {
  position: fixed;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  background: var(--onyx);
  opacity: 0;
}

#blackout.pulse { animation: blackoutPulse 400ms ease both; }
@keyframes blackoutPulse { 0% { opacity: 0; } 45% { opacity: 0.6; } 100% { opacity: 0; } }

@media (max-width: 760px) {
  .scene { min-height: 680px; }
  .cinema-stage { padding: 6rem 4.5rem; }
  .scene-title, .scene:nth-child(even) .scene-title, .scene:nth-child(odd) .scene-title { left: 4.5rem; right: 2rem; top: 16vh; text-align: left; }
  .scene-copy, .scene:nth-child(even) .scene-copy, .scene:nth-child(odd) .scene-copy, .scene-three .scene-copy, .scene-six .scene-copy { left: 4.5rem; right: 2rem; bottom: 13vh; top: auto; }
  .line-figure { width: 92vw; opacity: 0.78; }
  .hud-top, .hud-bottom { height: 52px; padding: 0 18px; }
  .hud-left, .hud-right { top: 52px; bottom: 52px; width: 44px; }
  .hud-progress { left: 44px; right: 44px; }
  .hud-coordinate { display: none; }
}
