/* Austra Cukura — portfolio
   Editorial workshop. Warm oat paper, heavy serif display,
   monospace labels, a single deep-green accent. Made, not generated. */

:root {
  --background: #F4EFE4;  /* warm oat paper */
  --surface:    #ECE4D3;
  --ink:        #1E1A12;  /* warm near-black */
  --ink-muted:  #6B6149;  /* warm taupe — AA on paper */
  --neutral:    #4A4334;  /* mid tone — decks, demoted credits */
  --rule:       #DBD1BD;
  --rule-strong:#8A7E60;  /* interactive control borders — ≥3:1, WCAG 1.4.11 */
  --accent:     #262017;
  --pop:        #2E6B4A; /* deep green — identity, links, live markers, the chosen option */
  --paper-white: #FCFBF8; /* warm near-white for UI surfaces — never pure #FFF */

  --radius-sm:   4px;    /* thumbnails, small inset frames        */
  --radius:      6px;    /* default — figures, demos, cards        */
  --radius-pill: 999px;  /* segmented controls, note pills, dot    */
  --rule-soft:  #E6DDCB;
  --shadow:     0 1px 2px rgba(30, 26, 18, 0.03), 0 8px 22px rgba(30, 26, 18, 0.05);
  --shadow-lift: 0 2px 4px rgba(30, 26, 18, 0.04), 0 16px 38px rgba(30, 26, 18, 0.09);

  /* ── Motion language ──────────────────────────────────────────────
     One curve, two speeds — borrowed from Linear's coherence. State
     changes (colour, border, background) register fast on --dur-1;
     positional reveals (arrows, underline draws) ease in on --dur-2.
     Everything shares --ease, so the whole site moves as one material. */
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 120ms;   /* hover / state feedback — crisp   */
  --dur-2: 240ms;   /* reveals, draws, fades — smooth   */

  /* ── Display tracking ─────────────────────────────────────────────
     One systematic scale: letter-spacing tightens as size grows and
     relaxes toward 0 at reading sizes — monotonic with type size,
     not per-element magic numbers.                                    */
  --ls-display: -0.025em;  /* hero wordmark / display XL */
  --ls-h1:      -0.022em;  /* case-study H1             */
  --ls-h2:      -0.018em;  /* section H2 · pull quotes  */
  --ls-h3:      -0.012em;  /* index titles · H3         */

  /* Two typefaces only — a serif for display, a sans for everything else.
     Labels use the sans (uppercase, tracked) rather than a third family. */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Geist", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Geist", -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Type scale — fluid. Each step grows with the viewport so the page
     scales up on large monitors instead of stranding tiny fixed text.
     min (small phones) · fluid middle · max (large desktop). */
  --fs-label: clamp(13px, 12.3px + 0.18vw, 15px);   /* labels / captions  13 → 15 */
  --fs-small: clamp(15px, 14.1px + 0.24vw, 17px);   /* secondary / meta   15 → 17 */
  --fs-body:  clamp(17px, 15.5px + 0.36vw, 20px);   /* body               17 → 20 */
  --fs-lede:  clamp(19px, 16px + 0.78vw, 25px);     /* lede / stand       19 → 25 */

  /* ── Vertical-spacing system ──────────────────────────────────────
     One scale, used for page rhythm on every page. Component internals
     (form fields, dense demo UIs) keep their own tight values; this
     governs the gaps you read DOWN the page.

     Bottom end (4 / 12) + usage rules borrowed from Linear's measured
     scale (xxs 4 · xs 8 · sm 12 · md 16 · lg 24 · xl 32 · xxl 48 ·
     section 96). Top end (64 / 128 / 160) kept for editorial air —
     a long-form portfolio breathes more than a dense product tool.
     Rules: section rhythm anchors on 96; headings take space ABOVE,
     not below; reading column stays ~68–73ch.
     4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 · 96 · 128 · 160               */
  --space-3xs:  4px;   /* Linear xxs — caption / label micro-gaps */
  --space-2xs:  8px;   /* Linear xs  — tightest stack             */
  --space-xs:  12px;   /* Linear sm  — caption-to-image           */
  --space-sm:  16px;   /* Linear md                               */
  --space-md:  24px;   /* Linear lg  — paragraph rhythm           */
  --space-lg:  32px;   /* Linear xl  — block padding              */
  --space-xl:  48px;   /* Linear xxl — block separation           */
  --space-2xl: 64px;   /* sub-section                             */
  --space-3xl: 96px;   /* Linear section — dominant section gap   */
  --space-4xl: 128px;  /* page top / bottom                       */
  --space-5xl: 160px;  /* reserved — largest editorial break      */
  /* Standard section vertical padding — fluid, anchored on Linear's 96. */
  --section: clamp(64px, 8vw, 96px);
}

/* ════════════════════════════════════════════════════════════════
   SELF-HOSTED FONTS — Fraunces (display) + Geist (body & labels).
   Latin-subset .woff2 in /fonts/. url() is relative to this stylesheet,
   so the paths resolve from every page (root and /projects/) and locally.
   font-display: swap — text is never invisible while a font loads.
   ════════════════════════════════════════════════════════════════ */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

