:root {
  --bg: #0b0b0f;
  --bg-elev: #101219;
  --surface: #12141d;
  --hairline: rgba(255, 255, 255, 0.085);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --fg: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-fg: #05080f;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #fb7185;

  color-scheme: dark;
  accent-color: var(--accent);
}

/* Fail-open guard before custom element upgrade */
jolt-hud:not(:defined) {
  opacity: 0;
  animation: defined-fallback 0.2s 2s forwards;
}

@keyframes defined-fallback {
  to {
    opacity: 1;
  }
}

@keyframes electric-sweep {
  0% {
    transform: translateX(-35%);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(135%);
    opacity: 0;
  }
}

@keyframes chip-hover {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes flow-dash {
  to {
    stroke-dashoffset: -28;
  }
}

@keyframes plate-pulse {
  0%, 100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes reticle-breathe {
  0%, 100% {
    opacity: 0.52;
  }
  50% {
    opacity: 1;
  }
}

html {
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

code, pre, kbd, .mono-pill, .mono-val, .cell-kicker, .node-pill, .nav-version, .eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.78em;
  border-radius: 4px;
  border: 1px solid var(--hairline-strong);
  background: #161925;
  color: var(--fg);
}

/* Sticky Top Nav */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 15, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.03em;
}

.nav-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #090a0f;
  border: 1px solid rgba(16, 185, 129, 0.38);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.18);
}

.nav-bolt-svg {
  width: 14px;
  height: 14px;
  fill: var(--ok);
}

.nav-version {
  font-size: 10.5px;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--fg);
}

@media (max-width: 780px) {
  .nav-links a {
    display: none;
  }
}

.nav-cta {
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border-radius: 5px;
  padding: 6px 13px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-cta:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Architectural Outer Frame */
.frame-shell {
  max-width: 1240px;
  margin: 0 auto 108px;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}

@media (max-width: 1240px) {
  .frame-shell {
    border-left: 0;
    border-right: 0;
  }
}

/* Split Hero with Electric Hairline Rail */
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.electric-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.electric-rail::before {
  content: "";
  display: block;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.85), rgba(56, 189, 248, 0.9), transparent);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
  animation: electric-sweep 7.5s linear infinite;
}

.rail-delay-1::before {
  animation-delay: -2.4s;
}

.rail-delay-2::before {
  animation-delay: -4.9s;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-copy {
  padding: 68px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  border-right: 1px solid var(--hairline);
}

@media (max-width: 920px) {
  .hero-copy {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    padding: 44px 24px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.15rem, 3.8vw, 3.15rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

.icon-bridge {
  display: inline-block;
  width: 0.72em;
  height: 0.56em;
  vertical-align: 0.04em;
  margin: 0 0.08em;
  color: var(--ok);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.35));
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 54ch;
}

.hero-sub code {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 1px 5px;
  border-radius: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  background: #f8fafc;
  color: #090a0f;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.14);
  transition: background 0.15s ease, box-shadow 0.2s ease;
}

.icon-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.btn-hero-primary:hover .icon-arrow {
  transform: translateY(2px);
}

.btn-hero-primary:hover {
  background: #ffffff;
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.28);
}

.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.83rem;
}

.install-box {
  margin-top: 4px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #08090d;
  overflow: hidden;
  max-width: 500px;
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.14);
}

.install-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--hairline);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}

.install-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.install-tab:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.install-tab.is-active {
  color: var(--ok);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.install-copy-btn {
  margin-left: auto;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font: inherit;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.install-copy-btn:hover {
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--ok);
}

.install-code {
  margin: 0;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
  overflow-x: auto;
}

.hero-diagram {
  position: relative;
  display: grid;
  place-items: center;
  padding: 38px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.07), transparent 66%);
  overflow: hidden;
}

.diagram-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.16), rgba(56, 189, 248, 0.1) 50%, transparent 72%);
  filter: blur(40px);
  pointer-events: none;
}

.iso-svg {
  width: min(460px, 100%);
  height: auto;
}

.chip-float {
  animation: chip-hover 5.5s ease-in-out infinite;
}

.flow-line {
  stroke-dasharray: 8 6;
  animation: flow-dash 1.8s linear infinite;
}

.stack-plate {
  animation: plate-pulse 4s ease-in-out infinite;
}

.stack-plate.p2 { animation-delay: 0.5s; }
.stack-plate.p3 { animation-delay: 1.0s; }
.stack-plate.p4 { animation-delay: 1.5s; }
.stack-plate.p5 { animation-delay: 2.0s; }

