/* The Paper decks' language: near-black boards, Inter Tight display type,
   Inter body, Geist Mono labels, grey hierarchy and one white focus. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #161616;
  --raised: #1c1c1c;
  --rule: #242424;
  --line: #333333;
  --line-2: #424242;
  --border: #4a4a4a;
  --ink: #f5f5f5;
  --ink-2: #c9c9c9;
  --ink-3: #a3a3a3;
  --ink-4: #8a8a8a;
  --ink-5: #6e6e6e;
  --shadow-a: #0e0e0e;
  --shadow-b: #2a2a2a;
  --shadow-c: #0c0c0c;
  --shadow-d: #222222;
  --display: "Inter Tight", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --pad: clamp(16px, 3.9vw, 56px);
  --max: 1440px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f7;
  --panel: #ffffff;
  --panel-2: #f3f1ee;
  --raised: #ebe9e4;
  --rule: #e6e3dd;
  --line: #d5d1c9;
  --line-2: #bdb8af;
  --border: #aaa49a;
  --ink: #171717;
  --ink-2: #383838;
  --ink-3: #565656;
  --ink-4: #706e69;
  --ink-5: #85817a;
  --shadow-a: #f3f1ee;
  --shadow-b: #d5d1c9;
  --shadow-c: #f7f5f1;
  --shadow-d: #e2dfd8;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
a {
  color: inherit;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}
code,
kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink-2);
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 50;
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 56px;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.brand img {
  height: 20px;
  width: auto;
}
.chapters {
  display: flex;
  justify-content: safe center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.chapters::-webkit-scrollbar {
  display: none;
}
.chapters a {
  font: 13px/1 var(--mono);
  color: var(--ink-4);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition:
    color 0.15s,
    background 0.15s;
}
.chapters a span {
  color: var(--ink-5);
  margin-right: 6px;
}
.chapters a:hover {
  color: var(--ink);
}
.chapters a[aria-current="page"] {
  color: var(--ink);
  background: var(--raised);
}
.chapters a[aria-current="page"] span {
  color: var(--ink-3);
}
.chapters .nav-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}
.updated {
  justify-self: end;
  white-space: nowrap;
  font: 11px/1 var(--mono);
  color: var(--ink-5);
}
.header-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  padding: 7px 9px;
  cursor: pointer;
  white-space: nowrap;
  font: 11px/1 var(--mono);
}
.theme-toggle:hover,
.theme-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: var(--raised);
}
.skill-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font: 11px/1.5 var(--mono);
}
.skill-links > span { color: var(--ink-5); margin-right: 2px; }
.skill-links a {
  color: var(--ink-3);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.skill-links a:hover { color: var(--ink); background: var(--raised); }
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--ink-3);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

/* ---------- Boards ---------- */

.board {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px var(--pad) 88px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
}
.board + .board {
  border-top: 0;
}

