:root {
  --paper: #f5f6f8;
  --ink: #17202b;
  --muted: #5b6675;
  --rule: #d5dae1;
  --panel: #ffffff;
  --blue: #2450b8;
  --red: #b3302a;
  --amber: #a86a12;
  --green: #2c774a;
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13171d;
    --ink: #e6eaef;
    --muted: #9aa4b2;
    --rule: #2c333d;
    --panel: #1a1f27;
    --blue: #7ea2ff;
    --red: #ff7a70;
    --amber: #e8a948;
    --green: #6fcf97;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--body); }
a { color: var(--blue); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.masthead, main, footer { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.masthead { display: flex; justify-content: space-between; align-items: baseline; padding-top: 1.5rem; }
.masthead a { text-decoration: none; }
.brand { font: 600 1.05rem/1 var(--display); color: var(--blue); letter-spacing: .02em; }
.masthead nav a { color: var(--muted); font-size: .95rem; margin-left: 1.25rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 1rem; max-width: 22ch; }
h2 { font-size: 1.6rem; line-height: 1.15; margin: 0 0 .5rem; }
h3 { font-size: 1.2rem; line-height: 1.25; margin: 0 0 .5rem; }
p, li { max-width: 68ch; }
code { font: .88em var(--mono); background: var(--panel); border: 1px solid var(--rule); padding: .08em .35em; border-radius: 3px; }
pre { font: 14px/1.5 var(--mono); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: .9rem 1rem; overflow-x: auto; max-width: 68ch; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------- Index ---------- */
.home-intro { padding: 4rem 0 2.5rem; }
.home-intro p { color: var(--muted); font-size: 1.1rem; }
.post-list { list-style: none; padding: 0; margin: 0 0 4rem; border-top: 2px solid var(--ink); }
.post-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); max-width: none; }
.post-list a { text-decoration: none; }
.post-list h2 { color: var(--ink); margin-bottom: .35rem; }
.post-list a:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.post-list p { color: var(--muted); margin: 0; }
.post-list time { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }

/* ---------- Article ---------- */
.article-head { padding: 3.5rem 0 2rem; border-bottom: 2px solid var(--ink); margin-bottom: 2.5rem; }
.article-head .lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.25rem; }
.article-head .meta { font-size: .92rem; color: var(--muted); margin: 0; }

.layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3.5rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: .95rem; }
.toc p { font-weight: 600; margin: 0 0 .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }

.prose > p, .prose > ul { margin: 0 0 1.1rem; }
.scenario { background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--amber); padding: 1.1rem 1.25rem; border-radius: 4px; margin: 0 0 2.5rem; max-width: 68ch; }
.scenario p { margin: 0; }
.scenario p + p { margin-top: .6rem; }

.phase { margin: 3.5rem 0 0; scroll-margin-top: 1.5rem; }
.phase-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.phase-head span { font: 600 .95rem/1 var(--display); color: var(--muted); white-space: nowrap; }
.phase-intro { color: var(--muted); margin: 0 0 1.5rem; }

/* The steps are a true sequence, so they're numbered continuously across phases. */
.prose { counter-reset: step; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { counter-increment: step; position: relative; padding: 0 0 2.25rem 4rem; max-width: none; }
.step::before {
  content: counter(step);
  position: absolute; left: 0; top: -.2rem;
  font: 700 2.2rem/1 var(--display);
  color: var(--ink);
  width: 3rem; text-align: right;
}
.step::after { content: ""; position: absolute; left: 3.35rem; top: .4rem; bottom: .6rem; border-left: 1px solid var(--rule); }
.step > * { margin-left: .5rem; }
.step p, .step ul { margin-top: 0; margin-bottom: .75rem; }
.step ul { padding-left: 1.2rem; }
.step li { margin-bottom: .3rem; }

.where { font-size: .95rem; color: var(--muted); }
.where strong { color: var(--ink); font-weight: 600; }
.caution { border-left: 3px solid var(--red); padding: .1rem 0 .1rem .9rem; font-size: .95rem; }
.m365 { font-size: .92rem; color: var(--muted); border-top: 1px dashed var(--rule); padding-top: .5rem; }
.m365 strong { color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 0 0 1.5rem; }
.table-wrap { overflow-x: auto; max-width: 68ch; }
th, td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; border-bottom: 2px solid var(--ink); }

.checklist { list-style: none; padding: 0; columns: 2 18rem; column-gap: 2.5rem; }
.checklist li { break-inside: avoid; padding-left: 1.6rem; position: relative; margin-bottom: .5rem; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .3rem; width: .9rem; height: .9rem; border: 2px solid var(--ink); border-radius: 2px; }

.cta { margin: 3rem 0 0; padding: 1.25rem 0; border-top: 2px solid var(--ink); }

footer { margin-top: 5rem; padding-bottom: 2.5rem; font-size: .9rem; color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; margin-bottom: 2rem; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .step { padding-left: 3rem; }
  .step::before { font-size: 1.7rem; width: 2.2rem; }
  .step::after { left: 2.55rem; }
  .masthead nav a { margin-left: .9rem; }
}
@media print {
  .masthead nav, .toc, footer { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
}
