:root {
  /* compliance vocabulary: (Google `font-variant-numeric: tabular-nums` prevent layout shift during counting. IntersectionObserver` trigger `requestAnimationFrame` loop increments displayed when modules viewport. `threshold: 0.15` */
  --deep-sky: #1a1440;
  --dusk-violet: #2d1b4e;
  --plum: #3a1d3f;
  --wine: #4a2040;
  --ember-brown: #5c3030;
  --amber-earth: #7a4020;
  --sunset-gold: #f5a623;
  --coral-bloom: #e8735a;
  --sky-lavender: #a78bdb;
  --warm-white: #f5efe6;
  --muted-peach: #c4a88a;
  --spring-mint: #7ecfa0;
  --soft-rose: #e87878;
  --ember-glow: #ff9f43;
  --trace-line: rgba(255, 190, 110, 0.15);
  --trace-border: rgba(255, 190, 110, 0.2);
  --surface: rgba(255, 248, 240, 0.06);
  --heading: "Libre Baskerville", Georgia, serif;
  --body: "Work Sans", Inter, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--warm-white);
  font-family: var(--body);
  background: linear-gradient(165deg, #1a1440 0%, #2d1b4e 35%, #3a1d3f 55%, #4a2040 70%, #5c3030 85%, #7a4020 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(8.333% - 1px), rgba(255, 190, 110, 0.08) 8.333%, transparent calc(8.333% + 1px)),
    linear-gradient(0deg, transparent calc(80px - 1px), rgba(255, 190, 110, 0.04) 80px, transparent calc(80px + 1px));
  background-size: 100% 100%, 100% 160px;
  opacity: 0.35;
}

#particle-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sky-gloss {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 166, 35, 0.2), transparent 24%),
    radial-gradient(circle at 78% 26%, rgba(167, 139, 219, 0.18), transparent 30%),
    radial-gradient(circle at 45% 90%, rgba(232, 115, 90, 0.2), transparent 34%);
  filter: blur(18px);
  animation: sky-breathe 18s ease-in-out infinite alternate;
}

main, .command-header { position: relative; z-index: 1; }

.command-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(245, 166, 35, 0.08);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border-bottom: 1px solid rgba(255, 190, 110, 0.18);
  box-shadow: 0 10px 40px rgba(26, 20, 64, 0.18);
}

.wordmark {
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.2rem;
  color: var(--warm-white);
  text-shadow: 0 0 16px rgba(255, 159, 67, 0.45);
}

.header-telemetry {
  display: flex;
  gap: clamp(12px, 2vw, 28px);
  align-items: center;
  color: var(--muted-peach);
  font-family: var(--mono);
  font-size: clamp(0.62rem, 1vw, 0.82rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

main { padding-top: 64px; }

.section-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.module {
  position: relative;
  overflow: hidden;
  background: rgba(255, 248, 240, 0.06);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 190, 110, 0.15);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.module::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 190, 110, 0.08);
  border-radius: 8px;
  pointer-events: none;
}

.module::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  right: -90px;
  top: -90px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.16), transparent 65%);
  pointer-events: none;
}

