/* Odysseus: product site, guide and textbook. One stylesheet, no scripts.
   The family: warm near-black and off-white, one typeface, an italic serif on the word that matters. */
:root {
  /* Paper: warm off-white, warm near-black ink, no accent colour. Colour is kept for meaning: proven, partial, not yet. */
  --paper: #f6f4ef;
  --paper-2: #eeebe3;
  --paper-3: #e4e0d6;
  --ink: #0a0908;
  --ink-2: #55504a;
  --ink-3: #7d766e;
  --rule: #d9d4c9;
  --accent: #0a0908;
  --accent-ink: #f6f4ef;
  --accent-soft: #e9e5db;
  --ok: #2f5d44;
  --ok-soft: #e2ecdf;
  --warn: #7a5716;
  --warn-soft: #f1e8d2;
  --bad: #8a3327;
  --bad-soft: #f2dfd9;
  --shadow: 0 1px 2px rgba(10, 9, 8, 0.05), 0 18px 40px -18px rgba(10, 9, 8, 0.22);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans);
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --wide: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Night */
    --paper: #0a0908;
    --paper-2: #141210;
    --paper-3: #1d1a17;
    --ink: #f6f4ef;
    --ink-2: #b6afa5;
    --ink-3: #9b948b;
    --rule: #2b2723;
    --accent: #f6f4ef;
    --accent-ink: #0a0908;
    --accent-soft: #1c1916;
    --ok: #9fcbae;
    --ok-soft: #14201a;
    --warn: #dcc08a;
    --warn-soft: #231d12;
    --bad: #e3a79b;
    --bad-soft: #261714;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 22px 48px -20px rgba(0, 0, 0, 0.8);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.68;
  letter-spacing: -0.003em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-thickness: 2px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--paper-2); padding: 0.08em 0.32em; border-radius: 4px; }
