/* The Empty Chair — letterpress tokens (the site's own palette), light and dark.
   Chart hues: --warm = the old posture (providence, duty; the older machines),
   --cool = the modern posture (the therapeutic ending; GPT-2), --grey = the rest.
   Both pairs validated (adjacent + all-pairs CVD, contrast) against their surface. */
:root {
  --bg: #F3EADA;
  --surface: #EADFCB;
  --surface-2: #E2D5BE;
  --ink: #2B211A;
  --ink-2: #4A3D31;
  --muted: #65584A;
  --rule: #CDBBA0;
  --grid: #D8CAB1;
  --accent: #7A3B2E;
  --warm: #9A3F2C;
  --cool: #1C6B9E;
  --grey: #9A8F80;
  --warm-wash: rgba(154, 63, 44, 0.10);
  --cool-wash: rgba(28, 107, 158, 0.10);
  --guard-bg: #7A3B2E;
  --guard-ink: #F3EADA;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120E;
    --surface: #1E1811;
    --surface-2: #282016;
    --ink: #E6DAC8;
    --ink-2: #CDBFAA;
    --muted: #A69782;
    --rule: #3A2F23;
    --grid: #30271D;
    --accent: #D08A76;
    --warm: #CF6A52;
    --cool: #4D95CF;
    --grey: #7F7467;
    --warm-wash: rgba(207, 106, 82, 0.14);
    --cool-wash: rgba(77, 149, 207, 0.14);
    --guard-bg: #C4715C;
    --guard-ink: #16120E;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.load-guard {
  margin: 0;
  padding: 16px;
  background: var(--guard-bg);
  color: var(--guard-ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.masthead { padding: 40px 0 8px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.kicker {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 3.25rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dek { margin: 12px 0 20px; font-size: 1.2rem; font-style: italic; color: var(--ink-2); }
h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--accent);
}
h3 { margin: 0 0 8px; font-size: 1.2rem; line-height: 1.3; }

.prose p, p.prose { margin: 0 0 14px; }
.muted { color: var(--muted); }
.block { margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); }

.probe {
  margin: 16px 0 20px;
  padding: 16px 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  font-size: 1.25rem;
  line-height: 1.5;
  font-style: italic;
}
.probe p { margin: 0; }
.probe.small { font-size: 1.05rem; margin: 12px 0; }
.ellipsis { color: var(--muted); font-style: normal; }

.ask { margin: 8px 0 12px; }

/* The six ending cards */
.endings { display: grid; gap: 8px; margin: 0 0 16px; }
@media (min-width: 720px) { .endings { grid-template-columns: 1fr 1fr; } }
.ending {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.ending:hover { background: var(--surface-2); }
.ending[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.ending .letter {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-2);
}
.ending[aria-checked="true"] .letter { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.ending .words { flex: 1; min-width: 0; }
.ending .tag {
  display: none;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.revealed .ending .tag { display: block; }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.swatch.old { background: var(--warm); }
.swatch.modern { background: var(--cool); }
.swatch.other { background: var(--grey); }
.swatch.square { border-radius: 2px; }

.reveal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 8px; }
button.primary {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.keys { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
@media (hover: none) { .keys { display: none; } }

.readout { font-size: 1.1rem; margin: 18px 0 12px; }
.yours { padding: 10px 12px; background: var(--surface); border-radius: 6px; font-size: 1rem; }

/* Three ranked columns */
.columns { display: grid; gap: 20px; margin: 16px 0 16px; }
@media (min-width: 1040px) {
  .columns {
    grid-template-columns: repeat(3, 1fr);
    position: relative;
    width: 62rem;
    left: 50%;
    margin-left: -31rem;
  }
  .col .sub { min-height: 4.2em; }
}
.col {
  padding: 14px 14px 10px;
  background: var(--surface);
  border-radius: 8px;
  font-family: var(--sans);
}
.col h4 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.col .size { font-weight: 500; color: var(--muted); }
.col .sub { margin: 2px 0 10px; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.col ol { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; padding: 6px 0; border-top: 1px solid var(--grid); }
.row:first-child { border-top: 0; }
.row .rk { grid-row: 1 / span 2; font-weight: 700; font-size: 0.95rem; color: var(--muted); padding-top: 1px; }
.row.top .rk { color: var(--accent); }
.row .ex { font-size: 0.9375rem; line-height: 1.35; }
.row.top .ex { font-weight: 700; }
.row.mine .ex::after { content: " · your choice"; font-weight: 400; color: var(--accent); font-size: 0.8125rem; }
.barline { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.track { position: relative; flex: 1; height: 12px; }
.track::before { content: ""; position: absolute; left: 0; top: -2px; bottom: -2px; width: 1px; background: var(--ink-2); }
.fill { position: absolute; left: 1px; top: 2px; height: 8px; border-radius: 0 4px 4px 0; }
.fill.old { background: var(--warm); }
.fill.modern { background: var(--cool); }
.fill.other { background: var(--grey); }
.val { flex: none; width: 4.2em; text-align: right; font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.scale-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }

.howto { margin-top: 8px; font-size: 1rem; }
.see-limits { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; }

/* Variant tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.tab {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }

.variant { padding: 16px; background: var(--surface); border-radius: 8px; }
.v-endings { margin: 8px 0 12px; padding: 0; list-style: none; font-size: 0.95rem; }
.v-endings li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 4px 0; }
.v-endings .lt { font-family: var(--sans); font-weight: 700; color: var(--muted); font-size: 0.8125rem; padding-top: 2px; }
.v-endings .md { font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-right: 6px; }
.v-endings .changed { font-family: var(--sans); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-left: 6px; }

.figure { margin: 12px 0 8px; }
.figure figcaption { margin-top: 6px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.bump svg, .axis-svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-2); }
.legend > span { white-space: nowrap; }
.verdict .vp { white-space: nowrap; }

svg text { font-family: var(--sans); fill: var(--ink); }
svg .t-muted { fill: var(--muted); }
svg .t-ink2 { fill: var(--ink-2); }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .axis { stroke: var(--ink-2); stroke-width: 1; }
svg .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
svg .ln.old { stroke: var(--warm); }
svg .ln.modern { stroke: var(--cool); }
svg .ln.other { stroke: var(--grey); }
svg .dot { stroke: var(--surface); stroke-width: 2; }
svg .dot.old { fill: var(--warm); }
svg .dot.modern { fill: var(--cool); }
svg .dot.other { fill: var(--grey); }
svg .dot.ring { fill: var(--surface); stroke-width: 2.5; }
svg .dot.ring.old { stroke: var(--warm); }
svg .stem { stroke-width: 2; }
svg .stem.old { stroke: var(--warm); }
svg .stem.modern { stroke: var(--cool); }
svg .hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
svg .hitdot { fill: transparent; cursor: pointer; }
svg .dim { opacity: 0.22; }

.verdict { margin: 10px 0 6px; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; }
.verdict .q { display: block; color: var(--muted); font-size: 0.8125rem; }
.break-callout {
  margin: 10px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  font-size: 1rem;
}

.numbers { margin: 10px 0 0; font-family: var(--sans); font-size: 0.875rem; }
.numbers summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }
.table-wrap { max-width: 100%; }
table.nums { width: 100%; border-collapse: collapse; margin: 6px 0 10px; table-layout: fixed; }
table.nums th, table.nums td { padding: 5px 3px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; font-weight: 400; }
table.nums thead th { font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
table.nums td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.8125rem; }
table.nums th.n { text-align: right; }
table.nums caption { text-align: left; font-weight: 700; padding: 8px 0 2px; color: var(--ink); }
table.nums .first-col { width: 36%; }
@media (max-width: 380px) { .variant { padding: 12px 10px; } }
table.nums td.n .r { display: block; font-size: 0.75rem; color: var(--muted); }
table.nums td.n .v { display: block; }

/* Six questions */
.axes-legend { margin: 8px 0 4px; }
.axis-item { padding: 14px 0 10px; border-top: 1px solid var(--grid); }
.axis-item:first-child { border-top: 0; }
.axis-item h3 { font-size: 1.1rem; margin: 0 0 2px; }
.axis-item .q { margin: 0 0 8px; font-style: italic; color: var(--ink-2); }
.poles { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 2px; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.35; color: var(--ink-2); }
.poles .l { text-align: left; max-width: 48%; }
.poles .r { text-align: right; max-width: 48%; }

/* Free completions */
.completions { display: grid; gap: 14px; }
.stem-card { padding: 14px; background: var(--surface); border-radius: 8px; }
.stem-card h3 { font-size: 1.05rem; font-style: italic; margin: 0 0 8px; }
.pair { display: grid; gap: 10px; }
@media (min-width: 720px) { .pair { grid-template-columns: 1fr 1fr; } }
.cell { font-size: 0.975rem; line-height: 1.5; }
.cell .who { display: block; font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
.cell .stem { color: var(--muted); }
.cell.withheld .body { font-family: var(--sans); font-size: 0.875rem; font-style: italic; color: var(--muted); }
.bos, .bos-demo {
  display: inline-block;
  margin: 0 4px;
  padding: 0 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
}

/* What this does not show: always open, never folded */
.limits {
  margin: 44px 0 0;
  padding: 18px 18px 8px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 8px;
}
.limits h2 { margin-bottom: 10px; }
.limits ul { margin: 0; padding: 0 0 0 18px; }
.limits li { margin: 0 0 12px; font-size: 1rem; line-height: 1.55; }

.method { margin-top: 32px; }
.method summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-family: var(--sans); font-weight: 700; color: var(--accent); }
.method .prose { margin-top: 10px; font-size: 0.975rem; }

.foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.8125rem; }

.tip {
  position: fixed;
  z-index: 10;
  max-width: 260px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.4;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ranked:not([hidden]) { animation: rise 0.35s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media print {
  .load-guard, .reveal-row, .tabs, .keys, .tip { display: none !important; }
  .ranked[hidden] { display: block !important; }
  details { display: block; }
}
.changed-note { margin-top: 6px !important; font-family: var(--sans); font-style: normal; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }

/* Rank grid (replaces the line chart: separate machines, grouped by what they read) */
.ranks { margin: 4px 0 0; }
table.rankgrid { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--sans); table-layout: fixed; }
table.rankgrid th, table.rankgrid td { padding: 0; text-align: center; vertical-align: middle; }
table.rankgrid th.kind { width: 36%; text-align: left; font-weight: 400; font-size: 0.875rem; padding-right: 6px; overflow-wrap: normal; word-break: normal; }
table.rankgrid thead th { overflow-wrap: normal; word-break: normal; }
table.rankgrid col.c-kind { width: 36%; }
@media (max-width: 380px) { table.rankgrid tr.groups th { letter-spacing: 0.02em; font-size: 0.625rem; } table.rankgrid col.c-kind { width: 31%; } table.rankgrid .kl .swatch { display: none; } }
table.rankgrid col.c-gap { width: 14px; }
table.rankgrid .kl { display: flex; align-items: baseline; }
table.rankgrid .kl .swatch { flex: none; }
@media (max-width: 380px) { table.rankgrid th.kind { font-size: 0.8125rem; } }
table.rankgrid thead th.kind { font-size: 0.75rem; color: var(--muted); vertical-align: bottom; padding-bottom: 6px; }
table.rankgrid tr.groups th { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0 2px 4px; }
table.rankgrid tr.groups th.old { color: var(--warm); border-bottom: 2px solid var(--warm); }
table.rankgrid tr.groups th.modern { color: var(--cool); border-bottom: 2px solid var(--cool); }
table.rankgrid th.mhead { font-size: 0.8125rem; font-weight: 700; line-height: 1.25; padding: 6px 2px 6px; vertical-align: bottom; }
table.rankgrid .mread { display: block; font-weight: 400; font-size: 0.6875rem; color: var(--muted); }
table.rankgrid td.gap { width: 14px; border-left: 1px solid var(--rule); }
table.rankgrid tbody tr { height: 44px; }
table.rankgrid tbody th, table.rankgrid tbody td.rc { border-top: 1px solid var(--grid); }
table.rankgrid td.rc { height: 44px; }
table.rankgrid .rk { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--ink); background: transparent; border: 2px solid var(--grey); }
table.rankgrid .rk.old { background: var(--warm); border-color: var(--warm); color: var(--bg); }
table.rankgrid .rk.modern { background: var(--cool); border-color: var(--cool); color: var(--bg); }
table.rankgrid .rk.first { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
/* the legend swatch is drawn the way a first-choice cell is: a filled disc inside an outer ring */
.rk-demo { display: inline-block; width: 12px; height: 12px; margin: 0 8px 0 3px; border-radius: 50%; background: var(--grey); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); vertical-align: -1px; }
.note-callout {
  margin: 10px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--grey);
  background: var(--surface-2);
  font-size: 1rem;
}

/* Site chrome for the public copy on ashitaorbis.com (publish/publish.py appends this).
   A crumb back to the site and the project page, and the footer's links. Links are
   40 px tall so they stay easy to tap on a phone. */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 2px;
  padding: 8px 0 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  text-decoration: none;
}
.crumb a:hover { text-decoration: underline; }
.crumb .sep { padding: 0 2px; }
.crumb + .masthead { padding-top: 16px; }
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
/* With scripts off the summary below IS the page's content, so the load guard's "broken" message
   would contradict it; the summary only exists in the DOM when scripts are off, so with scripts on
   (or app.js blocked) the guard behaves exactly as before. */
body:has(.noscript-summary) .load-guard { display: none; }
.noscript-summary { margin: 24px 0 0; padding: 16px; border: 1px solid var(--rule); background: var(--surface); }
.noscript-summary h2 { font-size: 1.25rem; }
.noscript-summary .table-wrap { overflow-x: auto; }
.ns-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: var(--sans); font-size: 0.875rem; }
.ns-table caption { caption-side: top; text-align: left; padding: 0 0 6px; color: var(--muted); font-size: 0.8125rem; }
.ns-table th, .ns-table td { padding: 6px 8px; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ns-table thead th:first-child { width: 3.5em; }
@media (max-width: 359px) {
  .noscript-summary { padding: 12px 10px; }
  .ns-table { font-size: 0.8125rem; }
  .ns-table th, .ns-table td { padding: 4px 4px; }
}
@media print {
  .crumb { display: none; }
}
