/* Mainstay prospect presentation: audience window.
   Mainstay kit v1.0.0-draft tokens + one per-edition accent pair from edition.json. */

@font-face { font-family: 'Cormorant Garamond'; src: url('brand/fonts/CormorantGaramond-Variable.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Geist; src: url('brand/fonts/Geist-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #F4F0E8;
  --paper-2: #EDE7DC;
  --stone: #DBD4C9;
  --ink: #262725;
  --ink-2: #3A3B38;
  --muted: #65665F;
  --copper: #AD6B4A;
  --copper-light: #DCA17D;
  --copper-deep: #8A4E32;
  --white: #FFFFFF;
  --edition: #6F2F8D;          /* replaced at boot from edition.brand.accent */
  --edition-2: #FBB040;        /* replaced at boot from edition.brand.accentSecondary */
  --edition-ink: #FFFFFF;

  --display: 'Cormorant Garamond', Georgia, serif;
  --text: Geist, Arial, sans-serif;

  --header-h: 68px;
  --gutter: clamp(20px, 4.4vw, 72px);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-micro: 180ms;
  --t-move: 280ms;
  --shadow: 0 1px 0 rgba(38, 39, 37, .06), 0 18px 48px -24px rgba(38, 39, 37, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.6 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--copper-deep); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius); }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(14px); -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  view-transition-name: bar;
}
.lockup { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.lockup .ms { height: 22px; width: auto; }
.lockup .x { width: 1px; height: 26px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.lockup .biz { height: 30px; width: auto; }
.lockup .for { font: 500 11px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.index { display: flex; justify-content: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.index a {
  position: relative; display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
  font: 500 12px/1 var(--text); letter-spacing: .06em; color: var(--muted); text-decoration: none; border-radius: 999px;
  transition: color var(--t-micro) var(--ease), background var(--t-micro) var(--ease);
}
.index a::after {
  content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: currentColor; opacity: 0; transform: scale(.4); transition: all var(--t-move) var(--ease);
}
.index a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.index a[aria-current] { color: var(--copper-deep); }
.index a[aria-current]::after { opacity: 1; transform: none; }
.index a .tip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px); white-space: nowrap;
  background: var(--ink); color: var(--paper); font: 500 12px/1 var(--text); letter-spacing: .02em; padding: 8px 10px; border-radius: var(--radius);
  opacity: 0; pointer-events: none; transition: all var(--t-micro) var(--ease);
}
.index a:hover .tip, .index a:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }

.bar-actions { display: flex; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); background: transparent;
  font: 500 13px/1 var(--text); letter-spacing: .02em; text-decoration: none;
  transition: background var(--t-micro) var(--ease), border-color var(--t-micro) var(--ease);
}
.pill:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.pill.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.solid:hover { background: var(--ink-2); }
.pill svg { width: 16px; height: 16px; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; transform-origin: 0 50%; background: var(--copper); transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: grow linear both; animation-timeline: scroll(root); }
  }
}
@keyframes grow { to { transform: scaleX(1); } }

/* ---------- Typography ---------- */
.eyebrow { font: 500 12px/1.35 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--copper-deep); margin: 0 0 18px; }
.eyebrow.on-dark { color: var(--copper-light); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(48px, 7.2vw, 112px); line-height: .96; }
h2 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.02; }
h3 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; }
p { margin: 0 0 1em; text-wrap: pretty; }
.dek { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.55; color: var(--ink-2); max-width: 38em; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.5; }
.label { font: 500 12px/1.35 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Cover ---------- */
.cover {
  position: relative; min-height: calc(100svh - var(--header-h)); display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(32px, 5vh, 64px) var(--gutter) clamp(40px, 7vh, 88px);
  overflow: clip;
}
.cover-copy { position: relative; z-index: 1; }
.cover .biz-mark { height: clamp(44px, 5.2vw, 72px); width: auto; margin: 0 0 clamp(20px, 3.4vh, 36px); view-transition-name: biz-mark; }
.cover h1 { max-width: 11.5em; }
.cover h1 em { font-style: italic; color: var(--edition); }
.cover .dek { margin-top: clamp(18px, 3vh, 28px); }
.cover-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: clamp(22px, 4vh, 40px); }
.cover-meta .by { display: flex; align-items: center; gap: 10px; font: 500 13px/1.3 var(--text); color: var(--muted); }
.cover-meta .by img { height: 18px; width: auto; }
.cover-cta { display: flex; gap: 12px; margin-top: clamp(24px, 4vh, 40px); }

