/* ColorPages case study only. Loaded after site.css.

   The masthead's three app screens, pinned on the canvas (.cp-wall), from the
   colorpages-hero spike (studies/colorpages-hero/README.md, R13). Then two
   figures drawn in the product's own skin, from the colorpages-figures
   spike (studies/colorpages-figures/README.md):

   - Fig. 02, the repair dock as the key: each tool plays one real repair,
     zoomed on the change (.cp-tools).
   - Fig. 06, one planning session replayed from its record (.cp-plan).

   Everything app-skinned sits under .cpapp, whose tokens are the app's own
   (ColorPagesApp web/src/index.css), so none of it leaks into the page.

   Last, the figures from the colorpages-narrative spike
   (studies/colorpages-narrative/README.md), drawn in the portfolio's own
   hairline vocabulary, not the app's: the trade-off table and chapter index
   (#problem), Fig. 01's range, and Figs. 03 and 04.

   Fig. 05, the first planner's transcript rolling beside its copy (.cp-first),
   is from the colorpages-first-planner spike
   (studies/colorpages-first-planner/README.md, F). */

/* --- Masthead: the plain opening panel, varied one way ------------------ */
/* The headline is set in Figtree, the app's own face (loaded by the page),
   with the pinned wall as the cover art at the panel's foot, cut by its
   bottom edge (masthead-variety spike, c2; plain-layout port). */
body[data-study="colorpages"] .case-hero h1 { font-family: Figtree, var(--sans); letter-spacing: -0.035em; max-width: 22ch; }

/* --- Masthead: three app screens pinned on the canvas -------------------- */
/* Geometry is leadership-texture C's wall; only the centre card moves to the
   front. */
.cp-wall { position: relative; height: 52rem; margin-top: 0.8rem; }
.cp-pin { position: absolute; margin: 0; background: #fff; padding: 1rem 1rem 0.8rem; border-radius: 0.3rem;
  box-shadow: 0 1px 2px rgba(42, 32, 24, 0.1), 0 1.4rem 3rem -1.4rem rgba(42, 32, 24, 0.38); }
