@font-face {
  font-family: Archivo;
  src: url("../assets/fonts/archivo-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f6f5ee;
  --ink: #182d27;
  --muted: #4d5c52;
  --line: #b8bdb0;
  --accent: #115c43;
  --baseline: #515b61;
  --gutter: clamp(1rem, 5vw, 5rem);
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.5 "IBM Plex Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #086daa; outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: absolute; left: 1rem; top: .5rem; background: white; padding: .5rem; z-index: 2; }
.masthead, footer { display: flex; align-items: center; flex-wrap: wrap; gap: 1.3rem; padding-inline: var(--gutter); }
.masthead { border-bottom: 1px solid var(--line); min-height: 3.8rem; justify-content: space-between; }
.brand { display: inline-flex; gap: .6rem; align-items: center; font: 750 1rem Archivo, sans-serif; text-transform: uppercase; letter-spacing: .13em; }
.brand-mark { width: 1.13rem; height: 1.13rem; border: 1.5px solid currentColor; border-radius: 50%; display: grid; place-items: center; transform: rotate(27deg); }
.brand-mark::after { content: ""; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; border-radius: 50%; width: .42rem; height: 100%; }
.masthead a, footer a { text-decoration: none; color: var(--ink); }
.masthead a:hover, footer a:hover { text-decoration: underline; }
nav { display: flex; gap: clamp(.8rem, 3vw, 2rem); font-size: .92rem; }
main { width: min(100%, 94rem); margin: auto; padding: 0 var(--gutter); }
.intro { margin: clamp(2rem, 5vw, 4.4rem) 0 2rem; }
.kicker, label { font: 650 .72rem/1.45 Archivo, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.kicker { color: var(--accent); margin: 0 0 .65rem; }
h1, h2, h3 { font-family: Archivo, system-ui, sans-serif; margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2.6rem, 6.5vw, 6rem); letter-spacing: -.055em; font-weight: 570; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.7rem); letter-spacing: -.04em; font-weight: 580; }
h3 { font-size: 1.17rem; letter-spacing: -.035em; font-weight: 650; }
.intro > p:last-child { max-width: 62ch; font-size: clamp(1rem, 1.55vw, 1.26rem); margin: .9rem 0 0; color: var(--muted); }
.controls { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: clamp(1rem, 3vw, 4rem); padding: 1.15rem 0; border-block: 1px solid var(--ink); }
label { display: block; margin-bottom: .42rem; color: var(--muted); }
input, button, select { font: inherit; color: var(--ink); }
button, select, input[type=text] { min-height: 2.75rem; border: 1px solid #939c8f; border-radius: .22rem; background: #fcfbf5; }
button, select { cursor: pointer; }
button { padding: .4rem .9rem; font-weight: 600; }
button:hover:enabled { background: #e3e8da; }
button:disabled { color: #768073; border-color: #c0c5bb; cursor: default; }
input[type=text], select { padding: .3rem .65rem; width: 100%; min-width: 0; }
.seed-entry, .day-input { display: flex; align-items: center; gap: .4rem; }
.seed-entry button { white-space: nowrap; }
.day-control label { display: flex; align-items: center; justify-content: space-between; }
.day-control output { color: var(--ink); letter-spacing: .035em; font-variant-numeric: tabular-nums; }
.day-input button { width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.27rem; }
input[type=range] { flex: 1; width: 100%; min-width: 0; height: 2.2rem; accent-color: var(--accent); cursor: pointer; }
.notice, .error { padding: .55rem .75rem; border-left: 3px solid #9b511c; background: #f8eddb; }
.error { margin: .5rem 0 0; font-size: .85rem; }
.results { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(1.7rem, 3.5vw, 3.2rem) 0; }
.plot-panel h2 { max-width: 18em; }
.caption, .ledger-context { color: var(--muted); margin: .4rem 0 1.2rem; }
.plot { width: 100%; margin-top: .9rem; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot text { font: 12px Archivo, sans-serif; fill: var(--muted); }
.plot .grid { stroke: #c9cdbf; stroke-width: 1; }
.plot .intervention { fill: #e7ece0; }
.plot .fork { stroke: #657561; stroke-dasharray: 2 3; }
.plot .cursor { stroke: #0d3928; stroke-width: 1.2; }
.plot .baseline, .plot .changed { stroke-width: 3; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.plot .changed { stroke: var(--accent); }
.plot .baseline { stroke: var(--baseline); stroke-dasharray: 6 5; stroke-width: 2; }
.legend { display: flex; gap: .4rem 1.25rem; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
.legend > span { display: inline-flex; align-items: center; gap: .45rem; }
.line { width: 1.6rem; border-top: 2px solid var(--accent); }
.line.lottery { border-top: 2px dashed var(--baseline); }
.reading { margin: .9rem 0 0; }
.summary { padding-left: clamp(1rem, 3vw, 3rem); border-left: 1px solid var(--line); }
.summary h2, .account h3, .household-history h3 { margin-bottom: 1rem; }
.summary .caption { font-size: .9rem; margin: .9rem 0 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .9rem; line-height: 1.35; }
th, td { padding: .62rem .28rem; border-bottom: 1px solid #d0d2c6; text-align: right; }
thead th { color: var(--muted); font-size: .82rem; font-weight: 600; border-bottom-color: var(--line); }
th:first-child { text-align: left; padding-left: 0; }
tbody th { font-weight: 400; }
tbody td { font-weight: 600; }
.ledger { border-block: 1px solid var(--ink); padding-block: clamp(1.7rem, 3vw, 3rem); }
.ledger-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.ledger-heading select { min-width: 12rem; }
.ledger-context { margin: .85rem 0 1.5rem; max-width: 62ch; }
.ledger-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 5vw, 6rem); }
.household-history { background: #e9ece1; padding: clamp(1rem, 2.5vw, 2rem); align-self: start; }
.household-history h3 { margin-bottom: .4rem; }
.household-history p:last-child { margin-bottom: 0; }
.actions, .method-links { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.4rem; }
.primary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover:enabled { background: #0d4834; }
.actions button span { margin-left: .5rem; }
#share-fallback { margin-top: .7rem; padding: .6rem; width: 100%; }
.method { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(1.5rem, 5vw, 7rem); padding-block: clamp(2rem, 5vw, 4.5rem); }
.method h2 { max-width: 13em; }
.method p:first-child { margin-top: 0; }
footer { background: #1c322a; color: #dee3d8; padding-block: 1rem; font-size: .85rem; }
footer a { color: white; }
footer a:last-child { margin-left: auto; }
@media (max-width: 820px) {
  .controls { gap: .8rem; grid-template-columns: 1fr 1fr; }
  .day-control { grid-column: 1 / -1; }
  .results { grid-template-columns: 1fr; }
  .summary { border: 0; padding: 0; }
}
@media (max-width: 600px) {
  .masthead { gap: .5rem; }
  .controls, .ledger-grid, .method { grid-template-columns: 1fr; }
  .day-control { grid-column: auto; }
  .ledger-heading { display: grid; }
  .ledger-heading select { min-width: 0; }
  .plot text { font-size: 13px; }
  .ledger-grid { gap: 1.25rem; }
  footer { gap: .75rem; }
}
