/* Practicing Strategy home. Fonts are self-hosted (SIL OFL 1.1), so the page makes no third-party requests. */
@font-face { font-family: 'Young Serif'; src: url(fonts/young-serif-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Next'; src: url(fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Next'; src: url(fonts/atkinson-hyperlegible-next-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Atkinson Next'; src: url(fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --f-display: 'Young Serif', 'Iowan Old Style', Georgia, serif;
  --f-body: 'Atkinson Next', system-ui, 'Segoe UI', sans-serif;
  --f-mono: 'Plex Mono', ui-monospace, Consolas, monospace;

  /* Ledger paper, not cream: a cool grey page with ink-navy type. */
  --paper: #f2f4f6;
  --panel: #ffffff;
  --ink: #131b2c;
  --ink-2: #4a5468;
  --rule: #d3d9e1;
  --grid: rgba(31, 59, 112, 0.05);
  --focus: #2458c6;

  /* One color per activity. Navy is the Five Forces Lab's own accent. */
  --navy: #1f3b70;   --navy-soft: #e3e9f4;
  --ochre: #8f6212;  --ochre-soft: #f5ecdc;
  --teal: #006c7a;   --teal-soft: #e0f0f0;
  --plum: #6b3563;   --plum-soft: #f1e5ee;
  --slate: #3d4a5e;  --slate-soft: #e7eaef;
  --green: #2e5e45;  --green-soft: #e3eee7;
  --moss: #4a6320;   --moss-soft: #eaf0dc;
  --brick: #a33b2b;  --brick-soft: #f8e6e2;
  --violet: #5b3fb0; --violet-soft: #ece8f8;
  --atlas: #1a6d9e;  --atlas-soft: #e1edf5;
  --crimson: #9b1d4a; --crimson-soft: #f7e4eb;
  --magenta: #901a82; --magenta-soft: #f6e3f2;
  --copper: #6e3a12; --copper-soft: #f6eadf;
  --ledger: #005c00; --ledger-soft: #e2f0e0;
  --oxblood: #661e24; --oxblood-soft: #f5e6e3;

  /* Book-cloth colors for the case spines, and the gilt on them. */
  --cloth-navy: #1f3b70; --cloth-oxblood: #6b2a2d; --cloth-green: #2e4f3f;
  --cloth-ochre: #74490f; --cloth-slate: #3d4a5e; --cloth-plum: #56304f;
  --gilt: #e2c68e;
  --on-cloth: #f6f1e6;
  --plank: #2a2f3a;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 27, 44, 0.06), 0 6px 18px rgba(19, 27, 44, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1420; --panel: #161e2d; --ink: #e8ecf3; --ink-2: #a9b3c4; --rule: #2a3547;
    --grid: rgba(143, 176, 234, 0.05); --focus: #8fb0ea;
    --navy: #8fb0ea;  --navy-soft: #1c2940;
    --ochre: #e0b462; --ochre-soft: #2e2617;
    --teal: #45e0c0;  --teal-soft: #0f3330;
    --plum: #dba8d0;  --plum-soft: #2b1d29;
    --slate: #aebcd2; --slate-soft: #262e3b;
    --green: #93cfab; --green-soft: #1d2c24;
    --moss: #b9d27f;  --moss-soft: #222a17;
    --brick: #f4a593; --brick-soft: #33201c;
    --violet: #ad8cff; --violet-soft: #241e3a;
    --atlas: #6fd0e0;  --atlas-soft: #11303a;
    --crimson: #ff8fb3; --crimson-soft: #3b1626;
    --magenta: #ff85ee; --magenta-soft: #3a1636;
    --copper: #ff9f45; --copper-soft: #3a2414;
    --ledger: #6fe86f; --ledger-soft: #173319;
    --oxblood: #fc8a66; --oxblood-soft: #3a1d17;
    --plank: #05080e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --paper: #0e1420; --panel: #161e2d; --ink: #e8ecf3; --ink-2: #a9b3c4; --rule: #2a3547;
  --grid: rgba(143, 176, 234, 0.05); --focus: #8fb0ea;
  --navy: #8fb0ea;  --navy-soft: #1c2940;
  --ochre: #e0b462; --ochre-soft: #2e2617;
  --teal: #45e0c0;  --teal-soft: #0f3330;
  --plum: #dba8d0;  --plum-soft: #2b1d29;
  --slate: #aebcd2; --slate-soft: #262e3b;
  --green: #93cfab; --green-soft: #1d2c24;
  --moss: #b9d27f;  --moss-soft: #222a17;
  --brick: #f4a593; --brick-soft: #33201c;
  --violet: #ad8cff; --violet-soft: #241e3a;
  --atlas: #6fd0e0;  --atlas-soft: #11303a;
  --crimson: #ff8fb3; --crimson-soft: #3b1626;
  --magenta: #ff85ee; --magenta-soft: #3a1636;
  --copper: #ff9f45; --copper-soft: #3a2414;
  --ledger: #6fe86f; --ledger-soft: #173319;
  --oxblood: #fc8a66; --oxblood-soft: #3a1d17;
  --plank: #05080e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* The analyst's worksheet: a faint 24px grid behind everything. */
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-body);
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
cite { font-style: italic; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.top { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.wordmark { font-family: var(--f-display); font-size: 1.25rem; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 36px; }
.hero-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px 48px; align-items: end; }
.eyebrow { font-size: 0.9rem; color: var(--ink-2); letter-spacing: 0.02em; }
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.25rem, 1.2rem + 4.2vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 17ch;
  margin-top: 14px;
  text-wrap: balance;
}
.lede { max-width: 60ch; font-size: 1.15rem; color: var(--ink-2); }
.eyebrow-link { color: var(--ink); font-weight: 700; text-underline-offset: 4px; }
.eyebrow-link::after { content: ' \2192'; }

/* Three first steps under the headline: student, instructor, professional. */
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.path a {
  display: grid; gap: 2px; height: 100%; padding: 14px 18px 16px;
  background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--acc); border-radius: var(--radius);
  text-decoration: none; transition: transform 160ms, box-shadow 160ms;
}
.path a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.path-who { font: 500 0.72rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--acc); }
.path-do { font-family: var(--f-display); font-size: 1.2rem; line-height: 1.2; }
.path-do::after { content: ' \2192'; color: var(--acc); }
.path-note { font-size: 0.9rem; color: var(--ink-2); }

