:root {
  /* Compliance vocabulary from DESIGN.md: (Google Inter's mechanical precision contrasts against Caveat's organic wobble Interlude" sections from left like film holes unwinding. Interludes: 4-5 scenes Intersection Observer each `.scene` element */
  --black: #08051a;
  --cyan: #00f0ff;
  --magenta: #ff2d7b;
  --violet: #7b2fff;
  --white: #d4dae0;
  --steel: #6a7b8e;
  --smoke: #1a1428;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 70% 20%, rgba(123, 47, 255, 0.2), transparent 34vw),
    radial-gradient(circle at 12% 42%, rgba(0, 240, 255, 0.12), transparent 30vw),
    linear-gradient(180deg, #08051a 0%, #110b25 45%, #08051a 100%);
  font-family: "Inter", sans-serif;
}

.grain,
.projection-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grain {
  z-index: 9999;
  opacity: 0.04;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="120" height="120" filter="url(%23n)" opacity="0.75"/></svg>');
  animation: grain-shift 100ms steps(5) infinite;
}

.projection-vignette {
  z-index: 9998;
  box-shadow: inset 0 0 12vw 4vw #08051a;
  background: linear-gradient(90deg, rgba(0,240,255,0.05), transparent 18%, transparent 82%, rgba(255,45,123,0.04));
}

.reel-counter {
  position: fixed;
  top: 1.3rem;
  right: 1.5rem;
  z-index: 30;
  text-align: right;
  font-family: "Bebas Neue", sans-serif;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan), 0 0 24px rgba(0, 240, 255, 0.35);
  animation: flicker 2.7s infinite;
}

.counter-kicker {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--steel);
}

.counter-window {
  display: block;
  min-width: 9rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.25em;
  transition: transform 260ms ease, opacity 260ms ease;
}

.counter-window.roll { transform: translateY(-12px); opacity: 0; }

.newsreel { position: relative; }

.scene {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  filter: blur(8px);
  opacity: 0.4;
  transform: scale(0.97);
  transition: filter 600ms ease-out, opacity 600ms ease-out, transform 600ms ease-out;
  border-bottom: 1px solid rgba(106, 123, 142, 0.12);
}

.scene.is-focused { filter: blur(0); opacity: 1; transform: scale(1); }

.act-opener {
  display: grid;
  grid-template-columns: minmax(1.2rem, 7vw) 1fr minmax(18rem, 32vw) minmax(1.2rem, 7vw);
  grid-template-rows: minmax(6rem, 15vh) 1fr minmax(12rem, 28vh);
}

.act-opener::before {
  content: "";
  position: absolute;
  inset: 8vh 5vw;
  border: 1px solid rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 48px rgba(123, 47, 255, 0.14), inset 0 0 80px rgba(8, 5, 20, 0.7);
  z-index: -1;
}

.scene-meta {
  grid-column: 2 / 3;
  grid-row: 1;
  align-self: end;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--magenta);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.headline {
  grid-column: 2 / 4;
  grid-row: 1 / 3;
  align-self: start;
  max-width: 12ch;
  margin: clamp(3rem, 11vh, 7rem) 0 0;
  font-family: "Caveat", cursive;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--white);
  text-shadow: 0 0 8px #00f0ff, 0 0 24px rgba(0, 240, 255, 0.3);
}

.viz-stage {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  place-self: center;
  width: min(58vw, 760px);
  aspect-ratio: 1.55;
  opacity: 0.95;
}

.scene-copy {
  grid-column: 3;
  grid-row: 3;
  align-self: center;
  justify-self: end;
  width: min(32rem, 100%);
  padding: 1.2rem 1.35rem;
  background: rgba(8, 5, 20, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.12), inset 0 0 30px rgba(123, 47, 255, 0.12);
  backdrop-filter: blur(12px);
}

.scene-copy p { margin: 0 0 1rem; font-size: 1rem; line-height: 1.65; font-weight: 400; color: var(--white); }
.scene-copy a { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--cyan); text-decoration: none; text-transform: uppercase; letter-spacing: 0.18em; }