pre { background: var(--paper-2); border: 1px solid var(--rule); padding: 14px 16px; overflow-x: auto; line-height: 1.55; border-radius: 8px; }
pre code { background: none; padding: 0; }
:not(pre) > code { overflow-wrap: anywhere; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 14.5px;
}
.masthead-inner { max-width: var(--wide); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; gap: 28px; align-items: center; }
.masthead .brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: 0.3em; text-transform: uppercase; }
.brand svg { width: 20px; height: 20px; color: var(--ink); flex: none; }
.masthead nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.masthead nav a { color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.masthead nav a:hover { color: var(--ink); background: var(--paper-2); }
.masthead nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.masthead nav a.go { background: var(--accent); color: var(--accent-ink); font-weight: 500; margin-left: 8px; padding: 7px 14px; }
.masthead nav a.go:hover { background: var(--accent); filter: brightness(1.12); }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 15.5px; font-weight: 500; padding: 12px 20px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; line-height: 1.2; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { border-color: var(--rule); color: var(--ink); background: var(--paper); }
.btn.ghost:hover { border-color: var(--ink-3); }
.chip { display: inline-block; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.live { background: var(--ok-soft); color: var(--ok); }
.chip.part { background: var(--warn-soft); color: var(--warn); }
.chip.open { background: var(--bad-soft); color: var(--bad); }
.eyebrow { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 18px; }

/* ---------- Landing ---------- */
.band { padding: 88px 24px; }
.band.tint { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band > .in { max-width: var(--wide); margin: 0 auto; }
.band h2 { font-size: clamp(1.9em, 3.8vw, 2.7em); line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 18px; font-weight: 500; text-wrap: balance; max-width: 18em; }
.band .lead { font-size: 1.12em; color: var(--ink-2); max-width: 38em; margin: 0 0 40px; text-wrap: pretty; }

.hero { padding: 72px 24px 80px; }
.hero > .in { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(2.6em, 6vw, 4.6em); line-height: 1; letter-spacing: -0.035em; margin: 0 0 24px; font-weight: 500; text-wrap: balance; }
h1 em, h2 em, .big em { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.hero .sub { font-size: 1.2em; color: var(--ink-2); margin: 0 0 30px; max-width: 30em; text-wrap: pretty; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fine { font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); margin: 22px 0 0; max-width: 36em; line-height: 1.5; }
.hero .fine a { color: var(--ink-2); }

/* A chat, drawn in HTML */
.phone { background: var(--paper); border: 1px solid var(--rule); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; font-family: var(--sans); font-size: 14.5px; line-height: 1.45; max-width: 430px; margin-left: auto; width: 100%; }
.phone .bar { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.phone .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.phone .avatar svg { width: 18px; height: 18px; }
.phone .who { font-weight: 600; line-height: 1.2; }
.phone .who small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.phone .thread { padding: 16px 14px 18px; display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--rule); border-bottom-left-radius: 5px; }
.msg .meta { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--rule); font-size: 12.5px; color: var(--ink-2); }
.msg.ask { background: var(--paper); border: 1px solid var(--ink-3); width: 86%; }
.msg.ask b { display: block; margin-bottom: 5px; }
.msg.ask .lines { color: var(--ink-2); font-size: 13.5px; }
.msg.ask .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.msg.ask .keys span { text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13.5px; }
.msg.ask .keys .y { background: var(--ok-soft); color: var(--ok); }
.msg.ask .keys .n { background: var(--paper-2); color: var(--ink-2); }

/* Honest status strip */
.strip { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper-2); padding: 18px 24px; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; }
.strip > div { max-width: var(--wide); margin: 0 auto; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; color: var(--ink-2); }
.strip b { color: var(--ink); font-weight: 600; }

/* Capability cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 22px 20px; display: flex; flex-direction: column; }
.band.tint .card { background: var(--paper); }
.card .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.card .ico svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.1em; margin: 0 0 7px; font-weight: 600; letter-spacing: -0.005em; }
.card p { font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 16px; }
.card .chip { margin-top: auto; align-self: flex-start; }

/* The gate */
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.answers { display: grid; gap: 12px; }
.answer { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: baseline; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.answer .k { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.answer.allow .k { color: var(--ok); } .answer.ask .k { color: var(--warn); } .answer.refuse .k { color: var(--bad); }
.answer p { margin: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.answer p b { color: var(--ink); font-weight: 600; }
.note { border-left: 3px solid var(--bad); background: var(--bad-soft); padding: 16px 20px; border-radius: 0 10px 10px 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; margin-top: 22px; }
.note b { color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 26px 0 0; font-family: var(--sans); font-size: 15px; }
.checks li { padding: 9px 0 9px 28px; position: relative; border-top: 1px solid var(--rule); margin: 0; color: var(--ink-2); }
.checks li b { color: var(--ink); font-weight: 600; }
.checks li::before { content: ""; position: absolute; left: 3px; top: 17px; width: 11px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }

/* Measured numbers */
.figures { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--paper); }
.figure { padding: 24px 20px; border-right: 1px solid var(--rule); }
.figure:last-child { border-right: 0; }
.figure .v { font-size: 1.9em; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure .l { font-family: var(--sans); font-size: 13px; line-height: 1.4; color: var(--ink-2); margin-top: 8px; }
.caption { font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); margin-top: 14px; max-width: 60em; }

/* Three steps */
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.steps3 > div { border-top: 2px solid var(--ink); padding-top: 18px; counter-increment: s; }
.steps3 > div::before { content: "0" counter(s); font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; }
.steps3 h3 { font-size: 1.14em; margin: 6px 0 6px; font-weight: 600; }
.steps3 p { font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0; }

/* Book and log teasers */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tile { border: 1px solid var(--rule); border-radius: 14px; padding: 28px; background: var(--paper); text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--ink-3); }
.tile h3 { font-size: 1.3em; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.tile p { font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 14px; }
.tile .more { font-family: var(--sans); font-size: 14.5px; font-weight: 500; color: var(--accent); }
.loglist { list-style: none; padding: 0; margin: 0; font-family: var(--sans); }
.loglist li { display: block; padding: 14px 0; border-top: 1px solid var(--rule); margin: 0; }
.loglist li:first-child { border-top: 0; padding-top: 0; }
.loglist .when { display: block; font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; margin-bottom: 2px; }
.loglist a { font-family: var(--serif); font-weight: 600; font-size: 1.02em; text-decoration: none; color: var(--ink); line-height: 1.3; }
.loglist a:hover { color: var(--accent); }
.loglist .sum { display: block; font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 3px; }

.closing { text-align: center; padding: 96px 24px; }
.closing h2 { margin: 0 auto 14px; max-width: 18em; }
.closing p { color: var(--ink-2); max-width: 34em; margin: 0 auto 28px; }
.closing .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Guide (deploy page) ---------- */
.guide { max-width: 880px; margin: 0 auto; padding: 56px 24px 96px; }
.guide > header { border-bottom: 1px solid var(--rule); padding-bottom: 28px; margin-bottom: 8px; }
.guide h1 { font-size: clamp(2.1em, 4.6vw, 3em); line-height: 1.06; letter-spacing: -0.024em; margin: 0 0 14px; font-weight: 600; text-wrap: balance; }
.guide .lede { font-size: 1.14em; color: var(--ink-2); margin: 0; max-width: 36em; text-wrap: pretty; }
.guide h2 { font-size: 1.5em; line-height: 1.2; margin: 2.4em 0 0.5em; font-weight: 600; letter-spacing: -0.012em; }
.guide h3 { font-size: 1.08em; margin: 1.6em 0 0.3em; font-weight: 600; }
.guide p, .guide li { text-wrap: pretty; }
.stage { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 20px; margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--rule); }
.stage > .num { font-family: var(--sans); font-weight: 600; font-size: 15px; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; }
.stage > div > h2 { margin-top: 2px; }
.stage > div > :last-child { margin-bottom: 0; }
.cmd { margin: 1em 0; }
.cmd .lab { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.cmd pre { margin: 0; }
.callout { border: 1px solid var(--rule); border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 10px 10px 0; padding: 14px 18px; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; margin: 1.4em 0; }
.callout.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.callout.info { border-left-color: var(--accent); background: var(--accent-soft); }
.callout b { font-weight: 600; }
.callout p { margin: 0 0 0.6em; } .callout p:last-child { margin: 0; }

/* ---------- Book pages ---------- */
.frame { max-width: var(--wide); margin: 0 auto; padding: 0 24px 96px; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; }
.frame.plain { display: block; max-width: 860px; }
.rail { font-family: var(--sans); font-size: 14px; padding-top: 44px; }
.rail-inner { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 20px; scrollbar-width: thin; }
.rail h2 { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; font-weight: 600; }
.rail ol { list-style: none; margin: 0 0 26px; padding: 0; }
.rail li { margin: 0; }
.rail li a, .rail li.planned { display: flex; padding: 4px 0; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.rail li a:hover { color: var(--accent); }
.rail li .n { flex: none; min-width: 2.3em; padding-right: 0.45em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rail li.here > a { color: var(--ink); font-weight: 600; }
.rail li.planned { opacity: 0.55; }

main { min-width: 0; }
.frame main { padding-top: 44px; }
.text { max-width: 68ch; }
@media (min-width: 1180px) { .frame:not(.plain) .text { margin-right: 250px; } }

.opener { border-bottom: 1px solid var(--rule); padding-bottom: 24px; margin-bottom: 30px; }
.opener .part { font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.opener .chno { font-family: var(--display); font-style: italic; font-size: 22px; color: var(--ink-2); margin-top: 16px; }
.text h1, .opener h1 { font-size: clamp(2.1em, 4.4vw, 2.9em); line-height: 1.04; margin: 6px 0 16px; font-weight: 500; letter-spacing: -0.03em; text-wrap: balance; }
.opener .lede { font-size: 1.12em; color: var(--ink-2); margin: 0; text-wrap: pretty; }
.opener .stamp { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-top: 14px; }

.text h2 { font-size: 1.5em; line-height: 1.18; margin: 2.4em 0 0.55em; font-weight: 500; letter-spacing: -0.022em; text-wrap: balance; }
.text h2 .n, .text h3 .n { color: var(--accent); font-family: var(--sans); font-size: 0.72em; font-weight: 600; margin-right: 0.6em; font-variant-numeric: tabular-nums; }
.text h3 { font-size: 1.12em; margin: 1.8em 0 0.3em; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }

.margin { font-family: var(--sans); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); border-left: 2px solid var(--rule); padding: 2px 0 2px 12px; margin: 0 0 1em; }
@media (min-width: 1180px) { .frame:not(.plain) .margin { float: right; clear: right; width: 215px; margin: 4px -250px 14px 0; } }

.box { border: 1px solid var(--rule); border-left-width: 3px; padding: 16px 20px 6px; margin: 1.6em 0; background: var(--paper-2); border-radius: 0 10px 10px 0; }
.box > .label { font-family: var(--sans); font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.box.objectives { border-left-color: var(--accent); background: var(--accent-soft); } .box.objectives > .label { color: var(--accent); }
.box.definition { border-left-color: var(--ok); background: var(--ok-soft); } .box.definition > .label { color: var(--ok); }
.box.caution { border-left-color: var(--bad); background: var(--bad-soft); } .box.caution > .label { color: var(--bad); }
.box.example { border-left-color: var(--warn); background: var(--warn-soft); } .box.example > .label { color: var(--warn); }
.box.summary { border-left-color: var(--ink-2); }
.box.exercises { background: none; border-left-color: var(--accent); }
.box.exercises ol { padding-left: 1.4em; } .box.exercises li { margin-bottom: 0.7em; }
details { margin: 0.4em 0 0.2em; }
details summary { font-family: var(--sans); font-size: 13.5px; color: var(--accent); cursor: pointer; }
details p { margin-top: 0.5em; color: var(--ink-2); }
dl.terms dt { font-weight: 600; margin-top: 0.7em; } dl.terms dd { margin: 0.1em 0 0 0; }

.g { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 0.08em; }
.g.v { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.g.s { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.g.c { background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); }
.g.u { background: var(--paper-2); color: var(--ink-2); border: 1px dashed var(--ink-3); }

.tablewrap { overflow-x: auto; margin: 1.6em 0; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 14.5px; line-height: 1.45; }
caption, figcaption { font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); text-align: left; padding: 0 0 8px; caption-side: top; }
caption b, figcaption b { color: var(--ink); font-weight: 600; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 1.5px solid var(--ink-2); font-weight: 600; font-size: 13px; }
tbody th { font-weight: 600; }
figure { margin: 1.8em 0; }
figure svg { display: block; width: 100%; height: auto; }
figcaption { padding: 10px 0 0; }
.fig text { font-family: var(--sans); fill: var(--ink); }
.fig .muted { fill: var(--ink-2); }
.fig .b { fill: var(--paper-2); stroke: var(--ink-2); stroke-width: 1.2; }
.fig .ba { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.fig .bg { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 1.5; }
.fig .bw { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 1.2; }
.fig .ln { stroke: var(--ink-2); stroke-width: 1.3; fill: none; }
.fig .arrowhead { fill: var(--ink-2); }

.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 3.2em; padding-top: 18px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 14.5px; }
.pager a { text-decoration: none; max-width: 48%; }
.pager .dir { display: block; font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.pager .next { text-align: right; margin-left: auto; }

/* Book cover and contents */
.cover { padding: 56px 0 34px; border-bottom: 1px solid var(--rule); }
.cover .kicker { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); }
.cover h1 { font-size: clamp(2.4em, 5.6vw, 3.8em); margin: 12px 0 16px; line-height: 1.02; letter-spacing: -0.034em; font-weight: 500; text-wrap: balance; }
.cover .sub { font-size: 1.16em; color: var(--ink-2); max-width: 34em; margin: 0 0 22px; text-wrap: pretty; }
.status { font-family: var(--sans); font-size: 14.5px; line-height: 1.55; border: 1px solid var(--rule); border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 14px 18px; max-width: 48em; border-radius: 0 10px 10px 0; }
.status b { color: var(--warn); }
.toc { margin-top: 30px; }
.toc h2 { margin-top: 1.8em; font-size: 1.45em; font-weight: 600; }
.toc .parttitle { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-3); margin: 3em 0 2px; }
.toc .partnote { font-size: 0.95em; color: var(--ink-2); margin: 6px 0 8px; max-width: 44em; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc ol > li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 0 6px; padding: 14px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.toc ol > li .n { font-family: var(--display); font-style: italic; font-size: 1.25em; color: var(--ink-3); font-variant-numeric: tabular-nums; line-height: 1.2; }
.toc ol > li a { font-weight: 600; text-decoration: none; font-size: 1.08em; color: var(--ink); }
.toc ol > li a:hover { color: var(--accent); }
.toc ol > li p { grid-column: 2; margin: 3px 0 0; color: var(--ink-2); font-size: 0.9em; font-family: var(--sans); line-height: 1.5; }
.toc li.planned .t { color: var(--ink-2); font-size: 1.08em; }
.toc li.planned .tag { font-family: var(--sans); font-size: 11.5px; border: 1px dashed var(--ink-3); padding: 0 7px; border-radius: 999px; margin-left: 8px; color: var(--ink-2); white-space: nowrap; }

/* Build log */
.entry { border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 40px; }
.entry:first-of-type { border-top: 0; margin-top: 10px; }
.entry .when { font-family: var(--sans); font-size: 13px; color: var(--ink-3); letter-spacing: 0.03em; }
.entry h2 { margin-top: 4px; }
.entry h3 { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); margin-top: 1.7em; }

footer { border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); background: var(--paper-2); }
footer > div { max-width: var(--wide); margin: 0 auto; padding: 32px 24px 44px; display: flex; gap: 24px 48px; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
footer p { margin: 0; max-width: 36em; line-height: 1.5; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--ink-2); text-decoration: none; } footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .figure:nth-child(3) { border-right: 0; }
  .figure:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .hero > .in, .split { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .phone { margin: 0 auto; }
}
@media (max-width: 900px) {
  body { font-size: 17.5px; }
  .frame { display: block; padding: 0 20px 72px; }
  .rail { padding-top: 22px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
  .rail-inner { position: static; max-height: none; }
  .rail .book { display: none; }
  .rail ol { margin-bottom: 14px; columns: 2; column-gap: 20px; }
  .frame main { padding-top: 28px; }
  .band { padding: 64px 20px; } .hero { padding: 48px 20px 60px; } .closing { padding: 72px 20px; }
  .steps3, .duo { grid-template-columns: minmax(0, 1fr); }
  .masthead-inner { padding: 0 16px; gap: 12px; }
  .masthead nav a { padding: 7px 8px; }
  .masthead nav a.hide-sm { display: none; }
  .guide { padding: 40px 20px 72px; }
  .stage { grid-template-columns: minmax(0, 1fr); } .stage > .num { margin-bottom: 12px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: 1fr 1fr; }
  .figure { border-right: 1px solid var(--rule) !important; border-bottom: 1px solid var(--rule); }
  .figure:nth-child(2n) { border-right: 0 !important; }
  .figure:nth-last-child(-n+2) { border-bottom: 0; }
  .answer { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .rail ol { columns: 1; }
  .masthead .brand { font-size: 18px; gap: 7px; }
  .brand svg { width: 19px; height: 19px; }
  .masthead-inner { gap: 6px; padding: 0 14px; }
  .masthead nav { gap: 0; font-size: 13.5px; }
  .masthead nav a { padding: 7px 6px; }
  .masthead nav a.go { margin-left: 4px; padding: 7px 11px; }
  .btn { width: 100%; justify-content: center; }
}
@media (max-width: 350px) {
  .masthead-inner { padding: 0 10px; gap: 2px; }
  .masthead .brand { font-size: 17px; gap: 6px; }
  .masthead nav { font-size: 13px; }
  .masthead nav a { padding: 7px 4px; }
  .masthead nav a.go { margin-left: 2px; padding: 7px 9px; }
}
@media print {
  .rail, .masthead nav, .pager, footer { display: none; }
  .masthead { position: static; }
  .frame { display: block; }
  body { font-size: 11.5pt; background: #fff; }
}

/* ---------- Launch page ---------- */
.hero { padding: 96px 24px 88px; }
.hero .sub { font-size: 1.22em; line-height: 1.5; }
.stage-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px 5px 10px; margin: 0 0 26px; }
.stage-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.chip.live { background: var(--ok-soft); color: var(--ok); }
.chip.once { background: var(--warn-soft); color: var(--warn); }
.chip.dev { background: var(--paper-3); color: var(--ink-2); }
.chip.plan { background: none; color: var(--ink-3); border: 1px dashed var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); margin: 0 0 34px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card .ico { background: var(--paper-2); color: var(--ink); }
.card h3 { font-weight: 500; letter-spacing: -0.015em; font-size: 1.14em; }
.group { margin-top: 56px; }
.group > h3 { font-size: 11.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.big { font-size: clamp(1.5em, 3vw, 2.1em); line-height: 1.18; letter-spacing: -0.025em; font-weight: 500; max-width: 24em; text-wrap: balance; margin: 0 0 22px; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--paper); counter-reset: f; }
.flow > div { padding: 26px 24px 24px; border-right: 1px solid var(--rule); counter-increment: f; }
.flow > div:last-child { border-right: 0; }
.flow > div::before { content: counter(f); font-family: var(--display); font-style: italic; font-size: 30px; color: var(--ink-3); line-height: 1; display: block; margin-bottom: 14px; }
.flow h3 { font-size: 1.05em; font-weight: 500; margin: 0 0 6px; letter-spacing: -0.012em; }
.flow p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.road { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.road > div { border-top: 1px solid var(--ink); padding-top: 18px; }
.road h3 { font-size: 11.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; margin: 0 0 14px; color: var(--ink); }
.road ul { list-style: none; padding: 0; margin: 0; }
.road li { padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; font-size: 15px; line-height: 1.45; }
.road li b { font-weight: 500; display: block; }
.road li span { color: var(--ink-2); font-size: 14px; }
.quote { font-family: var(--display); font-style: italic; font-size: clamp(1.6em, 3.4vw, 2.5em); line-height: 1.16; letter-spacing: -0.01em; max-width: 22em; margin: 0; text-wrap: balance; }
.quote + p { color: var(--ink-2); margin-top: 18px; max-width: 40em; }
.statline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.statline > div { padding: 30px 24px 28px 0; }
.statline .v { font-size: clamp(2em, 4vw, 3em); font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.statline .l { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin-top: 10px; max-width: 16em; }
.partcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.partcards a { border: 1px solid var(--rule); border-radius: 14px; padding: 24px; text-decoration: none; background: var(--paper); display: block; }
.partcards a:hover { border-color: var(--ink-3); }
.partcards .pn { font-family: var(--display); font-style: italic; font-size: 26px; color: var(--ink-3); line-height: 1; }
.partcards h3 { font-size: 1.1em; font-weight: 500; margin: 12px 0 6px; letter-spacing: -0.015em; }
.partcards p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0 8px; }
.paths > div { border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; background: var(--paper-2); }
.paths h3 { font-size: 1em; font-weight: 500; margin: 0 0 6px; }
.paths p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.text p, .text li { font-size: 1em; }
.text pre { font-size: 13.5px; }
@media (max-width: 1020px) {
  .cards.three, .partcards, .road, .paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow > div:nth-child(2n) { border-right: 0; }
  .flow > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .statline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .cards.three, .partcards, .road, .paths, .flow, .statline { grid-template-columns: minmax(0, 1fr); }
  .flow > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .flow > div:last-child { border-bottom: 0; }
  .hero { padding: 56px 20px 60px; }
}

/* The course: citations, the bibliography, problem sets and the pages built on the book */
a.cite { white-space: nowrap; }
.coursetabs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 30px; font-family: var(--sans); font-size: 14px; }
.coursetabs a { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--ink-2); }
.coursetabs a:hover { color: var(--ink); border-color: var(--ink-3); }
.coursetabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
ul.readings { list-style: none; padding: 0; }
ul.readings li { padding: 14px 0; border-top: 1px solid var(--rule); scroll-margin-top: 90px; }
ul.readings li:target { background: var(--accent-soft); padding-left: 12px; padding-right: 12px; border-radius: 8px; }
ul.readings li p { margin: 0.35em 0 0; color: var(--ink-2); font-size: 0.94em; }
ul.readings .venue { color: var(--ink-2); }
ul.readings .core { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
ul.readings p.cited { font-size: 0.86em; color: var(--ink-3); }
.box.theory { border-left-color: var(--ink); background: none; }
.box.theory > .label { color: var(--ink); }
.box.unit { border-left-color: var(--ink-3); background: none; padding-bottom: 10px; }
.box.unit dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.box.unit dt { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.box.unit dd { margin: 0; }
@media (max-width: 560px) { .box.unit dl { grid-template-columns: 1fr; } .box.unit dd { margin-bottom: 6px; } }
.box.exercises h3, .problems h3 { font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 1.2em 0 0.4em; }
.pts { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.math { font-family: var(--mono); font-size: 0.93em; white-space: nowrap; }
p.eq { font-family: var(--mono); font-size: 0.95em; margin: 1em 0 1em 1.4em; overflow-x: auto; }