html { overflow-x: clip; }

body {
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

::selection { background: var(--accent); color: var(--background); }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 13px;
}

.nav-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
  border-radius: 8px;
}

.nav-mark:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 4px;
  border-radius: 8px;
}

.nav-mark .dot { color: var(--pop); }

/* Shared confetti easter-egg layer (home logo + About link). Motion is in confetti.js. */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 99999; overflow: hidden; }
.confetti-layer i { position: absolute; top: 0; left: 0; display: block; border-radius: 1px; will-change: transform; }

.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none;
  color: var(--ink-muted);
  margin-left: 32px;
  padding: 12px 0;
  display: inline-block;
  transition: color var(--dur-1) var(--ease);
}

.nav-links a:hover { color: var(--pop); }

.nav-links a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--background);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  padding: 12px 16px;
  z-index: 10;
  text-decoration: none;
}

.skip:focus {
  left: 0;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: var(--space-2xl) var(--space-xl);   /* 64 / 48 — lead work sits higher, less dead air */
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);                                /* 48 */
  align-items: center;
}

.hero-text { min-width: 0; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(60px, 9vw, 124px);
  line-height: 0.98;
  letter-spacing: var(--ls-display);
  max-width: 11ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--pop);
  letter-spacing: -0.03em;
}

.hero h1 .dot { color: var(--pop); }

.hero-portrait { margin: 0; }

.hero-portrait img {
  width: clamp(160px, 18vw, 250px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--rule-soft);
  box-shadow: none;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-sm); padding-block: var(--space-lg) var(--space-xl); }  /* 16 · 32/48 */
  .hero-portrait { display: none; }            /* placeholder — hide on mobile; headline leads */
  .hero h1 { font-size: clamp(38px, 11vw, 60px); overflow-wrap: break-word; }
  .hero .stand { font-size: 18px; margin-top: 18px; max-width: none; }
}

.hero .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.015em;
  text-transform: none;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.hero .kicker::before,
.cs-header .kicker::before,
.index-head::before {
  content: "/ ";
  color: var(--pop);
  font-weight: 500;
}

.hero .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(24px, 2.2vw + 0.4rem, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 20px;
}

.hero .stand {
  font-size: var(--fs-lede);
  line-height: 1.5;
  max-width: 34em;
  margin-top: 20px;
}

/* ---------- Index list ---------- */

.index { padding-bottom: 0; }

.index-head {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: 0.015em;
  text-transform: none;
  color: var(--ink-muted);
  padding: 8px 0 28px;
}

.case-row {
  display: grid;
  grid-template-columns: 52px 1fr 196px;
  gap: 0 44px;
  align-items: baseline;   /* number sits on the title's baseline — scales with the type, no magic offset */
  padding: 40px 20px;
  margin: 0 -20px;
  background: none;                     /* no card — an editorial index row */
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: border-color var(--dur-1) var(--ease);
}


.case-row .num {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.015em;
  color: var(--pop);
}

.case-row:hover,
.case-row:focus-within {
  transform: none;
  box-shadow: none;
  background: none;                    /* no fill — directional cue only */
  border-top-color: var(--pop);
}

/* Slide the title + metric right on hover — small and crisp, the arrow
   easing in. Linear-style: a quick state shift, not a slow slide. */
.case-row > div:not(.case-side) { transition: transform var(--dur-1) var(--ease); }
.case-row:hover > div:not(.case-side),
.case-row:focus-within > div:not(.case-side) { transform: translateX(5px); }

.case-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  align-self: start;          /* thumbnail tops align with the title, not the baseline */
}

.case-thumb {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  background: var(--paper-white);
}

/* ---------- Selected work — media-forward bands ---------- */
.band {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.band-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.band-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.band-head .num { color: var(--pop); }

/* CTA: sentence case, with an underline that draws in on hover and keyboard focus */
.band-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease);
}
.band-cta .t { position: relative; }
.band-cta .t::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--pop);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-2) var(--ease);
}
.band-cta .arrow {
  font-family: var(--font-display);
  font-size: clamp(28px, 2vw + 0.5rem, 42px);
  line-height: 1;
  color: inherit;            /* muted when inactive, follows .band-cta to green on hover */
}
/* Matches the "About me" nav hover: text turns green, then the green stripe draws in */
.band:hover .band-cta, .band:focus-within .band-cta, .band:focus-visible .band-cta { color: var(--pop); }
.band:hover .band-cta .t::after, .band:focus-within .band-cta .t::after, .band:focus-visible .band-cta .t::after { transform: scaleX(1); }

.band:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 8px;
  border-radius: 2px;
}

/* Intro: copy on the left, the lead metric pulled out as a display figure on the right */
.band-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  margin: 20px 0 var(--space-lg);
}
.band-copy { min-width: 0; }
.band h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.4vw + 0.5rem, 46px);
  line-height: 1.12;
  letter-spacing: var(--ls-h3);
  margin: 0 0 10px;
  max-width: 20ch;
}
.band .outcome {
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-lede);
  color: var(--neutral);
  margin: 0;
  max-width: 46ch;
}
.band-lead {
  flex: none;
  text-align: right;
  max-width: 16ch;
}
.band-lead .figure {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 3.4vw + 0.5rem, 68px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: oldstyle-nums tabular-nums;
}
.band-lead .figure-cap {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  margin-top: 10px;
}

