:root {
  --bg: #0b0a14;
  --panel: #14122a;
  --soft: #1c1938;
  --line: #2a2650;
  --text: #ece9ff;
  --muted: #a29dc4;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --yellow: #facc15;
  --red: #f87171;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--cyan); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* Nav */
#nav { position: sticky; top: 0; z-index: 10; background: rgba(11, 10, 20, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.navbar { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.brand svg { width: 28px; height: 28px; }
#nav nav { display: flex; gap: 18px; }
#nav nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
#nav nav a:hover, #nav nav a[aria-current] { color: var(--text); }
#nav .btn { margin-left: auto; }

/* Buttons */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover, button:hover { filter: brightness(1.15); }
.btn-primary, button.primary { background: linear-gradient(135deg, var(--cyan), var(--violet)); border-color: transparent; color: #0b0a14; }
.btn-sm { padding: 7px 12px; font-size: 14px; white-space: nowrap; }

/* Type */
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px;
  background: var(--yellow); color: #111; font-weight: 700; font-size: 13px; letter-spacing: .06em;
}
h1 { margin: 0 0 12px; font-size: clamp(34px, 6.4vw, 64px); line-height: 1.04; letter-spacing: -.02em; }
h1 s { color: var(--muted); text-decoration-color: var(--red); text-decoration-thickness: 4px; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { margin: 0 0 12px; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; letter-spacing: -.01em; }
h3 { margin: 0 0 6px; font-size: 18px; }
.lede { margin: 0 0 28px; max-width: 680px; color: var(--muted); font-size: 19px; }
.fine { color: var(--muted); font-size: 14px; }

section.block { padding: 56px 0 8px; }
.hero { padding: 48px 0 8px; }

/* Generator */
.stage { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.stage canvas { display: block; width: 100%; height: auto; }
.controls {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 20px;
  margin: 20px 0 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.controls .wide { grid-column: span 2; }
.controls .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); align-content: start; }
.field b { color: var(--text); font-weight: 600; }
.field small { font-size: 13px; }
input[type=text], input[type=number] {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
input[type=range] { width: 100%; accent-color: var(--cyan); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 8px; font-size: 14px; color: var(--text); font-weight: 600; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 15px; color: var(--text); cursor: pointer; }
.check input { margin: 4px 0 0; accent-color: var(--violet); flex: none; }
.check.doom { border-color: rgba(248, 113, 113, .55); background: rgba(248, 113, 113, .07); }
.check.doom input { accent-color: var(--red); }
.check.doom span small { display: block; color: var(--muted); font-size: 13px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.post { margin-top: 24px; }
.post h3 { margin-bottom: 10px; }
pre {
  margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  white-space: pre-wrap; word-break: break-word; font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
}

/* Explainer */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.step { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.step .tag { display: inline-block; margin-bottom: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.step.now { border-color: var(--violet); }
.step p { margin: 0; color: var(--muted); }
.formula { margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.levers { width: 100%; border-collapse: collapse; font-size: 15px; }
.levers th, .levers td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.levers th { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.levers td:nth-child(2) { white-space: nowrap; font-weight: 700; color: var(--cyan); }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.quotes figure { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.quotes blockquote { margin: 0 0 12px; font-size: 17px; }
.quotes figcaption { color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Leaderboard */
.board { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.board ol { margin: 0; padding: 0; list-style: none; }
.board li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.board .rank { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.board .who b { display: block; font-size: 17px; }
.board .who span { color: var(--muted); font-size: 14px; }
.board .num { text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.board .num a { display: block; margin-top: 2px; font-weight: 500; font-size: 13px; }
.board li.doomed .num { color: var(--muted); }
.board li.doomed .who b::after { content: " · AI will kill us all"; color: var(--red); font-size: 13px; font-weight: 600; }
.strip { margin: 0; padding: 10px 20px; background: var(--yellow); color: #111; font-weight: 700; font-size: 14px; }

/* Footer */
footer { margin-top: 64px; border-top: 1px solid var(--line); }
.john { max-width: 680px; padding: 40px 0 16px; }
.john h2 { font-size: 22px; }
.john p { margin: 0 0 12px; }
.footbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footbar p { margin: 0; max-width: 640px; }

/* whois:start. The same block is on every mergetel satire site. Colours come from the site's own variables. */
.whois { margin: 12px 0 0; padding: 24px 0 40px; border-top: 1px solid var(--line, rgba(127, 127, 127, .3)); max-width: 680px; }
.whois h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; letter-spacing: 0; }
.whois p { margin: 0 0 14px; }
.whois ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.whois li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.whois li a { min-width: 7em; font-weight: 600; }
.whois li span { color: var(--muted, inherit); font-size: 14px; }
/* whois:end */

@media (max-width: 900px) {
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps, .quotes { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .controls { grid-template-columns: 1fr; padding: 16px; }
  .controls .wide { grid-column: auto; }
  .checks { grid-template-columns: 1fr; }
  #nav nav { gap: 12px; }
  .brand span { display: none; }
  .board li { grid-template-columns: 30px minmax(0, 1fr); padding: 14px 16px; }
  .board .num { grid-column: 2; text-align: left; }
}
