/* Seating Distance — shared styles.
   Plan: a screening-room drafting sheet. Cool paper and ink, one amber "projector beam"
   reserved for viewing wedges, chosen answers and the active nav item. */
:root {
  --paper: #f2f4f6;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #5a6774;
  --rule: #d4dae0;
  --beam: #c76f12;
  --beam-soft: rgba(199, 111, 18, 0.13);
  --good: #23704f;
  --good-bg: #e2f1ea;
  --warn: #a5461f;
  --warn-bg: #f8e6dc;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.05), 0 6px 20px rgba(21, 32, 43, 0.05);
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d131a;
    --panel: #141c25;
    --ink: #e6ebf0;
    --muted: #94a1ae;
    --rule: #28333f;
    --beam: #f0a23c;
    --beam-soft: rgba(240, 162, 60, 0.15);
    --good: #6cc99c;
    --good-bg: #15302a;
    --warn: #f19a6e;
    --warn-bg: #3a2219;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d131a;
  --panel: #141c25;
  --ink: #e6ebf0;
  --muted: #94a1ae;
  --rule: #28333f;
  --beam: #f0a23c;
  --beam-soft: rgba(240, 162, 60, 0.15);
  --good: #6cc99c;
  --good-bg: #15302a;
  --warn: #f19a6e;
  --warn-bg: #3a2219;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--ink); text-decoration-color: var(--beam); text-underline-offset: 3px; }
a:hover { color: var(--beam); }
:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 420px) { .wrap { padding: 0 16px; } }

/* Site header */
.site-head { background: var(--panel); border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 22px; flex: none; }
.brand span { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; font-size: 15px; font-weight: 700; color: var(--muted);
  padding: 19px 12px 17px; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--beam); }
@media (max-width: 520px) {
  .site-head .wrap { padding-top: 10px; }
  .site-nav { width: 100%; margin: 0 -12px; }
  .site-nav a { padding: 10px 12px 9px; }
}

.head-right { display: flex; align-items: center; gap: 12px; }
.support-btn {
  text-decoration: none; font-size: 14px; font-weight: 700; color: var(--beam);
  border: 1.5px solid var(--beam); border-radius: 999px; padding: 6px 14px; white-space: nowrap;
}
.support-btn:hover { background: var(--beam); color: var(--panel); }
@media (max-width: 520px) { .head-right { width: 100%; justify-content: space-between; } .site-nav { width: auto; } }

/* Page hero */
.hero { padding-top: 36px; padding-bottom: 8px; }
.eyebrow { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; font-size: 14px; color: var(--beam); margin: 0 0 8px; }
.eyebrow a { color: inherit; text-decoration: none; }
h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 6.4vw, 66px); line-height: 0.96; letter-spacing: 0.003em;
  margin: 0 0 12px; text-wrap: balance; max-width: 18ch;
}
.lede { color: var(--muted); max-width: 60ch; margin: 0; font-size: 18px; }
main { padding: 28px 0 56px; display: grid; gap: 48px; }

/* Panels and labels */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
@media (max-width: 420px) { .panel { padding: 16px; } }
legend, .label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; padding: 0;
}
section h2, .h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; margin: 0 0 8px; text-wrap: balance;
}
section > p.intro { color: var(--muted); max-width: 65ch; margin: 0 0 18px; }

/* Segmented controls */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.seg.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  flex: 1 1 auto; text-align: center; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px;
  cursor: pointer; font-size: 15px; background: var(--paper); user-select: none; line-height: 1.25;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.seg label:hover { border-color: var(--muted); }
.seg input:checked + label { border-color: var(--ink); background: var(--ink); color: var(--panel); font-weight: 700; }
.seg input:focus-visible + label { outline: 2px solid var(--beam); outline-offset: 2px; }
.seg label small { display: block; font-size: 12px; opacity: 0.75; font-weight: 400; margin-top: 2px; }
.seg.tabs { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 4px; gap: 4px; }
.seg.tabs label { border-color: transparent; background: transparent; }
.seg.tabs input:checked + label { background: var(--panel); color: var(--ink); border-color: var(--rule); box-shadow: var(--shadow); }