.reticle-pulse {
  animation: reticle-breathe 3.2s ease-in-out infinite;
}

/* Airy Hairline-Divided 12-Column Architectural Grid */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.arch-cell {
  padding: 44px 42px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.cell-half {
  grid-column: span 6;
}

.cell-half:first-child {
  border-right: 1px solid var(--hairline);
}

.cell-full {
  grid-column: span 12;
}

.cell-finale {
  border-bottom: 0;
  background: radial-gradient(70% 55% at 50% 100%, rgba(16, 185, 129, 0.05), transparent 75%);
}

@media (max-width: 960px) {
  .cell-half,
  .cell-full {
    grid-column: span 12;
    border-right: 0 !important;
    padding: 32px 24px;
  }
}

.cell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.cell-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--ok);
  margin-bottom: 6px;
}

.cell-head h2 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.cell-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 64ch;
}

.cell-desc code {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 1px 5px;
  border-radius: 4px;
}

.cell-visual {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05), #07080d 72%);
  padding: 12px 14px;
  display: grid;
  place-items: center;
}

.mini-iso-svg {
  width: 100%;
  height: auto;
  display: block;
}

.mono-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.mono-pill[data-state="mock"] {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

/* Full-Width Section 03: Chaos E-Commerce Split */
.full-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

@media (max-width: 960px) {
  .full-split {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.full-story {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ecom-card {
  background: #0e1017;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ecom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.ecom-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ecom-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: grid;
  place-items: center;
  color: var(--ok);
  font-size: 16px;
  flex-shrink: 0;
}

.ecom-product strong {
  display: block;
  font-size: 0.94rem;
}

.ecom-product span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.order-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: #090a0f;
}

.plan-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.plan-btn {
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
  background: #12141d;
  color: var(--fg);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.plan-btn.is-active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
  font-weight: 600;
}

.plan-btn[data-plan="blue"].is-active {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.24);
  color: #dbeafe;
}

.ecom-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

.qty-row,
.ecom-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

.ecom-total-row span {
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-step {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid var(--hairline-strong);
  background: #12141d;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.price-tag {
  font-size: 1.12rem;
  color: var(--ok);
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Finale WebGL2 Showcase */
.finale-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .finale-layout {
    grid-template-columns: 1fr;
  }
}

.webgl-stage {
  position: relative;
  height: 300px;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong);
  background: radial-gradient(circle at 50% 45%, rgba(16, 185, 129, 0.09), #07080d 72%);
  overflow: hidden;
}

.webgl-stage-finale {
  height: 380px;
}

#jolt-webgl-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.finale-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.scene-nodes-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-pill {
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-pill[data-color="cyan"] {
  border-color: rgba(56, 189, 248, 0.32);
  color: #7dd3fc;
}

.node-pill[data-color="emerald"] {
  border-color: rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
}

.node-pill[data-color="amber"] {
  border-color: rgba(245, 158, 11, 0.32);
  color: #fcd34d;
}

.node-pill[data-color="violet"] {
  border-color: rgba(167, 139, 250, 0.38);
  color: #c4b5fd;
}

.node-pill[data-color="rose"] {
  border-color: rgba(251, 113, 133, 0.38);
  color: #fda4af;
}

.controls-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.field-inline,
.toggle-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.83rem;
  color: var(--muted);
}

.field-inline input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  max-width: 150px;
  height: 20px;
  background: transparent;
  cursor: pointer;
}

.field-inline input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.field-inline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid #090a0f;
  margin-top: -5px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  transition: transform 0.14s ease;
}

.field-inline input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.field-inline select {
  -webkit-appearance: none;
  appearance: none;
  background-color: #090a0f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--fg);
  border: 1px solid var(--hairline-strong);
  border-radius: 5px;
  padding: 5px 30px 5px 11px;
  font: inherit;
  font-size: 0.81rem;
  cursor: pointer;
}

.field-inline select:focus-visible {
  outline: 1.5px solid var(--ok);
  outline-offset: 1px;
}

.toggle-inline {
  cursor: pointer;
}

.toggle-inline input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle-inline input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #94a3b8;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
}

.toggle-inline input[type="checkbox"]:checked {
  background: rgba(16, 185, 129, 0.24);
  border-color: var(--ok);
}

.toggle-inline input[type="checkbox"]:checked::after {
  transform: translateX(15px);
  background: var(--ok);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 5px;
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: filter 0.15s ease, transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-bolt-svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.42);
}

.btn-success {
  background: linear-gradient(180deg, #10b981, #059669);
  color: #022c22;
  border-color: rgba(110, 231, 183, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
}

.btn-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.4);
}

