:root {
  /* Compliance note: IBM Plex Mono's warmth prevents the coldness that pure technical type can create. Space Grotesk (Google Fonts) and IBM Plex Mono (Google Fonts). Interactions:** use IntersectionObserver` with threshold arrays `[0, 0.25, 0.5, 0.75, 1] for focus tuning. */
  --deep-void: #0f0a1e;
  --warm-signal: #ff6b9d;
  --cool-wash: #e0d7ff;
  --data-teal: #00e5c7;
  --sunset-start: #ff9a76;
  --sunset-end: #8b5cf6;
  --substrate: #1a1128;
  --whisper: #6b5b7b;
  --glow: rgba(255, 107, 157, 0.34);
  --focus: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cool-wash);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 154, 118, 0.18), transparent 34vw),
    radial-gradient(circle at 82% 20%, rgba(139, 92, 246, 0.24), transparent 38vw),
    linear-gradient(135deg, var(--deep-void) 0%, #120a22 48%, #080512 100%);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0px, transparent 1px, transparent 2px);
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 19;
  opacity: 0.03;
  filter: url(#noise);
  background: #fff;
}

.filters { position: absolute; }

.crt-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: calc(0.18 - (var(--focus) * 0.13));
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(224,215,255,0.16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,229,199,0.06) 0 1px, transparent 1px 9px);
  animation: staticShift 0.7s steps(2, end) infinite;
}

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  min-height: 100vh;
  padding-bottom: 60px;
}

.primary-zone {
  display: block;
  background-image:
    linear-gradient(var(--warm-signal) 2px, transparent 2px),
    linear-gradient(90deg, var(--warm-signal) 2px, transparent 2px);
  background-size: calc(100% / 12) 100%, calc(100% / 12) 100%;
  background-position: 0 0;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  padding: clamp(5rem, 9vw, 8rem) clamp(1rem, 3vw, 3rem);
  overflow: hidden;
  transform: scale(0.92);
  filter: blur(2px);
  opacity: 0.76;
  transition: transform 700ms ease, filter 700ms ease, opacity 700ms ease;
}

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

.grid-cell {
  position: relative;
  z-index: 2;
  background: rgba(26, 17, 40, 0.78);
  border: 1px solid rgba(255, 107, 157, 0.72);
  box-shadow: 0 0 28px rgba(255, 107, 157, 0.08), inset 0 0 24px rgba(15, 10, 30, 0.72);
  padding: clamp(1rem, 2.4vw, 2rem);
  backdrop-filter: blur(6px);
}

.eyebrow, .section-label, .label, .bottom-nav a, .kicker, .panel-head, .scope-readout {
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.7rem;
  line-height: 1.3;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0 0 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.95;
}

h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 2rem); }
p { margin: 0; }

.kicker { color: var(--data-teal); margin-bottom: 1rem; }

.hero-copy { grid-column: 1 / span 8; align-self: center; }
.eyebrow { grid-column: 1 / span 5; color: var(--sunset-start); }
.terminal-card { grid-column: 9 / span 4; align-self: end; color: var(--data-teal); }
.terminal-title { color: var(--warm-signal); font-family: "Chakra Petch", sans-serif; letter-spacing: 0.2em; margin-bottom: 0.75rem; }
.section-label { grid-column: 1 / span 3; color: var(--sunset-start); align-self: start; }
.wide-copy { grid-column: 4 / span 6; }
.waveform-console { grid-column: 3 / span 9; min-height: 280px; }
.heat-copy { grid-column: 4 / span 6; }
.heat-panel { grid-column: 1 / span 7; }
.gauge-panel { grid-column: 8 / span 4; display: grid; place-items: center; text-align: center; }
.log-entry { grid-column: 2 / span 7; }
.log-entry.alt { grid-column: 5 / span 7; }
.log-entry.quote { grid-column: 3 / span 8; font-family: "Lora", serif; font-style: italic; color: #fff; }
.log-entry span { display: block; color: var(--whisper); margin-bottom: 0.5rem; font-family: "Chakra Petch", sans-serif; letter-spacing: 0.2em; }
.final-copy { grid-column: 2 / span 7; align-self: center; }
.fidelity-card { grid-column: 8 / span 4; align-self: center; }
.fidelity-card strong, .fidelity-card span { display: block; }
.fidelity-card strong { color: var(--data-teal); margin: 1rem 0 0.4rem; }
.fidelity-card span { color: var(--cool-wash); }

.frequency-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--sunset-start), var(--warm-signal), var(--sunset-end));
  box-shadow: 0 0 18px var(--glow);
}
.frequency-bar.pulse { animation: pulse 4s ease-in-out infinite; }