.shelf-wrap { margin-top: 8px; }
.swipe { display: none; }

/* The signature: twelve case spines standing on a plank. */
.shelf {
  display: flex; align-items: flex-end; gap: 6px;
  height: 300px; padding: 28px 6px 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.shelf li { flex: 0 0 auto; height: 100%; display: flex; align-items: flex-end; scroll-snap-align: start; }
.spine {
  --cloth: var(--cloth-navy);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: var(--w, 72px); height: var(--h, 92%);
  padding: 14px 0 12px;
  background: var(--cloth);
  /* Cloth texture: a soft highlight down the rounded spine, darker at the edges. */
  background-image: linear-gradient(90deg, rgba(0,0,0,0.28), rgba(255,255,255,0.10) 30%, rgba(255,255,255,0.04) 55%, rgba(0,0,0,0.30));
  color: var(--on-cloth);
  text-decoration: none;
  border-radius: 4px 4px 1px 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15), 2px 0 0 rgba(0,0,0,0.12);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms;
  animation: rise 640ms cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
/* Gilt bands near the head and tail of each spine. */
.spine::before, .spine::after {
  content: ''; position: absolute; left: 8px; right: 8px; height: 3px;
  border-top: 1px solid var(--gilt); border-bottom: 1px solid var(--gilt); opacity: 0.7;
}
.spine::before { top: 40px; }
.spine::after { bottom: 44px; }
.spine:hover, .spine:focus-visible { transform: translateY(-14px); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15), 0 14px 20px -8px rgba(0,0,0,0.35); }
.spine:focus-visible { outline-offset: 4px; border-radius: 4px; }
/* The chosen case stands up, unmuted, with a gilt line at its foot. */
.spine[aria-current="true"] { transform: translateY(-14px); filter: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15), inset 0 -4px 0 var(--gilt), 0 14px 20px -8px rgba(0,0,0,0.35); }

