:root {
  color-scheme: dark;
  --ink: #f5f2e8;
  --muted: #bbb6a6;
  --soft: #918f86;
  --black: #0d0d0b;
  --panel: #171713;
  --line: #343329;
  --gold: #d7b35f;
  --green: #50b68d;
  --rust: #bf6f49;
  --blue: #6aa6c8;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--black);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(245, 242, 232, 0.12);
  background: rgba(13, 13, 11, 0.86);
  backdrop-filter: blur(16px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.nav {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - 64px);
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-visual {
  position: relative;
  min-height: 520px;
  background:
    linear-gradient(90deg, rgba(13, 13, 11, 0.1), rgba(13, 13, 11, 0.92)),
    radial-gradient(circle at 25% 22%, rgba(80, 182, 141, 0.18), transparent 34%),
    linear-gradient(135deg, #11140f, #282016 54%, #101817);
}

.stage-grid {
  position: absolute;
  inset: 8% 6%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  transform: perspective(900px) rotateX(58deg) rotateZ(-8deg);
  transform-origin: center;
}

.stage-grid span {
  min-height: 112px;
  border: 1px solid rgba(245, 242, 232, 0.14);
  background: rgba(245, 242, 232, 0.035);
}

.signal-line {
  position: absolute;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 20px rgba(215, 179, 95, 0.55);
}

.signal-line-a {
  width: 42%;
  left: 12%;
  top: 28%;
}

.signal-line-b {
  width: 58%;
  left: 20%;
  top: 58%;
  background: var(--green);
}

.signal-line-c {
  width: 34%;
  left: 46%;
  top: 74%;
  background: var(--blue);
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
  padding: clamp(40px, 7vw, 96px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(4rem, 12vw, 11rem);
  line-height: 0.82;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 20px;
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.45;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #17120a;
}

.button.secondary,
.button.ghost {
  background: rgba(245, 242, 232, 0.05);
  color: var(--ink);
}

.band {
  padding: clamp(44px, 8vw, 96px) clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.section-heading.compact {
  align-items: start;
  flex-direction: column;
  gap: 0;
}

.funding-layout,
.workbook-shell,
.dispatch-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.funding-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1.18fr);
  gap: 20px;
}

.funding-meter,
.workbook-card,
.signal-list article,
.dispatch-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 40px var(--shadow);
}

.funding-meter {
  padding: 22px;
}

.meter-head,
.amount-row,
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.meter-head span,
.amount-row,
.range-label,
.signal-list span,
.dispatch-grid span,
label {
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.meter-head strong {
  font-size: 2.5rem;
}

.meter-track {
  height: 18px;
  margin: 18px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(245, 242, 232, 0.12);
  border-radius: 999px;
  background: #0f100d;
}

.meter-fill {
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--rust));
}

input[type="range"] {
  width: 100%;
  margin-top: 14px;
  accent-color: var(--gold);
}

.range-label {
  display: block;
  margin-top: 22px;
}

.signal-list,
.dispatch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.signal-list article,
.dispatch-grid article {
  padding: 18px;
}

.signal-list p,
.dispatch-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.workbook-shell {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 18px;
}

.question-rail {
  display: grid;
  align-content: start;
  gap: 8px;
}

.question-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12120f;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.question-tab.active {
  border-color: var(--gold);
  color: var(--gold);
}

.workbook-card {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 32px);
}

label {
  display: grid;
  gap: 8px;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f100d;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

select {
  min-height: 42px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: var(--gold);
}

.dispatch-band {
  background: #10110e;
}

@media (max-width: 900px) {
  .hero,
  .funding-layout,
  .workbook-shell,
  .signal-list,
  .dispatch-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 300px;
  }

  .hero-copy {
    padding: 36px 22px 52px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .question-rail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .question-rail,
  .controls-row {
    grid-template-columns: 1fr;
  }

  .question-tab {
    min-height: 40px;
    font-size: 0.82rem;
  }
}

.version-switcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  gap: 8px;
  min-width: 214px;
  padding: 12px;
  border: 1px solid rgba(215, 179, 95, 0.38);
  border-radius: 8px;
  background: rgba(13, 13, 11, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}

.version-switcher span {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.version-switcher nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.version-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.version-switcher a.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #17120a;
}

@media (max-width: 560px) {
  .version-switcher {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-width: 0;
  }
}