.wave {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 8%;
  width: 124%;
  height: 34%;
  z-index: 1;
  opacity: 0.72;
  animation: drift 10s linear infinite;
}
.wave path, .scope-line, .mini-wave-card path {
  fill: none;
  stroke: var(--data-teal);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.wave-a path:nth-child(2) { stroke: var(--warm-signal); stroke-width: 1; opacity: 0.6; }
.wave-final { animation-duration: 6s; opacity: 1; }
.wave-final path { stroke: url(#unused); stroke: var(--data-teal); }

.waveform-console svg { width: 100%; height: 220px; display: block; }
.line-one { animation: drift 6s linear infinite; }
.line-two { stroke: var(--warm-signal); stroke-width: 2; animation: driftReverse 10s linear infinite; opacity: 0.78; }
.line-three { stroke: var(--sunset-start); stroke-width: 1; animation: drift 14s linear infinite; opacity: 0.55; }
.scope-readout { color: var(--data-teal); margin-top: 1rem; }

.panel-head { display: flex; justify-content: space-between; color: var(--warm-signal); margin-bottom: 1rem; }
.heat-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.heat-grid i {
  aspect-ratio: 1;
  display: block;
  background: var(--data-teal);
  opacity: var(--cell, 0.35);
  box-shadow: 0 0 14px rgba(0, 229, 199, 0.35);
  transform: scale(calc(0.78 + var(--cell, 0.35) * 0.22));
  transition: opacity 600ms ease, transform 600ms ease;
}

.gauge { position: relative; width: min(220px, 72vw); aspect-ratio: 1; display: grid; place-items: center; }
.gauge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from -120deg, var(--sunset-start), var(--warm-signal), var(--sunset-end) 78%, rgba(107,91,123,0.25) 78%);
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.28);
}
.gauge-ring::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--substrate); border: 1px solid var(--warm-signal); }
.gauge-value { position: relative; z-index: 1; font-family: "Space Grotesk", sans-serif; font-size: 2rem; color: var(--cool-wash); }

.fidelity-lines { display: flex; align-items: end; gap: 6px; height: 130px; }
.fidelity-lines i, .mini-bars i { display: block; width: 100%; background: linear-gradient(180deg, var(--data-teal), var(--sunset-end)); animation: bars 2.4s ease-in-out infinite; }
.fidelity-lines i:nth-child(1) { height: 32%; }
.fidelity-lines i:nth-child(2) { height: 68%; animation-delay: -0.2s; }
.fidelity-lines i:nth-child(3) { height: 48%; animation-delay: -0.4s; }
.fidelity-lines i:nth-child(4) { height: 92%; animation-delay: -0.6s; }
.fidelity-lines i:nth-child(5) { height: 72%; animation-delay: -0.8s; }
.fidelity-lines i:nth-child(6) { height: 55%; animation-delay: -1s; }
.fidelity-lines i:nth-child(7) { height: 84%; animation-delay: -1.2s; }
.fidelity-lines i:nth-child(8) { height: 40%; animation-delay: -1.4s; }