/* The product sits in a minimal flat browser frame on warm paper — a deliberate
   hero, matching the case-study pages. The frame opens on the screen's signature
   region (set per band via --obj), not the nav bar. */
.band-media {
  background: none;                /* no card — the browser frame sits straight on the paper */
  border: 0;
  border-radius: 0;
  padding: 0;
}

.band-media .browser {
  background: var(--paper-white);
  border: 1px solid var(--rule);
  border-radius: 10px;            /* a complete flat frame, hairline only */
  overflow: hidden;
  transition: border-color var(--dur-1) var(--ease);
}
.band:hover .band-media .browser, .band:focus-within .band-media .browser { border-color: var(--rule-strong); }
.band-media .bbar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
}
.band-media .bbar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  opacity: 0.5;
}
.band-media .bvp {
  height: clamp(300px, 32vw, 440px);
  overflow: hidden;
}
.band-media .bvp img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--obj, 50% 0%);
  transform-origin: var(--obj, 50% 0%);
  transition: transform var(--dur-2) var(--ease);
}
.band:hover .band-media .bvp img,
.band:focus-within .band-media .bvp img { transform: scale(1.04); }

.band-media .bvp.tbd {
  display: flex;
  align-items: center;
  justify-content: center;
}
.band-media .bvp.tbd span {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .band-media .bvp img, .band-cta .arrow, .band-cta .t::after { transition: none; }
  .band:hover .band-media .bvp img,
  .band:focus-within .band-media .bvp img { transform: none; }
}
@media (max-width: 760px) {
  .band { padding: var(--space-xl) 0 var(--space-2xl); }
  .band-intro { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: var(--space-md); }
  .band h3 { font-size: 26px; max-width: none; }
  .band-lead { text-align: left; max-width: none; }
  .band-lead .figure { font-size: 44px; }
  .band-media .bvp { height: clamp(220px, 56vw, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  .case-row, .case-row:hover { transition: none; box-shadow: none; }
  .case-row > div:not(.case-side) { transition: none; }
  .case-row:hover > div:not(.case-side),
  .case-row:focus-within > div:not(.case-side) { transform: none; }
}

.case-row h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 2.4vw + 0.5rem, 46px);
  line-height: 1.14;
  letter-spacing: var(--ls-h3);
  transition: color var(--dur-1) var(--ease);
  padding-right: 36px;
  position: relative;
}

.case-row h3::after {
  content: "→";
  position: absolute;
  margin-left: 14px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
  color: var(--pop);
}

.case-row:hover h3::after,
.case-row:focus-visible h3::after { opacity: 1; transform: translateX(0); }

/* Thumbnail stays still — precision over decoration (Linear hovers almost
   never move an element). The arrow + accent hairline carry the cue. */

.case-row .sector {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.015em;
  text-transform: none;
  color: var(--ink-muted);
}

.case-row .metric {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 12px;
}

/* Colophon — a quiet postscript, demoted below the four selected works */
.case-row--meta { margin-top: 32px; }
.case-row--meta .num { color: var(--ink-muted); }
.case-row--meta h3 { font-size: clamp(20px, 2.2vw, 24px); font-weight: 400; color: var(--ink-muted); }
.case-row--meta:hover h3 { color: var(--pop); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Case study pages ---------- */

/* Case-study column is left-anchored to the page frame (aligns under the nav
   mark). Reading measure is controlled per element, not by a centred column. */
/* Case-study frame matches the landing exactly — same 1280 wrap, same gutters,
   so the wordmark and spacing never jump between pages. Content is left-aligned
   within the frame, like the landing; reading measure is set per element. */
.cs-header.wrap,
article.wrap,
.cs-next.wrap { max-width: 1280px; }

.cs-header { padding-block: var(--space-xl) var(--space-md); }   /* 48 / 24 */

/* Case branding — each case study carries its own colour world.
   Pages set --case / --case-tint on <body>; everything else inherits. */
.themed .cs-header {
  background: none;                     /* no frame — open on the paper */
  border: 0;
  border-radius: 0;
  padding-block: var(--space-xl) var(--space-md);   /* 48 / 24 — side padding inherits .wrap → aligns under nav */
  margin-top: 0;
}

.themed .cs-header .kicker { color: var(--case); }

.themed article .cs-body h2::before { color: var(--case); }

.themed .pull::before { color: var(--case); }

.themed .decision li.chosen .verdict { color: var(--case); }

.themed .decision li.chosen { border-left-color: var(--case); }

.themed .demo-bar { background: var(--surface); }

.themed .demo-bar .live { color: var(--case); border-color: var(--case); }

.themed .demo-bar .live::before { background: var(--case); }

.themed .stats-hero { border-top-color: var(--case); box-shadow: none; }

@media (max-width: 640px) {
  .themed .cs-header { padding-block: var(--space-lg) var(--space-sm); margin-top: 0; }   /* 32 / 16 */
}

.cs-header .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.015em;
  text-transform: none;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.cs-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 4vw + 0.6rem, 76px);
  line-height: 1.08;
  letter-spacing: var(--ls-h1);
  max-width: 22ch;
}