.sp-ch { font: 500 0.7rem/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.sp-name {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-display); font-size: 1.15rem; line-height: 1.08; letter-spacing: 0.01em; text-align: center;
  max-height: calc(100% - 110px); text-wrap: balance;
}
.sp-code { font: 500 0.95rem/1 var(--f-mono); color: var(--gilt); }
.c-ochre .sp-code { color: var(--on-cloth); }

.c-navy { --cloth: var(--cloth-navy); } .c-oxblood { --cloth: var(--cloth-oxblood); } .c-green { --cloth: var(--cloth-green); }
.c-ochre { --cloth: var(--cloth-ochre); } .c-slate { --cloth: var(--cloth-slate); } .c-plum { --cloth: var(--cloth-plum); }
.h1 { --h: 100%; } .h2 { --h: 93%; } .h3 { --h: 86%; } .h4 { --h: 97%; }
.w1 { --w: 56px; } .w2 { --w: 63px; } .w3 { --w: 71px; }

/* The two open cases carry a gilt bookmark ribbon; the ten locked ones sit back, muted, with a small lock. */
.sp-ribbon {
  position: absolute; top: -12px; right: 5px; width: 9px; height: 36px;
  background: var(--gilt); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}
.spine.is-locked { filter: saturate(0.35) brightness(0.9); }
.spine.is-locked:hover, .spine.is-locked:focus-visible { filter: saturate(0.6); }
.sp-lock { position: absolute; top: 52px; left: 50%; width: 12px; height: 14px; margin-left: -6px; }
.sp-lock svg { width: 12px; height: 14px; display: block; fill: none; stroke: var(--gilt); stroke-width: 1.6; }
.sp-lock rect { fill: var(--gilt); stroke: none; }

.plank { height: 14px; background: var(--plank); border-radius: 2px; box-shadow: 0 10px 18px -10px rgba(0,0,0,0.5); position: relative; z-index: 1; }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Sections ---------- */
.section { padding: 60px 0; border-top: 1px solid var(--rule); }
.sec-head { max-width: 62ch; margin-bottom: 32px; }
.sec-head h2 { font-family: var(--f-display); font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -0.015em; }
.sec-head p { margin-top: 10px; color: var(--ink-2); }

/* Activity accents */
.t-navy { --acc: var(--navy); --acc-soft: var(--navy-soft); }
.t-ochre { --acc: var(--ochre); --acc-soft: var(--ochre-soft); }
.t-teal { --acc: var(--teal); --acc-soft: var(--teal-soft); }
.t-plum { --acc: var(--plum); --acc-soft: var(--plum-soft); }
.t-slate { --acc: var(--slate); --acc-soft: var(--slate-soft); }
.t-green { --acc: var(--green); --acc-soft: var(--green-soft); }
.t-moss { --acc: var(--moss); --acc-soft: var(--moss-soft); }
.t-brick { --acc: var(--brick); --acc-soft: var(--brick-soft); }
.t-violet { --acc: var(--violet); --acc-soft: var(--violet-soft); }
.t-atlas { --acc: var(--atlas); --acc-soft: var(--atlas-soft); }
.t-crimson { --acc: var(--crimson); --acc-soft: var(--crimson-soft); }
.t-magenta { --acc: var(--magenta); --acc-soft: var(--magenta-soft); }
.t-copper { --acc: var(--copper); --acc-soft: var(--copper-soft); }
.t-ledger { --acc: var(--ledger); --acc-soft: var(--ledger-soft); }
.t-oxblood { --acc: var(--oxblood); --acc-soft: var(--oxblood-soft); }