/* Calculator */
.tool { display: grid; grid-template-columns: minmax(290px, 350px) 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .tool > .controls { position: sticky; top: 16px; } }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }
.controls { display: grid; gap: 20px; }
.inputs { display: flex; gap: 8px; align-items: stretch; }
.field { position: relative; flex: 1; }
.field input {
  width: 100%; font: 600 24px/1 var(--font-mono); padding: 11px 44px 11px 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field input:focus { border-color: var(--beam); outline: none; box-shadow: 0 0 0 3px var(--beam-soft); }
.field .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.error { font-size: 14px; color: var(--warn); margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--beam); flex: none; }
.range { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.range input { flex: 1; accent-color: var(--beam); }
.range output { font: 500 15px var(--font-mono); min-width: 3.5ch; text-align: right; }
.units-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--rule); }
.units-row .seg { flex: 0 0 auto; }

.answer { display: grid; gap: 16px; min-width: 0; }
.answer-card { display: grid; gap: 12px; }
.answer-card .plan { border-top: 1px solid var(--rule); padding-top: 12px; }
.headline { display: grid; gap: 4px; align-content: center; }
.headline .kicker { font-size: 15px; color: var(--muted); margin: 0; }
.big {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(64px, 9vw, 104px); line-height: 0.88;
  color: var(--ink); font-variant-numeric: tabular-nums; margin: 4px 0 0; white-space: nowrap;
}
.big .alt { font-size: 0.3em; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; margin-left: 8px; }
.headline .sub { margin: 8px 0 0; font-size: 16px; }
.plan { margin: 0; }
.plan svg { width: 100%; height: auto; display: block; }
.plan figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }

.notes { display: grid; gap: 8px; }
.chip { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 15px; line-height: 1.45; }
.chip b { white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip span { color: var(--ink); }

.split { display: grid; gap: 16px; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--rule); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.compare td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare td.basis { color: var(--muted); font-size: 14px; }
.compare tr.sel td { background: var(--beam-soft); font-weight: 700; color: var(--ink); }
.compare tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--beam); }
.compare tbody tr { cursor: pointer; }
.compare tbody tr:hover td { background: var(--beam-soft); }
.table-scroll { overflow-x: auto; padding: 8px 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; padding: 0; background: var(--rule); overflow: hidden; }
.fact { padding: 12px 16px; background: var(--panel); }
.fact .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.fact .v { font: 500 18px var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 2px; }
.facts.panel { padding: 0; }

/* Math blocks and sources */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
pre.math {
  margin: 0; font: 14px/1.75 var(--font-mono); background: var(--panel); border: 1px solid var(--rule);
  border-radius: 12px; padding: 16px 18px; overflow-x: auto; white-space: pre;
}
pre.math .c { color: var(--muted); }
pre.math .r { color: var(--beam); font-weight: 500; }
.sources { display: grid; gap: 14px; }
.src { border-left: 3px solid var(--rule); padding: 2px 0 2px 14px; max-width: 70ch; }
.src.weak { border-left-color: var(--warn); }
.src.solid { border-left-color: var(--good); }
.src h3 { font-size: 16px; margin: 0 0 2px; }
.src p { margin: 0; font-size: 15px; color: var(--muted); }
.src .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-left: 6px; }
.src.solid .tag { color: var(--good); }
.src.weak .tag { color: var(--warn); }
.src.mid .tag { color: var(--muted); }