.status-log {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 11px 13px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: #08090d;
  color: var(--muted);
  min-height: 46px;
}

.status-log[data-state="ok"] {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.status-log[data-state="warn"] {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.status-log[data-state="error"] {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fda4af;
}

/* Reactive SVG state styling for Section 03 Chaos Diagram */
#chaos-diagram[data-mode="mock-armed"] .chaos-flow-1,
#chaos-diagram[data-mode="mock-armed"] .chaos-flow-2 {
  stroke: #f59e0b;
}

#chaos-diagram[data-mode="mock-armed"] .chaos-dot-1,
#chaos-diagram[data-mode="mock-armed"] .chaos-dot-2 {
  fill: #fbbf24;
}

#chaos-diagram[data-mode="mock-armed"] #chaos-mid-side {
  fill: url(#chaos-slab-warn);
}

#chaos-diagram[data-mode="mock-armed"] #chaos-mid-top,
#chaos-diagram[data-mode="mock-armed"] #chaos-end-plate {
  stroke: #f59e0b;
}

#chaos-diagram[data-mode="mock-armed"] #chaos-mid-label,
#chaos-diagram[data-mode="mock-armed"] #chaos-end-label {
  fill: #fcd34d;
}

#chaos-diagram[data-mode="fault-500"] .chaos-flow-1 {
  stroke: #f59e0b;
}

#chaos-diagram[data-mode="fault-500"] .chaos-dot-1 {
  fill: #fbbf24;
}

#chaos-diagram[data-mode="fault-500"] .chaos-flow-2 {
  stroke: #fb7185;
}

#chaos-diagram[data-mode="fault-500"] .chaos-dot-2 {
  fill: #fda4af;
}

#chaos-diagram[data-mode="fault-500"] #chaos-mid-side {
  fill: url(#chaos-slab-warn);
}

#chaos-diagram[data-mode="fault-500"] #chaos-mid-top {
  stroke: #f59e0b;
}

#chaos-diagram[data-mode="fault-500"] #chaos-mid-label {
  fill: #fcd34d;
}

#chaos-diagram[data-mode="fault-500"] #chaos-end-plate {
  fill: #171019;
  stroke: rgba(251, 113, 133, 0.55);
}

#chaos-diagram[data-mode="fault-500"] #chaos-end-label {
  fill: #fda4af;
}

#chaos-diagram[data-mode="crash-js"] .chaos-flow-1,
#chaos-diagram[data-mode="crash-js"] .chaos-flow-2 {
  stroke: #fb7185;
}

#chaos-diagram[data-mode="crash-js"] .chaos-dot-1,
#chaos-diagram[data-mode="crash-js"] .chaos-dot-2 {
  fill: #fda4af;
}

#chaos-diagram[data-mode="crash-js"] #chaos-mid-side {
  fill: url(#chaos-slab-err);
}

#chaos-diagram[data-mode="crash-js"] #chaos-mid-top,
#chaos-diagram[data-mode="crash-js"] #chaos-end-plate {
  fill: #171019;
  stroke: rgba(251, 113, 133, 0.65);
}

#chaos-diagram[data-mode="crash-js"] #chaos-mid-label,
#chaos-diagram[data-mode="crash-js"] #chaos-end-label {
  fill: #fda4af;
}

.layout-demo-parent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 6px;
  border: 1px dashed var(--hairline-strong);
  background: var(--surface);
}

.layout-demo-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.layout-demo-info span {
  font-size: 0.82rem;
  color: var(--muted);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.digest-panel {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #08090d;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 200px;
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.12);
}

.digest-panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}

.digest-tab.is-active {
  color: var(--ok);
}

.digest-hint {
  font-size: 10.5px;
  color: #64748b;
}

.digest-box {
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.55;
  flex: 1;
  min-height: 150px;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Unified Jolt Syntax Highlighting Theme */
.tok-kw {
  color: #c084fc;
}

.tok-fn {
  color: #38bdf8;
}

.tok-str {
  color: #6ee7b7;
}

.tok-key {
  color: #7dd3fc;
}

.tok-num {
  color: #fbbf24;
}

.tok-bool {
  color: #c084fc;
}

.tok-null {
  color: #fb7185;
}

.tok-punc {
  color: #64748b;
}

/* Editorial Chapter Interlude Bands */
.chapter-band {
  position: relative;
  padding: 76px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--hairline);
  background: radial-gradient(60% 70% at 50% 50%, rgba(16, 185, 129, 0.045), transparent 72%);
}

.chapter-band h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.chapter-band p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
  max-width: 58ch;
}