.status-column {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1rem 5rem;
  display: grid;
  align-content: center;
  gap: 1rem;
  background: rgba(15, 10, 30, 0.78);
  border-left: 1px solid var(--warm-signal);
}

.status-card {
  width: min(100%, 180px);
  min-height: 120px;
  margin-inline: auto;
  padding: 1rem;
  background: var(--substrate);
  border: 1px solid var(--warm-signal);
  box-shadow: 0 0 22px rgba(255, 107, 157, 0.12);
}
.status-card strong { display: block; font-family: "Space Grotesk", sans-serif; font-size: 2rem; color: var(--data-teal); }
.status-card small { color: var(--whisper); }
.label { display: block; color: var(--sunset-start); margin-bottom: 0.75rem; }
.mini-wave-card svg { width: 100%; height: 70px; animation: drift 8s linear infinite; }
.blink-row { display: flex; align-items: center; gap: 1rem; color: var(--data-teal); }
.blink-row i { width: 24px; height: 24px; border-radius: 50%; background: var(--data-teal); box-shadow: 0 0 18px var(--data-teal); animation: blink 3s ease-in-out infinite; }
.mini-bars { height: 58px; display: flex; align-items: end; gap: 5px; }
.mini-bars i { height: 28%; animation-duration: 1.8s; }
.mini-bars i:nth-child(2n) { height: 72%; animation-delay: -0.45s; }
.mini-bars i:nth-child(3n) { height: 48%; animation-delay: -0.9s; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 3vw, 2rem);
  background: rgba(15, 10, 30, 0.92);
  border-top: 1px solid var(--warm-signal);
  box-shadow: 0 -8px 30px rgba(15, 10, 30, 0.8);
}
.bottom-nav a { color: var(--cool-wash); text-decoration: none; padding: 0.55rem 0.7rem; transition: color 250ms ease, box-shadow 250ms ease; }
.bottom-nav a.active { color: #fff; box-shadow: 0 0 18px var(--warm-signal), inset 0 0 14px rgba(255, 107, 157, 0.18); }

.mobile-ticker { display: none; }

@keyframes staticShift { 0% { transform: translate(0, 0); } 50% { transform: translate(1.5%, -1%); } 100% { transform: translate(-1%, 1%); } }
@keyframes pulse { 0%, 100% { opacity: 0.58; filter: saturate(0.8); } 50% { opacity: 1; filter: saturate(1.45); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(8%); } }
@keyframes driftReverse { from { transform: translateX(8%); } to { transform: translateX(0); } }
@keyframes blink { 0%, 54%, 100% { opacity: 1; transform: scale(1); } 72% { opacity: 0.25; transform: scale(0.76); } }
@keyframes bars { 0%, 100% { transform: scaleY(0.55); opacity: 0.58; } 50% { transform: scaleY(1); opacity: 1; } }

@media (max-width: 768px) {
  .mobile-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 31;
    display: flex;
    gap: 1.5rem;
    height: 32px;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    background: rgba(15, 10, 30, 0.94);
    border-bottom: 1px solid var(--warm-signal);
    font-family: "Chakra Petch", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--data-teal);
  }
  .mobile-ticker span { animation: ticker 14s linear infinite; }
  .shell { grid-template-columns: 1fr; padding-top: 32px; }
  .status-column { display: none; }
  .scene { grid-template-columns: 1fr; min-height: auto; padding: 5rem 1rem; }
  .grid-cell, .hero-copy, .eyebrow, .terminal-card, .section-label, .wide-copy, .waveform-console, .heat-copy, .heat-panel, .gauge-panel, .log-entry, .log-entry.alt, .log-entry.quote, .final-copy, .fidelity-card { grid-column: 1; }
  .bottom-nav { justify-content: flex-start; overflow-x: auto; padding-inline: 0.5rem; }
  .bottom-nav a { flex: 0 0 auto; }
  @keyframes ticker { from { transform: translateX(100vw); } to { transform: translateX(-120vw); } }
}
