/* SentientSuns.com — design spec parts 1–3, §2 (design system) and §3 (site frame).
   System fonts only; warm paper and amber; light and dark follow the system; no outside files. */

:root {
  color-scheme: light dark;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F3EEE6;
  --text: #1E1A15;
  --muted: #5C5347;
  --line: #E6DED2;
  --field-line: #8B7F6E;
  --accent: #A04A00;
  --sun: #B86000;
  --error: #B3261E;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120E;
    --surface: #201C17;
    --surface-2: #2A251F;
    --text: #F2ECE3;
    --muted: #B5AA9A;
    --line: #3A332A;
    --field-line: #877B6A;
    --accent: #FFB454;
    --sun: #F5A524;
    --error: #FF8A7A;
  }
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* Site column: 880px, 16px sides below 600px, 24px from 600px. Prose 680px inside it. */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 600px) { .wrap { padding: 0 24px; } }
main.wrap { padding-top: 32px; padding-bottom: 48px; }
main p, main ul, main ol, main dl, main .table-wrap, main h2, main h3 { max-width: 680px; }

h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 16px; }
h2 { font-size: 1.375rem; line-height: 1.25; font-weight: 650; margin: 48px 0 12px; scroll-margin-top: 16px; }
h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 650; margin: 32px 0 8px; }
@media (min-width: 860px) { h2 { margin-top: 64px; } }
p, ul, ol { margin: 0 0 16px; }

a { color: var(--accent); text-underline-offset: 0.15em; transition: color 120ms; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.small, .src, .meta { font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.src a, .meta a { color: var(--accent); }
.nb { white-space: nowrap; } /* a source name or "data year 2024" never breaks inside itself */
.answer + .src { margin-bottom: 0; } /* the answer's source line and the meta line read as one block */
.answer + .src + .meta { margin-top: 2px; }
.meta { margin-top: 4px; }
.num, data { font-variant-numeric: tabular-nums; }
sup { line-height: 0; }

/* Skip link: the first focusable element, visible only on focus. */
.skip { position: absolute; left: 8px; top: -100px; z-index: 10; padding: 12px 16px; background: var(--surface); color: var(--accent); border-radius: 10px; }
.skip:focus { top: 8px; }

/* Header (not sticky). The wide inline nav starts at 860px; below that, the Menu. */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-weight: 650; text-decoration: none; }
.mark { width: 20px; height: 20px; flex: none; fill: var(--sun); }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--muted); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }

.menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0 8px; color: var(--accent); font-weight: 500;
}
.menu > summary::-webkit-details-marker { display: none; }
/* `.main-nav .menu-panel` outranks `.main-nav ul` (which zeroes list margins and padding) — the phone menu
   is an inset card, not an edge-to-edge list (Robert's M1 test, 12 Oct 2026). */
.main-nav .menu-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  margin: 4px 8px 0; padding: 4px 16px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.menu-panel li + li { border-top: 1px solid var(--line); }
.menu-panel a { display: flex; align-items: center; min-height: 48px; }
.nav-inline { display: none; }
@media (min-width: 860px) {
  .menu { display: none; }
  .nav-inline { display: flex; gap: 24px; font-size: 0.9375rem; font-weight: 500; }
  .nav-inline a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Footer: descriptor, independence line, footer nav. Never hidden at any width. */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; font-size: 0.875rem; line-height: 1.45; }