.cp-pin img { display: block; width: 100%; height: auto; }
.cp-pin figcaption { text-align: left; margin-top: 0.8rem; font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.cp-pin::before { content: ""; position: absolute; top: -0.7rem; left: 50%; width: 1.4rem; height: 1.4rem; margin-left: -0.7rem;
  border-radius: 50%; background: var(--accent); box-shadow: 0 2px 0.3rem rgba(0, 0, 0, 0.25); z-index: 1; }
.cp-pin-left { left: 0; top: 6rem; width: 40%; transform: rotate(-2.2deg); z-index: 2; }
.cp-pin-centre { left: 30%; top: 0; width: 44%; transform: rotate(1.2deg); z-index: 4; }
.cp-pin-right { right: 0; top: 9rem; width: 30%; transform: rotate(2.4deg); z-index: 3; }
@media (max-width: 991px) {
  .cp-wall { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; padding-bottom: 2.4rem; }
  .cp-pin { position: relative; left: auto; right: auto; top: auto; width: auto; }
  .cp-pin-centre { grid-column: 1 / -1; order: -1; }
}

.cpapp {
  --c-canvas: #faf5ee; --c-surface: #fff; --c-sunk: #f3ede3;
  --c-ink: #2a2018; --c-ink-muted: #6b5d50; --c-ink-faint: #756759; --c-ink-ghost: #c4b7a6;
  --c-line: #e7ddce; --c-line-strong: #d6c8b4; --c-line-soft: #f1e9dc;
  --c-accent: #cc2062; --c-accent-ink: #a81450; --c-accent-tint: #fde8f0;
  --c-ok: #0b7f5a; --c-ok-ink: #076b4b; --c-ok-tint: #e1f6ee; --c-ok-line: #a9e3cb;
  --c-warn-ink: #8a5300;
  --c-shadow-card: 0 1px 2px rgb(64 40 16 / .07), 0 0.3rem 1rem -0.3rem rgb(64 40 16 / .1);
  --c-shadow-pop: 0 1.2rem 2.8rem -0.8rem rgb(64 40 16 / .24), 0 2px 0.6rem rgb(64 40 16 / .08);
  --c-settle: cubic-bezier(.22, 1, .36, 1);
  font-family: 'Figtree', system-ui, sans-serif; color: var(--c-ink);
  font-size: 1.4rem; line-height: 1.43;
}
.cpapp *, .cpapp *::before, .cpapp *::after { box-sizing: border-box; }
.cpapp p { margin: 0; }
.cpapp button { font: inherit; color: inherit; }
.cpapp .cp-i { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cpapp .cp-btn { display: inline-block; border: 1px solid var(--c-line-strong); background: var(--c-surface);
  border-radius: 1rem; padding: 0.6rem 1.4rem; font-size: 1.3rem; font-weight: 600; transition: transform 120ms ease; }
.cpapp .cp-btn.is-ghost { border-color: transparent; background: var(--c-sunk); color: var(--c-ink-ghost); }
.cpapp .cp-btn.is-accent { border-color: var(--c-accent); background: var(--c-accent); color: #fff; }
.cpapp .cp-btn.is-pressed { transform: scale(.96); }

/* --- Fig. 02: the dock as the key ---------------------------------------- */

.cp-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.4rem; align-items: start;
  width: 100%; max-width: 72rem; margin: 0 auto; }
.cp-tools-side { display: grid; gap: 0.8rem; justify-items: center; }
.cp-dock { display: flex; flex-direction: column; gap: 2px; padding: 0.4rem; background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 1.5rem; box-shadow: var(--c-shadow-card); }
.cp-dock button { position: relative; width: 5.2rem; padding: 0.7rem 0 0.6rem; border: 0; background: none; border-radius: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 1.1rem; font-weight: 600;
  color: var(--c-ink); cursor: pointer; transition: background-color 120ms ease, color 120ms ease; }
@media (hover: hover) { .cp-dock button:hover { background: var(--c-sunk); } }
.cp-dock button[aria-pressed="true"] { background: var(--c-accent-tint); color: var(--c-accent-ink); }
.cp-dock button:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
/* Redraw is the one queued tool: the dot, and the key under the dock. */
.cp-dock .is-queued::after { content: ""; position: absolute; right: 0.5rem; top: 0.6rem; width: 0.5rem; height: 0.5rem;
  border-radius: 50%; background: var(--c-warn-ink); }
.cp-tools-key { font: 600 0.95rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-faint); }
.cp-tools-key::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem;
  border-radius: 50%; background: var(--c-warn-ink); vertical-align: 1px; }

.cp-tool-win { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--c-line);
  border-radius: 1.2rem; box-shadow: var(--c-shadow-card); }
.cp-tool-win img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cp-tool-after, .cp-tool-mask { position: absolute; inset: 0; }
.cp-tool-after { opacity: 0; transition: opacity 600ms ease; }
.cp-tool-mask { opacity: 0; transition: opacity 400ms ease; }
.cp-tool.is-small .cp-tool-win { max-width: 44rem; margin: 0 auto; }
.cp-tool.is-small .cp-tool-win img { image-rendering: pixelated; }
.cp-tool-tag { position: absolute; top: 1rem; padding: 0.5rem 0.7rem; border-radius: 0.5rem; background: rgba(255, 255, 255, .92);
  font: 600 1rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-faint);
  transition: opacity 300ms ease; }
.cp-tool-tag.is-before { left: 1rem; }
.cp-tool-tag.is-after { right: 1rem; opacity: 0; color: var(--c-ok-ink); }
.cp-tool-cap { margin-top: 1.2rem !important; max-width: 60ch; font-size: 1.4rem; color: var(--c-ink-muted); }

/* Where to look: a ring on the changed region (inline --rl/--rt/--rw/--rh,
   cut from the before/after diff), and the brush that makes the change
   (--cy, --cs), drawn as the app draws its pointer ring. */
.cp-tool-ring { position: absolute; left: var(--rl); top: var(--rt); width: var(--rw); height: var(--rh);
  border: 2px dashed var(--c-accent); border-radius: 1rem; opacity: 0; transition: opacity 300ms ease; pointer-events: none; }