.chapter-band code {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 1px 5px;
  border-radius: 4px;
}

.agnostic-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.agnostic-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid var(--hairline-strong);
  background: #0e1017;
  color: var(--muted);
}

.agnostic-pill strong {
  color: var(--ok);
}

/* Before / After Comparison & Adapters Showcase */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 680px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.compare-card {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #08090d;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-card.is-after {
  border-color: rgba(16, 185, 129, 0.35);
  background: radial-gradient(120% 90% at 100% 0%, rgba(16, 185, 129, 0.08), #08090d 65%);
}

.compare-tag {
  align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--hairline-strong);
  color: var(--muted);
}

.compare-card.is-after .compare-tag {
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.compare-card ul {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--muted);
}

.compare-card.is-after ul {
  color: #cbd5e1;
}

.compare-card code {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

.adapter-box {
  max-width: 100%;
  margin-top: 0;
}

/* Final CTA Band */
.cta-band {
  padding: 68px 32px;
}

.cta-command-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.cta-cli {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  padding: 9px 14px;
  border-radius: 5px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: #08090d;
  color: #6ee7b7;
}

/* Static Hosting Fallback Spotlight Overlay */
.jolt-static-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  background: rgba(2, 4, 10, 0.65);
}

.jolt-static-card {
  position: fixed;
  z-index: 2147483641;
  width: min(340px, calc(100vw - 24px));
  background: #0d111d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 2px solid #10b981;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--fg);
  font-size: 0.86rem;
}

.jolt-static-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #6ee7b7;
}

.jolt-static-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Architectural Footer */
.site-footer {
  position: relative;
  border-top: 1px solid var(--hairline);
  background: #08090d;
}

.site-footer .electric-rail {
  top: 0;
  bottom: auto;
}

.footer-grid {
  padding: 48px 42px 36px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  border-bottom: 1px solid var(--hairline);
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr;
    padding: 36px 24px 28px;
  }
}

.footer-tagline {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 38ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h4 {
  margin: 0 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}

.footer-col a,
.footer-col span {
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--ok);
}

.footer-bottom {
  padding: 18px 42px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #64748b;
}

@media (max-width: 820px) {
  .footer-bottom {
    padding: 16px 24px;
  }
}

.btn-hero-hud {
  cursor: pointer;
  color: var(--fg);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-hero-hud:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.65);
}

.btn-hero-hud .btn-bolt-svg {
  width: 13px;
  height: 13px;
  fill: var(--ok);
}

/* Embedded <jolt-hud> UI Showcase */
.hud-showcase {
  --hud-accent: #10b981;
  --hud-glow: rgba(16, 185, 129, 0.18);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.06), #07080d 70%);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-showcase[data-mode="mock"] {
  --hud-accent: #f59e0b;
  --hud-glow: rgba(245, 158, 11, 0.2);
}

.hud-showcase[data-mode="live"] {
  --hud-accent: #38bdf8;
  --hud-glow: rgba(56, 189, 248, 0.22);
}

.hud-showcase-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-showcase-caption {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hud-mode-tabs {
  display: inline-flex;
  gap: 4px;
}

.hud-mode-tab {
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.hud-mode-tab.is-active {
  color: var(--fg);
  border-color: var(--hud-accent);
  background: rgba(255, 255, 255, 0.06);
}

.hud-mock-capsule {
  border-radius: 14px;
  background: #0b0c12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 28px var(--hud-glow);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.hud-mock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-mock-status-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hud-mock-bolt {
  width: 14px;
  height: 14px;
  fill: var(--hud-accent);
  flex-shrink: 0;
}

.hud-mock-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--hud-accent);
  border: 1px solid var(--hud-accent);
  background: rgba(255, 255, 255, 0.04);
}

.hud-mock-title {
  font-size: 12px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-mock-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
}

.hud-mock-stop {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(251, 113, 133, 0.16);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.4);
}

.hud-mock-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.hud-mock-metric {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-mock-metric + .hud-mock-metric {
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.hud-mock-mlabel {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #64748b;
}

.hud-mock-mval {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #f8fafc;
}

.hud-showcase[data-mode="mock"] #hud-preview-net {
  color: #fbbf24;
}

.hud-mock-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: #7dd3fc;
}

.hud-mock-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #050609;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 4px 4px 10px;
}

.hud-mock-prompt {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-mock-pin-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: #f8fafc;
  color: #090a0f;
  flex-shrink: 0;
}

.hud-mock-signal {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: #94a3b8;
}

.hud-mock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hud-accent);
  flex-shrink: 0;
}