.cs-header .lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  max-width: 34em;          /* a deck — kept to an optimal reading measure */
  margin-top: 24px;
  color: var(--neutral);
}

article { padding-block: var(--space-sm) var(--space-4xl); }   /* 16 / 128 */

.cs-body { max-width: 68ch; }

.cs-body .demo { margin-left: 0; margin-right: 0; }

.cs-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 2.2vw + 0.6rem, 46px);
  line-height: 1.1;
  letter-spacing: var(--ls-h2);
  margin: var(--space-2xl) 0 var(--space-md);   /* 64 above / 24 below — calm, even section rhythm; heading hugs its text */
}

.cs-body h2:first-child { margin-top: 0; }

.cs-body p { margin-bottom: 24px; max-width: 68ch; }

.cs-body strong { font-weight: 500; }   /* precise, not bold — emphasis one notch up, never 600+ in running text */

.cs-body a,
.about .meta a {
  color: var(--pop);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-1) var(--ease), text-decoration-thickness var(--dur-1) var(--ease);
}

.cs-body a:hover,
.about .meta a:hover { color: var(--ink); text-decoration-thickness: 2px; }

figure { margin: var(--space-xl) 0; }   /* 48 */

/* Figures and screenshot slots break out of the text column and scale up on
   larger screens — aligned left with the title and stats, capped at the
   stat-band width so the whole header/body share one right edge. */
.cs-body figure,
.cs-body .shot,
.cs-body .demo,
.cs-body .decision {
  width: min(1216px, calc(100vw - 64px));
  max-width: none;
}
@media (max-width: 640px) {
  .cs-body figure,
  .cs-body .shot,
  .cs-body .demo,
  .cs-body .decision { width: 100%; }
}

figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
}

figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.4;
  color: var(--ink-muted);
  margin-top: 16px;
  max-width: 60ch;
}

.cs-next {
  padding-block: var(--space-xl) var(--space-3xl);   /* 48 / 96 */
  display: flex;
  align-items: center;
  gap: var(--space-sm);                               /* 16 */
  flex-wrap: wrap;
}

.cs-next .label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--ink-muted);
  white-space: nowrap;
}

.cs-next .label::before { content: "/ "; color: var(--pop); font-weight: 500; }

.cs-next a {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 2vw + 0.5rem, 42px);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}

.cs-next a:hover { color: var(--pop); }

/* ---------- Pull quotes & section numbers ---------- */

article .cs-body { counter-reset: sec; }

article .cs-body h2 { counter-increment: sec; }

article .cs-body h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  color: var(--pop);
  margin-bottom: 12px;
}

.pull {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw + 0.5rem, 46px);
  line-height: 1.2;
  letter-spacing: var(--ls-h2);
  max-width: 24ch;
  color: var(--ink);
  margin: var(--space-xl) 0;   /* 48 — flows with the section rhythm */
}

.pull::before {
  content: "—";
  color: var(--pop);
  margin-right: 12px;
}

/* ---------- About ---------- */

.about .cs-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 1.8vw + 0.6rem, 40px);
  line-height: 1.15;
  margin: var(--space-2xl) 0 var(--space-md);   /* 64 / 24 */
}

.about-grid {
  display: grid;
  grid-template-columns: clamp(232px, 24vw, 312px) minmax(0, 58ch);
  gap: 48px 72px;
  align-items: start;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  order: -1;
  min-width: 0;
}

.portrait { margin: 0; }

.portrait img {
  width: 100%;
  display: block;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  box-shadow: none;
}

.portrait figcaption,
.shelf-cap {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 14px;
}

.shelf-books {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 188px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0;
}

.book {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.05em;
  text-transform: none;
  width: 36px;
  padding: 12px 0;
  text-align: center;
  border: 1px solid var(--rule);
  background: var(--paper-white);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.book.b1 { height: 182px; background: var(--accent); color: var(--background); border-color: var(--accent); }
.book.b2 { height: 128px; background: var(--surface); }
.book.b3 { height: 158px; background: #E2EDDD; }
.book.b4 { height: 104px; background: #F4E9D4; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-aside { max-width: 340px; order: -1; }
}

/* ---------- Skills, with receipts ---------- */

.receipts { margin: 32px 0 8px; }

.receipts .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.receipts .row:last-child { border-bottom: 1px solid var(--rule); }

.receipts .skill {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--ink-muted);
  padding-top: 3px;
}

.receipts .proof { font-size: var(--fs-body); line-height: 1.55; }

@media (max-width: 640px) {
  .receipts .row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Print — nothing hidden, ever ---------- */

@media print {
  .js .fade { opacity: 1 !important; transform: none !important; }
}

.about { padding-block: var(--space-3xl) var(--space-4xl); }   /* 96 / 128 */

.about h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 48px;
}

.about .cs-body p { font-size: clamp(18px, 16.5px + 0.4vw, 21px); line-height: 1.5; }

.about .meta {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.about .meta p {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.about .meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.about .meta a:hover { color: var(--pop); }

/* ---------- Footer ---------- */

footer { border-top: 1px solid var(--rule); }

.footer-inner {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  padding-block: var(--space-lg);   /* 32 */
  flex-wrap: wrap;
  gap: var(--space-md);             /* 24 */
}

footer a {
  color: var(--ink);
  text-decoration: none;
  padding: 12px 0;
  display: inline-block;
  transition: color var(--dur-1) var(--ease);
}

footer a:hover { color: var(--pop); }

footer .copy {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--ink-muted);
  margin-left: auto;
}

/* ---------- Motion ---------- */

/* Fade-in only when JS is confirmed present (html.js set in <head>),
   so content is never hidden if JS fails. */
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fadeUp 520ms ease-out both; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Case study furniture ---------- */

.key-outcomes {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--ink);
  margin-top: 28px;
}

.key-outcomes .ko-label {
  display: inline-block;
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-muted);
  margin-right: 16px;
}