.cp-tool-cursor { position: absolute; left: var(--rl); top: var(--cy); width: var(--cs); aspect-ratio: 1;
  border-radius: 50%; border: 1.5px solid var(--c-ink); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9);
  transform: translate(-50%, -50%); opacity: 0; transition: opacity 200ms ease; pointer-events: none; }

/* Play states, set by the page script, in order: ringed, brush (the stroke
   starts at the ring's left edge), sweep (it crosses the ring), done (the
   picked page), flip (back to before, twice, so the change reads on a second
   look). Erase and ink paint the picked page in under the brush, as the app's
   opaque white and black do; Redraw paints its translucent mask instead, and
   move and paste cross-fade. Outside the ring the two images are identical,
   so a full-height stroke only changes what the brush is over. */
.cp-tool.is-ringed .cp-tool-ring { opacity: 1; }
.cp-tool.is-brush .cp-tool-cursor { opacity: 1; }
.cp-tool.is-sweep .cp-tool-cursor { left: calc(var(--rl) + var(--rw)); transition: left 1.1s linear, opacity 200ms ease; }
.cp-tool:not([data-tool="redraw"]).is-brush .cp-tool-after { opacity: 1; transition: none;
  clip-path: inset(0 calc(100% - var(--rl)) 0 0); }
.cp-tool[data-tool="redraw"].is-brush .cp-tool-mask { opacity: 1; transition: none;
  clip-path: inset(0 calc(100% - var(--rl)) 0 0); }
.cp-tool:not([data-tool="redraw"]).is-sweep .cp-tool-after,
.cp-tool[data-tool="redraw"].is-sweep .cp-tool-mask { clip-path: inset(0 calc(100% - var(--rl) - var(--rw)) 0 0);
  transition: clip-path 1.1s linear; }
.cp-tool.is-marked .cp-tool-mask { opacity: 1; }
.cp-tool.is-done .cp-tool-after { opacity: 1; }
.cp-tool.is-done .cp-tool-mask, .cp-tool.is-done .is-before { opacity: 0; }
.cp-tool.is-done .is-after { opacity: 1; }
.cp-tool.is-done.is-flip .cp-tool-after, .cp-tool.is-done.is-flip .is-after { opacity: 0; }
.cp-tool.is-done.is-flip .is-before { opacity: 1; }
.cp-tool.is-flip .cp-tool-after { transition-duration: 250ms; }

/* Redraw's ask, as the app's panel sets it: the brushed region, then the
   words, then the button. Space is held so the caption does not jump. */
.cp-tool-ask { display: flex; align-items: center; gap: 1rem; max-width: 56rem; margin-top: 1rem; padding: 1rem;
  background: var(--c-surface); border-radius: 1.4rem; box-shadow: var(--c-shadow-pop);
  opacity: 0; transform: translateY(0.6rem); transition: opacity 300ms ease, transform 300ms var(--c-settle); }
.cp-tool.is-asked .cp-tool-ask { opacity: 1; transform: none; }
.cp-ask-field { flex: 1; min-width: 0; margin: 0 !important; padding: 0.8rem 1rem; border: 1px solid var(--c-line-strong);
  border-radius: 1rem; font-size: 1.4rem; line-height: 1.35; color: var(--c-ink); min-height: 2.7em; }
.cp-ask-ph { color: var(--c-ink-ghost); }
.cp-ask-text:empty { display: none; }
.cp-ask-field:has(.cp-ask-text:not(:empty)) .cp-ask-ph { display: none; }
.cp-tool.is-typing .cp-ask-text::after { content: ""; display: inline-block; width: 1.5px; height: 1.05em;
  margin-left: 1px; vertical-align: -2px; background: var(--c-ink); }
.cp-ask-go { flex: none; white-space: nowrap; }

body.is-flat .cp-tool * { transition: none !important; }