.z-trail {
  position: absolute;
  inset: 6vh 4vw;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.z-trail path {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 0.34;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  opacity: 0;
  filter: drop-shadow(0 0 12px #00f0ff) drop-shadow(0 0 18px rgba(0, 240, 255, 0.5));
}

.scene.trace .z-trail path { animation: draw-z 800ms ease-out forwards; }

.radar,
.sankey,
.constellation { width: 100%; height: 100%; overflow: visible; }
.radar-ring { fill: none; stroke: rgba(106, 123, 142, 0.36); stroke-width: 1; }
.radar-spokes line { stroke: rgba(123, 47, 255, 0.35); stroke-width: 1; }
.radar-fill { fill: rgba(0, 240, 255, 0.15); stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 14px rgba(0,240,255,0.7)); transition: all 600ms ease; }
.svg-label { font-family: "IBM Plex Mono", monospace; font-size: 13px; fill: var(--magenta); font-weight: 300; letter-spacing: 0.13em; text-anchor: middle; }

.flow { fill: none; stroke: url(#flowA); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 18 16; animation: flow 1.6s linear infinite; filter: drop-shadow(0 0 10px rgba(255,45,123,0.55)); }
.flow-wide { stroke-width: 8; }
.flow-hot { stroke-width: 3; }
.sprockets circle { fill: none; stroke: rgba(106, 123, 142, 0.45); stroke-width: 2; }

.data-theater { display: grid; place-items: center; }
.constellation { width: min(88vw, 1040px); animation: rotate-sky 120s linear infinite; }
.constellation-lines line { stroke: rgba(123, 47, 255, 0.4); stroke-width: 1.5; stroke-dasharray: 10 12; animation: flow 2.4s linear infinite; }
.node { fill: var(--cyan); filter: drop-shadow(0 0 18px #00f0ff); transform-origin: center; animation: pulse 3s ease-in-out infinite; }
.node.medium { fill: var(--violet); filter: drop-shadow(0 0 18px #7b2fff); animation-delay: 0.7s; }
.node.big { animation-delay: 1.2s; }
.node.hot { fill: var(--magenta); filter: drop-shadow(0 0 18px #ff2d7b); animation-delay: 1.8s; }
.labels text { font-family: "Caveat", cursive; font-size: 34px; fill: var(--white); text-shadow: 0 0 8px #00f0ff; animation: label-fade 5s ease-in-out infinite; }

.montage-strip {
  min-height: 24vh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 2rem 5vw;
  background: linear-gradient(90deg, rgba(8,5,20,0.92), rgba(26,20,40,0.72), rgba(8,5,20,0.92));
}

.montage-item {
  position: relative;
  padding: 1rem;
  min-height: 7rem;
  background: rgba(8, 5, 20, 0.85);
  border: 1px solid rgba(255, 45, 123, 0.4);
  box-shadow: 0 0 22px rgba(255, 45, 123, 0.12);
  backdrop-filter: blur(12px);
  animation-name: pulse-border, float;
  animation-duration: 3.6s, 11s;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
}
.montage-item:nth-of-type(1) { grid-column: 1 / 4; transform: translateY(-2.3rem); }
.montage-item:nth-of-type(2) { grid-column: 4 / 7; transform: translateY(0.6rem); }
.montage-item:nth-of-type(3) { grid-column: 7 / 10; transform: translateY(-1.1rem); }
.montage-item:nth-of-type(4) { grid-column: 10 / 13; transform: translateY(2rem); }
.montage-item span { display: block; margin-bottom: 0.6rem; font-family: "IBM Plex Mono", monospace; color: var(--magenta); font-size: 0.75rem; font-weight: 300; }
.montage-item strong { font-family: "Caveat", cursive; font-size: clamp(1.5rem, 2.4vw, 2.4rem); font-weight: 700; line-height: 0.96; color: var(--white); text-shadow: 0 0 8px #00f0ff, 0 0 24px rgba(0, 240, 255, 0.3); }

.neon-bars { display: flex; align-items: end; justify-content: center; gap: 1.5vw; height: 100%; padding: 4rem; border: 1px solid rgba(0,240,255,0.2); background: radial-gradient(circle, rgba(123,47,255,0.16), transparent 60%); }
.neon-bars i { width: clamp(12px, 3vw, 34px); height: var(--h, 50%); background: linear-gradient(180deg, var(--cyan), var(--violet), var(--magenta)); box-shadow: 0 0 22px rgba(0,240,255,0.55); animation: bar-rise 2.8s ease-in-out infinite; }
.neon-bars i:nth-child(1) { --h: 22%; animation-delay: .1s; } .neon-bars i:nth-child(2) { --h: 44%; animation-delay: .3s; } .neon-bars i:nth-child(3) { --h: 66%; animation-delay: .5s; } .neon-bars i:nth-child(4) { --h: 38%; animation-delay: .2s; } .neon-bars i:nth-child(5) { --h: 82%; animation-delay: .7s; } .neon-bars i:nth-child(6) { --h: 58%; animation-delay: .4s; } .neon-bars i:nth-child(7) { --h: 73%; animation-delay: .9s; } .neon-bars i:nth-child(8) { --h: 33%; animation-delay: .6s; } .neon-bars i:nth-child(9) { --h: 91%; animation-delay: 1s; }

.final-orbit { position: relative; display: grid; place-items: center; width: min(52vw, 560px); aspect-ratio: 1; border-radius: 50%; }
.final-orbit span { position: absolute; inset: calc(var(--i, 0) * 7%); border: 1px solid rgba(0,240,255,0.3); border-radius: 50%; box-shadow: 0 0 26px rgba(123,47,255,0.25); animation: orbit 9s linear infinite; }
.final-orbit span:nth-child(1) { --i: 0; } .final-orbit span:nth-child(2) { --i: 1; animation-duration: 13s; border-color: rgba(255,45,123,.35); } .final-orbit span:nth-child(3) { --i: 2; animation-duration: 17s; } .final-orbit span:nth-child(4) { --i: 3; animation-duration: 21s; border-color: rgba(123,47,255,.42); }
.final-orbit b { font-family: "Caveat", cursive; font-size: clamp(4rem, 12vw, 9rem); color: var(--white); text-shadow: 0 0 8px #00f0ff, 0 0 24px rgba(0, 240, 255, 0.3); }

.float-1 { animation: float 8s ease-in-out infinite; }
.float-2 { animation: float 11s ease-in-out 2s infinite; }
.float-3 { animation: float 14s ease-in-out 5s infinite; }

@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 33% { transform: translateY(-8px) rotate(0.5deg); } 66% { transform: translateY(4px) rotate(-0.3deg); } }
@keyframes draw-z { 0% { stroke-dashoffset: 320; opacity: 1; } 76% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0.82; } }
@keyframes grain-shift { 0% { background-position: 0 0; } 25% { background-position: 18px -12px; } 50% { background-position: -9px 24px; } 75% { background-position: 33px 9px; } 100% { background-position: -18px -20px; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 7% { opacity: .72; } 9% { opacity: 1; } 43% { opacity: .86; } 47% { opacity: 1; } 78% { opacity: .7; } 82% { opacity: 1; } }
@keyframes flow { to { stroke-dashoffset: -68; } }
@keyframes pulse { 0%, 100% { transform: scale(0.95); opacity: .82; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes rotate-sky { to { transform: rotate(360deg); } }
@keyframes label-fade { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
@keyframes pulse-border { 0%, 100% { border-color: rgba(255,45,123,.28); } 50% { border-color: rgba(0,240,255,.62); } }
@keyframes bar-rise { 0%, 100% { transform: scaleY(.66); opacity: .72; } 50% { transform: scaleY(1.08); opacity: 1; } }
@keyframes orbit { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .act-opener { grid-template-columns: 1rem 1fr 1rem; grid-template-rows: 7rem auto 1fr auto; padding-bottom: 4rem; }
  .headline { grid-column: 2; grid-row: 2; margin-top: 0; max-width: 10ch; }
  .scene-meta { grid-column: 2; }
  .viz-stage { grid-column: 2; grid-row: 3; width: 88vw; }
  .scene-copy { grid-column: 2; grid-row: 4; justify-self: stretch; }
  .montage-strip { grid-template-columns: 1fr; min-height: 100vh; align-content: center; }
  .montage-item:nth-of-type(n) { grid-column: 1; transform: none; }
  .reel-counter { right: 1rem; }
}
