:root {
  --paper: #f0f2f4; --ink: #281d1a; --sub: #373d49; --muted: #6b7280; --slate: #8b93a7;
  --code: #e2e4e9; --frame: #1f1235; --blue: #2f6fdb; --orange: #e8673a;
  --serif: "Fraunces", "Recoleta", ui-serif, Georgia, serif;
  --sans: "Karla", system-ui, -apple-system, sans-serif;
  --mono: Menlo, ui-monospace, SFMono-Regular, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font: 17px/1.6 var(--sans); }
a { color: inherit; text-decoration-color: var(--slate); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

header { position: sticky; top: 0; z-index: 5; height: 60px; background: var(--paper); border-bottom: 1px solid var(--slate); }
header .in { max-width: 1120px; margin: 0 auto; padding: 0 32px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.word { font: 400 26px var(--serif); font-variation-settings: "SOFT" 100, "opsz" 144; text-decoration: none; }
.icon-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 15px; }
nav.top { display: flex; align-items: center; gap: 26px; font-size: 15.5px; }
nav.top a:not(.icon-link) { text-decoration: none; }
nav.top a:not(.icon-link):hover, nav.top a[aria-current] { text-decoration: underline; text-decoration-color: var(--slate); }

.layout { display: grid; grid-template-columns: 300px minmax(0, 620px); gap: 0; padding: 0 32px; }
nav.toc { position: sticky; top: 92px; align-self: start; font-size: 14.5px; line-height: 1.45; padding-top: 30px; }
nav.toc a { display: block; text-decoration: none; padding: 1.5px 0; color: var(--ink); }
nav.toc a.sub { padding-left: 16px; }
nav.toc a.on { color: var(--blue); }

main { padding: 100px 0 120px; }
h1 { font: 400 64px/1 var(--serif); font-variation-settings: "SOFT" 100, "opsz" 144; margin: 0 0 40px; letter-spacing: -.5px; }
.blurb { font: 18px/28px var(--mono); margin: 0; }
.byline { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin: 120px 0 64px; gap: 16px; flex-wrap: wrap; }
h2 { font: 400 30px/48px var(--serif); font-variation-settings: "SOFT" 100, "opsz" 144; margin: 72px 0 12px; }
h3 { font: 400 24px/1.6 var(--sans); color: var(--sub); margin: 48px 0 8px; }
p, li { margin: 0 0 16px; }
ol, ul { padding-left: 28px; }
li::marker { color: var(--slate); }
code { font: 14px var(--mono); background: var(--code); padding: 2px 4px; border-radius: 2px; }
pre { position: relative; background: #fff; border: 2px solid var(--frame); border-radius: 6px; padding: 24px; overflow-x: auto; margin: 24px 0 32px; }
pre code { background: none; padding: 0; font-size: 14px; line-height: 1.7; }
pre .cm { color: var(--muted); }
.copy { position: absolute; top: 10px; right: 10px; background: var(--paper); border: 1px solid var(--slate); border-radius: 4px; padding: 4px 8px; cursor: pointer; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; font: 13px var(--sans); }
blockquote { margin: 24px 0; padding: 0 0 0 18px; border-left: 3px solid var(--slate); color: #5a6478; }
figure { margin: 40px 0; }
figure img { width: 100%; display: block; mix-blend-mode: multiply; }
figcaption { font-size: 14.5px; color: var(--muted); margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 24px 0 8px; }
th, td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid #d5d9e0; vertical-align: top; }
th { font-weight: 600; color: var(--sub); }
td:first-child { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.verdict { white-space: nowrap; }

/* the analogue picker */
.widget { margin: 40px 0 48px; }
.widget .call { font: 17px var(--mono); text-align: center; margin-bottom: 22px; }
.strip { display: grid; grid-template-columns: repeat(16, 1fr); gap: 8px; }
.cell { aspect-ratio: 1 / 1.45; border: 1.5px solid var(--slate); border-radius: 6px; background: #fff; position: relative; transition: background .2s, border-color .2s; }
.cell.dash { border-style: dashed; background: none; }
.cell.now { border-color: var(--ink); border-width: 2px; background: var(--ink); }
.cell.pick { background: var(--blue); border-color: var(--blue); }
.cell.blocked { background: repeating-linear-gradient(135deg, #fff 0 3px, #dfe3ea 3px 5px); }
.cell i { position: absolute; left: 0; right: 0; bottom: 5px; margin: 0 auto; width: 5px; background: var(--slate); border-radius: 2px; }
.cell.pick i { background: #fff; }
.axis { display: flex; justify-content: space-between; font: 12.5px var(--mono); color: var(--muted); margin-top: 8px; }
.controls { display: flex; gap: 22px; justify-content: center; margin-top: 22px; flex-wrap: wrap; font-size: 15px; }
.controls label { display: flex; gap: 10px; align-items: center; }
.controls input { accent-color: var(--ink); }
.controls input[type=range] { width: 92px; }
[hidden] { display: none !important; }
.controls output { font-family: var(--mono); min-width: 1.5em; }
.legend { display: flex; gap: 18px; justify-content: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend b { width: 12px; height: 15px; border: 1.5px solid var(--slate); border-radius: 3px; display: inline-block; background: #fff; }
.legend b.pick { background: var(--blue); border-color: var(--blue); }
.legend b.blocked { background: repeating-linear-gradient(135deg, #fff 0 3px, #dfe3ea 3px 5px); }
.legend b.dash { border-style: dashed; background: none; }
.legend b.now { background: var(--ink); border-color: var(--ink); }

.links { display: flex; gap: 22px; flex-wrap: wrap; margin: 24px 0; }
.links a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; border-bottom: 1px solid var(--slate); padding-bottom: 2px; }
footer { color: var(--muted); font-size: 14px; border-top: 1px solid #d5d9e0; margin-top: 96px; padding-top: 24px; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 22px; }
  nav.toc { display: none; }
  main { padding-top: 56px; }
  h1 { font-size: 46px; }
  .byline { margin: 64px 0 40px; }
  .strip { gap: 4px; }
}

/* paper viewer */
.mode { display: inline-flex; border: 1.5px solid var(--slate); border-radius: 4px; overflow: hidden; }
.mode button { background: #fff; border: 0; padding: 5px 10px; font: 14px var(--sans); cursor: pointer; color: var(--ink); }
.mode button[aria-pressed=true], .mode button[aria-selected=true] { background: var(--ink); color: var(--paper); }
.viewer { border: 2px solid var(--frame); border-radius: 6px; background: #fff; margin: 24px 0 32px; overflow: hidden; }
.vbar { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-bottom: 1px solid #d5d9e0; flex-wrap: wrap; font-size: 14px; }
.vpage { color: var(--muted); font-family: var(--mono); font-size: 13px; flex: 1; }
.vtools { display: inline-flex; align-items: center; gap: 8px; }
.vtools button, .vtools a { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--slate); border-radius: 4px; padding: 4px 8px; color: var(--ink); text-decoration: none; cursor: pointer; font: 13px var(--sans); }
.vtools output { font: 13px var(--mono); min-width: 3.2em; text-align: center; }
.vpages { height: min(78vh, 900px); overflow: auto; background: #e3e6eb; padding: 18px; display: flex; flex-direction: column; gap: 16px; outline: none; }
.vsheet { background: #fff; box-shadow: 0 1px 3px rgba(31, 18, 53, .18); flex: none; margin: 0 auto; } /* auto margins, unlike align-items: center, never clip an overflowing page */
.vsheet canvas { width: 100%; height: 100%; display: block; }
.vmsg { color: var(--muted); font-size: 15px; margin: 40px 0; }
