/* ==========================================================================
   Design Roadmap — shared design system
   Palette: paper + ink + four Bauhaus-ish pigments. No purple. Promise.
   ========================================================================== */

/* fonts are loaded via <link> in each page head (faster than @import) */

:root {
  --paper: #F3EDE2;
  --paper-2: #E9E1D2;
  --paper-3: #DDD3C0;
  --ink: #16130F;
  --ink-2: #3D372F;
  --ink-3: #7A7166;
  --line: rgba(22, 19, 15, .14);

  --red: #E2462B;      /* tomato — energy, urgency */
  --blue: #2340D8;     /* cobalt — trust, competence */
  --yellow: #F0B42E;   /* mustard — optimism, attention */
  --green: #1F5C4A;    /* forest — calm, growth */
  --pink: #F2B8A6;     /* clay pink — warmth */

  --display: 'Fraunces', Georgia, serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --step--1: clamp(.83rem, .8rem + .15vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-2: clamp(1.56rem, 1.38rem + .9vw, 2.1rem);
  --step-3: clamp(1.95rem, 1.6rem + 1.75vw, 3rem);
  --step-4: clamp(2.44rem, 1.8rem + 3.2vw, 4.6rem);
  --step-5: clamp(3rem, 1.9rem + 5.6vw, 7.5rem);

  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* paper grain */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--yellow); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1.1em; max-width: 66ch; }
strong { font-weight: 650; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- type ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-variation-settings: 'SOFT' 50, 'opsz' 144;
}
h1 { font-size: var(--step-5); font-weight: 400; letter-spacing: -.035em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.15; letter-spacing: -.01em; }
h4 { font-size: var(--step-1); line-height: 1.2; letter-spacing: 0; }
em.serif, .serif-i { font-family: var(--display); font-style: italic; font-weight: 400; }
.kicker {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: .6em;
}
.kicker::before { content: ''; width: 28px; height: 1.5px; background: currentColor; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 54ch; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .88em; }
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }
.hl-red { color: var(--red); }
.hl-blue { color: var(--blue); }
.hl-green { color: var(--green); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.logo__mark { width: 30px; height: 30px; }
.logo__mark .s1 { transform-origin: center; animation: spin 14s linear infinite; }
.nav__links { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  text-decoration: none; font-size: .88rem; font-weight: 500;
  padding: .45rem .7rem; border-radius: 999px; color: var(--ink-2);
  transition: background .25s var(--ease), color .25s;
}
.nav__links a:hover { background: var(--paper-2); color: var(--ink); }
.nav__links a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav__links .n { font-family: var(--mono); font-size: .72rem; opacity: .6; margin-right: .3em; }
.nav__toggle { display: none; background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: .4rem .9rem; font: 600 .85rem var(--body); cursor: pointer; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--red); transition: width .08s linear; }
@media (max-width: 1060px) {
  .nav__toggle { display: block; }
  .nav__links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--paper); padding: 1rem 1.25rem 1.5rem; border-bottom: 1px solid var(--line); display: none; }
  .nav__links.open { display: flex; }
  .nav__links a { display: block; font-size: 1.05rem; }
}

