:root {
  --paper: #eef1ec;
  --surface: #f8f9f6;
  --ink: #1f2a24;
  --muted: #56645b;
  --line: #c9d0c8;
  --root: #7a4e2d;
  --wing: #3e6fa8;
  --root-soft: #ead9cb;
  --wing-soft: #d3e0ee;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161c18;
    --surface: #1e2620;
    --ink: #e4e9e3;
    --muted: #a3b0a7;
    --line: #36423a;
    --root: #d39a6b;
    --wing: #86afe0;
    --root-soft: #3a2b1f;
    --wing-soft: #1f2e40;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--sans);
}
a { color: inherit; text-decoration-color: var(--wing); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--wing);
  outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; max-width: 14ch; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code { font-size: 0.85em; background: var(--surface); border: 1px solid var(--line); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.root { color: var(--root); }
.wing { color: var(--wing); }
.neutral { color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

nav.top { padding: 20px 24px; }
.brand { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; }
main { padding: 0 24px 64px; }
footer.site { border-top: 1px solid var(--line); padding: 24px; color: var(--muted); font-size: 0.85rem; }
footer.site p { max-width: 720px; margin: 0 auto; }

.narrow { max-width: 720px; margin: 0 auto; padding: 48px 0 8px; }
.narrow > p { max-width: 66ch; }

/* hero: copy on the left, the card is the picture */
.hero { max-width: 1120px; margin: 0 auto; padding: 24px 0 40px; display: grid; gap: 48px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .hero { grid-template-columns: 1fr 1.05fr; padding-top: 56px; } }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn, button {
  font: 700 1rem var(--sans);
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.55em 1.2em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.ghost { background: transparent; color: var(--ink); }
button:disabled { opacity: 0.6; cursor: progress; }
.cta { margin-top: 24px; }

/* the card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 28px 20px;
}
.card header { margin-bottom: 18px; }
.who { color: var(--muted); margin: 0 0 4px; font-size: 0.95rem; }
.rw-label { font-size: 2rem; margin: 0 0 12px; }
.sig { margin: 12px 0 0; }
.rw-meter { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-size: 0.85rem; font-weight: 700; }
.rw-end.root { color: var(--root); }
.rw-end.wing { color: var(--wing); }
.rw-bar { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--root), var(--wing)); }
.rw-mark { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--surface); border: 4px solid var(--ink); }

.specs { list-style: none; margin: 0; padding: 0; }
.spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.25;
}
.pole.l { text-align: right; }
.pole.root, .pole.wing { font-weight: 700; }
.track { position: relative; height: 2px; background: var(--line); }
.track::after { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 10px; background: var(--line); }
.dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); z-index: 1; }
.dot.root { background: var(--root); }
.dot.wing { background: var(--wing); }
.nosignal { position: absolute; left: 50%; top: -0.8em; transform: translateX(-50%); color: var(--muted); font-size: 0.75rem; white-space: nowrap; background: var(--surface); padding: 0 4px; }

/* comparison */
.dot.pa { background: var(--root); }
.dot.pb { background: var(--wing); }
.dot.both { background: linear-gradient(90deg, var(--root) 50%, var(--wing) 50%); }
.gap { position: absolute; top: -3px; height: 8px; background: var(--line); border-radius: 4px; opacity: 0.9; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.key.pa { background: var(--root); }
.key.pb { background: var(--wing); }

.base { margin-top: 18px; }
.base h3 { margin-top: 12px; }
.base ul { list-style: none; padding: 0; margin: 0; }
.base li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px dashed var(--line); }
.origin { color: var(--muted); font-style: italic; white-space: nowrap; }
.meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.8rem; }
.meta a { overflow-wrap: anywhere; }

/* sections */
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: 0.7em; padding-left: 0.2em; }
.steps button { font-size: 0.95rem; padding: 0.35em 0.9em; }
.copyline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 24px; }
.copyline code { font-size: 1rem; padding: 0.45em 0.7em; }
.copyline button { font-size: 0.95rem; padding: 0.4em 1em; }
.clients { display: grid; grid-template-columns: 1fr; gap: 4px 24px; margin: 0; }
@media (min-width: 640px) { .clients { grid-template-columns: 9.5em 1fr; } }
.clients dt { font-weight: 700; padding-top: 12px; }
.clients dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
@media (min-width: 640px) { .clients dt { border-bottom: 1px solid var(--line); } }

textarea, input[type="text"], input:not([type]) {
  width: 100%;
  font: 0.9rem/1.5 ui-monospace, Menlo, monospace;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
input:not([type]) { font-family: var(--sans); font-size: 1rem; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 18px; font-size: 0.95rem; color: var(--muted); }
.check input { margin-top: 0.35em; width: 18px; height: 18px; accent-color: var(--wing); }
.errors { margin-top: 18px; border-left: 4px solid var(--root); padding: 8px 16px; background: var(--root-soft); border-radius: 0 8px 8px 0; }
.errors ul { margin: 0; padding-left: 1.2em; font-size: 0.9rem; }
#result { margin-top: 28px; scroll-margin-top: 20px; }

.spectrum-list { list-style: none; padding: 0; margin: 0; }
.spectrum-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.pair { margin: 0 0 2px; font-weight: 700; }
.vs { color: var(--muted); font-weight: 400; }
.desc { margin: 0; color: var(--muted); font-size: 0.95rem; }
.or { font-style: italic; }

.compare { margin-top: 32px; }
.compare .row { display: flex; gap: 10px; }
.compare input { flex: 1; }
.err { color: var(--root); font-size: 0.9rem; margin-top: 8px; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .card { padding: 20px 16px 14px; }
  .spec { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); gap: 8px; font-size: 0.78rem; }
  .compare .row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* v0.2: consumer flow */
.meaning { color: var(--muted); margin: -6px 0 14px; max-width: 46ch; }
.welcome { background: var(--wing-soft); border-radius: 10px; padding: 12px 16px; }
.pick-label { margin: 28px 0 10px; font-weight: 700; }
.hero-card .pick-label { margin-top: 0; color: var(--muted); }
.tabs .tab { font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin: 8px 0 24px; }
.tab {
  background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  margin-bottom: -2px; padding: 0.6em 1em; font-size: 1rem;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--wing); }
.steps.big { font-size: 1.05rem; }
.steps.big li { margin-bottom: 1em; }
.btn.big { font-size: 1.05rem; padding: 0.7em 1.4em; }
.status { display: block; margin-top: 8px; color: var(--wing); font-weight: 700; font-size: 0.95rem; }
.status:empty { display: none; }
.hint { color: var(--muted); font-size: 0.95rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.chip code { font-size: 0.85rem; }
button.mini { font-size: 0.8rem; padding: 0.25em 0.8em; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details > summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
details[open] > summary { margin-bottom: 12px; }
details.connector { margin-top: 16px; }
details.fallback { margin-top: 28px; }
details.spectrums > summary, #dev summary { color: var(--muted); }
.actions { margin-top: 18px; }
@media (max-width: 520px) {
  .base li { flex-direction: column; gap: 2px; }
  .tab { padding: 0.6em 0.7em; }
}
.share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.share .btn { font-size: 0.95rem; padding: 0.5em 1.1em; }