/* ---------- Lab tiles ---------- */
.labs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lab { background: var(--panel); border: 1px solid var(--rule); border-top: 6px solid var(--acc); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lab-band { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; background: var(--acc-soft); padding: 10px 18px; border-bottom: 1px solid var(--rule); min-height: 88px; }
.lab-ch { display: grid; justify-items: start; line-height: 1; }
.lab-num { font-family: var(--f-display); font-size: 3rem; color: var(--acc); letter-spacing: -0.03em; }
.lab-chl { margin-top: 6px; font: 500 0.72rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.lab .thumb svg { width: 100%; max-width: 150px; max-height: 70px; margin-left: auto; }
.lab-body { padding: 18px 20px 20px; }
.lab h3 { font-family: var(--f-display); font-size: 1.45rem; line-height: 1.15; }
.lab h3 a { text-decoration: none; }
.lab h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--acc); }
.lab-promise { margin-top: 6px; font-size: 0.97rem; }
.access { display: block; margin-top: 10px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--acc); }
.lab-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
.lab-actions .btn { margin-top: 0; min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.btn-soft { background: var(--acc-soft); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 45%, transparent); }
.inside { margin-top: 14px; border-top: 1px solid var(--rule); }
.inside summary { cursor: pointer; padding: 12px 0 4px; min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); list-style: none; }
.inside summary::-webkit-details-marker { display: none; }
.inside summary::before { content: '+'; font: 700 1.1rem var(--f-mono); color: var(--acc); width: 1em; }
.inside[open] summary::before { content: '\2212'; }
.inside summary:hover { color: var(--ink); }
.mods { margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); }
.mods li { border-bottom: 1px solid var(--rule); padding: 8px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 0.95rem; }
.mods a { font-weight: 700; text-decoration-color: color-mix(in srgb, var(--acc) 45%, transparent); text-underline-offset: 4px; }
.mods a:hover { color: var(--acc); }
.mod-sub { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.mod-sub a { font-weight: 400; color: var(--ink-2); }
.mod-sub a::before { content: '→ '; color: var(--acc); }
.mod-note { font-size: 0.88rem; color: var(--ink-2); }
.mod-name { font-weight: 700; }

.waves { margin-top: 8px; border-top: 1px solid var(--rule); counter-reset: wave; }
.waves li { counter-increment: wave; display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.waves li::before { content: 'Wave ' counter(wave); font: 500 0.8rem var(--f-mono); color: var(--acc); min-width: 5.5em; }
.w-name { font-weight: 700; flex: 1; }
.w-state { font: 500 0.75rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 9px; }
.w-state.ready { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: var(--acc-soft); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; min-height: 46px; padding: 0 20px;
  background: var(--acc, var(--ink)); color: var(--panel); border: 0; border-radius: 999px;
  font: 700 1rem var(--f-body); text-decoration: none; cursor: pointer;
  transition: transform 150ms, box-shadow 150ms;
}
.btn::after { content: '→'; transition: transform 150ms; }
.btn:hover { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--acc, var(--ink)) 70%, transparent); }
.btn:hover::after { transform: translateX(3px); }
.btn-ghost { --acc: var(--ink); margin-top: 0; }