/* Hero stat band — numbers before prose, carried by a soft card */
.stats-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 28px 48px;
  max-width: none;            /* data is not reading text — fill the frame */
  margin: 24px 0 8px;
  padding: 22px 0;
  background: none;          /* no frame — an editorial band, not a card */
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
}

.stats-hero .stat .n {
  font-family: var(--font-display);
  font-size: clamp(38px, 3vw + 0.6rem, 66px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  display: block;
}

.stats-hero .stat .d {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--ink-muted);
  display: block;
  margin-top: 8px;
  max-width: 24ch;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 32px;
  max-width: none;            /* metadata fills the frame, like the stats */
  margin-top: 20px;
}

.cs-meta dt {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.cs-meta dd {
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--neutral);              /* demoted — reference, not narrative */
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px;
  margin: 32px 0 8px;
}

.stats .stat .n {
  font-family: var(--font-display);
  font-size: clamp(32px, 2vw + 0.6rem, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  display: block;
}

.stats .stat .d {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--ink-muted);
  display: block;
  margin-top: 10px;
  max-width: 28ch;
}

.decision {
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding: 28px 0;
  margin: 48px 0;
}

.decision .label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.decision ul { list-style: none; }

.decision li {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.decision li:first-child { border-top: 0; padding-top: 0; }

.decision li .verdict {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.decision li.chosen .verdict { color: var(--pop); font-weight: 400; }

.decision li.chosen { border-left: 2px solid var(--pop); padding-left: 14px; margin-left: -16px; }

.wrong {
  border-left: 2px solid var(--rule);
  padding-left: 24px;
  margin: 32px 0;
}

.wrong .label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.wrong p { color: var(--ink); margin-bottom: 0; }

/* ---------- Embedded demos ---------- */

.demo {
  border: 1px solid var(--rule);
  background: var(--paper-white);
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
  margin: 48px 0;
}

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.demo-bar .t {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--ink-muted);
}

.demo-bar .live {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--pop);
  border: 1px solid var(--pop);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
  position: relative;
}

.demo-bar .live::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--pop);
  margin-right: 7px;
  vertical-align: 1px;
}

.demo-body { padding: 28px; }

.demo-note {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.5;
  color: var(--ink-muted);
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  max-width: none;
}

.testimonial {
  margin: 48px 0;
  padding: 0;
}