/* ---------- sections ---------- */
section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }
.sec-tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink .kicker, .band-ink .muted { color: #A9A094; }
.band-ink .lede { color: #D9D1C4; }
.band-2 { background: var(--paper-2); }
.band-red { background: var(--red); color: var(--paper); }
.band-blue { background: var(--blue); color: var(--paper); }
.band-yellow { background: var(--yellow); }
.band-green { background: var(--green); color: var(--paper); }
.rule { height: 1px; background: var(--line); border: 0; margin: 3rem 0; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 2rem); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } .split, .split--even { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 96px; }

/* ---------- chapter header ---------- */
.chap {
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.chap__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.chap__num {
  font-family: var(--display); font-size: clamp(6rem, 18vw, 15rem); line-height: .8;
  font-weight: 300; letter-spacing: -.06em; color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
}
.chap h1 { font-size: var(--step-4); margin-top: .5rem; }
.chap__art { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: end; width: 100%; }
@media (max-width: 900px) { .chap__grid { grid-template-columns: 1fr; } .chap__art { justify-self: start; max-width: 320px; } }

/* ---------- cards & callouts ---------- */
.card {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  position: relative;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.card:hover { transform: translate(-4px, -4px); box-shadow: 6px 6px 0 var(--ink); }
.card--flat:hover { transform: none; box-shadow: none; }
.card h3, .card h4 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .tag { position: absolute; top: 1rem; right: 1rem; }
.band-ink .card { background: #201C17; border-color: #3a342c; color: var(--paper); }
.band-ink .card:hover { box-shadow: 6px 6px 0 var(--red); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid currentColor;
}
.tag--fill { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Explain-like-I'm-10 sticky note */
.eli {
  background: var(--yellow);
  padding: 1.6rem 1.6rem 1.4rem;
  border-radius: 4px;
  position: relative;
  transform: rotate(-1.2deg);
  box-shadow: 0 18px 30px -18px rgba(22,19,15,.45);
  max-width: 560px;
  margin: 2rem 0;
}
.eli::before {
  content: ''; position: absolute; top: -12px; left: 50%; width: 110px; height: 26px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(243, 237, 226, .7); border: 1px solid rgba(22,19,15,.08);
}
.eli__label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: .4rem; }
.eli p { font-family: var(--display); font-size: 1.22rem; line-height: 1.45; margin: 0; font-variation-settings: 'SOFT' 100; }
.eli--r { transform: rotate(1.4deg); background: var(--pink); }
.eli--g { transform: rotate(-.6deg); background: #CFE0C3; }

/* research note */
.study {
  border-left: 4px solid var(--blue);
  background: var(--paper-2);
  padding: 1.25rem 1.5rem;
  border-radius: 0 12px 12px 0;
  margin: 1.75rem 0;
}
.study__label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); display: block; margin-bottom: .35rem; }
.study p { margin-bottom: .5em; }
.study cite { font-family: var(--mono); font-size: .76rem; font-style: normal; color: var(--ink-3); display: block; }
.study--warn { border-color: var(--red); }
.study--warn .study__label { color: var(--red); }

/* big stat */
.stat { border-top: 1.5px solid currentColor; padding-top: 1rem; }
.stat__n { font-family: var(--display); font-size: var(--step-4); line-height: 1; letter-spacing: -.04em; display: block; margin-bottom: .4rem; }
.stat__l { font-size: .95rem; color: inherit; opacity: .8; }

/* pull quote */
.pull { font-family: var(--display); font-size: var(--step-3); line-height: 1.12; letter-spacing: -.02em; font-weight: 400; max-width: 22ch; margin: 0; font-variation-settings: 'SOFT' 100, 'opsz' 144; }
.pull cite { display: block; font-family: var(--mono); font-size: .8rem; font-style: normal; margin-top: 1.25rem; letter-spacing: .05em; opacity: .7; }

/* list with numbers */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .85rem; color: var(--red); padding-top: .3rem; }
.steps h4 { margin-bottom: .25rem; }
.steps p { margin: 0; color: var(--ink-2); }

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { padding-left: 1.6rem; position: relative; margin-bottom: .55rem; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--red); }
.ticks--x li::before { background: none; border: 2px solid var(--ink-3); width: .6rem; height: .6rem; }

/* do / don't */
.dd { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.dd > div { border-radius: 14px; padding: 1.2rem 1.4rem; }
.dd .do { background: #D7E5D0; }
.dd .dont { background: #F5CFC4; }
.dd b { font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: .35rem; }
@media (max-width: 600px) { .dd { grid-template-columns: 1fr; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 600 1rem var(--body); text-decoration: none;
  padding: .95rem 1.5rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink);
  cursor: pointer; transition: transform .35s var(--ease), background .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); background: var(--red); border-color: var(--red); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); padding: 1rem 0; }
.marquee__track { display: flex; gap: 3rem; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { font-family: var(--display); font-size: var(--step-2); font-style: italic; white-space: nowrap; display: inline-flex; align-items: center; gap: 3rem; }
.marquee span::after { content: '✺'; font-style: normal; color: var(--yellow); font-size: .8em; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- chapter index (home) ---------- */
.toc { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.toc li { border-bottom: 1.5px solid var(--ink); }
.toc a {
  display: grid; grid-template-columns: 5rem 1fr auto; align-items: center; gap: 1.5rem;
  padding: 1.6rem .5rem; text-decoration: none; position: relative; overflow: hidden; isolation: isolate;
}
.toc a::before { content: ''; position: absolute; inset: 0; background: var(--c, var(--yellow)); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); z-index: -1; }
.toc a:hover::before { transform: scaleY(1); }
.toc .n { font-family: var(--mono); font-size: .9rem; }
.toc .t { font-family: var(--display); font-size: var(--step-3); letter-spacing: -.03em; line-height: 1; transition: transform .5s var(--ease); }
.toc a:hover .t { transform: translateX(12px); font-style: italic; }
.toc .d { font-size: .95rem; color: var(--ink-2); max-width: 30ch; text-align: right; }
@media (max-width: 760px) { .toc a { grid-template-columns: 2.5rem 1fr; } .toc .d { display: none; } }

/* ---------- next chapter footer ---------- */
.next { display: block; text-decoration: none; padding: clamp(3rem, 8vw, 6rem) 0; background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.next .kicker { color: #A9A094; }
.next__t { font-family: var(--display); font-size: var(--step-5); line-height: .95; letter-spacing: -.04em; display: flex; align-items: center; gap: .3em; transition: transform .6s var(--ease); }
.next:hover .next__t { transform: translateX(1.5rem); font-style: italic; color: var(--yellow); }
.next__dot { position: absolute; right: -8vw; top: 50%; width: 30vw; aspect-ratio: 1; border-radius: 50%; background: var(--red); transform: translateY(-50%) scale(.2); transition: transform .8s var(--ease); }
.next:hover .next__dot { transform: translateY(-50%) scale(1); }

.foot { padding: 2.5rem 0; font-size: .85rem; color: var(--ink-3); border-top: 1px solid var(--line); }
.foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- demos (interactive) ---------- */
.demo { border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--paper); margin: 2rem 0; }
.demo__bar { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.1rem; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.demo__bar .dots { display: flex; gap: 6px; }
.demo__bar .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); }
.demo__bar .dots i:nth-child(1) { background: var(--red); }
.demo__bar .dots i:nth-child(2) { background: var(--yellow); }
.demo__bar .dots i:nth-child(3) { background: var(--green); }
.demo__body { padding: clamp(1.25rem, 3vw, 2.25rem); }
.controls { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.controls label { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; display: flex; flex-direction: column; gap: .4rem; }
input[type=range] { accent-color: var(--red); width: 180px; }
input[type=color] { width: 54px; height: 38px; border: 1.5px solid var(--ink); border-radius: 10px; padding: 2px; background: var(--paper); cursor: pointer; }
select { font: 500 .95rem var(--body); padding: .5rem .8rem; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); }
.chip { font: 600 .82rem var(--body); padding: .5rem .95rem; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; cursor: pointer; transition: all .25s var(--ease); }
.chip:hover { background: var(--paper-2); }
.chip.on { background: var(--ink); color: var(--paper); }

/* swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.sw { border-radius: 14px; aspect-ratio: 1 / 1.1; padding: .85rem; display: flex; flex-direction: column; justify-content: flex-end; font-family: var(--mono); font-size: .72rem; border: 1.5px solid rgba(22,19,15,.15); transition: transform .4s var(--ease); }
.sw:hover { transform: translateY(-6px) rotate(-1deg); }
.sw b { font-family: var(--body); font-size: .95rem; display: block; }

/* color wheel */
.wheel-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem; align-items: center; }
@media (max-width: 760px) { .wheel-wrap { grid-template-columns: 1fr; } }
.wheel { width: 300px; height: 300px; border-radius: 50%; position: relative; background: conic-gradient(from 90deg, hsl(0 80% 55%), hsl(30 85% 55%), hsl(60 85% 52%), hsl(90 60% 48%), hsl(120 55% 42%), hsl(150 55% 42%), hsl(180 60% 42%), hsl(210 70% 50%), hsl(240 70% 58%), hsl(270 55% 55%), hsl(300 55% 52%), hsl(330 70% 55%), hsl(360 80% 55%)); border: 1.5px solid var(--ink); }
.wheel::after { content: ''; position: absolute; inset: 32%; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); }
.wheel__dot { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px var(--ink); top: 50%; left: 50%; margin: -13px; transition: transform .6s var(--ease); z-index: 2; }

/* contrast */
.contrast-preview { border-radius: 14px; padding: 2rem; border: 1.5px solid var(--line); transition: background .3s, color .3s; }
.contrast-preview .big { font-family: var(--display); font-size: 2.2rem; line-height: 1.1; margin-bottom: .5rem; }
.badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.badge { font-family: var(--mono); font-size: .75rem; padding: .3rem .7rem; border-radius: 999px; background: var(--ink); color: var(--paper); }
.badge.fail { background: var(--red); }
.badge.pass { background: var(--green); }
.ratio { font-family: var(--display); font-size: var(--step-4); line-height: 1; letter-spacing: -.04em; }

/* type scale */
.scale-row { display: grid; grid-template-columns: 6rem 1fr; align-items: baseline; gap: 1rem; border-bottom: 1px dashed var(--line); padding: .5rem 0; overflow: hidden; }
.scale-row .mono { color: var(--ink-3); font-size: .72rem; }
.scale-row div:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }

/* specimen */
.specimen { font-family: var(--display); font-size: clamp(7rem, 22vw, 18rem); line-height: .85; letter-spacing: -.05em; font-variation-settings: 'SOFT' 0, 'opsz' 144, 'wght' 400; transition: font-variation-settings 1.2s var(--ease); cursor: default; user-select: none; }
.specimen:hover { font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 850; }

/* gestalt demo tiles */
.gest { aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 14px; display: grid; place-items: center; background: var(--paper); padding: 1rem; }
.gest svg { width: 80%; height: auto; }
.gest-cap { margin-top: .8rem; }
.gest-cap h4 { margin-bottom: .2rem; }
.gest-cap p { font-size: .93rem; color: var(--ink-2); margin: 0; }

/* layout demo */
.lay { aspect-ratio: 4/3; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper); position: relative; overflow: hidden; }
.lay .b { position: absolute; background: var(--ink); border-radius: 3px; transition: all .8s var(--ease); }