/* Reference tables (charts + guides) */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.jump a { display: inline-block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; font-size: 14px; background: var(--panel); }
.jump a:hover { border-color: var(--beam); color: var(--ink); }
.bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.bar .units-row { border: 0; padding: 0; }
section.tbl { display: grid; gap: 12px; scroll-margin-top: 16px; }
.ref { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--panel); }
.ref th, .ref td { padding: 9px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.ref tbody tr:last-child th, .ref tbody tr:last-child td { border-bottom: 0; }
.ref thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; vertical-align: bottom; background: var(--paper); }
.ref thead th small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.ref thead th[scope="colgroup"] { text-align: center; color: var(--ink); }
.ref th[scope="row"], .ref thead th:first-child { text-align: left; }
.ref th[scope="row"] { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.ref td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ref td.key { background: var(--beam-soft); font-weight: 500; }
.ref td.px { color: var(--muted); }
.ref td.px.warn { color: var(--warn); }
.ref .pxfirst { border-left: 1px solid var(--rule); }
.ref tbody tr:hover td, .ref tbody tr:hover th { background: var(--beam-soft); }
.tablewrap { border: 1px solid var(--rule); border-radius: 12px; overflow-x: auto; box-shadow: var(--shadow); background: var(--panel); }
.legend { font-size: 15px; color: var(--muted); margin: 0; max-width: 75ch; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; background: var(--beam-soft); border: 1px solid var(--beam); }
.met { display: none; }
body.metric .imp { display: none; }
body.metric .met { display: inline; }

/* Buttons */
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.cta { display: inline-block; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--panel); text-decoration: none; font-weight: 700; font-size: 15px; border: 1px solid var(--ink); }
.cta.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.cta:hover { color: var(--panel); background: var(--beam); border-color: var(--beam); }

/* Guides index */
.guide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.guide-card { display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink); position: relative; }
a.guide-card:hover { border-color: var(--beam); color: var(--ink); }
a.guide-card:hover h2 { color: var(--beam); }
.guide-card .num { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 0.8; color: var(--beam); }
.guide-card h2 { font-size: 26px; margin: 0; transition: color 0.15s; }
.guide-card p { margin: 0; color: var(--muted); font-size: 15px; }
.guide-card .status { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.guide-card .status.live { color: var(--good); }
.guide-card .status.soon { color: var(--muted); }
.guide-card.soon { box-shadow: none; background: transparent; border-style: dashed; }

/* Guide article */
.article-grid { display: grid; grid-template-columns: minmax(0, 720px) 220px; gap: 48px; align-items: start; justify-content: space-between; }
@media (max-width: 1000px) { .article-grid { grid-template-columns: 1fr; } .toc-side { display: none; } }
.toc-side { position: sticky; top: 16px; font-size: 14px; }
.toc-side ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--rule); }
.toc-side a { display: block; padding: 5px 12px; text-decoration: none; color: var(--muted); margin-left: -2px; border-left: 2px solid transparent; }
.toc-side a:hover { color: var(--ink); border-left-color: var(--beam); }
.toc-inline { display: none; }
@media (max-width: 1000px) { .toc-inline { display: flex; } }
article h2 { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.05; margin: 44px 0 12px; text-wrap: balance; scroll-margin-top: 16px; }
article h2 .step { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--beam); color: var(--panel); font-size: 20px; margin-right: 10px; vertical-align: 3px; }
article h3 { font-size: 18px; margin: 22px 0 6px; }
article > p, article > ul, article > ol { max-width: 68ch; }
article p, article li { font-size: 17px; line-height: 1.65; }
article p { margin: 0 0 14px; }
article ul, article ol { margin: 0 0 14px; padding-left: 22px; }
article li { margin-bottom: 6px; }
article .tablewrap { margin: 4px 0 8px; }
article pre.math { margin: 4px 0 18px; }
.cap { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.callout { border-left: 3px solid var(--beam); background: var(--panel); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 4px 0 18px; box-shadow: var(--shadow); }
.callout p { margin: 0; font-size: 16px; }
.checklist { list-style: none; padding: 0; counter-reset: c; }
.checklist li { counter-increment: c; padding-left: 38px; position: relative; }
.checklist li::before { content: counter(c); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--panel); font: 700 13px/26px var(--font-body); text-align: center; }
.buy { border-top: 1px solid var(--rule); margin-top: 48px; }
.disclosure { font-size: 15px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pick { display: grid; gap: 6px; align-content: start; }
.pick h3 { margin: 0; font-size: 18px; }
.pick p { font-size: 15px; margin: 0; color: var(--muted); }
.pick ul { margin: 2px 0 6px; padding-left: 20px; }
.pick li { font-size: 15px; margin-bottom: 3px; line-height: 1.5; }
.slot { border: 1px dashed var(--muted); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--muted); }
.srcs { font-size: 14px; color: var(--muted); padding-left: 20px; }
.srcs li { font-size: 14px; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); background: var(--panel); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 28px; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr; } }
.site-foot h2 { font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin: 0 0 8px; }
.site-foot p { margin: 0 0 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