/* Thumbnail drawing: every stroke takes the card's accent. */
.thumb svg { color: var(--acc); }
.th-box rect, .th-page { fill: var(--panel); stroke: currentColor; stroke-width: 2; }
.th-core { fill: currentColor; }
.th-lines path { stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; fill: none; opacity: 0.5; }
.th-label text { font: 500 13px var(--f-mono); fill: currentColor; text-anchor: middle; }
.th-core-label { font: 500 13px var(--f-mono); text-anchor: middle; fill: var(--panel); }
.th-bars rect { fill: currentColor; opacity: 0.35; }
.th-mark { fill: currentColor; opacity: 0.85; }
.th-lens { fill: color-mix(in srgb, var(--panel) 55%, transparent); stroke: currentColor; stroke-width: 5; }
.th-handle { stroke: currentColor; stroke-width: 10; stroke-linecap: round; }
.th-arc path { stroke: currentColor; stroke-width: 3; fill: none; }
.th-arrow path { stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.th-node { fill: var(--panel); stroke: currentColor; stroke-width: 2.5; }
.th-node.done { fill: currentColor; }
.th-node-label text { font-size: 14px; }
.th-node-label text.on { fill: var(--panel); }
.th-dots circle { fill: currentColor; opacity: 0.7; }
.th-grid rect { fill: var(--panel); stroke: currentColor; stroke-width: 1.5; }
.th-fill rect { fill: currentColor; opacity: 0.75; }
.th-margin { fill: currentColor; opacity: 0.35; }

/* ---------- Start free ---------- */
.sec-head-row { max-width: none; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 20px; }
.sec-head-row p { margin-top: 0; }
.section.start { padding-top: 40px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px 16px;
  background: var(--panel); border: 1px solid var(--rule); border-left: 5px solid var(--acc); border-radius: var(--radius);
  text-decoration: none; transition: transform 160ms, box-shadow 160ms;
}
.tile a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-kind { font: 500 0.7rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--acc); }
.tile-title { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.2; }
.tile-title::after { content: ' \2192'; color: var(--acc); }
.tile-text { font-size: 0.9rem; color: var(--ink-2); }
.tile-time { margin-top: auto; padding-top: 4px; font: 500 0.72rem var(--f-mono); color: var(--ink-2); }
/* The one recommended first step: a full-width tile, tinted. */
.tile-first { grid-column: 1 / -1; }
.tile-first a { background: var(--acc-soft); border-left-width: 8px; padding: 18px 22px 20px; }
.tile-first .tile-title { font-size: 1.5rem; }
.tile-first .tile-text { font-size: 1rem; color: var(--ink); max-width: 62ch; }

/* ---------- The book's cases ---------- */
.case-index { margin-top: 18px; }
.case-entry { display: none; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.case-entry.is-current { display: block; }
/* Without the script, a spine's link still works: the targeted entry shows instead. */
.case-index:has(.case-entry:target) .case-entry { display: none; }
.case-index:has(.case-entry:target) .case-entry:target { display: block; }
.case-entry:focus { outline: none; }
.case-entry:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.case-entry h3 { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.2; }
.ce-code { font: 500 0.95rem var(--f-mono); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 7px; vertical-align: 3px; }
.ce-meta { margin-top: 6px; color: var(--ink-2); font-size: 0.93rem; }
.ce-uses { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ce-uses a { display: grid; gap: 2px; height: 100%; padding: 10px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--acc); border-radius: 8px; background: var(--acc-soft); text-decoration: none; }
.ce-uses a:hover { box-shadow: var(--shadow); }
.ce-lab { font-weight: 700; }
.ce-lab::after { content: ' \2192'; color: var(--acc); }
.ce-what { font-size: 0.92rem; }
.ce-note { font: 500 0.72rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.case-foot { margin-top: 12px; color: var(--ink-2); font-size: 0.92rem; }

/* ---------- Instructors ---------- */
.inst-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: start; }
.inst-grid .sec-head { margin-bottom: 0; }
.inst-links { border-top: 1px solid var(--ink); }
.inst-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 700; }
.inst-links a:hover { color: var(--navy); }
.inst-what { font-weight: 400; color: var(--ink-2); font-size: 0.93rem; text-align: right; }
.inst-what::after { content: ' →'; }
.inst-gets { margin-top: 20px; display: grid; gap: 10px; }
.inst-gets li { position: relative; padding-left: 26px; color: var(--ink-2); }
.inst-gets li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 14px; height: 2px; background: var(--navy); }
.inst-gets strong { color: var(--ink); }
.inst-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.inst-actions .btn { margin-top: 0; }
.inst-actions .btn-soft { background: var(--acc-soft); color: var(--ink); }

/* ---------- Learning on your own ---------- */
.follow { background: var(--acc-soft); }
.follow-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 48px; }
.follow-inner .sec-head { margin-bottom: 0; }
.follow-inner .btn { margin-top: 0; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 56px; background: var(--panel); }
.foot-inner { display: grid; gap: 8px; color: var(--ink-2); font-size: 0.95rem; }
.foot .wordmark { color: var(--ink); margin-bottom: 6px; }
.foot a { color: var(--ink); font-weight: 700; margin-left: 4px; }
.fine { font-size: 0.85rem; }

