:root {
  --bg: #050811;
  --surface: rgba(11, 18, 34, 0.78);
  --surface-solid: #0B1222;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --ink: #F8FAFC;
  --body: #CBD5E1;
  --muted: #94A3B8;
  --accent: #10B981;
  --accent-bright: #34D399;
  --accent-ink: #031912;
  --radius-card: 22px;
  --radius-input: 12px;
  --radius-pill: 999px;
  --font-head: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.58;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  color: var(--ink);
  letter-spacing: -0.03em;
}

.tele-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Fullscreen 3D Canvas Stage */
#stage-3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.2s linear;
}

header, main, footer, .chapter-hud {
  position: relative;
  z-index: 2;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.btn:active { transform: translateY(1px) scale(0.985); }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: 0.88rem; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.32);
}

.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 12px 36px rgba(16, 185, 129, 0.42);
}

.btn-secondary {
  background: rgba(11, 18, 34, 0.72);
  color: var(--ink);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(20, 30, 51, 0.92);
  border-color: rgba(255, 255, 255, 0.42);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline-light:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* Header */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(5, 8, 17, 0.56);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.head-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  white-space: nowrap;
}

.brand-dot { color: var(--accent-bright); }

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

.main-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--body);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--ink); }

.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.head-panel-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
}

.head-panel-link:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.mobile-drawer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px 24px;
  background: rgba(5, 8, 17, 0.96);
  border-bottom: 1px solid var(--border);
}

.mobile-drawer[hidden] { display: none; }
.mobile-drawer a { font-weight: 600; color: var(--ink); padding: 4px 0; }

/* Right-edge Chapter HUD */
.chapter-hud {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hud-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 8, 17, 0.6);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.hud-dot.active {
  border-color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.22);
  color: var(--accent-bright);
  transform: scale(1.1);
}

/* 3D Scroll Acts */
.act {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 96px 0 64px;
}

.act-grid-left {
  display: grid;
  grid-template-columns: minmax(0, 560px) 1fr;
}

.act-grid-right {
  display: grid;
  grid-template-columns: 1fr minmax(0, 580px);
}

.act-grid-right > * {
  grid-column: 2;
}

/* Hero Act 1 */
.hero-copy {
  padding: 28px;
  margin-left: -28px;
  border-radius: 28px;
  background: radial-gradient(circle at 35% 45%, rgba(5, 8, 17, 0.84) 0%, rgba(5, 8, 17, 0.45) 72%, rgba(5, 8, 17, 0) 100%);
}

.hero-copy h1 {
  font-size: clamp(2.35rem, 4.4vw, 4.05rem);
  font-weight: 800;
  line-height: 1.03;
  margin-bottom: 18px;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.65);
}

.hero-sub {
  margin: 0 0 28px;
  max-width: 46ch;
  font-size: 1.1rem;
  color: #E2E8F0;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.burst-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(52, 211, 153, 0.38);
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent-bright);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.burst-pill:hover { background: rgba(16, 185, 129, 0.24); }
.burst-pill:active { transform: scale(0.97); }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

.drag-hint {
  margin: 24px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Floating Glass Panels */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
}

/* Act 2 Editorial Pillars */
.editorial-col h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  margin-bottom: 12px;
}

.ed-lead {
  margin: 0 0 24px;
  color: var(--body);
}

.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pillar {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pillar-idx {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-bright);
  padding-top: 2px;
}

.pillar h3 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.pillar p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Act 3 Inspector HUD */
.inspector {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insp-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.insp-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.insp-top h2 {
  font-size: 1.55rem;
  margin-top: 2px;
}

.status-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.16);
  color: var(--accent-bright);
  border: 1px solid rgba(16, 185, 129, 0.32);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.insp-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.insp-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #059669, #34D399);
}

.insp-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(5, 8, 17, 0.72);
  border: 1px solid var(--border);
}

.insp-pin-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 4px;
}

.insp-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.insp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.insp-grid dt { font-size: 0.74rem; color: var(--muted); }
.insp-grid dd { margin: 2px 0 0; font-size: 0.86rem; font-weight: 600; color: var(--ink); }

.insp-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--body);
}

.insp-pins {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.pin-tab {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(5, 8, 17, 0.8);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.pin-tab:hover { border-color: var(--accent); }
.pin-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Act 4 Configurator */
.quote-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quote-head h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  margin-bottom: 8px;
}

.quote-head p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--body);
}

.pill-group { border: 0; margin: 0; padding: 0; }
.pill-group legend {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: rgba(5, 8, 17, 0.78);
  color: var(--body);
  font-size: 0.86rem;
  font-weight: 600;
}

.pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 0.84rem; font-weight: 700; color: var(--ink); }

.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-input);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 17, 0.9);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
}

.field input::placeholder,
.field textarea::placeholder { color: #64748B; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hp-field {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.form-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.form-foot a { color: var(--accent-bright); font-weight: 600; }

.form-msg {
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
}
.form-msg.ok { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.45); color: #A7F3D0; }
.form-msg.err { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.45); color: #FCA5A5; }

/* Solid Bottom Band */
.solid-band {
  background: rgba(5, 8, 17, 0.94);
  border-top: 1px solid var(--border);
  padding: 72px 0;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.bottom-grid h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.15rem);
  margin-bottom: 10px;
}

.band-sub {
  margin: 0 0 24px;
  color: var(--body);
}

.zone-clusters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.zone-clusters h3 {
  font-size: 1rem;
  color: var(--accent-bright);
  margin-bottom: 6px;
}

.zone-clusters p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.faq-list { border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); padding: 15px 0; }
.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent-bright); }
.faq-list details[open] summary::after { content: "-"; }
.faq-list details p { margin: 10px 0 2px; font-size: 0.92rem; color: var(--body); }

/* Footer */
.site-foot {
  background: #04070E;
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--body);
}

.foot-links a:hover { color: var(--accent-bright); }
.foot-copy { font-size: 0.84rem; color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .chapter-hud,
  .main-nav,
  .head-panel-link,
  .head-actions .btn-sm {
    display: none;
  }

  .nav-toggle { display: inline-flex; }

  .act {
    min-height: auto;
    align-items: flex-end;
    padding: 320px 0 48px;
  }

  .act-hero {
    min-height: 100dvh;
    padding: 270px 0 44px;
  }

  .act-grid-left,
  .act-grid-right,
  .bottom-grid,
  .zone-clusters {
    grid-template-columns: 1fr;
  }

  .act-grid-right > * { grid-column: 1; }

  .hero-copy {
    margin-left: 0;
    padding: 18px;
    background: rgba(5, 8, 17, 0.78);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero-copy h1 { font-size: clamp(1.85rem, 7.2vw, 2.35rem); }
  .hero-ctas .btn, .burst-pill { width: 100%; justify-content: center; white-space: normal; text-align: center; }
  .glass-panel { padding: 20px 16px; }
  .form-grid, .insp-grid { grid-template-columns: 1fr; }
  .insp-pins { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .burst-pill, .hud-dot { transition: none; }
}