.module:hover {
  border-color: rgba(255, 190, 110, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(245, 166, 35, 0.08), 0 8px 34px rgba(0, 0, 0, 0.25);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease-out, transform 600ms ease-out, border-color 0.4s ease, box-shadow 0.4s ease;
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

h1, h2 {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--warm-white);
}

h1 { font-size: clamp(2.3rem, 5.4vw, 5rem); max-width: 9em; }
h2 { font-size: clamp(1.8rem, 4vw, 3.5rem); max-width: 10em; }
p {
  max-width: 38em;
  color: var(--muted-peach);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.module-kicker, .data-label {
  font-family: var(--mono);
  color: var(--sunset-gold);
  font-size: clamp(0.68rem, 1vw, 0.82rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.hero-array {
  min-height: calc(100vh - 64px);
  padding: 36px 0 56px;
  grid-template-rows: repeat(8, minmax(54px, 1fr));
}

.hero-core {
  grid-column: 4 / span 6;
  grid-row: 1 / span 8;
  padding: clamp(28px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.line-card { grid-column: 1 / span 3; grid-row: 1 / span 4; }
.gauge-card { grid-column: 10 / span 3; grid-row: 1 / span 4; }
.scatter-card { grid-column: 1 / span 3; grid-row: 5 / span 4; }
.bars-card { grid-column: 10 / span 3; grid-row: 5 / span 4; }

.viz-module, .wide-viz, .portrait-viz, .compact-viz, .twin-viz {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.hero-metrics div, .data-value, .gauge-number {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--warm-white);
}

.counter { color: var(--warm-white); text-shadow: 0 0 12px rgba(255, 159, 67, 0.38); }
.hero-metrics .counter { font-size: clamp(1.4rem, 3vw, 2.5rem); }
.hero-metrics small, .data-value small { display: block; color: var(--muted-peach); margin-top: 3px; }

.data-value { font-size: 1.35rem; }
.gauge-number {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -22%);
  font-size: 1.55rem;
}

svg { width: 100%; height: auto; overflow: visible; }
.circuit { margin-top: 18px; }
.draw-svg path:not(.gridline), .closing-orbit path {
  stroke: #ff9f43;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(255, 159, 67, 0.4));
  stroke-dasharray: var(--dash, 800);
  stroke-dashoffset: var(--dash, 800);
}

.is-visible .draw-svg path:not(.gridline), .is-visible .closing-orbit path { animation: draw-trace 1.5s ease-out 200ms forwards; }
.accent-path { stroke: url(#traceGrad) !important; stroke-width: 2 !important; }
.nodes circle, .scatter-dots circle {
  fill: #f5a623;
  filter: drop-shadow(0 0 7px rgba(255, 159, 67, 0.7));
  transform-origin: center;
  animation: node-pulse 3s ease-in-out infinite;
}
.nodes circle:nth-child(2n), .scatter-dots circle:nth-child(2n) { fill: #e8735a; animation-delay: 0.6s; }
.nodes circle:nth-child(3n), .scatter-dots circle:nth-child(3n) { fill: #7ecfa0; animation-delay: 1.1s; }
.node-ring { fill: rgba(255, 248, 240, 0.04); stroke: rgba(255, 190, 110, 0.32); stroke-width: 1.5; }

.gridline { stroke: rgba(255, 190, 110, 0.14); stroke-width: 1; }
.chart-line {
  stroke: url(#traceGrad);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(245, 166, 35, 0.45));
}
.rose-line { stroke: #e87878; }
.mint-line { stroke: #7ecfa0; }

.radial-gauge { max-height: 190px; }
.gauge-track { fill: none; stroke: rgba(255, 190, 110, 0.14); stroke-width: 12; }
.gauge-fill {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 90px 90px;
  stroke-dasharray: 390;
  stroke-dashoffset: 390;
  transition: stroke-dashoffset 2.3s cubic-bezier(.19,1,.22,1) 400ms;
  filter: drop-shadow(0 0 6px rgba(255, 159, 67, 0.5));
}
.gauge-gold { stroke: #f5a623; }
.gauge-coral { stroke: #e8735a; }

.scatter-dots circle { opacity: 0; }
.is-visible .scatter-dots circle { animation: dot-in 900ms ease-out forwards, node-pulse 3s ease-in-out infinite; }
.scatter-dots circle:nth-child(1) { animation-delay: 100ms; }.scatter-dots circle:nth-child(2) { animation-delay: 220ms; }.scatter-dots circle:nth-child(3) { animation-delay: 340ms; }.scatter-dots circle:nth-child(4) { animation-delay: 460ms; }.scatter-dots circle:nth-child(5) { animation-delay: 580ms; }.scatter-dots circle:nth-child(6) { animation-delay: 700ms; }.scatter-dots circle:nth-child(7) { animation-delay: 820ms; }.scatter-dots circle:nth-child(8) { animation-delay: 940ms; }.scatter-dots circle:nth-child(9) { animation-delay: 1060ms; }

.bar-stack, .band-list { display: grid; gap: 12px; margin: 24px 0; }
.bar-stack span, .band-list i {
  display: block;
  height: 12px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5a623, #e8735a);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.28);
  transition: width 1.5s ease-out 350ms;
}
.band-list i:nth-child(2n) { background: linear-gradient(135deg, #7ecfa0, #a78bdb); }
.is-visible .bar-stack span, .is-visible .band-list i { width: var(--w); }

.narrative { min-height: 80vh; padding: 80px 0; align-items: center; }
.narrative-one .text-module { grid-column: 1 / span 5; }
.narrative-one .wide-viz { grid-column: 6 / span 7; min-height: 390px; }
.text-module { padding: clamp(28px, 4vw, 48px); min-height: 360px; display: flex; flex-direction: column; justify-content: center; }

.narrative-two .portrait-viz { grid-column: 1 / span 3; min-height: 500px; }
.narrative-two .text-module { grid-column: 4 / span 5; }
.narrative-two .compact-viz { grid-column: 9 / span 4; min-height: 280px; align-self: end; }
.petals path { fill: rgba(245, 166, 35, 0.10); stroke: #ff9f43; stroke-width: 1.4; filter: drop-shadow(0 0 5px rgba(255,159,67,.35)); transform-origin: 120px 150px; animation: petal-breathe 5s ease-in-out infinite; }
.petals path:nth-child(2) { fill: rgba(232, 115, 90, 0.11); animation-delay: .4s; }
.petals path:nth-child(3) { fill: rgba(126, 207, 160, 0.10); animation-delay: .8s; }
.petals path:nth-child(4) { fill: rgba(167, 139, 219, 0.11); animation-delay: 1.2s; }

.narrative-three .text-module { grid-column: 2 / span 5; }
.narrative-three .twin-viz { grid-column: 7 / span 5; min-height: 350px; }

.terminal-section {
  width: min(1180px, calc(100% - 32px));
  min-height: 40vh;
  margin: 0 auto;
  padding: 70px 0;
}
.terminal-module { min-height: 330px; padding: 24px; }
.terminal-head {
  display: flex;
  justify-content: space-between;
  color: var(--sunset-gold);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.terminal-stream {
  height: 245px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}
.terminal-row {
  display: grid;
  grid-template-columns: 90px 92px 1fr 88px;
  gap: 14px;
  color: var(--warm-white);
  opacity: 0;
  transform: translateY(12px);
  animation: row-rise 700ms ease-out forwards;
}
.terminal-row.positive { color: #7ecfa0; }
.terminal-row.alert { color: #e87878; }

.closing-section {
  min-height: 50vh;
  display: grid;
  place-items: center;
  padding: 70px 16px 100px;
}
.closing-module {
  width: min(720px, 100%);
  min-height: 420px;
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.closing-module p { margin-left: auto; margin-right: auto; }
.closing-orbit { width: 230px; margin-bottom: 12px; animation: orbit 120s linear infinite; }

@keyframes sky-breathe { to { transform: translate3d(2%, -1%, 0) scale(1.04); } }
@keyframes draw-trace { to { stroke-dashoffset: 0; } }
@keyframes node-pulse { 0%,100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes dot-in { from { opacity: 0; transform: scale(.4); } to { opacity: .95; transform: scale(1); } }
@keyframes petal-breathe { 0%,100% { transform: scale(.98); opacity: .75; } 50% { transform: scale(1.03); opacity: 1; } }
@keyframes row-rise { to { opacity: .95; transform: translateY(0); } }
@keyframes orbit { to { transform: rotate(360deg); } }

@media (max-width: 1024px) {
  .section-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .hero-array { grid-template-rows: auto; }
  .hero-core { grid-column: 2 / span 6; grid-row: auto; min-height: 620px; }
  .line-card, .scatter-card { grid-column: 1 / span 4; grid-row: auto; }
  .gauge-card, .bars-card { grid-column: 5 / span 4; grid-row: auto; }
  .narrative-one .text-module, .narrative-two .text-module, .narrative-three .text-module { grid-column: 1 / span 4; }
  .narrative-one .wide-viz, .narrative-three .twin-viz { grid-column: 5 / span 4; }
  .narrative-two .portrait-viz { grid-column: 1 / span 4; }
  .narrative-two .compact-viz { grid-column: 5 / span 4; }
}

@media (max-width: 767px) {
  .command-header { padding: 0 16px; }
  .header-telemetry span:first-child { display: none; }
  .section-grid { grid-template-columns: 1fr; width: min(100% - 24px, 520px); }
  .hero-array { padding-top: 24px; min-height: auto; }
  .hero-core, .line-card, .gauge-card, .scatter-card, .bars-card,
  .narrative-one .text-module, .narrative-one .wide-viz,
  .narrative-two .portrait-viz, .narrative-two .text-module, .narrative-two .compact-viz,
  .narrative-three .text-module, .narrative-three .twin-viz { grid-column: 1; grid-row: auto; }
  .hero-core { min-height: 620px; }
  .hero-array .scatter-card, .hero-array .bars-card { display: none; }
  .narrative { padding: 42px 0; min-height: auto; }
  .terminal-row { grid-template-columns: 72px 70px 1fr; }
  .terminal-row span:last-child { display: none; }
}