/* ---------- About page ---------- */
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.about-hero { padding: 56px 0 44px; }
.about-hero-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px 56px; align-items: end; }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--panel); }
.about-hero h1 { font-family: var(--f-display); font-size: clamp(2.6rem, 1.4rem + 4.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; margin-top: 12px; }
.about-roles { margin-top: 20px; display: grid; gap: 8px; font-size: 1.1rem; color: var(--ink-2); }
.about-roles li { position: relative; padding-left: 30px; }
.about-roles li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 18px; height: 2px; background: var(--navy); }
.mini-shelf-fig { margin: 0; }
.about-books { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; align-items: center; margin-top: 10px; }
.about-books p { margin-top: 0; }
.mini-shelf { display: flex; align-items: flex-end; gap: 6px; height: 250px; padding: 26px 4px 0; }
.mini-shelf li { height: 100%; display: flex; align-items: flex-end; }
.mini-shelf .spine { --w: 92px; --h: 100%; }
.mini-shelf li:nth-child(2) .spine { --w: 84px; --h: 90%; }
.mini-shelf li:nth-child(3) .spine { --w: 88px; --h: 95%; }
.mini-shelf span.spine { cursor: default; }
.mini-shelf .sp-name { font-size: 1.2rem; }
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px 64px; }
.about-text { max-width: 64ch; }
.about-lead { font-size: 1.2rem; line-height: 1.6; }
.about-text h2 { font-family: var(--f-display); font-size: 1.5rem; margin-top: 36px; }
.about-text p { margin-top: 10px; }
.text-link { font-weight: 700; color: var(--navy); text-underline-offset: 4px; }
.text-link::after { content: ' \2192'; }
.about-facts { --acc: var(--navy); align-self: start; position: sticky; top: 84px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.about-facts h2 { font-family: var(--f-display); font-size: 1.35rem; }
.about-facts dl { margin: 8px 0 0; }
.about-facts dt { font-weight: 700; margin-top: 14px; line-height: 1.35; }
.about-facts dd { margin: 3px 0 0; color: var(--ink-2); }
.about-facts .facts-sub { margin-top: 24px; font-size: 1.15rem; }
@media (max-width: 960px) {
  .about-hero-grid, .about-grid, .about-books { grid-template-columns: 1fr; }
  .about-photo { max-width: 260px; }
  .about-facts { position: static; }
}
@media (max-width: 600px) {
  .about-hero { padding: 36px 0 28px; }
  .mini-shelf { height: 230px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-head { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .labs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ce-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inst-grid { grid-template-columns: 1fr; }
  .paths { grid-template-columns: 1fr; gap: 8px; margin-top: 28px; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .top { position: static; }
  .top-inner { padding: 8px 0 4px; gap: 0; }
  .lede { font-size: 1.05rem; }
  .hero { padding: 40px 0 28px; }
  .shelf { height: 250px; gap: 5px; }
  .swipe { display: inline; }
  .w1 { --w: 52px; } .w2 { --w: 58px; } .w3 { --w: 64px; }
  .sp-name { font-size: 1.05rem; }
  /* Start free: one sideways row of tiles, each most of the screen wide, so the next one peeks in. */
  .start-tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
  .start-tiles .tile { scroll-snap-align: start; }
  .tile-first { grid-column: auto; }
  .path-note { display: none; }
  .path a { padding: 12px 16px 14px; }
  .tile-first .tile-title { font-size: 1.25rem; }
  .labs { grid-template-columns: 1fr; }
  .ce-uses { grid-template-columns: 1fr; }
  .lab-num { font-size: 2.8rem; }
  .lab-band { min-height: 80px; }
  .spine::before { top: 34px; } .spine::after { bottom: 38px; }
  .section { padding: 52px 0; }
  .sp-lock { top: 46px; }
  .sp-ribbon { right: 3px; width: 8px; }
  .nav { gap: 0 14px; font-size: 0.9rem; }
  .inst-links a { flex-direction: column; gap: 2px; }
  .inst-what { text-align: left; }
}

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