.testimonial blockquote {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.testimonial cite {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--ink-muted);
  margin-top: 16px;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }

  /* Nav — fits one line, never wraps */
  .nav-mark { font-size: 30px; }
  .nav-links a { margin-left: 16px; font-size: var(--fs-label); letter-spacing: 0.02em; white-space: nowrap; }

  .hero { padding-block: var(--space-lg) var(--space-xl); }   /* 32 / 48 */

  /* Landing index — compact, left-aligned, no wasted space */
  .case-row { display: block; padding: 22px 0; margin: 0; }
  .case-row > div:not(.case-side) { transform: none; }
  .case-row .num { display: inline-block; padding-top: 0; margin-bottom: 8px; }
  .case-row h3 { font-size: 23px; line-height: 1.2; padding-right: 0; }
  .case-row h3::after { display: none; }
  .case-row .metric { font-size: var(--fs-small); margin-top: 10px; }
  .case-side { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 18px; }
  .case-thumb { width: 100%; max-width: none; }
  .case-row .sector { font-size: var(--fs-label); letter-spacing: 0.1em; order: 2; }

  /* Case header */
  .cs-header { padding-block: 28px 12px; }
  .cs-header h1 { font-size: clamp(30px, 8.4vw, 42px); }
  .cs-header .lede { font-size: 18px; max-width: none; }
  .stats-hero { grid-template-columns: 1fr; gap: 16px; padding: 22px 0; }
  .stats-hero .stat .n { font-size: 38px; }
  .cs-meta { grid-template-columns: 1fr 1fr; gap: 14px 20px; }

  /* Body — full measure on small screens */
  .cs-body h2 { font-size: 29px; margin-top: var(--space-2xl); }   /* 64 on mobile */
  .cs-body p, .pull { max-width: none; }
  .pull { font-size: 23px; margin: var(--space-xl) 0; }   /* 48 */
  .demo-body { padding: 16px; }
  .decision { padding: 22px 0; }
  .stats { gap: 20px; }
  .stats .stat .n { font-size: 32px; }

  /* Wide SVG diagrams stay legible via contained horizontal scroll */
  figure { overflow-x: auto; }
  figure svg { min-width: 480px; }

  .about { padding-block: var(--space-xl) var(--space-2xl); }   /* 48 / 64 on mobile */

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Generous tap targets on touch devices (WCAG 2.5.5) */
@media (pointer: coarse) {
  .nav-links a, footer a, .cs-next a, .more {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .seg button { min-height: 44px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero h1 { font-size: clamp(32px, 10vw, 46px); }
  .cs-meta { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   ART DIRECTION — Edwardian editorial · Holland Park · warm light
   A refinement layer over the system above. Visual only.
   ════════════════════════════════════════════════════════════════ */

:root {
  --brass: #9C7B3F;          /* hairline ornament — used at whisper weight */
  --paper-deep: #EFE8D9;     /* faint depth tone */
}

/* Old-world numerals + fine ligatures across prose — instant Edwardian warmth.
   Display stats keep their own treatment below. */
body {
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "liga" 1, "dlig" 1, "onum" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

/* Display type: tighter, warmer, with optical softness where Fraunces allows. */
.hero h1, .cs-header h1, .cs-body h2, .case-row h3, .pull, .cs-next a {
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "liga" 1, "onum" 1, "ss01" 1;
}

/* One drop cap, on the About opening only — restraint. Roman, ink. */
.about .cs-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.2em;
  line-height: 0.78;
  float: left;
  margin: 0.04em 0.12em 0 0;
  color: var(--ink);
}

/* Section rhythm is carried by the number + generous space — no extra rules.
   (The per-heading brass hairline was removed: it fought the section number.) */

/* Stat numbers — oldstyle figures for the ledger look, tabular so the
   digits hold an even column across the band (data, not prose). */
.stats-hero .stat .n, .stats .stat .n,
.pf .pf-n { font-variant-numeric: oldstyle-nums tabular-nums; }

/* Metric line on the index — short data phrases ($500M · 28%): tabular so
   figures sit on a fixed advance, oldstyle to stay in the editorial voice. */
.case-row .metric { font-variant-numeric: oldstyle-nums tabular-nums; }

/* Hero portrait — a quiet hairline, no heavy frame. */
.hero-portrait img {
  padding: 0;
  border: 1px solid var(--rule);
  box-shadow: none;
}

/* Links — a slow underline draw, the way fine print rewards attention. */
.cs-body a, .about .meta a {
  text-decoration: none;
  background-image: linear-gradient(var(--pop), var(--pop));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 1.18em;
  transition: background-size var(--dur-2) var(--ease), color var(--dur-1) var(--ease);
}
.cs-body a:hover, .about .meta a:hover {
  color: var(--pop);
  background-size: 100% 2px;
}

/* Case headings ease toward the accent on hover — a held breath. */
.case-row:hover h3 { color: var(--pop); }

/* Lighter, airier rhythm — let the warmth breathe. */
.cs-body p { line-height: 1.62; }
.hero .stand { color: var(--ink); opacity: 0.92; }

/* ════════════════════════════════════════════════════════════════
   MOTION — advanced, restrained, 2026
   Scroll-driven reveals + View Transitions + reading progress.
   transform/opacity only · @supports-gated · reduced-motion safe.
   If unsupported, everything renders fully visible and static.
   ════════════════════════════════════════════════════════════════ */

/* Smooth cross-page transitions (multi-page View Transitions). */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out 220ms ease both; }
  ::view-transition-new(root) { animation: vt-in 320ms ease both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(8px); } }

/* Scroll-driven reveal — a quiet opacity fade only. No movement, no
   clipping: content settles in place so nothing shifts or cuts the eye
   as you scroll. Calm flow, the Linear feeling. */
@keyframes rise-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wipe-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    article .cs-body > h2,
    article .cs-body > p,
    .cs-meta, .pull, .decision, .wrong, .testimonial,
    .stats, .stats-hero {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 18%;   /* solid almost immediately — no faint, gappy zone */
    }
    .demo, figure {
      animation: wipe-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 18%;
    }
    .stats-hero .stat, .stats .stat {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 18%;
    }

    /* Reading-progress hairline in the case's own colour. */
    body.themed::after {
      content: "";
      position: fixed; top: 0; left: 0;
      height: 2px; width: 100%;
      background: var(--case, var(--pop));
      transform: scaleX(0); transform-origin: 0 50%;
      z-index: 10000;
      animation: progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ── Hover micro-interactions ── */

/* Nav links: a fine underline draws in from the left. */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px;
  height: 1px; background: var(--pop);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--dur-2) var(--ease);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after { transform: scaleX(1); }
.nav-links a[aria-current] { text-decoration: none; }
.nav-links a[aria-current]::after { transform: scaleX(1); background: var(--ink); }

/* Stat numbers lift a hair and warm to the accent on hover of their card. */
.stats-hero:hover .stat .n, .case-row:focus-visible h3 { transition: color var(--dur-1) var(--ease); }

/* Next-case link — consistent with the landing index: the arrow is hidden
   until hover, pinned to the right of the column, then eases in. On touch /
   no-hover devices it's hidden entirely (there is no hover), exactly as the
   landing-row arrow is hidden on mobile. */
.cs-next a::after {
  content: "→"; flex: none; margin-left: auto; color: var(--pop);
  opacity: 0; transform: translateX(-8px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.cs-next a:focus-visible::after { opacity: 1; transform: translateX(0); }
@media (hover: hover) {
  .cs-next a:hover::after { opacity: 1; transform: translateX(0); }
}
@media (hover: none) {
  .cs-next a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links a::after { transition: none; }
  .cs-next a::after { transition: none; }
}

/* ════════════════════════════════════════════════════════════════
   READING CONTROLS — depth (skim / full) + director's commentary
   No-JS default: full case shown, summary + notes hidden, controls
   hidden. With JS the head script sets the depth before paint.
   ════════════════════════════════════════════════════════════════ */

.case-controls { display: none; }
html.js .case-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 16px; padding-top: 14px; padding-bottom: 26px;
}
.case-controls .seg-label {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.case-controls .seg-label::before { content: "/ "; color: var(--case, var(--pop)); }

.seg {
  display: inline-flex; gap: 2px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-pill);
  padding: 4px; background: var(--surface);
}
.seg button {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.01em;
  border: 0; background: none; color: var(--ink-muted);
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 18px; min-height: 38px; border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--case, var(--pop)); color: var(--paper-white); }
.seg .seg-sub { opacity: 0.55; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] .seg-sub { opacity: 0.8; }

/* (commentary uses inline <details>; styled below) */

/* ── Skim summary ── */
.case-skim { display: none; }
.case-skim.wrap { max-width: 1280px; padding-top: 8px; padding-bottom: 8px; }
html.mode-skim .case-skim { display: block; }
html.mode-skim article { display: none; }
/* Header (kicker · H1 · lede · stats · meta) stays identical in BOTH modes,
   so the Skim/Full toggle never moves when you switch — only the content
   below it swaps (summary ↔ full article). No jump. */

.skim-row { display: grid; grid-template-columns: 92px 1fr; gap: 22px; padding: 22px 0; border-top: 1px solid var(--rule); }
.skim-row:first-of-type { border-top: 0; }
.skim-row .sk-k { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--ink-muted); padding-top: 4px; }
.skim-row .sk-v { font-size: var(--fs-body); line-height: 1.55; max-width: 58ch; }
.skim-more { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--ink-muted); margin-top: 26px; text-align: right; }
.skim-more button { font: inherit; color: var(--case, var(--pop)); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }

