/* miltonbot.ai. One stylesheet, no scripts, nothing loaded from elsewhere. */

:root {
  --paper: #fbfaf6;
  --surface: #f2f0e8;
  --ink: #1b1d1b;
  --muted: #59605a;
  --rule: #d6d3c7;
  --accent: #1f5a45;
  --wash: rgba(31, 90, 69, 0.14);
  --hover: rgba(27, 29, 27, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101311;
    --surface: #181c19;
    --ink: #e8e6df;
    --muted: #a3a9a2;
    --rule: #2d342f;
    --accent: #7fc8a6;
    --wash: rgba(127, 200, 166, 0.2);
    --hover: rgba(232, 230, 223, 0.08);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap { display: block; max-width: 72rem; margin-inline: auto; padding-inline: 1.5rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 2; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; margin-bottom: 0.9rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
h4 { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.2rem 0 0.4rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
code { font-family: var(--mono); font-size: 0.82em; overflow-wrap: anywhere; }

/* Masthead */
.masthead { border-top: 5px solid var(--accent); border-bottom: 3px double var(--rule); }
.masthead-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.1rem 0.9rem; }
.brand { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; }
.wordmark { font-size: 1.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.tagline { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }
.masthead nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.masthead nav a { font-family: var(--sans); font-size: 0.92rem; color: var(--ink); text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.masthead nav a:hover { border-bottom-color: var(--rule); }
.masthead nav a[aria-current="page"] { border-bottom-color: var(--accent); }

.notice { margin: 0; background: var(--surface); border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 0.86rem; color: var(--muted); padding-block: 0.55rem; }
.notice strong { color: var(--ink); }

main { padding-block: 2.75rem 4rem; }

/* Shared pieces */
.kicker { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 0 0 0.8rem; }
.kicker a { color: inherit; }
.standfirst { font-size: 1.18rem; line-height: 1.5; color: var(--muted); max-width: var(--measure); }
.facts { font-family: var(--sans); font-size: 0.98rem; font-variant-numeric: tabular-nums; margin: 1rem 0 1.2rem; }
.source, .aside { font-family: var(--sans); font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.source { margin-top: 0.6rem; }
.aside { border-left: 2px solid var(--rule); padding-left: 0.8rem; }
.held { display: block; font-family: var(--sans); font-size: 0.8rem; font-weight: 400; color: var(--muted); }
h3 .held { display: inline; margin-left: 0.4rem; }
.tag { font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; border: 1px solid currentColor; border-radius: 2px; padding: 0.05rem 0.3rem; white-space: nowrap; }
.figures td .tag { display: block; width: max-content; margin: 0.25rem 0 0 auto; }
.empty { font-size: 1.18rem; color: var(--muted); }
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: 0.6rem; }
.url { overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.82em; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; font-family: var(--sans); font-size: 0.95rem; margin-top: 1.4rem; }
.button { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--paper); text-decoration: none; padding: 0.55rem 1rem; border-radius: 2px; font-family: var(--sans); font-size: 0.95rem; }
.button:hover { background: transparent; color: var(--accent); }

.page-head { margin-bottom: 2.2rem; }
.page-head h1 { max-width: 22ch; margin-bottom: 1rem; }

.band { border-top: 1px solid var(--rule); padding-block: 2.2rem; }
.band:last-child { padding-bottom: 0; }

/* Home */
.lead { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2.5rem 3rem; align-items: start; padding-bottom: 2.75rem; }
.lead h1 { max-width: 20ch; }
.card { border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 1.1rem 1.2rem 0.4rem; background: var(--surface); font-family: var(--sans); font-size: 0.92rem; }
.card-figure { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; font-weight: 600; margin-bottom: 0.4rem; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 2.5rem; }
.pillars h2 { font-size: 1.2rem; }
.pillars p { font-size: 1rem; }
.purpose p { max-width: var(--measure); }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem 2rem; }
.charts.single { max-width: 30rem; }
figure { margin: 0; }
figcaption { font-family: var(--sans); font-size: 0.84rem; font-weight: 600; margin-bottom: 0.5rem; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--rule); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-family: var(--sans); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-band { fill: var(--wash); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.chart-ref { stroke: var(--muted); stroke-width: 1; }
.chart-label { fill: var(--ink); font-family: var(--sans); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: var(--hover); }

/* Tables */
.scroll { overflow-x: auto; }
.figures { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; font-variant-numeric: tabular-nums; line-height: 1.4; }
.figures th, .figures td { padding: 0.5rem 0.75rem; text-align: right; vertical-align: top; border-bottom: 1px solid var(--rule); }
.figures th:first-child, .figures td:first-child { text-align: left; padding-left: 0; }
.figures th:last-child, .figures td:last-child { padding-right: 0; }
.figures thead th { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--ink); vertical-align: bottom; }
.figures tbody th { font-weight: 600; white-space: nowrap; }
.figures td { white-space: nowrap; }
.figures .left { text-align: left; }
.figures.signals td.left, .figures.steps td.left { white-space: normal; }
.figures .links a { margin-right: 0.9rem; white-space: nowrap; }
.figures .chosen th, .figures .chosen td, .figures td.own { background: var(--wash); }
.figures .chosen th:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 0.6rem; }
.figures.compact th, .figures.compact td { padding-block: 0.4rem; }
.figures.narrow { max-width: 34rem; }
.figures.signals tbody th { white-space: normal; }
.figures.steps td:nth-child(2) { white-space: nowrap; }
.figures.signals td.left:last-child { min-width: 16rem; }

/* Meeting pages */
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0; margin: 0 0 2.5rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.keyfacts div { padding: 0.9rem 1rem 0.9rem 0; }
.keyfacts dt { font-family: var(--sans); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.keyfacts dd { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 2.5rem 4rem; align-items: start; }
.statement, .prose { max-width: var(--measure); }
.statement p { font-size: 1.12rem; line-height: 1.65; overflow-wrap: anywhere; }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child, .statement h2 { margin-top: 0; }
.formula { font-family: var(--sans); font-size: 0.95rem; background: var(--surface); border-left: 3px solid var(--accent); padding: 0.9rem 1rem; }
.sidebar section { border-top: 1px solid var(--ink); padding-block: 1rem 1.4rem; }
.sidebar h2 { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 0.7rem; }
.sidebar p, .sidebar li { font-size: 0.98rem; }

.pager { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1.2rem; font-family: var(--sans); font-size: 0.95rem; }

/* Record pages */
.contents { font-family: var(--sans); font-size: 0.92rem; margin-bottom: 2rem; }
.contents ol { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; padding-left: 1.2rem; margin: 0; }
.briefing, .ballot, .speech { max-width: 52rem; padding-block: 1.2rem; border-top: 1px solid var(--rule); }
.band > h2 + .briefing, .band > .standfirst + .ballot, .band > h2 + .ballot, .band > h2 + .speech { border-top: 0; padding-top: 0.2rem; }
.briefing > p, .ballot > p, .speech > p { max-width: var(--measure); overflow-wrap: anywhere; }
.vote-line { font-family: var(--sans); font-size: 0.95rem; }
.plainfacts { font-family: var(--sans); font-size: 0.92rem; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.5rem 1.5rem; margin: 0; }
.plainfacts dt { color: var(--muted); }
.plainfacts dd { margin: 0; }

/* Committee and simulations */
.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 2.5rem; }
.seat { border-top: 1px solid var(--rule); padding-block: 1.1rem 0.6rem; }
.seat p { font-size: 1rem; }
.seat .held { margin-bottom: 0.6rem; }
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0.5rem 3rem; }
.prose-grid > h2 { grid-column: 1 / -1; }
.prose-grid article { border-top: 1px solid var(--rule); padding-block: 1.1rem 0.4rem; }
.prose-grid p { font-size: 1rem; }

/* Footer */
.colophon { border-top: 3px double var(--rule); font-family: var(--sans); font-size: 0.84rem; color: var(--muted); padding-block: 1.6rem 2.5rem; }
.colophon p { margin: 0 0 0.4rem; }

@media (max-width: 56rem) {
  .lead, .columns { grid-template-columns: minmax(0, 1fr); }
  .card { max-width: 24rem; }
}

@media (max-width: 36rem) {
  body { font-size: 1rem; }
  .wrap { padding-inline: 1.1rem; }
  main { padding-block: 2rem 3rem; }
  .wordmark { font-size: 1.45rem; }
  .masthead nav ul { gap: 0.1rem 1.1rem; }
  .keyfacts dd { font-size: 1.15rem; }
}

@media print {
  .masthead nav, .actions, .pager, .contents, .skip { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}