/* roadmap */
.phase { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; padding: 3rem 0; border-top: 1.5px solid var(--ink); position: relative; }
.phase__side { position: sticky; top: 96px; align-self: start; }
.phase__n { font-family: var(--display); font-size: 5rem; line-height: .9; letter-spacing: -.05em; font-weight: 300; }
.phase__when { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.phase__bar { height: 6px; background: var(--paper-3); border-radius: 99px; margin-top: 1rem; overflow: hidden; }
.phase__bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .6s var(--ease); }
@media (max-width: 800px) { .phase { grid-template-columns: 1fr; gap: 1rem; } .phase__side { position: static; } }
.task { display: flex; gap: .9rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; cursor: pointer; transition: background .25s; }
.task:hover { background: var(--paper-2); }
.task input { appearance: none; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 6px; margin-top: .2rem; display: grid; place-items: center; cursor: pointer; transition: background .25s; }
.task input::after { content: ''; width: 10px; height: 6px; border-left: 2.5px solid var(--paper); border-bottom: 2.5px solid var(--paper); transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .3s var(--ease); }
.task input:checked { background: var(--green); border-color: var(--green); }
.task input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.task input:checked + span { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; color: var(--ink-3); }
.task b { display: block; }
.task small { color: var(--ink-3); font-size: .88rem; }
.overall { display: flex; align-items: center; gap: 1.2rem; }
.overall__ring { width: 84px; height: 84px; }
.overall__ring circle { fill: none; stroke-width: 8; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.5rem 0; }
.tbl th { text-align: left; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; padding: .7rem .8rem; border-bottom: 1.5px solid var(--ink); }
.tbl td { padding: .9rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: var(--paper-2); }
.tbl .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: .5rem; border: 1px solid rgba(0,0,0,.15); }
.tbl-wrap { overflow-x: auto; }