@media (max-width: 767px) {
  .cp-tools { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .cp-tools-side { order: -1; }
  .cp-tools-side .cp-dock { flex-direction: row; max-width: 100%; }
  .cp-tools-side .cp-dock button { width: 4.8rem; }
  .cp-tools-key { display: none; }
}

/* --- Fig. 06: one planning session, replayed ----------------------------- */

.cp-plan { width: 100%; }
.cp-plan-win { background: var(--c-canvas); border: 1px solid var(--c-line); border-radius: 1.4rem;
  overflow: hidden; box-shadow: var(--c-shadow-pop); }
.cp-plan-head { display: flex; align-items: center; gap: 1.2rem; padding: 0.9rem 1.6rem; border-bottom: 1px solid var(--c-line); font-size: 1.35rem; }
.cp-plan-back { font-size: 1.3rem; color: var(--c-ink-muted); }
.cp-plan-bars { display: flex; gap: 0.3rem; margin-left: auto; }
.cp-plan-bars i { width: 1.4rem; height: 0.3rem; border-radius: 2px; background: var(--c-line-strong); transition: background-color 300ms ease; }
.cp-plan-bars i.is-done { background: var(--c-ink); }
.cp-plan-bars i.is-now { background: var(--c-accent); }
.cp-plan-badge { padding: 2px 0.9rem; border-radius: 999.9rem; background: var(--c-sunk); white-space: nowrap;
  font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-muted); }