.site-footer p { margin: 0 0 4px; }
.descriptor { color: var(--text); }
.independence { color: var(--muted); }
.footer-nav { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 16px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* "On this page" (pages with 5 or more sections). */
.toc { margin: 24px 0 0; padding: 16px 20px; background: var(--surface); border-radius: 12px; max-width: 680px; }
.toc h2 { font-size: 0.875rem; margin: 0 0 4px; } /* design spec §5: 14px */
.toc ul { list-style: none; margin: 0; padding: 0; }
/* Block links with equal top and bottom padding: one-line and wrapped items are spaced the same, 44px+. */
.toc a { display: block; padding: 9px 0; }

/* Answer sentence (home). */
.answer { font-size: clamp(1.375rem, 1rem + 2vw, 2rem); line-height: 1.3; font-weight: 400; margin: 0 0 8px; }
.answer .num { font-weight: 650; }

/* Tables: real tables, hairline rows, numbers right-aligned. */
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-size: 0.875rem; line-height: 1.45; color: var(--muted); padding-bottom: 8px; }
th, td { text-align: left; vertical-align: top; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { padding-right: 0; } /* no gap after the last column: tables keep the full 288px at 320px */
th[scope="row"] { font-weight: 400; }
td.value { text-align: right; padding-right: 0; }
td.value .src { display: block; margin-top: 2px; }
.value-main { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Formulas and worked examples. */
.formula { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9375rem; background: var(--surface-2); border-radius: 10px; padding: 12px 16px; overflow-x: auto; max-width: 680px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (forced-colors: active) {
  .mark { fill: CanvasText; }
  .menu-panel, .toc { border: 1px solid CanvasText; }
}

/* ── Home: the meter (design spec §4.2) ─────────────────────────────────────────────────────────
   Positions that depend on the data are appended to this file by the build (src/home.js meterCss). */
.meter { margin: 32px 0 8px; max-width: none; }
.meter-chart { position: relative; }
.meter-row { position: relative; padding-bottom: 6px; font-size: 0.875rem; line-height: 1.35; color: var(--text); }
.meter-label { display: block; width: fit-content; }
.meter-label.align-right { margin-left: auto; text-align: right; }
.meter-label b { font-weight: 650; }
.meter-stem { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.meter-bar { display: block; height: 18px; }
.meter-track { fill: var(--line); }
.meter-fill { fill: var(--sun); }
.meter-marker { stroke: var(--text); stroke-width: 2; }
.meter-tick { stroke: var(--muted); stroke-width: 1; }
.meter-scale { position: relative; height: 1.6em; margin-top: 4px; font-size: 0.875rem; color: var(--muted); }
.meter-scale span { position: absolute; top: 0; white-space: nowrap; }
.meter-scale .t0 { left: 0; }
.meter-scale .t1 { left: 33.333%; transform: translateX(-50%); }
.meter-scale .t2 { left: 66.667%; transform: translateX(-50%); }
.meter-scale .t3 { right: 0; }
.meter figcaption, .history figcaption { margin-top: 12px; max-width: 680px; }

/* ── Home: the history chart (design spec §4.4) ── */
.history { margin: 16px 0 8px; }
.chart { position: relative; height: 200px; margin: 24px 56px 32px 0; }
@media (min-width: 600px) { .chart { height: 280px; } }
.chart svg { position: absolute; inset: 0; display: block; }
.chart .line { fill: none; stroke: var(--sun); stroke-width: 2; stroke-linejoin: round; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { font-family: var(--font); font-size: 14px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .dot { fill: var(--sun); }
.chart .lastlab { fill: var(--text); font-weight: 600; }
@media (max-width: 599px) { .chart .x-wide { display: none; } }
.chart .x-xwide { display: none; } /* a decade beside the last year (2020 by 2024): only where there is room */
@media (min-width: 860px) { .chart .x-xwide { display: inline; } }
.numbers-list { margin: 8px 0 0; max-width: 680px; }
/* Keep the browser's ▸/▾ marker (display: list-item, the default) and make the row 44px tall. */
.numbers-list > summary { display: list-item; min-height: 44px; padding: 9px 0; cursor: pointer; color: var(--accent); }
.numbers-list td, .numbers-list thead th { text-align: right; font-variant-numeric: tabular-nums; }
.numbers-list th[scope="row"], .numbers-list thead th:first-child { text-align: left; }

/* ── Home: "Go further" ── */
.next { list-style: none; padding: 0; }
.next li { margin: 0 0 16px; }
.next a { display: inline-flex; align-items: center; min-height: 44px; }
.next-line { display: block; color: var(--muted); font-size: 0.9375rem; }

/* ── Definition page (design spec §5) ── */
.lede strong { font-weight: 650; }
.quote { margin: 24px 0; max-width: 680px; }
.quote blockquote { margin: 0 0 0 16px; font-size: 1.125rem; }
.quote blockquote p { margin: 0 0 4px; }
.quote figcaption { margin-left: 16px; font-size: 0.875rem; color: var(--muted); }
/* Both tables fit a 288px column at 320px without sideways scrolling: smaller type, short status words,
   and every cell free to wrap at spaces (only the date and the one-word status stay whole). */
.timeline, .status-table { font-size: 0.9375rem; line-height: 1.4; }
.timeline td:first-child { white-space: nowrap; }
.status-table .status { font-weight: 600; white-space: nowrap; } /* scoped: the calculators' copy-status line must wrap */
.more { margin-top: -8px; }
.sources { padding-left: 1.5em; font-size: 0.9375rem; }
.sources li { margin-bottom: 8px; overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .meter-fill, .chart .dot { fill: Highlight; }
  .meter-track { stroke: CanvasText; stroke-width: 1; }
  .meter-marker { stroke: CanvasText; }
  .meter-stem { background: CanvasText; }
  .chart .line { stroke: Highlight; }
}

/* ── Calculators (design spec §6, §7; Google's unit converter: results update as you type) ────────
   Results keep a fixed structure: a value that can't be worked out shows "—", and a line with nothing
   to say is hidden with visibility (data-empty), never removed, so nothing moves under the thumb. */
.calc { max-width: none; }
.calc p, .calc ul, .calc dl, .calc h2 { max-width: none; }
.calc h2:first-child { margin-top: 32px; }
.noscript { padding: 12px 16px; background: var(--surface-2); border-radius: 10px; max-width: 680px; }
.not-game { font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
[data-empty] { visibility: hidden; }

.calc-grid, .dyson-grid { display: grid; gap: 16px; }
@media (min-width: 860px) {
  .calc-grid { grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  /* DOM order stays share → results → assumptions; the results take column 2 across both rows. */
  .dyson-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 24px; align-items: start; } /* Assumptions sits right under the chips */
  .dyson-main { grid-column: 1; grid-row: 1; }
  .dyson-result { grid-column: 2; grid-row: 1 / span 2; }
  .assumptions { grid-column: 1; grid-row: 2; }
}
@media (min-width: 860px) and (min-height: 760px) {
  .dyson-result { position: sticky; top: 16px; }
}

/* Fields: a visible label above, a 48px field, one reserved message line (two lines' room, so a long
   hint or error never pushes the page down). */
.field { margin: 0 0 8px; }
.field label { display: block; font-weight: 600; margin: 0 0 6px; }
.field-row { display: flex; align-items: center; gap: 8px; }
.field input, .field select {
  height: 48px; min-width: 0; font: inherit; font-size: 1.0625rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--field-line); border-radius: 10px;
}
.field input { flex: 1 1 auto; width: 100%; padding: 0 12px; font-variant-numeric: tabular-nums; }
.field select { flex: 0 0 96px; width: 96px; padding: 0 8px; }
/* The error border is 2px without moving anything: 1px border + a 1px ring. */
.field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.suffix { flex: none; color: var(--muted); }
.msg { min-height: 2.9em; margin: 6px 0 0; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.msg[data-state="error"] { color: var(--error); }

.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent); text-decoration: none; transition: background-color 120ms;
}

/* Result panels: fixed structure, values change in place. */
/* Each panel is a size container, so its rows lay out by the panel's own width, not the screen's. */
.result { background: var(--surface); border-radius: 12px; padding: 20px; container-type: inline-size; }
@media (min-width: 860px) { .result { padding: 24px; } }
.result p { margin: 0; }
.result-label { font-size: 0.875rem; color: var(--muted); }
/* Up to 44px inside a panel (the 56px page size would not fit "3.83 × 10²⁴ W" in a 356px panel). */
.result-headline { font-size: clamp(2.25rem, 1.75rem + 2vw, 2.75rem); line-height: 1.05; font-weight: 600; margin: 4px 0; overflow-wrap: anywhere; }
.result-headline output, .result output { font-variant-numeric: tabular-nums; }
.result-sub { min-height: 1.45em; }
.result-rows, .result-years { margin: 16px 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.result-years:first-child { margin-top: 0; padding-top: 0; border-top: 0; } /* the year panel opens with its list */
.result-rows > div, .result-years > div { padding: 8px 0; }
.result-rows dt, .result-years dt { color: var(--muted); font-size: 0.9375rem; }
.result-rows dd, .result-years dd { margin: 0; font-weight: 600; }
.result-years dd { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); line-height: 1.15; }
.result-line { display: block; font-weight: 400; font-size: 0.9375rem; color: var(--muted); }
.result-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 400; font-size: 0.9375rem; }
@container (min-width: 480px) {
  /* A wide panel puts the value right-aligned beside its label; a narrow one (phones, and each half of
     the wide two-column layout) keeps the label above the value. */
  .result-rows > div { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: baseline; }
  .result-rows dd { text-align: right; }
}
.result .src { margin-top: 12px; }
.start { margin: 8px 0 4px; }

/* Assumptions: one tap deeper (design spec §7.1). */
.assumptions { margin: 0; }
.assumptions > summary { display: list-item; min-height: 44px; padding: 9px 0; cursor: pointer; color: var(--accent); font-weight: 500; }
.assumptions[open] > summary { margin-bottom: 8px; }
.changed { color: var(--muted); font-weight: 400; }
.fixed { font-size: 0.875rem; color: var(--muted); }

/* Copy link and Reset: 44px targets; the status line keeps its height. */
.calc-actions { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; margin: 24px 0 0; }
.button {
  min-height: 44px; padding: 0 16px; font: inherit; color: var(--accent); cursor: pointer;
  background: var(--surface); border: 1px solid var(--field-line); border-radius: 10px;
}
.reset { display: inline-flex; align-items: center; min-height: 44px; }
.copy-status { flex-basis: 100%; min-height: 1.45em; margin: 4px 0 0; font-size: 0.875rem; color: var(--muted); }

/* Worked examples: a panel, formulas in plain text with <sub> and <sup>. */
.worked { background: var(--surface); border-radius: 12px; padding: 16px 20px 16px 2.5em; }
.worked li { margin: 0 0 8px; }
.worked li:last-child { margin-bottom: 0; }
.worked .src { display: block; }
sub { line-height: 0; }

@media (forced-colors: active) {
  .field input, .field select, .button, .chip, .result { border: 1px solid CanvasText; }
  .field input[aria-invalid="true"] { border-width: 2px; }
}

/* Generated by the build from data/derived.json: meter positions (design spec §4.2). */
.meter .lbl-sun{margin-right:31.39%;max-width:calc(68.61% - 12px)}
.meter .stem-sun{left:calc(68.61% - 1px)}
.meter .lbl-humanity{margin-left:24.35%;max-width:calc(44.26% - 12px)}
.meter .stem-humanity{left:calc(24.35% - 1px)}
