:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #171d20;
  --panel-strong: #20282b;
  --ink: #f6f1e8;
  --muted: #b9b1a6;
  --line: rgba(246, 241, 232, 0.16);
  --teal: #5ad7c8;
  --blue: #6fb7ff;
  --amber: #efc15b;
  --orange: #f2a66a;
  --violet: #b99cff;
  --danger-text: #ffd4ca;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(112deg, rgba(246, 241, 232, 0.026) 0 1px, transparent 1px 24px),
    linear-gradient(95deg, rgba(90, 215, 200, 0.09), transparent 34%, rgba(239, 193, 91, 0.07)),
    linear-gradient(180deg, #101316 0%, #15191b 46%, #0f1215 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a,
button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.selector-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(34px, env(safe-area-inset-bottom));
}

.selector-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 19, 22, 0.84);
  color: var(--muted);
  backdrop-filter: blur(18px);
  font: 800 0.72rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.selector-topbar a,
.selector-topbar strong {
  color: var(--ink);
  text-decoration: none;
}

.selector-topbar strong {
  padding: 8px 10px;
  border: 1px solid rgba(239, 193, 91, 0.46);
  background: rgba(239, 193, 91, 0.10);
}

.selector-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-height: 62vh;
  align-content: end;
  padding: 34px 0 18px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font: 900 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

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

h1 {
  max-width: 9ch;
  margin-bottom: 14px;
  font-size: 4.4rem;
  line-height: 0.86;
}

h2 {
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 0.96;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.coupon-stage,
.decision-cockpit,
.ashby-panel,
.cvd-gate {
  border: 1px solid var(--line);
  background: rgba(23, 29, 32, 0.86);
  box-shadow: var(--shadow);
}

.coupon-stage {
  position: relative;
  min-height: 230px;
  margin: 0;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(246, 241, 232, 0.06) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(90, 215, 200, 0.05) 1px, transparent 1px) 0 0 / 34px 34px,
    rgba(17, 23, 25, 0.94);
}

.coupon-stage figcaption,
.ashby-panel figcaption {
  color: var(--muted);
  font-size: 0.86rem;
}

.coupon {
  display: inline-grid;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 2px solid currentColor;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.coupon-circle {
  border-radius: 999px;
}

.coupon-square {
  border-radius: 2px;
}

.coupon-triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  min-height: 78px;
  padding-top: 24px;
}

.coupon-metal {
  color: var(--blue);
  background: rgba(111, 183, 255, 0.12);
}

.coupon-polymer {
  color: var(--orange);
  background:
    radial-gradient(circle, rgba(242, 166, 106, 0.32) 0 3px, transparent 4px) 0 0 / 18px 18px,
    rgba(242, 166, 106, 0.10);
}

.coupon-composite {
  color: var(--amber);
  background:
    repeating-linear-gradient(45deg, rgba(239, 193, 91, 0.40) 0 4px, transparent 4px 12px),
    rgba(239, 193, 91, 0.10);
}

.decision-cockpit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
}

.part-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.part-buttons button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(32, 40, 43, 0.82);
  color: var(--ink);
  text-align: left;
  padding: 0 12px;
  font-weight: 850;
}

.part-buttons button[aria-pressed="true"] {
  border-color: rgba(90, 215, 200, 0.78);
  box-shadow: inset 0 0 0 2px rgba(90, 215, 200, 0.22);
}

.boundary-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.scenario-card,
.material-card,
.gate-list li {
  border: 1px solid var(--line);
  background: rgba(16, 19, 22, 0.72);
}

.scenario-card {
  min-height: 100%;
  padding: 16px;
}

.scenario-card strong,
.metric strong {
  display: block;
  color: var(--ink);
}

.posture-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid rgba(239, 193, 91, 0.48);
  color: var(--amber);
  font: 900 0.75rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.ashby-panel {
  margin-top: 14px;
  padding: 14px;
}

.section-heading {
  max-width: 760px;
}

.ashby-panel figure {
  margin: 0;
}

#ashbyCanvas {
  width: 100%;
  max-height: 620px;
  display: block;
  border: 1px solid rgba(246, 241, 232, 0.12);
  background: #0c1013;
}

.comparison-section {
  margin-top: 18px;
}

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

.material-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
}

.material-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--family-color);
}

.material-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.material-card h3,
.material-card p {
  overflow-wrap: anywhere;
}

.family-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--family-color);
  color: var(--family-color);
  font-weight: 950;
}

.family-mark.circle {
  border-radius: 999px;
}

.family-mark.square {
  border-radius: 2px;
}

.family-mark.triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--family-color), transparent 58%) 0 4px, transparent 4px 10px),
    rgba(255, 255, 255, 0.02);
}

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

.metric {
  padding: 10px;
  border: 1px solid rgba(246, 241, 232, 0.10);
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
}

.receipt-line {
  margin: 12px 0 0;
  color: var(--muted);
  font: 750 0.72rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cvd-gate {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
}

.gate-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate-list li {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 800;
}

.gate-list li::before {
  content: "check";
  display: inline-grid;
  min-width: 42px;
  min-height: 28px;
  place-items: center;
  border: 1px solid var(--teal);
  color: var(--teal);
  font: 900 0.64rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

@media (min-width: 720px) {
  .selector-shell {
    padding-inline: 22px;
  }

  .selector-hero,
  .decision-cockpit,
  .cvd-gate {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  }

  .selector-hero {
    align-items: end;
  }

  h1 {
    font-size: 6.2rem;
  }

  h2 {
    font-size: 3.2rem;
  }

  .coupon-stage {
    min-height: 430px;
  }

  .part-buttons,
  .comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  h1 {
    font-size: 8.4rem;
  }

  .comparison-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
