/* AI Assisted Software Engineering: companion site.
   Layout: a reading column with a sticky "on this page" rail; full-width bands for the audit and the verdicts; the map as a figure plus a sticky panel.
   Palette from the cover: deep navy ink, signal cyan for the title, sunset orange as the accent, a cool paper ground.
   The four verdicts each have a color: holds green, recalibrate blue, breaks red, inverts violet. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --sunk: #e9edf3;
  --ink: #0e1a2b;
  --ink-2: #33415a;
  --muted: #5d6b82;
  --line: #d5dce7;
  --cyan: #0a7ea6;
  --cyan-soft: #d9f0f8;
  --orange: #c95a06;
  --orange-soft: #fde9d8;
  --violet: #4d5fd1;
  --violet-soft: #e3e7fb;
  --band: #0e1a2b;
  --band-ink: #e8eef7;
  --band-muted: #9fb0c8;
  --code-bg: #0f1b2c;
  --code-ink: #dce6f2;
  --ok: #1f7a4d;
  --warn: #9a6a00;
  --line-strong: #9fb0c8;
  --v-holds: #1f7a4d; --v-holds-soft: #dcf1e5;
  --v-recalibrate: #1f5fbf; --v-recalibrate-soft: #dfe9fb;
  --v-breaks: #b42318; --v-breaks-soft: #fbe3e0;
  --v-inverts: #6c3fc4; --v-inverts-soft: #ece4fb;
  --v-none: #5d6b82; --v-none-soft: #e9edf3;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --wrap: 1180px;
  --narrow: 760px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --surface: #101c2e; --sunk: #0d1727; --ink: #e8eef7; --ink-2: #c3cfdf; --muted: #8fa1ba; --line: #22324a;
    --cyan: #3cc4ee; --cyan-soft: #0f3346; --orange: #ff9a45; --orange-soft: #3b2412; --violet: #8f9cff; --violet-soft: #1f2650;
    --band: #060c17; --band-ink: #e8eef7; --band-muted: #8fa1ba; --code-bg: #070e1a; --code-ink: #dce6f2; --ok: #5fd39a; --warn: #f0c050;
    --line-strong: #4a5d7a; --v-holds: #5fd39a; --v-holds-soft: #11301f; --v-recalibrate: #7fb0ff; --v-recalibrate-soft: #142846; --v-breaks: #ff8a7a; --v-breaks-soft: #3d1714; --v-inverts: #b99bff; --v-inverts-soft: #2a1d4a; --v-none: #8fa1ba; --v-none-soft: #16233a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #101c2e; --sunk: #0d1727; --ink: #e8eef7; --ink-2: #c3cfdf; --muted: #8fa1ba; --line: #22324a;
  --cyan: #3cc4ee; --cyan-soft: #0f3346; --orange: #ff9a45; --orange-soft: #3b2412; --violet: #8f9cff; --violet-soft: #1f2650;
  --band: #060c17; --band-ink: #e8eef7; --band-muted: #8fa1ba; --code-bg: #070e1a; --code-ink: #dce6f2; --ok: #5fd39a; --warn: #f0c050;
    --line-strong: #4a5d7a; --v-holds: #5fd39a; --v-holds-soft: #11301f; --v-recalibrate: #7fb0ff; --v-recalibrate-soft: #142846; --v-breaks: #ff8a7a; --v-breaks-soft: #3d1714; --v-inverts: #b99bff; --v-inverts-soft: #2a1d4a; --v-none: #8fa1ba; --v-none-soft: #16233a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--serif); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
img { max-width: 100%; height: auto; }
a { color: var(--cyan); text-underline-offset: 2px; }
a:hover { color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; font-stretch: 85%; letter-spacing: -.01em; margin: 0 0 .75rem; }
h2 { font-size: 1.6rem; font-weight: 750; font-stretch: 88%; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.6rem 0 .5rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }
:not(pre) > code { font-size: .86em; background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; padding: .05em .3em; overflow-wrap: anywhere; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }
.selectable { user-select: all; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.narrow, .narrow { max-width: var(--narrow); }
.eyebrow { font: 700 .72rem/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin: 0 0 .5rem; }
.eyebrow.mono { font-family: var(--mono); letter-spacing: .04em; text-transform: none; font-weight: 400; font-size: .78rem; }

/* header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 600 1rem/1 var(--display); font-stretch: 90%; white-space: nowrap; }
.brand b { font-weight: 800; }
.brand .mark { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a, .menu nav a { font: 600 .9rem/1 var(--display); color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.site-nav a:hover { background: var(--sunk); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.site-nav a.is-featured { color: var(--cyan); }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; }
.theme-toggle svg { width: 18px; height: 18px; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 20px; height: 20px; color: var(--ink); }
.menu nav { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: grid; min-width: 240px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
@media (max-width: 1000px) { .site-nav { display: none; } .menu { display: block; } .theme-toggle { margin-left: auto; } }

/* buttons, chips, badges */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: 700 .92rem/1 var(--display); text-decoration: none; padding: 12px 18px; border-radius: 8px; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn:hover { background: var(--cyan); border-color: var(--cyan); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.small { padding: 8px 12px; font-size: .84rem; }
.btn.disabled { background: var(--sunk); color: var(--muted); border-color: var(--line); cursor: default; }
.chip { font: 600 .82rem/1.2 var(--display); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--cyan); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.verdict { display: inline-block; font: 700 .7rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; background: var(--ph-soft); color: var(--ph); white-space: nowrap; }
.v-holds { --ph: var(--v-holds); --ph-soft: var(--v-holds-soft); }
.v-recalibrate { --ph: var(--v-recalibrate); --ph-soft: var(--v-recalibrate-soft); }
.v-breaks { --ph: var(--v-breaks); --ph-soft: var(--v-breaks-soft); }
.v-inverts { --ph: var(--v-inverts); --ph-soft: var(--v-inverts-soft); }
.v-none { --ph: var(--v-none); --ph-soft: var(--v-none-soft); }
.pred-tag { font: 600 .75rem/1 var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; color: var(--ink-2); }

/* page heads */
.page-head { padding-block: 48px 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; background: linear-gradient(180deg, var(--surface), var(--bg)); }
.page-top { padding-top: 40px; }
.dek { font-size: 1.15rem; color: var(--ink-2); max-width: 64ch; }
.sec-h { margin-top: 3rem; }

/* home */
.hero { background: var(--band); color: var(--band-ink); padding-block: 56px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 32px 32px; opacity: .08; pointer-events: none; }
.hero-inner { display: grid; gap: 40px; align-items: center; position: relative; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: minmax(0, 1fr) 300px; } }
.hero .eyebrow { color: var(--band-muted); }
.hero h1 { color: var(--band-ink); font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; font-stretch: 78%; }
.hero h1 .h-pre { display: block; font-size: .42em; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; font-stretch: 100%; margin-bottom: .2em; color: var(--band-muted); }
.h-c { color: #3cc4ee; }
.hero-sub { font: italic 400 1.4rem/1.3 var(--serif); color: #3cc4ee; margin-bottom: 1.2rem; }
.hero-dek { color: var(--band-ink); opacity: .88; max-width: 60ch; }
.hero .btn { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
.hero .btn:hover { background: #3cc4ee; border-color: #3cc4ee; }
.hero .btn.ghost { background: transparent; color: var(--band-ink); border-color: rgba(232,238,247,.3); }
.hero .btn.ghost:hover { border-color: #ff9a45; color: #ff9a45; }
.hero-cover { margin: 0; justify-self: center; max-width: 300px; }
.hero-cover img { border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.5); display: block; }
.band { padding-block: 48px; background: var(--surface); border-block: 1px solid var(--line); }
.band h2 { margin-top: 0; }
.band-note { color: var(--ink-2); margin: 1.2rem 0 0; }
.loop-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.loop-strip li { padding: 16px; display: grid; gap: 4px; border-right: 1px solid var(--line); background: var(--bg); position: relative; }
.loop-strip li:nth-child(4) { background: var(--orange-soft); }
.loop-band .loop-strip b { font-size: 1.15rem; }
.loop-strip li:last-child { border-right: 0; }
.loop-strip b { font: 800 1.25rem/1 var(--display); font-stretch: 85%; }
.loop-strip .step-btn { display: grid; gap: 4px; padding: 16px; margin: -16px; color: inherit; text-decoration: none; cursor: pointer; height: calc(100% + 32px); box-sizing: border-box; transition: background .15s; }
.loop-strip .step-btn:hover, .loop-strip .step-btn:focus-visible { background: var(--cyan-soft); outline: none; }
.loop-strip .step-btn[aria-expanded="true"] { background: var(--cyan-soft); box-shadow: inset 0 -3px 0 var(--cyan); }
.loop-strip .step-btn b::after { content: " +"; color: var(--cyan); font-weight: 600; }
.loop-strip .step-btn[aria-expanded="true"] b::after { content: " \2212"; }
.step-hint { margin: .6rem 0 0; font: 600 .9rem/1.4 var(--display); color: var(--cyan); }
.step-panel { display: none; margin-top: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step-panel.open, .step-panel:target { display: block; }
.js .step-panel:target:not(.open) { display: none; }
.step-panel h3 { margin: 0 0 .3rem; font: 800 1.5rem/1.15 var(--display); }
.step-lead { font-size: 1.08rem; color: var(--ink-2); margin: 0 0 1rem; }
.step-dl { display: grid; grid-template-columns: 11rem 1fr; gap: .55rem 1.2rem; margin: 0 0 1rem; }
.step-dl dt { font: 700 .78rem/1.6 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step-dl dd { margin: 0; }
.step-sub { font: 700 .78rem/1.6 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .4rem; }
.step-vrow { display: grid; grid-template-columns: 8.5rem 1fr; gap: 10px; align-items: start; margin: 0 0 8px; }
.step-vrow .verdict { justify-self: start; }
@media (max-width: 640px) { .step-vrow { grid-template-columns: 1fr; gap: 4px; } }
.step-ladder { margin: 0 0 1rem 1.2rem; padding: 0; }
.step-example { border-left: 3px solid var(--orange); background: var(--orange-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 1rem 0; }
.step-example .eyebrow { color: var(--orange); }
.step-example p:last-child { margin: 0; }
.step-links { margin: .8rem 0 0; font-size: .98rem; }
@media (max-width: 640px) { .step-dl { grid-template-columns: 1fr; gap: .2rem; } .step-dl dd { margin-bottom: .6rem; } .step-panel { padding: 18px 16px; } }
.step-n { font: 600 .78rem/1 var(--mono); color: var(--cyan); }
.step-who { font: 400 .82rem/1.3 var(--mono); color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; padding-block: 48px; }
.tile { display: grid; gap: 6px; align-content: start; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); }
.tile:hover { border-color: var(--cyan); color: var(--ink-2); }
.tile b { font: 750 1.15rem/1.25 var(--display); color: var(--ink); }
.tile-k { font: 600 .74rem/1 var(--mono); color: var(--cyan); }
.tile-map { background: var(--band); color: var(--band-muted); border-color: var(--band); }
.tile-map b { color: var(--band-ink); }
.tile-map .tile-k { color: #ff9a45; }
.tile-map:hover { color: var(--band-muted); border-color: #ff9a45; }
.v-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.v-card { padding: 20px; border-radius: var(--radius); background: var(--ph-soft); border-top: 4px solid var(--ph); }
.v-card h3 { margin: .2rem 0 .4rem; font-size: 1.5rem; color: var(--ph); }
.v-card .mono { font-size: .8rem; color: var(--ink-2); margin: 0; }
.v-card p { color: var(--ink-2); font-size: .97rem; }
.v-list { display: grid; gap: 2px; margin: 0; font: 600 .9rem/1.4 var(--display); }
.v-list a { color: var(--ink); text-decoration: none; }
.v-list a:hover { color: var(--ph); text-decoration: underline; }
.home-book { padding-block: 32px 64px; }

/* chapters list */
.part-block h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.part-n { font: 600 .8rem/1 var(--mono); color: var(--orange); text-transform: uppercase; letter-spacing: .06em; }
.ch-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 8px; }
.ch-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); }
.ch-row:hover { border-color: var(--cyan); color: var(--ink-2); }
.ch-n { font-size: 1.3rem; font-weight: 600; color: var(--cyan); line-height: 1.2; }
.ch-main { display: grid; gap: 2px; min-width: 0; }
.ch-main b { font: 700 1.05rem/1.3 var(--display); color: var(--ink); }
.ch-holds { font-style: italic; font-size: .95rem; }
.ch-meta { display: grid; justify-items: end; gap: 6px; text-align: right; }
@media (max-width: 560px) { .ch-row { grid-template-columns: 36px minmax(0, 1fr); } .ch-meta { grid-column: 2; justify-items: start; text-align: left; display: flex; gap: 8px; align-items: center; } }

/* chapter page */
.ch-head h1 { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.ch-big { color: var(--cyan); font-weight: 600; font-size: .8em; }
.ch-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font: 500 .9rem/1.3 var(--display); color: var(--ink-2); margin-bottom: 1.2rem; }
.audit-box { margin: 0 0 1rem; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--ph); border-radius: 6px; }
.audit-box .eyebrow { color: var(--ph); }
.audit-box .assume { font: 600 1.2rem/1.4 var(--serif); color: var(--ink); }
.audit-box p:last-child { margin: 0; color: var(--ink-2); }
.pred-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.pred-list li { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.pred-list b { font-family: var(--mono); color: var(--cyan); margin-right: 6px; }
.terms-dl { margin: 0; display: grid; gap: 4px; }
.terms-dl dt { font: 700 1rem/1.4 var(--display); color: var(--orange); margin-top: .7rem; scroll-margin-top: 90px; }
.terms-dl dd { margin: 0; color: var(--ink-2); }
.terms-dl dt:target { background: var(--orange-soft); border-radius: 4px; }
.used-in { display: block; font: 500 .82rem/1.4 var(--display); color: var(--muted); margin-top: 2px; }
.used-in a { margin: 0 1px; }
.g-ch { font: 600 .8rem/1 var(--display); white-space: nowrap; margin-left: 4px; }
.glossary-search { margin-bottom: 8px; }
.g-item[hidden] { display: none; }
.with-toc { display: grid; gap: 40px; padding-bottom: 64px; }
@media (min-width: 1040px) { .with-toc { grid-template-columns: minmax(0, var(--narrow)) 220px; justify-content: center; } }
.toc { display: none; }
@media (min-width: 1040px) { .toc { display: block; position: sticky; top: 84px; align-self: start; font: 500 .86rem/1.4 var(--display); max-height: calc(100vh - 100px); overflow: auto; } }
.toc-title { font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.toc a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover, .toc a.active { color: var(--cyan); }
.prose { min-width: 0; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: 1.2rem 0; padding: 12px 18px; border-left: 3px solid var(--cyan); background: var(--surface); border-radius: 0 6px 6px 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table, table.data { border-collapse: collapse; width: 100%; font: 400 .9rem/1.45 var(--display); margin: 1rem 0 1.5rem; display: block; overflow-x: auto; }
.prose th, .prose td, table.data th, table.data td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.prose th, table.data th { font-weight: 700; color: var(--ink); background: var(--sunk); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.table-scroll { overflow-x: auto; }
.loop-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.loop-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.loop-list b { font: 700 .9rem/1.6 var(--display); color: var(--cyan); }
.trap-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-left: 4px solid var(--orange); }
.trap-t { font-weight: 600; color: var(--ink); }
.trap-card p:last-child { margin: 0; }
.ch-toc { padding-left: 1.2rem; }
.ch-toc ul { padding-left: 1.1rem; margin: .3rem 0 .6rem; font-size: .95rem; color: var(--ink-2); }
.terms ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.terms strong { color: var(--orange); }
.conn-list { padding-left: 1.1rem; }
.conn-how { color: var(--ink-2); font-size: .95rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 3rem; }
.pager a { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); font-family: var(--display); }
.pager a:hover { border-color: var(--cyan); }
.pager .next { text-align: right; }
.xref { text-decoration-style: dotted; }

/* code */
pre.code { font-variant-ligatures: none; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font: 400 .84rem/1.55 var(--mono); margin: 0 0 1.2rem; tab-size: 4; }
pre.code code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

/* audit steps and milestone cards */
.loop-cards { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.loop-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.loop-cards:not(.ms-cards) .loop-card:nth-child(4) { background: var(--orange-soft); border-color: transparent; }
.loop-card h3 { margin: .3rem 0 .1rem; font-size: 1.3rem; }
.loop-card p { margin: .2rem 0 0; font-size: .95rem; color: var(--ink-2); }
.never { padding: 16px 20px; border: 1px dashed var(--orange); border-radius: var(--radius); margin-bottom: 32px; }
.never p:last-child { margin: 0; font-weight: 600; }
.never .eyebrow { color: var(--orange); }

/* callouts, book */
.callout { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 6px; margin-bottom: 1.5rem; }
.callout p:last-child { margin: 0; }
.empty { padding: 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.book-head { display: grid; gap: 32px; align-items: start; }
@media (min-width: 760px) { .book-head { grid-template-columns: 240px minmax(0, 1fr); } }
.map-hint { display: inline-block; margin: 2px 0 12px; padding: 4px 10px; border-radius: 6px; background: var(--cyan-soft); color: var(--cyan); font: 600 .9rem/1.4 var(--display); }
.author-photo { float: right; width: 240px; height: 240px; object-fit: cover; border-radius: 8px; margin: 0 0 16px 24px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.author-thumb { float: left; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin: 4px 18px 8px 0; }
.home-book .cta-row { clear: both; }
@media (max-width: 560px) { .author-photo { float: none; display: block; width: 180px; height: 180px; margin: 0 auto 20px; } }
.book-cover { border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.25); max-width: 240px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; font: 400 .92rem/1.4 var(--display); margin-top: 1.4rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.book-toc > li { margin-bottom: .8rem; list-style: none; }
.book-toc { padding-left: 0; }
.book-toc ol { margin-top: .3rem; }

/* map */
.map-wrap { margin-bottom: 64px; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.map-controls-label, .map-select span { font: 700 .72rem/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.verdict-chip { border-color: var(--ph); color: var(--ph); }
.verdict-chip[aria-pressed="true"] { background: var(--ph); border-color: var(--ph); color: var(--surface); }
.map-select { display: inline-flex; align-items: center; gap: 6px; }
.map-select select { padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 .85rem/1 var(--display); max-width: 200px; }
.map-search { flex: 1 1 220px; }
.map-search input { width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 .9rem/1.2 var(--display); }
.map-stage { display: grid; gap: 24px; align-items: start; scroll-margin-top: 80px; margin-top: 16px; }
@media (min-width: 960px) { .map-stage { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); } .map-panel { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; } }
.map-figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-width: 0; }
.map-wheel { display: block; width: 100%; height: auto; font-family: var(--display); }
.map-wheel .chord { fill: none; stroke: var(--cyan); opacity: .22; transition: opacity .2s; pointer-events: none; }
.map-wheel .part-arc { fill: var(--sunk); stroke: var(--line); }
.map-wheel .part-I, .map-wheel .part-III { fill: var(--line); }
.map-wheel .chapter { cursor: pointer; outline: none; }
.map-wheel .arc { fill: var(--ph-soft); stroke: var(--ph); stroke-width: 1; transition: fill .2s, opacity .2s; }
.map-wheel .arc-num { font: 700 17px var(--mono); fill: var(--ph); pointer-events: none; }
.map-wheel .ch-label { font-size: 23px; font-weight: 600; font-stretch: 85%; fill: var(--ink-2); pointer-events: none; }
.map-wheel .chapter:hover .arc, .map-wheel .chapter:focus-visible .arc { fill: var(--ph); }
.map-wheel .chapter:hover .arc-num, .map-wheel .chapter:focus-visible .arc-num { fill: var(--surface); }
.map-wheel .node { cursor: pointer; outline: none; }
.map-wheel .node .hit { fill: transparent; }
.map-wheel .node .dot { fill: var(--surface); stroke: var(--orange); stroke-width: 2; transition: fill .2s, opacity .2s; }
.map-wheel .node .dot.local { stroke: var(--line-strong); }
.map-wheel .node:hover .dot, .map-wheel .node:focus-visible .dot { fill: var(--orange); }
.map-wheel .map-hub { fill: var(--bg); stroke: var(--line); }
.map-wheel .map-center { font-size: 30px; font-weight: 800; font-stretch: 85%; fill: var(--ink); }
.map-wheel .map-center.small { font: 400 15px var(--mono); fill: var(--muted); }
.map-wheel.has-focus .chord { opacity: .05; }
.map-wheel.has-focus .chord.is-on { opacity: .9; stroke: var(--orange); }
.map-wheel.has-focus .chapter:not(.is-on) .arc { opacity: .25; }
.map-wheel.has-focus .chapter:not(.is-on) .ch-label { opacity: .35; }
.map-wheel.has-focus .chapter.is-current .arc { fill: var(--ph); stroke-width: 2.5; }
.map-wheel.has-focus .chapter.is-current .arc-num { fill: var(--surface); }
.map-wheel.has-focus .node:not(.is-on) { opacity: .18; }
.map-wheel.has-focus .node.is-current .dot { fill: var(--orange); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); margin: 6px 8px 4px; font-family: var(--display); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ph-soft); border: 1.5px solid var(--ph); margin-right: 5px; vertical-align: -1px; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--orange); margin-right: 5px; vertical-align: -1px; }
.map-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.map-panel h2 { font-size: 1.4rem; margin: 0 0 .6rem; }
.map-panel p, .map-panel li { font-size: .95rem; color: var(--ink-2); }
.map-panel .holds-line { font: 600 1.05rem/1.4 var(--serif); color: var(--ink); border-left: 3px solid var(--ph, var(--orange)); padding-left: 12px; }
.term-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 !important; }
.term-chips li { margin: 0; }
.term-chips a { display: inline-block; font: 500 .82rem/1.3 var(--display); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); }
.term-chips a:hover { border-color: var(--orange); color: var(--orange); }
.ms-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ms-cards .step-n { font-size: 1rem; font-weight: 700; }
.ms-cards p { font-size: .9rem; }
.map-plist { padding-left: 1.1rem; margin: .25rem 0 1rem; }
.map-plist li { margin-bottom: .45rem; }
.map-details { border-top: 1px solid var(--line); padding: 8px 0; }
.map-details summary { cursor: pointer; font: 700 .92rem/1.4 var(--display); color: var(--ink); }
.map-details ul { padding-left: 1.1rem; margin: .5rem 0; }
.map-how { color: var(--ink-2); font-size: .9rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--cyan); text-decoration: underline; cursor: pointer; font: inherit; }
.map-list { margin-top: 48px; max-width: var(--narrow); }
.map-rows { list-style: none; padding: 0; display: grid; gap: 10px; }
.map-rows > li { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.map-row { font: 700 1rem/1.3 var(--display); color: var(--ink); text-decoration: none; }
.map-rows ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .92rem; }
mark { background: var(--orange-soft); color: inherit; border-radius: 2px; }

/* footer */
.site-footer { background: var(--band); color: var(--band-muted); padding-block: 40px 24px; font: 400 .92rem/1.6 var(--display); }
.site-footer a { color: var(--band-ink); text-decoration: none; }
.site-footer a:hover { color: #ff9a45; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-title { font-weight: 800; color: var(--band-ink); margin-bottom: .5rem; }
.fine { margin-top: 24px; border-top: 1px solid rgba(159,176,200,.2); padding-top: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