/* ── Inline comments — click to open each one, right where it belongs.
   Warm and embedded: a darker tone of the oat paper, no accent colour. ── */
.note { margin: 24px 0; }
.note > summary {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--ink-muted);
  background: var(--surface);
  border-radius: var(--radius-pill); padding: 6px 14px; cursor: pointer; list-style: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.note > summary::-webkit-details-marker { display: none; }
.note > summary::before {
  content: ""; width: 13px; height: 13px; flex: none; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 3.5A1.5 1.5 0 0 1 3.5 2h9A1.5 1.5 0 0 1 14 3.5v6A1.5 1.5 0 0 1 12.5 11H6l-3 3v-3H3.5A1.5 1.5 0 0 1 2 9.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 3.5A1.5 1.5 0 0 1 3.5 2h9A1.5 1.5 0 0 1 14 3.5v6A1.5 1.5 0 0 1 12.5 11H6l-3 3v-3H3.5A1.5 1.5 0 0 1 2 9.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.note > summary:hover { color: var(--ink); background: var(--paper-deep, var(--surface)); }
.note[open] > summary { color: var(--ink); background: var(--rule); }
.note > summary::after {
  content: ""; width: 11px; height: 11px; flex: none;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-1) var(--ease);
}
.note[open] > summary::after { transform: rotate(180deg); }
.note .note-body {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px; margin-top: 10px;
}
.note .note-body p { font-size: var(--fs-body); line-height: 1.55; margin: 0; max-width: none; color: var(--ink); }
.note .note-body p + p { margin-top: 10px; }
.note .note-sig { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.04em; color: var(--ink-muted); display: block; margin-top: 12px; }

/* About — the personal story disclosure: a tidy full-width rounded button in the
   narrow aside (the 999px pill blobs when it wraps, so square it off and wrap cleanly). */
.about .note.story { margin: var(--space-md) 0 0; }
.about .note.story > summary {
  width: 100%;
  justify-content: space-between;
  white-space: normal;
  text-align: left;
  line-height: 1.4;
  border-radius: var(--radius);
  padding: 10px 14px;
}
.about .note.story > summary::before { display: none; }
.about .note.story > summary::after { margin-left: 10px; }
.about .note.story .note-body p { font-size: var(--fs-body); }

