:root {
  --paper: #f6f3ec;
  --card: #fffdf8;
  --ink: #1b1a17;
  --muted: #5d5a52;
  --rule: #d9d3c4;
  --accent: #8a2c1d;
  --good: #2f5d3a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161512; --card: #1e1c18; --ink: #ece7dc; --muted: #a59f92;
    --rule: #3a362f; --accent: #e08a72; --good: #8cc49a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--sans);
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font: 600 18px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--accent); }
nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 15px; }
nav a:first-child { margin-left: 0; }
nav a:hover, nav a[aria-current] { color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.005em; }
h1 { font-size: clamp(32px, 6vw, 50px); margin: 56px 0 16px; max-width: 18ch; }
h2 { font-size: 28px; margin: 64px 0 8px; }
h3 { font-size: 20px; margin: 28px 0 6px; }
.lede { font-size: 20px; color: var(--muted); max-width: 60ch; margin: 0 0 8px; }
p, li { max-width: 68ch; }
a { color: var(--accent); }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 56px; }
.kicker + h1, .kicker + h2 { margin-top: 10px; }
.note { font-size: 14px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 56px 0; }

/* calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); background: var(--card); margin-top: 20px; }
.calc .inputs { padding: 20px; border-right: 1px solid var(--rule); }
.calc .outputs { padding: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field small { display: block; font-size: 13px; color: var(--muted); }
.field input { width: 100%; font: 16px var(--mono); padding: 8px 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 2px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.result { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); gap: 12px; }
.result:last-of-type { border-bottom: 0; }
.result .k { font-size: 15px; }
.result .v { font: 600 22px/1 var(--mono); white-space: nowrap; }
.result.big .v { font-size: 30px; color: var(--accent); }
.working { font: 13px/1.5 var(--mono); color: var(--muted); background: var(--paper); border: 1px dashed var(--rule); padding: 12px; margin-top: 12px; white-space: pre-wrap; }

/* leaderboard */
.scroll { overflow-x: auto; margin-top: 16px; border: 1px solid var(--rule); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 180px; }
thead th { white-space: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; vertical-align: bottom; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); }
td .sub { display: block; font-size: 13px; color: var(--muted); }
td.zero { color: var(--good); font-weight: 600; }
td.bad { color: var(--accent); font-weight: 600; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.legend b { color: var(--ink); }

.offer { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin-top: 24px; }
.offer .price { font: 600 24px var(--serif); }
.button { display: inline-block; background: var(--ink); color: var(--paper); padding: 10px 18px; text-decoration: none; font-weight: 600; font-size: 15px; border-radius: 2px; margin-top: 8px; }
.button:hover { background: var(--accent); }

article h2 { margin-top: 44px; }
article table td, article table th { white-space: normal; text-align: left; }

footer { border-top: 1px solid var(--rule); margin-top: 80px; padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
footer a { color: var(--muted); }

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
  .calc .inputs { border-right: 0; border-bottom: 1px solid var(--rule); }
  nav { width: 100%; }
  nav a { margin-left: 14px; }
  h1 { margin-top: 36px; }
}