.cover-figure { position: relative; justify-self: end; width: min(100%, 560px); aspect-ratio: 4 / 4.4; }
.cover-figure .panel {
  position: absolute; inset: 0 0 7% 20%; border-radius: 280px 280px var(--radius) var(--radius);
  background: radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--edition) 88%, white) 0%, var(--edition) 55%, color-mix(in srgb, var(--edition) 78%, black) 100%);
}
.cover-figure .panel::after {
  content: ''; position: absolute; inset: 14px; border-radius: 266px 266px 2px 2px; border: 1px solid color-mix(in srgb, var(--edition-2) 70%, transparent);
}
.cover-figure .photo {
  position: absolute; inset: 7% 8% 0 6%; border-radius: 300px 300px var(--radius) var(--radius); overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(38,39,37,.55);
}
.cover-figure .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 20%; mix-blend-mode: normal; }
.cover-figure figcaption { position: absolute; left: 6%; right: 8%; bottom: -30px; font: 400 12px/1.3 var(--text); color: var(--muted); text-align: right; }
.cover .scroll-cue {
  position: absolute; left: var(--gutter); bottom: 18px; display: flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.cover .scroll-cue i { display: block; width: 36px; height: 1px; background: currentColor; position: relative; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .cover .scroll-cue i::after { content: ''; position: absolute; inset: 0; background: var(--copper); animation: cue 2.4s var(--ease) infinite; }
  .cover h1, .cover .dek, .cover-meta, .cover-cta, .cover .biz-mark { animation: rise .9s var(--ease) both; }
  .cover .dek { animation-delay: .08s; } .cover-meta { animation-delay: .16s; } .cover-cta { animation-delay: .22s; }
  .cover-figure .panel { animation: lift 1.1s var(--ease) both .05s; }
  .cover-figure .photo { animation: reveal-photo 1.2s var(--ease) both .15s; }
}
@keyframes cue { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lift { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes reveal-photo { from { clip-path: inset(100% 0 0 0 round 300px 300px 4px 4px); } to { clip-path: inset(0 0 0 0 round 300px 300px 4px 4px); } }

/* ---------- Library ---------- */
.library-intro { padding: clamp(48px, 9vh, 104px) var(--gutter) clamp(20px, 4vh, 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.library-intro p { max-width: 34em; color: var(--ink-2); margin: 0; }
.chapters { list-style: none; margin: 0; padding: 0 var(--gutter) clamp(64px, 12vh, 140px); display: grid; gap: 14px; }
.chapter {
  --band: var(--white); --band-ink: var(--ink);
  position: relative; display: grid; grid-template-columns: 104px minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: center;
  min-height: clamp(280px, 38vh, 380px); padding: clamp(24px, 3.4vw, 48px);
  background: var(--band); color: var(--band-ink); border-radius: 6px; text-decoration: none;
  box-shadow: 0 1px 0 rgba(38,39,37,.05);
  transition: transform var(--t-move) var(--ease), box-shadow var(--t-move) var(--ease);
  overflow: clip; isolation: isolate;
}
.chapter:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chapter.alt { --band: var(--paper-2); }
.chapter.dark { --band: var(--ink); --band-ink: var(--paper); }
.chapter.featured { --band: var(--edition); --band-ink: var(--edition-ink); }
.chapter .num { align-self: start; font: 500 64px/.9 var(--display); color: transparent; -webkit-text-stroke: 1px var(--copper); }
.chapter.dark .num, .chapter.featured .num { -webkit-text-stroke-color: var(--copper-light); }
.chapter.featured .num { -webkit-text-stroke-color: var(--edition-2); }
.chapter h2 { font-size: clamp(32px, 3.3vw, 50px); margin-bottom: 14px; }
.chapter .hook { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; margin: 0 0 22px; max-width: 30em; opacity: .88; }
.chapter .open {
  display: inline-flex; align-items: center; gap: 10px; font: 500 14px/1 var(--text); letter-spacing: .02em;
  padding: 12px 18px; border-radius: 999px; border: 1px solid currentColor; background: transparent;
}
.chapter .open svg { width: 16px; height: 16px; transition: transform var(--t-micro) var(--ease); }
.chapter:hover .open svg { transform: translateX(3px); }
.chapter .teaser { justify-self: stretch; min-width: 0; }
.chapter .kicker { font: 500 12px/1.3 var(--text); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 14px; color: var(--copper-deep); }
.chapter.dark .kicker { color: var(--copper-light); }
.chapter.featured .kicker { color: var(--edition-2); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .chapter { animation: band-in linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
    .chapter .teaser { animation: teaser-in linear both; animation-timeline: view(); animation-range: entry 10% cover 38%; }
  }
}
@keyframes band-in { from { opacity: .001; transform: translateY(56px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes teaser-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* Teasers */
.t-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.t-stats b { display: block; font: 500 clamp(44px, 4.6vw, 72px)/.95 var(--display); letter-spacing: -.02em; }
.t-stats span { display: block; margin-top: 8px; font: 400 14px/1.4 var(--text); opacity: .82; }
.t-image { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.t-image img { width: 100%; height: 100%; object-fit: cover; }
.t-funnel { display: grid; gap: 8px; }
.t-funnel div { display: grid; grid-template-columns: 5.2em 1fr; align-items: center; gap: 14px; }
.t-funnel b { font: 500 clamp(30px, 3vw, 44px)/1 var(--display); text-align: right; }
.t-funnel span { position: relative; height: 34px; display: flex; align-items: center; padding: 0 12px; font: 500 13px/1 var(--text); border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }
.t-funnel span i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--edition-2) 85%, transparent); z-index: -1; }
.t-funnel span em { font-style: normal; position: relative; }
.t-quote { font: 500 clamp(26px, 2.5vw, 38px)/1.12 var(--display); margin: 0; }
.t-quote cite { display: block; margin-top: 14px; font: 400 13px/1.4 var(--text); font-style: normal; opacity: .75; }
.t-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.t-list li { display: flex; gap: 12px; align-items: baseline; padding: 14px 0; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); font-size: 17px; line-height: 1.4; }
.t-list li b { font: 500 13px/1 var(--text); letter-spacing: .1em; color: var(--copper-deep); min-width: 2.4em; }
.chapter.dark .t-list li b { color: var(--copper-light); }

/* ---------- Topic view ---------- */
.topic { padding: 0 0 clamp(64px, 10vh, 120px); }
.topic-head {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: clamp(20px, 3vw, 48px); align-items: end;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(28px, 5vh, 56px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.topic-head .num { font: 500 104px/.8 var(--display); color: transparent; -webkit-text-stroke: 1px var(--copper); }
.topic-head h1 { font-size: clamp(44px, 5.6vw, 88px); max-width: 13em; }
.topic-head .dek { margin: 18px 0 0; }
.topic-head .crumbs { display: flex; gap: 8px; align-self: start; }
.topic.featured .topic-head { background: var(--edition); color: var(--edition-ink); border-bottom: 0; }
.topic.featured .topic-head .num { -webkit-text-stroke-color: var(--edition-2); }
.topic.featured .topic-head .eyebrow { color: var(--edition-2); }
.topic.featured .topic-head .dek { color: color-mix(in srgb, var(--edition-ink) 86%, transparent); }
.topic.featured .topic-head .pill { border-color: color-mix(in srgb, var(--edition-ink) 40%, transparent); }

.blocks { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 40px); padding: clamp(32px, 6vh, 64px) var(--gutter) 0; }
.blk { grid-column: 1 / -1; min-width: 0; }
.blk.half { grid-column: span 6; }
.blk.wide { grid-column: 2 / span 10; }
.blk.narrow { grid-column: 3 / span 8; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .blk { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
  }
}

.lede p { font: 500 clamp(28px, 2.8vw, 42px)/1.18 var(--display); margin: 0; max-width: 24em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.stat { padding: 26px 26px 26px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.stat + .stat { padding-left: 26px; border-left: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.stat b { display: block; font: 500 clamp(48px, 5vw, 80px)/.95 var(--display); letter-spacing: -.02em; }
.stat .what { display: block; margin-top: 12px; font: 500 16px/1.4 var(--text); }
.stat .note { display: block; margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--muted); }

.src {
  display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; vertical-align: 2px;
  min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent);
  font: 500 11px/1 var(--text); letter-spacing: .02em; color: var(--muted); text-decoration: none; border: 0;
}
.src:hover { background: var(--ink); color: var(--paper); }

.finding {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; border-radius: 6px; overflow: hidden;
  background: var(--white); box-shadow: 0 1px 0 rgba(38,39,37,.05);
}
.finding .obs { padding: clamp(24px, 3vw, 44px); }
.finding .obs h3 { margin: 0 0 16px; }
.finding .obs p:not(.eyebrow) { margin: 0; font-size: 18px; }
.finding .side { padding: clamp(24px, 3vw, 44px); background: var(--paper-2); display: grid; gap: 22px; align-content: start; }
.finding .side p { margin: 0; font-size: 16px; line-height: 1.55; }
.finding .side .label { display: block; margin-bottom: 6px; }
.finding .limit { color: var(--muted); }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.steps-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.step { position: relative; padding: 22px 22px 26px 0; }
.step + .step { padding-left: 22px; border-left: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); display: block; font: 500 13px/1 var(--text); letter-spacing: .12em; color: var(--copper-deep); margin-bottom: 14px; }
.step b { display: block; font: 500 22px/1.2 var(--display); margin-bottom: 8px; }
.step p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.step.observed::after { content: 'Observed'; position: absolute; right: 12px; top: 20px; font: 500 10px/1 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.quote { margin: 0; padding: 26px; background: var(--white); border-radius: 6px; display: grid; gap: 18px; align-content: space-between; }
.quote p { margin: 0; font: 500 24px/1.22 var(--display); }
.quote footer { font-size: 13px; line-height: 1.4; color: var(--muted); }
.quote .stars { color: var(--edition); letter-spacing: 2px; font-size: 14px; }

.figure { margin: 0; }
.figure .frame { border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.figure img { width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }

.callout { display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px; border-radius: 6px; font-size: 15px; line-height: 1.5; }
.callout .tag { flex: none; font: 500 11px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; }
.callout.scenario { background: color-mix(in srgb, var(--edition) 8%, var(--paper)); }
.callout.scenario .tag { background: var(--edition); color: var(--edition-ink); }
.callout.observed { background: var(--paper-2); }
.callout.observed .tag { background: var(--ink); color: var(--paper); }
.callout.limit { background: transparent; border: 1px dashed color-mix(in srgb, var(--ink) 26%, transparent); color: var(--ink-2); }
.callout.limit .tag { background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); color: var(--muted); }

.question {
  position: relative; padding: clamp(32px, 4vw, 56px); border-radius: 6px; background: var(--ink); color: var(--paper); overflow: clip;
}
.question::before { content: '?'; position: absolute; right: -10px; top: -60px; font: 500 320px/1 var(--display); color: color-mix(in srgb, var(--copper) 26%, transparent); }
.question p { position: relative; font: 500 clamp(28px, 2.8vw, 44px)/1.15 var(--display); margin: 0; max-width: 22em; }

.topic-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin: clamp(48px, 8vh, 96px) var(--gutter) 0; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.topic-foot .next { justify-self: end; text-align: right; }
.topic-foot a { text-decoration: none; }
.topic-foot .dir { display: block; font: 500 12px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.topic-foot .t { font: 500 26px/1.15 var(--display); }

/* ---------- Sources drawer ---------- */
.sources {
  position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); z-index: 40; background: var(--paper); color: var(--ink);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.4); transform: translateX(102%); transition: transform var(--t-move) var(--ease);
  display: grid; grid-template-rows: auto 1fr; visibility: hidden;
}
.sources[data-open='true'] { transform: none; visibility: visible; }
.sources header { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.sources header h2 { font-size: 30px; }
.sources ol { list-style: none; margin: 0; padding: 12px 28px 40px; overflow: auto; }
.sources li { padding: 16px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); scroll-margin-top: 12px; }
.sources li b { display: block; font-weight: 500; }
.sources li .when { font-size: 13px; color: var(--muted); }
.sources li p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.sources li:target, .sources li.hit { background: color-mix(in srgb, var(--copper-light) 22%, transparent); margin: 0 -12px; padding: 16px 12px; border-radius: 4px; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(38,39,37,.32); opacity: 0; pointer-events: none; transition: opacity var(--t-move) var(--ease); }
.scrim[data-open='true'] { opacity: 1; pointer-events: auto; }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 28px var(--gutter) 36px; background: var(--ink); color: color-mix(in srgb, var(--paper) 80%, transparent); font-size: 13px; }
.foot img { height: 20px; width: auto; }

/* ---------- View transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: 220ms var(--ease) both fade-out; }
  ::view-transition-new(root) { animation: 360ms var(--ease) both fade-up; }
  ::view-transition-group(*) { animation-duration: 420ms; animation-timing-function: var(--ease); }
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .index .tip { display: none; }
}
@media (max-width: 900px) {
  :root { --header-h: 60px; }
  body { font-size: 17px; }
  .bar { grid-template-columns: auto auto; justify-content: space-between; gap: 12px; }
  .bar > nav { display: none; }
  .lockup .for, .lockup .x { display: none; }
  .lockup .biz { height: 24px; }
  .lockup .ms { display: none; }
  .bar-actions .pill.hide-narrow { display: none; }
  .cover { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; }
  .cover-figure { justify-self: center; width: min(88%, 420px); order: -1; }
  .cover .scroll-cue { display: none; }
  .library-intro { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 18px; min-height: 0; }
  .chapter .num { font-size: 44px; }
  .topic-head { grid-template-columns: 1fr; gap: 14px; }
  .topic-head .num { font-size: 64px; }
  .topic-head .crumbs { order: -1; }
  .blk.half, .blk.wide, .blk.narrow { grid-column: 1 / -1; }
  .finding { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 0; border-left: 0; }
  .step + .step { padding-left: 0; border-left: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
  .topic-foot { grid-template-columns: 1fr 1fr; }
  .topic-foot .home { grid-column: 1 / -1; order: 3; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