@media (max-width: 640px) {
  html.js .case-controls { padding-left: 18px; padding-right: 18px; justify-content: flex-start; }
  .skim-row { grid-template-columns: 1fr; gap: 6px; }
  .skim-row .sk-v { font-size: var(--fs-body); }
}

/* ── Colophon: live performance panel ── */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 32px; }
.pf .pf-n { font-family: var(--font-display); font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; display: block; }
.pf .pf-l { font-size: var(--fs-label); line-height: 1.5; color: var(--ink-muted); display: block; margin-top: 8px; max-width: 24ch; }

/* ════════════════════════════════════════════════════════════════
   SCREENSHOT PLACEHOLDERS
   A <figure class="shot"> reserves the exact aspect box (zero layout
   shift) and shows the build brief. When the real screen is ready,
   delete the <div class="ph">…</div> and drop in:
     <img src="../img/<name>.webp" alt="…" width="1840" height="1150">
   Per-image ratio is set inline on .ph (style="aspect-ratio:16/10").
   Add class "phone" to the <figure> for tall app screens.
   ════════════════════════════════════════════════════════════════ */
.shot { margin: var(--space-xl) 0; }   /* 48 */
.shot .ph {
  width: 100%;
  aspect-ratio: 16 / 10;            /* default; override inline per image */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 28px;
  background: var(--surface);
  border: 1px dashed var(--ink-muted);
  border-radius: var(--radius);
  color: var(--ink-muted);
}
.shot .ph-spec {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: 0.06em; color: var(--neutral);
}
.shot .ph-brief { font-size: var(--fs-small); line-height: 1.5; max-width: 46ch; }
.shot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule-soft); border-radius: var(--radius);
}
.shot.phone .ph, .shot.phone img { max-width: 340px; margin-inline: auto; }
.shot.phone .ph { aspect-ratio: 9 / 19; }

/* Colophon changelog — appendix heading + log, via the system (no inline styles) */
.cs-changelog-h { font-family: var(--font-display); font-weight: 400; font-size: 32px; letter-spacing: -0.02em; margin: 64px 0 24px; }
.cs-changelog { font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.8; }

/* ── Interactive-control focus, made explicit for cross-browser certainty (WCAG 2.4.7) ── */
.seg button:focus-visible,
.sx-type:focus-visible,
.ex-tier:focus-visible,
.px-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════
   CASE-STUDY LAYOUT — ONE LEFT AXIS  (case-study pages only)
   Every tier — kicker · H1 · lede · stats · meta · body · figures ·
   controls · next — anchors to the SAME left edge as the nav wordmark
   (the .wrap 32px gutter). Reading widths nest (text < heading < media)
   but all share that left edge: asymmetry over centring, aligned under
   the logo. Nothing is centred. The frame/nav stay 1280, so the
   wordmark never moves between pages.
   ════════════════════════════════════════════════════════════════ */
body.themed {
  --cs-text:  68ch;                              /* reading measure          */
  --cs-wide:  70rem;                             /* headings · kicker · next */
  --cs-media: min(1216px, calc(100vw - 64px));   /* figures · data · demos   */
}

/* Catch-all: NOTHING centres. Every direct child of the header and the
   body sits on the same left edge as the nav wordmark — whatever its type.
   The rules below only add reading-width caps on top of this. */
body.themed .cs-header > *,
body.themed .cs-body > *           { margin-inline: 0; }

/* Header — left-anchored tiers */
body.themed .cs-header .kicker,
body.themed .cs-header h1      { max-width: var(--cs-wide);  margin-inline: 0; }
body.themed .cs-header .lede   { max-width: 52rem;           margin-inline: 0; }
body.themed .stats-hero,
body.themed .cs-meta           { max-width: var(--cs-media); margin-inline: 0; }

/* Body — full-width column; each child left-anchors at its own width */
body.themed .cs-body           { max-width: none; }
body.themed .cs-body > p,
body.themed .cs-body > .pull,
body.themed .cs-body > .note,
body.themed .cs-body > .wrong  { max-width: var(--cs-text);  margin-inline: 0; }
body.themed .cs-body > h2      { max-width: var(--cs-wide);  margin-inline: 0; }
body.themed .cs-body > figure,
body.themed .cs-body > .shot,
body.themed .cs-body > .demo,
body.themed .cs-body > .decision {
  width: var(--cs-media); max-width: none; margin-inline: 0;
}

/* Controls · skim · next — left-aligned on the same axis.
   NOTE: .case-controls and .cs-next are themselves .wrap elements that
   centre via margin:0 auto. We must NOT zero their inline margins (that
   throws them to the viewport edge on wide screens) — only left-align
   their *contents*. .skim-row is an inner child, so zeroing it is safe. */
body.themed .case-controls         { justify-content: flex-start; }
body.themed .case-skim .skim-row   { max-width: var(--cs-wide); margin-inline: 0; }
body.themed .cs-next               { justify-content: flex-start; }

/* ── Hero AI line — recency signal, set in the site's kicker grammar ── */
.hero-ai {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  margin-top: 22px;
  max-width: 34em;
}
@media (max-width: 760px) { .hero-ai { margin-top: 16px; font-size: var(--fs-label); } }