.head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1120px;
}
.eyebrow {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
}
.eyebrow a.pin {
  opacity: 0;
  text-decoration: none;
  color: var(--ink-5);
  transition: opacity 0.15s;
}
.board:hover .eyebrow a.pin,
.eyebrow a.pin:focus-visible {
  opacity: 1;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  font-weight: 600;
}
h2 {
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.sub {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  color: var(--ink-3);
  margin: 0;
  max-width: 1040px;
}
p {
  margin: 0;
}
.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.6;
}
.prose strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* Chapter openers: the cover slide of each deck. */
.opener {
  min-height: min(90vh, 880px);
  justify-content: space-between;
  padding-top: 56px;
  padding-bottom: 48px;
}
.opener .top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.opener .top span:last-child {
  font: 13px/16px var(--mono);
  text-transform: none;
  letter-spacing: 0;
}
.opener h1 {
  font-size: clamp(60px, 10.5vw, 148px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin-bottom: 26px;
}
.opener .lede {
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.45;
  color: var(--ink-3);
  max-width: 900px;
}
.opener .foot {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  font: 13px/1.5 var(--mono);
  color: var(--ink-4);
}
.opener .foot .brandline {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* The "you are here" strip on each chapter opener. */
.trail {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trail li {
  display: flex;
  align-items: center;
}
.trail li + li::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-2);
  margin: 0 6px;
}
.trail a {
  font: 13px/1 var(--mono);
  color: var(--ink-5);
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.trail a:hover {
  color: var(--ink-2);
  border-color: var(--line-2);
}
.trail a.here {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.trail a.done {
  color: var(--ink-3);
  border-color: var(--line);
}

/* ---------- Blocks reused across boards ---------- */

.cols {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 24px;
}
.col {
  border-top: 1px solid var(--line-2);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.col.tight {
  padding: 22px 20px;
}
.col.focus {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.col.dashed {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
}
.tag {
  font: 14px/21px var(--mono);
  color: var(--ink-4);
}

.focus .tag {
  color: var(--ink-2);
}
.col h3 {
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.col h3.sm {
  font-size: clamp(19px, 1.6vw, 22px);
}
.col p,
.col li {
  font-size: 16.5px;
  line-height: 1.6;
}
.focus p {
  color: var(--ink-2);
}
.col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.col li::before {
  content: "· ";
  color: var(--ink-5);
}
.col .foot {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  font: 13px/1.5 var(--mono);
  color: var(--ink-4);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.panel.raised {
  background: var(--raised);
  border-color: var(--border);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.panel-head code {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--ink-4);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, var(--a, 1fr)) minmax(0, var(--b, 1fr));
  gap: 28px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Label / statement rows: "Why add this level?" + large text. */
.say {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
}
.say .k {
  font: 14px/22px var(--mono);
  color: var(--ink-4);
}
.say .v {
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.48;
  color: var(--ink-2);
  max-width: 980px;
}

/* Footer rows with a rule: "THE BRIDGE", "NOTHING LANDS ON ITS OWN". */
.notes {
  display: flex;
  flex-direction: column;
}
.note {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  border-top: 1px solid var(--rule);
  padding: 22px 0;
  align-items: baseline;
}
.note .k {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.note .v {
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 1000px;
}
.note .v strong,
.say .v strong {
  color: var(--ink);
  font-weight: 500;
}

/* Definition lists: term in mono, meaning in grey. */
.defs {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px 24px;
  margin: 0;
}
.defs dt {
  font: 14px/24px var(--mono);
  color: var(--ink);
}
.defs dd {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.defs.wide {
  grid-template-columns: 190px minmax(0, 1fr);
}
.defs.ruled dt,
.defs.ruled dd {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

pre.code {
  margin: 0;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  font: 13.5px/1.65 var(--mono);
  color: var(--ink-2);
}
pre.code .c {
  color: var(--ink-5);
}
pre.code .w {
  color: var(--ink);
}

/* Tables in the deck style. */
.table-wrap {
  overflow-x: auto;
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.5;
}
.t th {
  text-align: left;
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 0 16px 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.t td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-3);
}
.t td:first-child {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}
.t td.dim {
  color: var(--ink-5);
}

/* Chips: mono tokens in a row. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font: 13px/1 var(--mono);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--panel-2);
}
.chip.focus {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip.dashed {
  border-style: dashed;
  background: transparent;
  color: var(--ink-4);
}

/* Example popups. The same button on every page; the specimen opens above the text. */

.ex-open,
.ex-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ex-open {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  font: 500 15px/1.2 var(--body);
  text-align: left;
}
.ex-open:hover,
.ex-open:focus-visible {
  border-color: var(--ink);
  background: var(--raised);
}
.ex-ico {
  flex: none;
  display: block;
}
.ex-k {
  flex: none;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  padding: 5px 8px;
}
.ex-name {
  color: var(--ink);
}
.ex-pop {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1100px, calc(100vw - 32px));
  height: fit-content;
  max-height: min(84vh, 880px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.ex-pop::backdrop {
  background: rgba(0, 0, 0, 0.62);
}
.ex-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.ex-title {
  margin: 0;
  min-width: 0;
}
.ex-close {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  font: 500 13px/1 var(--mono);
  padding: 8px 12px;
}
.ex-close:hover,
.ex-close:focus-visible {
  border-color: var(--ink);
}
.ex-body {
  display: grid;
  gap: 20px;
  padding: 20px 18px 28px;
}
body.ex-lock {
  overflow: hidden;
}

/* Big number + label stats. */

/* Bridge to the next chapter. */
.next {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line-2);
  padding-top: 24px;
  margin-top: 12px;
  text-decoration: none;
}
.next .k {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex-shrink: 0;
}
.next .v {
  font: 600 clamp(22px, 2.4vw, 30px) / 1.2 var(--display);
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: right;
}
.next .v span {
  display: inline-block;
  transition: transform 0.2s;
}
.next:hover .v span {
  transform: translateX(6px);
}
.next em {
  display: block;
  font: 400 15px/1.5 var(--body);
  color: var(--ink-4);
  font-style: normal;
  letter-spacing: 0;
  margin-top: 6px;
}

/* Capability blocks: ladder rows, statement, reach, derivation. */

.panel > code {
  font-size: 14px;
  color: var(--ink-4);
}
.panel .big,
.derive .big {
  font: 600 clamp(22px, 2.5vw, 34px) / 1.25 var(--display);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.panel .flow {
  font: 500 clamp(18px, 1.7vw, 23px) / 1.4 var(--display);
  color: var(--ink);
}
.panel .flow b {
  color: var(--ink-5);
  font-weight: 400;
}
.panel .flow span {
  color: var(--ink-5);
}
.panel.reach {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}
.panel.reach > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.panel.reach code {
  font-size: 18px;
  color: var(--ink);
}
.panel.reach span {
  font-size: 13px;
  color: var(--ink-4);
}
.panel.reach h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.derive {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.d-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
  border-top: 1px solid var(--line-2);
  padding: 22px 0;
}
.d-row.focus {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.d-row > code {
  font-size: 14px;
  color: var(--ink-4);
}
.d-row.focus > code {
  color: var(--ink-2);
}

.small {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-4);
}
.lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-3);
}
.lead strong {
  color: var(--ink);
  font-weight: 500;
}

/* Give → run → get back strips. */

.inputs,
.outputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inputs > div {
  border: 1px solid var(--rule);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 14px 16px;
}

.inputs code {
  color: var(--ink);
  font-size: 13.5px;
}
.inputs p {
  font-size: 14.5px;
  line-height: 1.5;
  margin-top: 4px;
}

.score {
  font: 600 clamp(40px, 4.5vw, 64px) / 1 var(--display);
  color: var(--ink);
  letter-spacing: -0.04em;
}
.score code {
  font-size: 14px;
  letter-spacing: 0;
  vertical-align: middle;
  margin-left: 8px;
}

/* Two halves, and the line between them. */
.halves {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 40px;
}
.h-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.h-label {
  font-size: 13px;
  color: var(--ink-4);
}
.h-label code {
  color: var(--ink);
  margin-right: 8px;
}
.h-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  position: relative;
}
.h-card.stacked {
  box-shadow:
    -10px -10px 0 -1px var(--shadow-a),
    -10px -10px 0 0 var(--shadow-b),
    -20px -20px 0 -1px var(--shadow-c),
    -20px -20px 0 0 var(--shadow-d);
  margin: 20px 0 0 20px;
}
.h-head {
  font-size: 14px;
  color: var(--ink-4);
}
.h-head b {
  display: block;
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.h-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.h-box.bright {
  background: var(--raised);
  border-color: var(--border);
}
.h-box > code {
  color: var(--ink);
  font-size: 15px;
}
.h-box .kicker {
  font-size: 12.5px;
  color: var(--ink-4);
}
.h-box p {
  font-size: 15px;
  line-height: 1.5;
}
.h-sub {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  margin: 8px 0 0;
  font-size: 14.5px;
}
.h-sub dt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.h-sub dd {
  margin: 0;
}
.h-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  font: 13px var(--mono);
  color: var(--ink);
}
.h-agent span {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px;
  background: var(--raised);
}
.h-agent::before,
.h-agent::after {
  content: "";
  width: 1px;
  height: 14px;
  background: var(--ink-5);
}
.h-line {
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0 5px,
    transparent 5px 11px
  );
}
.h-foot {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  font-size: 15px;
}
.h-foot b {
  color: var(--ink);
  font-weight: 500;
}
.h-foot span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.halves [data-step] {
  transition: opacity 0.35s ease;
}

/* Interactive diagram pickers (Process anatomy & Self-improvement). */
.picked .pk {
  transition: opacity 0.22s ease;
}
.picked [data-lit="eval"] .pk:not(.p-eval),
.picked [data-lit="feedback"] .pk:not(.p-feedback),
.picked [data-lit="gate"] .pk:not(.p-gate),
.picked [data-lit="boundaries"] .pk:not(.p-boundaries),
.picked [data-lit="states"] .pk:not(.p-states),
.picked [data-lit="recipes"] .pk:not(.p-recipes),
.picked [data-lit="tools"] .pk:not(.p-tools),
.picked [data-lit="facts"] .pk:not(.p-facts),
.picked [data-lit="guards"] .pk:not(.p-guards),
.picked [data-lit="people"] .pk:not(.p-people) {
  opacity: 0.18;
}
.picked [data-lit="eval"] .d-edge.p-eval,
.picked [data-lit="feedback"] .d-edge.p-feedback,
.picked [data-lit="gate"] .d-edge.p-gate,
.picked [data-lit="boundaries"] .d-edge.p-boundaries,
.picked [data-lit="states"] .d-edge.p-states,
.picked [data-lit="recipes"] .d-edge.p-recipes,
.picked [data-lit="tools"] .d-edge.p-tools,
.picked [data-lit="facts"] .d-edge.p-facts,
.picked [data-lit="guards"] .d-edge.p-guards,
.picked [data-lit="people"] .d-edge.p-people {
  stroke: var(--ink-2);
}
.picked [data-lit="eval"] .d-n.p-eval .d-node,
.picked [data-lit="feedback"] .d-n.p-feedback .d-node,
.picked [data-lit="gate"] .d-n.p-gate .d-node,
.picked [data-lit="boundaries"] .d-n.p-boundaries .d-node,
.picked [data-lit="states"] .d-n.p-states .d-node,
.picked [data-lit="recipes"] .d-n.p-recipes .d-node,
.picked [data-lit="tools"] .d-n.p-tools .d-node,
.picked [data-lit="facts"] .d-n.p-facts .d-node,
.picked [data-lit="guards"] .d-n.p-guards .d-node,
.picked [data-lit="people"] .d-n.p-people .d-node {
  stroke: var(--ink-3);
  fill: var(--raised);
}
.d-n.is-pickable {
  cursor: pointer;
}
.d-n.is-pickable .d-node {
  transition: stroke 0.15s, fill 0.15s;
}
.d-n.is-pickable:hover .d-node,
.d-n.is-pickable:focus-visible .d-node {
  stroke: var(--ink);
  fill: var(--raised);
}
.d-n.is-pickable:focus-visible {
  outline: none;
}
.picked .d-n.is-pickable[aria-pressed="true"] .d-node {
  fill: var(--ink);
  stroke: var(--ink);
}
.picked .d-n.is-pickable[aria-pressed="true"] .d-label,
.picked .d-n.is-pickable[aria-pressed="true"] .d-sub {
  fill: var(--bg);
}
.pick-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 28px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  padding: 24px;
}
.pick-pane[hidden] {
  display: none;
}
.pick-pane > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quote {
  font: 500 19px/1.45 var(--display);
  color: var(--ink);
}

.chip em {
  font: 13px/1.4 var(--body);
  font-style: normal;
  color: var(--ink-4);
}

.flow2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1.4fr);
  gap: 12px;
  align-items: center;
}
.flow2 > .arrow {
  text-align: center;
  color: var(--ink-5);
  font-size: 22px;
}
.suggestion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.suggestion .big {
  font-size: clamp(20px, 2vw, 26px);
}
.suggestion .ev {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--ink-4);
}
.suggestion ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 14px/1.8 var(--mono);
  color: var(--ink-2);
}
.t.scores td:nth-child(2) {
  color: var(--ink-4);
}
.t.scores td:nth-child(3) {
  color: var(--ink);
  font-family: var(--mono);
}
.t.scores tr.worse td:last-child {
  color: var(--ink);
}

/* The agent loop log. */
.log {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 24px;
  font: 13.5px/1.5 var(--mono);
  overflow-x: auto;
}
.log-row {
  display: grid;
  grid-template-columns: 110px 84px minmax(320px, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.log-row:last-child {
  border-bottom: 0;
}
.log-row span:first-child {
  color: var(--ink-5);
}
.log-row span:nth-child(2) {
  color: var(--ink-4);
}
.log-row span:last-child {
  color: var(--ink-2);
}
.log-row.is-agent span:nth-child(2),
.log-row.is-user span:nth-child(2) {
  color: var(--ink);
}
.log-row.is-agent span:last-child,
.log-row.is-user span:last-child {
  color: var(--ink);
}
.log-row.is-system span:last-child {
  color: var(--ink-4);
}
.log-break {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 13px;
  text-align: center;
}
.log-break::before,
.log-break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

/* ---------- Diagrams ---------- */

.diagram {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.diagram svg {
  display: block;
  width: 100%;
  min-width: var(--min, 0);
  height: auto;
  overflow: visible;
}
.d-group {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
}
.d-group.is-filled {
  fill: var(--panel);
}
.d-group.is-dashed {
  stroke: var(--line-2);
  stroke-dasharray: 5 4;
}
.d-node {
  fill: var(--panel-2);
  stroke: var(--border);
  stroke-width: 1;
}
.d-node.is-raised {
  fill: var(--raised);
  stroke: var(--border);
}
.d-node.is-focus {
  fill: var(--ink);
  stroke: var(--ink);
}
.d-node.is-dashed {
  fill: none;
  stroke: var(--line-2);
  stroke-dasharray: 4 4;
}
.d-node.is-ghost {
  fill: var(--bg);
  stroke: var(--line);
}
.d-node.is-diamond {
  fill: var(--panel-2);
  stroke: var(--line);
}
.d-label {
  font: 500 14px var(--body);
  fill: var(--ink);
}
.d-label.is-mono {
  font: 13px var(--mono);
}
.d-label.is-small {
  font-size: 11.5px;
}
.d-label.on-focus,
.d-sub.on-focus {
  fill: var(--bg);
}
.d-sub {
  font: 12px var(--body);
  fill: var(--ink-4);
}
.d-edge {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.2;
}
.d-edge.is-dashed {
  stroke-dasharray: 4 4;
}
.d-edge.is-strong {
  stroke: var(--ink-2);
}
.d-arrow { fill: var(--ink-4); }
.d-arrow-strong { fill: var(--ink-2); }
.d-edge-label {
  font: 11.5px var(--body);
  fill: var(--ink-3);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.panel .d-edge-label {
  stroke: var(--panel);
}
.d-eyebrow {
  font: 500 11.5px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  fill: var(--ink-4);
}
.d-note {
  font: 12px var(--body);
  fill: var(--ink-4);
}
.d-mono {
  font: 12px var(--mono);
  fill: var(--ink-4);
}
.d-barrier {
  font: 500 11.5px var(--body);
  letter-spacing: 0.09em;
  fill: var(--ink-3);
}
.d-rule {
  stroke: var(--line-2);
  stroke-dasharray: 5 4;
}

.d-link {
  cursor: pointer;
}
.d-link .d-node {
  transition:
    stroke 0.15s,
    fill 0.15s;
}
.d-link:hover .d-node:not(.is-focus),
.d-link:focus-visible .d-node:not(.is-focus) {
  stroke: var(--ink-2);
  fill: var(--raised);
}
.d-link:hover .d-node.is-focus {
  fill: var(--ink);
}
.d-link:focus-visible {
  outline: none;
}
.d-link:focus-visible .d-node {
  stroke: var(--ink);
  stroke-width: 2;
}

.legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-4);
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.legend i.focus {
  background: var(--ink);
  border-color: var(--ink);
}
.legend i.dashed {
  background: none;
  border-style: dashed;
  border-color: var(--line-2);
}

/* Contents list on the home cover. */

/* The homepage lifecycle replaces the detailed architecture diagram. */
#top + #ecosystem,
#ecosystem + #contents {
  border-top: 0;
}

#ecosystem .note {
  border-top: 0;
}

/* ---------- Skills ---------- */

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filters button {
  font: 500 13.5px/1.2 var(--mono);
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.filters button:hover {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--border);
}
.filters button[aria-pressed="true"] {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}
.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 24px;
}
.skill {
  border-top: 1px solid var(--line-2);
  padding: 22px 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skill[hidden] {
  display: none;
}
.skill .fam {
  font: 12px/16px var(--mono);
  color: var(--ink-5);
}
.skill h4 {
  font: 500 16px/1.3 var(--mono);
  color: var(--ink);
}
.skill p {
  font-size: 15px;
  line-height: 1.55;
}
.skill details {
  font-size: 14.5px;
}
.skill summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--ink-2);
  font: 500 13px/1.3 var(--mono);
  list-style: none;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.skill summary:hover {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--border);
}
.skill summary::-webkit-details-marker {
  display: none;
}
.skill summary::before {
  content: "+ ";
}
.skill details[open] summary::before {
  content: "– ";
}
.skill details ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-3);
}
.skill .src {
  margin-top: auto;
  font: 13px/1 var(--mono);
  color: var(--ink-4);
  text-decoration: none;
  padding-top: 6px;
}
.skill .src:hover {
  color: var(--ink);
}