/* glossary */
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); }
.gloss div { padding: 1.2rem 1rem 1.2rem 0; border-bottom: 1px solid var(--line); }
.gloss dt { font-family: var(--display); font-size: 1.3rem; margin-bottom: .2rem; }
.gloss dd { margin: 0; font-size: .93rem; color: var(--ink-2); }

/* books */
.book { aspect-ratio: 2/3; border-radius: 4px 12px 12px 4px; padding: 1.2rem 1rem 1rem 1.4rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; box-shadow: inset 6px 0 0 rgba(0,0,0,.18), 0 20px 30px -20px rgba(0,0,0,.5); transition: transform .5s var(--ease); }
.book:hover { transform: translateY(-10px) rotate(-2deg); }
.book h4 { font-size: 1.15rem; line-height: 1.1; }
.book small { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

/* hero */
.hero { padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.hero h1 { max-width: 11ch; }
.hero h1 .row { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.hero h1 .row > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero h1 .row:nth-child(2) > span { animation-delay: .12s; }
.hero h1 .row:nth-child(3) > span { animation-delay: .24s; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; }
.hero__art { width: 100%; max-width: 560px; aspect-ratio: 1; justify-self: end; overflow: visible; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } .hero__art { max-width: 420px; justify-self: start; } }

/* floating shapes */
.float { animation: float 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.float.d1 { animation-delay: -1.5s; animation-duration: 8s; }
.float.d2 { animation-delay: -3s; animation-duration: 9s; }
.float.d3 { animation-delay: -4.5s; animation-duration: 6.5s; }
.spin { animation: spin 22s linear infinite; transform-box: fill-box; transform-origin: center; }
.spin-r { animation: spin 30s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.pulse { animation: pulse 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.blink { animation: blink 5s infinite; transform-box: fill-box; transform-origin: center; }

/* draw-on SVG lines */
.draw path, .draw line, .draw circle, .draw polyline, .draw rect, .draw ellipse { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); transition: stroke-dashoffset 2.2s var(--ease); }
.draw.in path, .draw.in line, .draw.in circle, .draw.in polyline, .draw.in rect, .draw.in ellipse { stroke-dashoffset: 0; }

/* scroll reveal */
.rv { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .1s; } .rv-d2 { transition-delay: .2s; } .rv-d3 { transition-delay: .3s; } .rv-d4 { transition-delay: .4s; }

/* hover-reveal emphasis on inline terms */
.term { border-bottom: 2px dotted var(--red); cursor: help; position: relative; }
.term:hover::after { content: attr(data-tip); position: absolute; left: 0; bottom: 130%; width: 260px; background: var(--ink); color: var(--paper); font-size: .85rem; line-height: 1.45; padding: .7rem .9rem; border-radius: 10px; z-index: 20; animation: pop .25s var(--ease); }

@keyframes rise { to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(4deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
  .hero h1 .row > span { transform: none; }
  .draw path, .draw line, .draw circle, .draw polyline, .draw rect, .draw ellipse { stroke-dashoffset: 0; }
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* chips on dark bands */
.band-ink .chip { color: var(--paper); border-color: var(--paper); }
.band-ink .chip:hover { background: #2a251f; }
.band-ink .chip.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }


/* ==========================================================================
   v2 — typography refinements
   ========================================================================== */
body { font-kerning: normal; font-optical-sizing: auto; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, .pull, .lede { text-wrap: balance; }
p, li, dd { text-wrap: pretty; hanging-punctuation: first; }
.stat__n, .ratio, .phase__n, .chap__num, .mono { font-variant-numeric: lining-nums tabular-nums; }
main { animation: pagein .9s var(--ease) both; }
@keyframes pagein { from { opacity: 0; transform: translateY(14px); } }

/* parallax art follows the pointer */
.hero__art, .chap__art { transform: translate(calc(var(--mx, 0) * 16px), calc(var(--my, 0) * 16px)); transition: transform .9s var(--ease); }

/* icons */
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.ic-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--paper-2); margin-bottom: 1rem; transition: transform .5s var(--ease), background .3s; }
.ic-badge .ic { width: 24px; height: 24px; }
.card:hover .ic-badge { transform: rotate(-8deg) scale(1.08); background: var(--yellow); }
.band-ink .ic-badge { border-color: #3a342c; background: #2a251f; }
.band-ink .card:hover .ic-badge { color: var(--ink); }
.phase__ic { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; margin-bottom: 1rem; background: var(--paper); }
.phase__ic .ic { width: 26px; height: 26px; }

/* ==========================================================================
   Explainer player — motion-graphic storyboards
   ========================================================================== */
.ex { border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); overflow: hidden; box-shadow: 8px 8px 0 var(--ink); margin: 0; color: var(--ink); }
.ex__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem .7rem 1.2rem; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); }
.ex__title { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: .65rem; }
.ex__rec { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.ex.is-playing .ex__rec { background: var(--red); animation: pulse 1.4s ease-in-out infinite; }
.ex__ctrl { display: flex; gap: .4rem; }
.ex__ctrl button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: background .25s, transform .3s var(--ease); }
.ex__ctrl button:hover { background: var(--yellow); transform: rotate(-10deg); }
.ex__ctrl .i-pause { display: none; }
.ex.is-playing .ex__ctrl .i-pause { display: block; }
.ex.is-playing .ex__ctrl .i-play { display: none; }
.ex__body { display: grid; grid-template-columns: 1.65fr 1fr; }
.ex__stage { position: relative; aspect-ratio: 16 / 10; container-type: inline-size; overflow: hidden; background: var(--paper); border-right: 1.5px solid var(--ink); transition: background .9s var(--ease); }
.ex__stage .o { position: absolute; transition: all .95s var(--ease); }
.ex--init .ex__stage .o { transition: none !important; }
.ex__stage .tx { white-space: nowrap; line-height: 1; font-family: var(--display); }
.ex__stage .mn { font-family: var(--mono); white-space: nowrap; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
.ex__stage .sn { font-family: var(--body); white-space: nowrap; line-height: 1.1; }
.ex__stage .pill { border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: .35em; font-family: var(--body); font-weight: 600; white-space: nowrap; }
.ex__stage .bub { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 1.6cqw; padding: .55em .85em; font-family: var(--body); white-space: nowrap; line-height: 1.2; }
.ex__stage .ring { border: 2px solid var(--red); border-radius: 50%; animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(226,70,43,.45); } 100% { box-shadow: 0 0 0 2.4cqw rgba(226,70,43,0); } }
.ex__caps { list-style: none; margin: 0; padding: 1rem; counter-reset: c; display: flex; flex-direction: column; gap: .15rem; justify-content: center; }
.ex__caps li { counter-increment: c; display: grid; grid-template-columns: 2.1rem 1fr; padding: .7rem .8rem; border-radius: 12px; cursor: pointer; opacity: .42; font-size: .93rem; line-height: 1.45; transition: opacity .4s, background .4s, transform .5s var(--ease); }
.ex__caps li::before { content: attr(data-n); font-family: var(--mono); font-size: .74rem; color: var(--red); padding-top: .2rem; }
.ex__caps li:hover { opacity: .75; }
.ex__caps li.on { opacity: 1; background: var(--paper-2); transform: translateX(4px); }
.ex__caps li b { display: block; font-family: var(--display); font-weight: 500; font-size: 1.12rem; line-height: 1.2; margin-bottom: .15rem; }
.ex__bar { height: 4px; background: var(--paper-3); }
.ex__bar i { display: block; height: 100%; width: 0; background: var(--red); }
.ex__bar i.run { animation: exbar var(--dur, 3.4s) linear forwards; }
@keyframes exbar { to { width: 100%; } }
.ex-sec { padding: clamp(3rem, 6vw, 5rem) 0; border-bottom: 1px solid var(--line); }
.ex-sec .kicker { margin-bottom: 1rem; }
.ex-sec h2 { font-size: var(--step-3); max-width: 24ch; margin-bottom: 1.8rem; }
.band-ink .ex { box-shadow: 8px 8px 0 var(--red); }
@media (max-width: 900px) {
  .ex__body { grid-template-columns: 1fr; }
  .ex__stage { border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .ex__caps li:not(.on) { display: none; }
  .ex__caps { min-height: 8.5rem; justify-content: flex-start; }
  .ex { box-shadow: 5px 5px 0 var(--ink); }
}

/* ==========================================================================
   Research library
   ========================================================================== */
.ev { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; padding: .28rem .65rem; border-radius: 999px; color: var(--paper); white-space: nowrap; }
.ev .ic { width: 13px; height: 13px; }
.ev--strong { background: var(--green); }
.ev--moderate { background: var(--blue); }
.ev--weak { background: var(--red); }
.ev--guide { background: var(--ink); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.ref { border: 1.5px solid var(--ink); border-radius: 16px; padding: 1.4rem 1.4rem 1.2rem; background: var(--paper); display: flex; flex-direction: column; gap: .6rem; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.ref:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.ref.hide { display: none; }
.ref__top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.ref__ch { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.ref h4 { font-size: 1.2rem; margin: .2rem 0 0; }
.ref p { font-size: .93rem; margin: 0; color: var(--ink-2); }
.ref .meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); line-height: 1.5; }
.ref a.src { margin-top: auto; font-weight: 600; font-size: .88rem; display: inline-flex; gap: .35rem; align-items: center; text-decoration: none; border-bottom: 1.5px solid var(--red); align-self: flex-start; padding-bottom: 2px; }
.ref a.src:hover { color: var(--red); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.filters .lbl { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-right: .4rem; min-width: 5.5rem; }
.ev-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2rem; }
.ev-legend > div { border-top: 1.5px solid currentColor; padding-top: .8rem; font-size: .93rem; }
@media (max-width: 800px) { .ev-legend { grid-template-columns: 1fr 1fr; } }
