:root {
  --bg: #0a0e0d;
  --bg-raised: #101614;
  --line: #23302c;
  --phosphor: #8fffb0;
  --phosphor-dim: #4d8a63;
  --amber: #ffb454;
  --text: #dfe8e2;
  --text-dim: #7e948a;
  --serif: "Fraunces", ui-serif, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(143, 255, 176, 0.03) 0px,
    rgba(143, 255, 176, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

a { color: var(--phosphor); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Hero ---------- */

.hero {
  padding: 5.5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 900px 400px at 15% -10%, rgba(143,255,176,0.10), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 0%, rgba(255,180,84,0.06), transparent 55%);
}

.hero-inner { max-width: 780px; margin: 0 auto; }

.kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--phosphor-dim);
  margin: 0 0 1.5rem;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--phosphor);
}

.lede {
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 58ch;
  margin: 0 0 2rem;
}

.stat-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}

.stat strong { color: var(--phosphor); font-weight: 600; }
.stat-sep { color: var(--line); }

/* ---------- Sections ---------- */

main { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; }

section { padding: 3.5rem 0; border-bottom: 1px solid var(--line); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.4rem;
  margin: 0;
  color: var(--phosphor);
}

.section-sub { color: var(--text-dim); font-size: 13px; margin: 0; }

#filter {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  min-width: 220px;
}

#filter:focus { outline: 1px solid var(--phosphor-dim); }

/* ---------- Ledger table ---------- */

.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.ledger thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.ledger tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.ledger tbody tr:hover { background: var(--bg-raised); }

.ledger td { padding: 0.6rem 0.75rem; vertical-align: top; }

.ledger .col-select { width: 2rem; }

.ledger td.name { color: var(--phosphor); font-weight: 500; white-space: nowrap; }
.ledger td.operator { color: var(--amber); white-space: nowrap; }
.ledger td.purpose { color: var(--text-dim); }

.ledger input[type="checkbox"] {
  accent-color: var(--phosphor);
  width: 14px;
  height: 14px;
}

/* ---------- Generator ---------- */

.stance-picker {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stance {
  font-family: var(--mono);
  font-size: 12.5px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stance:hover { border-color: var(--phosphor-dim); color: var(--text); }

.stance.active {
  background: rgba(143, 255, 176, 0.1);
  border-color: var(--phosphor);
  color: var(--phosphor);
}

.tab-bar { display: flex; gap: 0.25rem; margin-bottom: -1px; }

.tab {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-bottom: none;
  color: var(--text-dim);
  padding: 0.45rem 1rem;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}

.tab.active { color: var(--phosphor); background: #0d1412; }

.output {
  margin: 0;
  background: #0d1412;
  border: 1px solid var(--line);
  border-radius: 0 4px 4px 4px;
  padding: 1.25rem;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  max-height: 340px;
  overflow-y: auto;
}

.output.hidden { display: none; }

.output code { color: var(--phosphor); white-space: pre; }

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-primary, .btn-ghost {
  font-family: var(--mono);
  font-size: 13px;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--phosphor);
}

.btn-primary {
  background: var(--phosphor);
  color: #06110b;
  font-weight: 600;
}

.btn-primary:hover { background: #a6ffc4; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--phosphor-dim); color: var(--text); }

.copy-flash {
  font-size: 12px;
  color: var(--phosphor);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.copy-flash.show { opacity: 1; }
.copy-flash.error { color: #ff6b6b; }

/* ---------- Referral / footer ---------- */

.referral {
  border-bottom: none;
  padding: 3rem 0;
  text-align: center;
}

.referral p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0 auto;
}

.referral a { color: var(--amber); }

footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  section { padding: 2.5rem 0; }
  .ledger td.purpose { display: none; }
  .ledger thead th:nth-child(4) { display: none; }
}

/* ---------- Comparison page ---------- */

.hero-compact { padding: 4rem 1.5rem 3rem; }

.compare-intro {
  padding: 2.5rem 0 0;
  border-bottom: none;
  color: var(--text-dim);
  max-width: 68ch;
}

.compare-table th:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(2),
.compare-table td:nth-child(3) {
  width: 32%;
}

.compare-table td:first-child { color: var(--text-dim); }
.compare-table td:nth-child(2) { color: var(--text); }
.compare-table td:nth-child(3) { color: var(--text); }

.table-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  font-size: 10.5px;
}

.compare-verdict {
  color: var(--text-dim);
  max-width: 68ch;
  margin: 0 0 1rem;
}

a.btn-primary {
  display: inline-block;
  text-decoration: none;
}