.cp-plan-body { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; height: 53rem; }
.cp-plan-thread { position: relative; overflow: hidden; padding: 1.4rem 1.6rem 0; }
.cp-plan-scroll { transition: transform 700ms var(--c-settle); }
.cp-plan-ladder { display: flex; flex-direction: column; min-height: 0; background: var(--c-canvas); border-left: 1px solid var(--c-line); }
.cp-plan-lh { display: flex; justify-content: space-between; padding: 1.4rem 1.4rem 0.8rem; font-size: 1.1rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-faint); }
.cp-plan-rungs { flex: 1; display: grid; align-content: start; gap: 0.8rem; margin: 0; padding: 0.4rem 1.4rem; overflow: hidden; list-style: none; }
.cp-plan-rungs li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.8rem; }
.cp-plan-rl { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-faint); }
.cp-plan-rv { font-size: 1.25rem; font-weight: 600; line-height: 1.35; color: var(--c-ink-ghost); }
.cp-plan-rungs li.is-settled .cp-plan-rv { color: var(--c-ink); }
.cp-plan-rungs li.is-now .cp-plan-rv { color: var(--c-accent-ink); }
.cp-plan-create { padding: 1.2rem 1.4rem; border-top: 1px solid var(--c-line); }
.cp-plan-create .cp-btn { display: block; text-align: center; color: var(--c-ink-ghost); }
.cp-plan-create .cp-btn.is-accent { color: #fff; }
/* The replay's control, drawn as a playback timeline in the portfolio's ink
   and rules rather than the app's palette, so it reads as the figure's and
   not the planner's (colorpages-fig06-scrub spike). */
.cp-plan-scrub { display: flex; align-items: center; gap: 1.6rem; margin-top: 2rem; }
.cp-plan-play { display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; padding: 0; border: 1px solid var(--line);
  border-radius: 999.9rem; background: #fff; color: var(--ink); cursor: pointer; }
.cp-plan-play svg { width: 0.9rem; height: 0.9rem; }
.cp-plan-play:focus-visible, .cp-plan-tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-plan-track { position: relative; flex: 1; height: 2.4rem; margin: 0 0.6rem; }
.cp-plan-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.cp-plan-fill { position: absolute; left: 0; top: calc(50% - .5px); width: 0; height: 1px; background: var(--ink); }
.cp-plan-tick { position: absolute; top: 0; width: 2.4rem; height: 2.4rem; margin-left: -1.2rem; padding: 0; border: 0; background: none; cursor: pointer; }
.cp-plan-tick::after { content: ''; position: absolute; left: 50%; top: 50%; width: 1px; height: 0.9rem; transform: translate(-50%, -50%);
  background: var(--ink-3); transition: all 200ms ease; }
.cp-plan-tick.is-past::after { background: var(--ink); }
.cp-plan-tick[aria-current]::after { width: 0.9rem; height: 0.9rem; border-radius: 999.9rem; }
.cp-plan-pos { flex: none; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .06em; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* thread parts: the app's GateCard, Beat and chips */
.cpapp .cp-node { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border: 1px solid;
  border-radius: 999.9rem; font-size: 1.1rem; font-weight: 700; }
.cpapp .cp-node.is-now { border-color: var(--c-accent); background: var(--c-accent); color: #fff; }
.cpapp .cp-node.is-done { border-color: var(--c-ink); background: var(--c-ink); color: #fff; }
.cpapp .cp-node.is-idle { border-color: var(--c-line-strong); background: #fff; color: var(--c-ink-faint); }
.cpapp .cp-bub { width: fit-content; max-width: 78%; margin: 0 0 1.2rem auto; padding: 0.8rem 1.3rem; border-radius: 1.5rem;
  background: var(--c-ink); color: #fff; font-size: 1.35rem; line-height: 1.45; }
.cpapp .cp-say { margin: 0 0 0.8rem; font-size: 1.4rem; line-height: 1.55; }
.cpapp .cp-say code { padding: 0 0.4rem; border-radius: 0.4rem; background: var(--c-sunk); font-size: 1.2rem; }
.cpapp .cp-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.2rem; }
.cpapp .cp-chips span { padding: 2px 0.9rem; border: 1px solid var(--c-line); border-radius: 999.9rem; background: var(--c-surface);
  font-size: 1.15rem; color: var(--c-ink-muted); }
.cpapp .cp-chips span::before { content: "\2713\00a0"; color: var(--c-ink-faint); }
.cpapp .cp-gate { display: flex; gap: 1.2rem; margin-bottom: 1.2rem; }
.cpapp .cp-spine { position: relative; flex: none; width: 2.4rem; }
.cpapp .cp-spine::before { content: ""; position: absolute; top: 0; bottom: -1.2rem; left: 50%; width: 1px; background: var(--c-line); }
.cpapp .cp-spine .cp-node { position: relative; }
.cpapp .cp-card { flex: 1; min-width: 0; border: 1px solid var(--c-line); border-radius: 1.5rem; background: #fff; }
.cpapp .cp-gate.is-live .cp-card { border-color: var(--c-accent); }
.cpapp .cp-card-label { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.6rem 1.2rem; border-bottom: 1px solid var(--c-line);
  border-radius: 1.4rem 1.4rem 0 0; font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-faint); }
.cpapp .cp-gate.is-live .cp-card-label { border-color: var(--c-accent); color: var(--c-accent-ink); }
.cpapp .cp-card-label .cp-open { display: none; }
.cpapp .cp-gate.is-live .cp-card-label .cp-open { display: inline; }
.cpapp .cp-card-body { padding: 1rem 1.2rem; }
.cpapp .cp-count { margin-top: 2px; font-size: 1.25rem; color: var(--c-ink-muted); }
.cpapp .cp-opts { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.cpapp .cp-opt { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.2rem; border: 1px solid var(--c-line-strong); border-radius: 1rem;
  background: #fff; transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease, color 180ms ease; }
.cpapp .cp-ring { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border: 1px solid var(--c-line-strong);
  border-radius: 999.9rem; font-size: 1rem; color: var(--c-ink); }
.cpapp .cp-opt b { display: block; font-size: 1.4rem; font-weight: 500; }
.cpapp .cp-opt small { display: block; font-size: 1.25rem; color: var(--c-ink-faint); }
.cpapp .cp-opt.is-taken { border-color: var(--c-ink); background: var(--c-ink); color: #fff; }
.cpapp .cp-opt.is-taken .cp-ring { border-color: #fff; background: #fff; }
.cpapp .cp-opt.is-taken .cp-ring::after { content: "\2713"; }
.cpapp .cp-opt.is-taken small { color: rgba(255, 255, 255, .7); }
.cpapp .cp-opt.is-dim { border-color: var(--c-line); opacity: .4; }
.cpapp .cp-disc { margin-top: 0.6rem; padding: 0.7rem 1.2rem; border: 1px solid var(--c-line); border-radius: 1rem; font-size: 1.25rem; color: var(--c-ink-muted); }
.cpapp .cp-disc::before { content: "\2304\00a0"; }
.cpapp .cp-signoff { margin-top: 1rem !important; font-size: 1.4rem; color: var(--c-ink-muted); }
.cpapp .cp-answer { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--c-line); }
.cpapp .cp-answer .cp-bub { margin-bottom: 0; }
.cpapp .cp-gate:not(.is-answered) .cp-answer { display: none; }
.cpapp .cp-gate .cp-opts, .cpapp .cp-gate .cp-disc, .cpapp .cp-gate .cp-signoff { transition: opacity 500ms ease; }
.cpapp .cp-gate.is-asking .cp-opts, .cpapp .cp-gate.is-asking .cp-disc, .cpapp .cp-gate.is-asking .cp-signoff { opacity: 0; }
.cpapp .cp-commit { margin: 0.4rem 0 1.2rem 3.6rem; padding: 1.2rem; border: 1px solid var(--c-line); border-radius: 1.5rem; background: #fff; }
.cpapp .cp-commit h4 { margin: 0 0 0.4rem; font-size: 1.5rem; font-weight: 700; }
.cpapp .cp-commit p { font-size: 1.25rem; color: var(--c-ink-muted); }
.cpapp .cp-commit .cp-btn { margin-top: 1rem; }
.cpapp .cp-commit.is-made { border-color: var(--c-ok-line); background: var(--c-ok-tint); }
.cpapp .cp-commit.is-made .cp-btn { border-color: var(--c-ok); background: var(--c-ok); }

@keyframes cp-in { from { opacity: 0; transform: translateY(0.4rem); } }
@media (prefers-reduced-motion: no-preference) {
  body:not(.is-flat) .cp-plan-rungs li.is-settled .cp-plan-rv,
  body:not(.is-flat) .cpapp .cp-gate.is-answered .cp-answer { animation: cp-in 450ms var(--c-settle); }
}

@media (max-width: 860px) {
  .cp-plan-body { grid-template-columns: minmax(0, 1fr); height: 52rem; }
  .cp-plan-ladder, .cp-plan-back { display: none; }
  .cp-plan-head b { font-size: 1.25rem; }
}

/* --- Narrative figures (colorpages-narrative spike) ----------------------- */

/* #problem: the three trade-offs, the share that became pages, and the
   hand-off into the four chapters. */
.cp-tradeoffs { margin: 0; max-width: 82rem; border-top: 1px solid var(--line); }
.cp-tradeoff { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 0.8rem 4rem;
  padding: 2.4rem 0 2.6rem; border-bottom: 1px solid var(--line); }
.cp-tradeoffs dt { margin: 0; font-size: var(--fs-item); line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.cp-tradeoffs dd { margin: 0; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-2); }
.cp-tradeoff-n { display: block; margin-bottom: 0.6rem; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: 0.08em; color: var(--ink-3); }
.cp-ratio { display: grid; grid-template-columns: max-content minmax(0, 64ch); gap: 1.2rem 4rem; align-items: start; }
.cp-ratio-num { margin: 0; font-family: var(--mono); font-weight: 600; font-size: var(--fs-number);
  line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.cp-ratio-of { display: block; margin-top: 1rem; font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.04em; color: var(--ink-3); }
@media (max-width: 767px) {
  .cp-tradeoff { grid-template-columns: minmax(0, 1fr); padding: 1.6rem 0 1.8rem; }
  .cp-ratio { grid-template-columns: minmax(0, 1fr); }
}

/* Fig. 01: one child held, six faces and six poses varied. Real picked
   pages, all from Trey's trained model. */
.cp-range { max-width: 96rem; margin: 0 auto; display: grid; gap: 2.2rem; }
.cp-range-k { margin: 0 0 1rem; display: flex; align-items: baseline; gap: 0.8rem; font-size: var(--fs-caption); line-height: 1.35; color: var(--ink-2); }
.cp-range-k.is-top { margin: 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.cp-range-key { flex: none; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink); }
.cp-range-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.2rem; }
.cp-range-grid figure { margin: 0; }
.cp-range-grid img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; }
.cp-range-grid figcaption { margin-top: 0.6rem; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.03em; line-height: 1.35; color: var(--ink-2); }
.cp-range-grid.is-faces img { border-radius: 50%; }
@media (max-width: 620px) { .cp-range-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 0.8rem; } }

/* Fig. 03: one gauge, asked for six times, each cropped to what came back. */
.cp-gauges { width: 100%; }
.cp-gauges-ask { margin: 0 0 1.6rem; font: var(--fs-label)/1.5 var(--mono); }
.cp-gauges-ask span { display: block; font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cp-gauges-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.cp-gauge { margin: 0; }
.cp-gauge img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; }
.cp-gauge figcaption { margin-top: 0.6rem; line-height: 1.35; color: var(--ink-2); }
.cp-gauge.is-fix img { border-color: var(--accent); }
.cp-gauge-count { display: flex; flex-direction: column; justify-content: center; aspect-ratio: 4 / 3; padding: 1.2rem 1.4rem;
  background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; }
.cp-gauge-count p { margin: 0; font-size: var(--fs-caption); line-height: 1.35; color: var(--ink-2); }
.cp-gauge-count .cp-gauge-zero { margin-bottom: 0.6rem; font-size: var(--fs-number); line-height: 1; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
@media (max-width: 767px) {
  .cp-gauges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .cp-gauge-count { aspect-ratio: auto; }
}

/* Fig. 04: one brief before and after the linter. Brief strings are
   verbatim, so they keep their own punctuation. */
.cp-lint { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; width: 100%; max-width: 76rem; margin: 0 auto; }
.cp-lint-col { display: flex; flex-direction: column; }
.cp-lint-when { margin: 0 0 0.8rem; font: 400 var(--fs-xs)/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cp-lint-brief { flex: 1; margin: 0; padding: 1.2rem 1.4rem; font: var(--fs-label)/1.6 var(--mono); letter-spacing: 0; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; }
.cp-lint-brief mark { background: none; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 0.3rem; }
/* The rewrite reads as correct in green, off the study accent that marks
   the errors. */
.cp-lint { --lint-ok: #1d7a4c; --lint-ok-wash: #ddf2e5; }
.cp-lint-brief mark.is-pos { text-decoration: none; color: var(--ink); background: var(--lint-ok-wash); box-shadow: 0 0 0 2px var(--lint-ok-wash); }
.cp-lint-verdict { margin: 0.8rem 0 0; font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: 0.04em; color: var(--accent); }
.cp-lint-verdict.is-pass { color: var(--lint-ok); }
.cp-lint-verdict::before { content: "✕ "; }
.cp-lint-verdict.is-pass::before { content: "✓ "; }
.cp-lint-brief.is-pos { border-color: var(--lint-ok); }
.cp-lint-why { grid-column: 1 / -1; margin: 0.4rem 0 0; font-size: var(--fs-small); line-height: 1.45; color: var(--ink); }
@media (max-width: 560px) {
  .cp-lint { grid-template-columns: 1fr; }
}

/* --- Chapter 01 attempts (colorpages-character-progression spike) ------- */
/* Four approaches on one rail. Attempts 1 to 3 are superseded: slashed
   hollow node, grey title, collapsed to the sentence that led to the next.
   Attempt 4 is where it landed: filled accent node, always open. The whole
   summary row is the hit area; "Read attempt N" names what it opens. */
.cp-attempts { display: flex; flex-direction: column; gap: 0.8rem; }
.cp-att { position: relative; padding: 0 0 2rem 4rem; }
.cp-att::before { content: ""; position: absolute; left: 0.7rem; top: 3.4rem; bottom: -0.6rem; border-left: 1.5px dashed var(--line); }
.cp-att.is-final::before { display: none; }
.cp-att-node { position: absolute; left: 0; top: 1.4rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--ink-3);
  background: linear-gradient(135deg, transparent 45%, var(--ink-3) 45%, var(--ink-3) 55%, transparent 55%), #f3f2ef; }
.cp-att.is-final .cp-att-node { top: 0.4rem; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--accent) 4.5%, transparent); }
.cp-att > summary { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; margin: 0 -1.6rem; padding: 1.2rem 1.6rem;
  border-radius: 0.6rem; list-style: none; cursor: pointer; transition: background-color 160ms var(--ease-quiet, ease); }
.cp-att > summary::-webkit-details-marker { display: none; }
.cp-att > summary:hover { background: #f3f2ef; }
.cp-att > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-att-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.cp-att-k { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.04em; color: var(--ink-3); }
.cp-att-h { margin: 0; font-size: var(--fs-item); line-height: 1.3; letter-spacing: -0.015em; color: var(--ink-2); }
.cp-att.is-final .cp-att-h { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.025em; color: var(--ink); }
.cp-att-tag { order: -1; margin-bottom: 0.4rem; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--s-mark); background: color-mix(in srgb, var(--accent) 4.5%, transparent); border-radius: 0.3rem; padding: 2px 0.6rem; }
.cp-att-limit { margin-top: 2px; max-width: 60ch; font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }
.cp-att[open] .cp-att-limit { display: none; }
.cp-att-ctl { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; font-size: var(--fs-small); font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.4rem; }
.cp-att > summary:hover .cp-att-ctl { text-decoration-color: var(--ink); }
.cp-att-close, .cp-att[open] .cp-att-open { display: none; }
.cp-att[open] .cp-att-close { display: inline; }
.cp-att-chev { width: 1.2rem; height: 1.2rem; transition: transform 200ms var(--ease-quiet, ease); }
.cp-att[open] .cp-att-chev { transform: rotate(180deg); }
.cp-att-body { display: flex; flex-direction: column; gap: 2.4rem; padding: 1.6rem 0 0.8rem; }
.cp-att.is-final .cp-att-body { padding-top: 2rem; }
@media (min-width: 768px) {
  .cp-att.is-final .cp-att-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .cp-att.is-final .cp-att-tag { order: 0; grid-column: 2; grid-row: 1; margin: 0; }
}
@media (max-width: 767px) {
  .cp-att { padding-left: 3.2rem; }
  .cp-att > summary { margin: 0 -0.8rem; padding: 1.2rem 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-att > summary, .cp-att-chev { transition: none; }
}

/* --- Fig. 05: the first planner, rolling beside its copy ---------------- */
/* One whole session scrolls past on its own at about half size, so it reads
   as a wall of text, and takes ~45s to reach Create. The window is a fixed
   300px beside the copy; the image is absolute so it can't stretch
   the row. Container units let the roll stop exactly at the image's end
   without script. Hover pauses; flat and reduced motion get a plain
   scrollable window. */
.cp-first { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4.8rem; align-items: start; }
/* In the plain layout the block starts on the reading column and runs out
   to the figures' right edge, so the window keeps its size beside the copy. */
.sec > .cp-first { width: calc(100% + (min(var(--wide), 100vw - 2 * var(--gut)) - 100%) / 2); }
.cp-first h3 { margin-top: 0; }
.cp-first h3 + div { margin-top: 1.6rem; }
.cp-first-fig figcaption { margin-top: 1.2rem; font-size: var(--fs-caption); line-height: 1.5; color: var(--ink-3); }
.cp-principle { margin: 0; max-width: 40ch; font-size: var(--fs-callout); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; }
.sec > .cp-principle { margin-top: 3.2rem; }
.cp-first-fig { display: flex; flex-direction: column; margin: 0; }
.cp-first-win { position: relative; flex: none; height: 30rem; overflow: hidden; container-type: size; background: #faf5ee;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.8rem, #000 calc(100% - 2.8rem), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 2.8rem, #000 calc(100% - 2.8rem), transparent 100%); }
.cp-first-win img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: auto; max-width: none; }
@media (prefers-reduced-motion: no-preference) {
  body:not(.is-flat) .cp-first-win img { animation: cp-first-roll 48s linear infinite; }
  body:not(.is-flat) .cp-first-win:hover img { animation-play-state: paused; }
}
@keyframes cp-first-roll {
  0%, 3% { transform: translateY(0); }
  94%, 100% { transform: translateY(calc(-100% + 100cqh)); }
}
@media (prefers-reduced-motion: reduce) { .cp-first-win { overflow-y: auto; } .cp-first-win img { position: static; } }
body.is-flat .cp-first-win { overflow-y: auto; }
body.is-flat .cp-first-win img { position: static; }
@media (max-width: 767px) {
  .cp-first { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
  .sec > .cp-first { width: auto; }
  .cp-first-win { height: 32rem; }
  .cp-first-win img { width: 160%; }
}