/* ---------- Footer ---------- */

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity 0.6s ease,
      transform 0.6s ease;
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1100px) {

  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1400px) {
  html {
    scroll-padding-top: 112px;
  }
}
/* The chapter list needs the full width before the brand and controls crowd it. */
@media (max-width: 1400px) {
  .bar-inner {
    height: auto;
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }
  .bar-inner .brand {
    grid-column: 1;
    grid-row: 1;
  }
  .bar-inner .chapters {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    margin: 0 -10px;
  }
  .side nav {
    top: 116px;
  }
  .bar-inner .header-meta {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (max-width: 860px) {

  .flow3,
  .flow2,
  .halves,
  .pick-pane,
  .chips.five {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow2 > .arrow {
    transform: rotate(90deg);
  }

  .numbered li p,

  .h-line {
    height: 1px;
    background: repeating-linear-gradient(
      to right,
      var(--border) 0 5px,
      transparent 5px 11px
    );
  }

  .rung,
  .d-row,
  .panel.reach {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .cols,
  .cols.triad,
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .say,
  .note {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .brand span {
    display: none;
  }
  .board {
    padding-top: 56px;
    padding-bottom: 64px;
  }
  .next {
    flex-direction: column;
    gap: 8px;
  }
  .next .v {
    text-align: left;
  }
}
@media (max-width: 560px) {
  .bar-inner .chapters {
    justify-content: flex-start;
  }
  .toc,
  .skills {
    grid-template-columns: minmax(0, 1fr);
  }
  .defs,
  .defs.wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .defs dd {
    margin-bottom: 12px;
  }
  .defs.ruled dd {
    border-top: 0;
    padding-top: 0;
  }
}
.col li b {
  color: var(--ink-2);
  font-weight: 500;
}
.t td:first-child .plain {
  font-family: var(--body);
  font-size: 15.5px;
  color: var(--ink-2);
}
.asks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.asks li {
  font: 500 17px/1.45 var(--display);
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.asks li:first-child {
  border-top: 0;
  padding-top: 0;
}
.panel a,
.small a,
.col .foot a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}

/* ---------- Reading layout: chapters read as documents, not slides ---------- */

.opener[data-chapter]:not([data-chapter="top"]) {
  min-height: 0;
  padding-top: 72px;
  padding-bottom: 40px;
  gap: 28px;
}
.opener[data-chapter]:not([data-chapter="top"]) .top,
.opener[data-chapter]:not([data-chapter="top"]) .foot {
  display: none;
}
.opener[data-chapter]:not([data-chapter="top"]) h1 {
  font-size: clamp(48px, 7vw, 96px);
  margin-bottom: 20px;
}
#top.opener {
  min-height: min(78vh, 760px);
  justify-content: center;
}

.doc {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  border-top: 1px solid var(--rule);
}
.side nav {
  position: sticky;
  top: 80px;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-k {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.side ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--rule);
}
.side ol a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-4);
  text-decoration: none;
}
.side ol a:hover {
  color: var(--ink-2);
}
.side ol a[aria-current="true"] {
  color: var(--ink);
  border-left-color: var(--ink);
}
.side-prev {
  font: 13px/1.4 var(--mono);
  color: var(--ink-5);
  text-decoration: none;
  margin-top: 10px;
}
.side-prev:hover {
  color: var(--ink-2);
}

.doc-body .board {
  max-width: none;
  margin: 0;
  padding: 56px 0 40px;
  gap: 24px;
}
.doc-body .board + .board {
  border-top: 0;
}
.doc-body .head {
  max-width: 760px;
}
.doc-body h2 {
  font-size: clamp(26px, 2.4vw, 32px);
  letter-spacing: -0.025em;
}
.doc-body .sub {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 720px;
}
h2 .pin {
  margin-left: 10px;
  font: 400 0.6em var(--mono);
  color: var(--ink-5);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.board:hover h2 .pin,
h2 .pin:focus-visible {
  opacity: 1;
}

/* Notes read as asides in the text, not slide footers. */
.doc-body .notes {
  gap: 14px;
  max-width: 820px;
}
.doc-body .note {
  display: block;
  border-top: 0;
  border-left: 2px solid var(--line-2);
  padding: 2px 0 2px 18px;
}
.doc-body .note .k {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}
.doc-body .note .v {
  font-size: 16.5px;
  line-height: 1.65;
}
.doc-body .say {
  display: block;
  max-width: 820px;
}
.doc-body .say .k {
  display: block;
  margin-bottom: 6px;
}
.doc-body .say .v {
  font: 500 clamp(19px, 1.7vw, 22px) / 1.5 var(--display);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.doc-body .next {
  margin-top: 40px;
}

/* Diagrams sit in a narrower column now; keep their text readable. */
.doc-body .d-label {
  font-size: 15px;
}
.doc-body .d-label.is-mono {
  font-size: 14px;
}
.doc-body .d-label.is-small {
  font-size: 12.5px;
}
.doc-body .d-sub,
.doc-body .d-edge-label {
  font-size: 13px;
}

@media (max-width: 1100px) {
  .doc {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .side {
    display: none;
  }
}
.doc-body .col h3 {
  font-size: clamp(19px, 1.6vw, 22px);
}
.doc-body .col {
  padding: 22px 20px;
}

.doc-body .panel .big,
.doc-body .derive .big {
  font-size: clamp(20px, 2vw, 26px);
}

/* Evaluation hierarchy: nested levels. */
.nests {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nest {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.nest .nest {
  background: var(--panel-2);
}
.nest.focus {
  border-color: var(--border);
  background: var(--raised);
}
.nest-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.nest-h code {
  font-size: 15px;
  color: var(--ink);
}
.nest-h span {
  font: 600 16px var(--display);
  color: var(--ink-2);
}
.nest-h em {
  font: 12.5px var(--mono);
  font-style: normal;
  color: var(--ink-5);
  margin-left: auto;
}
.nest-p {
  font-size: 15px;
}
.nest-call {
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}
.nest-call::before {
  content: "↓ ";
}
.t.kinds td {
  vertical-align: middle;
}
.t.kinds td:first-child {
  white-space: nowrap;
}
.cell {
  display: block;
  text-align: center;
  font: 12.5px/1 var(--mono);
  padding: 8px 6px;
  border-radius: 6px;
  min-width: 84px;
}
.cell.is-r {
  background: var(--ink);
  color: var(--bg);
}
.cell.is-p {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--ink-3);
}
.cell.is-s {
  border: 1px dashed var(--line-2);
  color: var(--ink-4);
}
.outputs h3 + p code,

.plain-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
  line-height: 1.55;
}
.plain-list b {
  color: var(--ink);
  font-weight: 500;
}
.brand img {
  height: 21px;
}
.brand span {
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  color: var(--ink-3);
}

/* ---------- One anatomy for every chapter ---------- */

/* Overview: the chapter's context, then its sections in order. */
.overview .context {
  max-width: 760px;
  gap: 16px;
}
.overview .context p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
}
.overview .context p strong {
  color: var(--ink);
  font-weight: 500;
}
.outline-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.outline-k,
.deeper-k {
  font: 500 12px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.outline {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.outline li + li a,
.outline li + li.outline-group {
  border-top: 1px solid var(--rule);
}
.outline a {
  display: grid;
  grid-template-columns: 52px minmax(0, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 16px 0;
  text-decoration: none;
  color: inherit;
}
.outline a:hover .t {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.outline .n {
  font: 13px var(--mono);
  color: var(--ink-5);
}
.outline .t {
  font: 600 17px/1.35 var(--display);
  color: var(--ink);
}
.outline .g {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.outline-group {
  padding: 18px 0 8px;
  font: 500 11px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* Hidden depth: examples, code and reference, in that order, under the body. */
.deeper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.deeper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ex-open.is-code .ex-k,
.ex-title .ex-k.is-code {
  background: var(--ink-2);
}
.ex-open.is-reference .ex-k,
.ex-open.is-sketch .ex-k {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  padding: 4px 7px;
}

/* Keyed rows: one list shape for sequences, types and modes. */
.rows {
  --k: 48px;
  list-style: none;
  margin: 0;
  padding: 0 24px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.rows.wide {
  --k: 150px;
}
.rows li {
  display: grid;
  grid-template-columns: var(--k) minmax(0, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.rows.aside li {
  grid-template-columns: var(--k) minmax(0, 240px) minmax(0, 1fr) 150px;
}
.rows li:first-child {
  border-top: 0;
}
.rows li.focus {
  margin: 0 -24px;
  padding: 20px 24px;
  background: var(--raised);
}
.rows li.focus + li {
  border-top-color: transparent;
}
.rows .n {
  font: 13.5px/1.5 var(--mono);
  color: var(--ink-4);
}
.rows b {
  font: 600 18px/1.35 var(--display);
  color: var(--ink);
}
.rows p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-3);
}
.rows li.focus p {
  color: var(--ink-2);
}
.rows code {
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-4);
}
.chips.wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 860px) {
  .outline a {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 12px;
  }
  .outline .g {
    grid-column: 2;
  }
  .rows li,
  .rows.aside li {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .rows code {
    text-align: left;
  }
}
.pick-pane.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
}
.code-set {
  display: grid;
  gap: 18px;
}

/* ---------- Sign-in ---------- */

.login-body {
  margin: 0;
}
.login {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px 48px;
  overflow: hidden;
  background: var(--bg);
}
.login-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font: 600 14px/1 var(--display);
  letter-spacing: -0.015em;
}
.login-mark {
  height: 16px;
  width: auto;
}
.login-title {
  margin: 14px 0 0;
  font: 600 clamp(56px, 9vw, 84px) / 1.02 var(--display);
  letter-spacing: -0.045em;
  color: var(--ink);
}
.login-sub {
  margin: 12px 0 0;
  color: var(--ink-3);
  font: 16px/1.5 var(--body);
}
.login-actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 260px;
}
.login-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: 500 14px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.login-google:hover,
.login-google:focus-visible {
  background: var(--raised);
  border-color: var(--ink-4);
}
.login-g {
  width: 16px;
  height: 16px;
}
.login-error {
  margin: 0;
  color: var(--ink-2);
  font: 13px/1.45 var(--body);
}
.login .rise {
  animation: login-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}
@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login .rise {
    animation: none;
  }
}

.signout button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  padding: 7px 9px;
  cursor: pointer;
  white-space: nowrap;
  font: 11px/1 var(--mono);
}
.signout button:hover {
  color: var(--ink);
  background: var(--raised);
}
.overview .context p.source {
  font-size: 14.5px;
  color: var(--ink-4);
}
.overview .context p.source a {
  color: var(--ink-3);
}

/* Skill briefs: two across, the brief first, depth in toggles. */
.skills {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}
.skill .tldr {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.skill .when {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-3);
}
.skill .when b {
  display: block;
  margin-bottom: 2px;
  font: 500 11px/16px var(--body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.skill-more {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.skill-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 4px;
  font: 12.5px/1.4 var(--mono);
}
.skill-foot a {
  color: var(--ink-3);
}
.skill-foot a:hover {
  color: var(--ink);
}
@media (max-width: 860px) {
  .skills {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* The current chapter is scrolled into view relative to the nav itself. */
.chapters {
  position: relative;
}

/* Evaluation hierarchy popup: the case's four parts side by side. */
.nest-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.nest-cols .col {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
@media (max-width: 1100px) {
  .nest-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .nest-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}
