/*
  portfolio-shared.css
  Loaded after each page's <style> block so it wins for same-specificity rules.

  ──────────────────────────────────────────────────────────────────────────
  TYPOGRAPHY SYSTEM — 8 tokens (single source of truth)
  ──────────────────────────────────────────────────────────────────────────
    Display     54px  · Hero H1 only · 500 · -0.025em · lh 1.06
    Pull Quote  54px  · Italic orange · 400 · -0.025em · lh 1.15 · pull quotes only
    Heading     48px  · Section H2 · 500 · -0.022em · lh 1.08
    Subheading  24px  · H3, card titles · 500 · -0.015em · lh 1.3
    Lead        20px  · Emphasised lead paragraphs · 500 · 0 · lh 1.45
    Body        16px  · Primary content (body floor) · 400 · 0 · lh 1.75
    Caption     14px  · Nav, byline, secondary text · 400 · 0 · lh 1.55
    Eyebrow     11px  · UPPERCASE sub-labels · 500 · 0.09em · lh 1.5

  Tokens are responsive: --type-display, --type-heading, --type-subheading,
  --type-lead all scale down at 1100px and 768px breakpoints. Body, Caption,
  and Eyebrow remain fixed across breakpoints.

  Legacy aliases (--type-subhead, --type-nav) preserved for existing CSS.
  Phase 2 will add utility classes (.t-display, .t-heading, etc.) that
  consume these tokens; Phase 3 will migrate per-file styles to the system.
*/

/* ── Typography tokens ────────────────────────────────────────────────────── */
:root {
  /* Sizes — desktop */
  --type-display:    54px;
  --type-heading:    48px;
  --type-subheading: 24px;
  --type-lead:       20px;
  --type-body:       16px;
  --type-caption:    14px;
  --type-eyebrow:    11px;

  /* Legacy aliases — preserved so existing CSS that references them still works */
  --type-subhead: var(--type-subheading);
  --type-nav:     var(--type-caption);

  /* Font weights */
  --weight-regular: 400;
  --weight-medium:  500;

  /* Letter-spacing */
  --track-display:  -0.025em;
  --track-heading:  -0.022em;
  --track-subhead:  -0.015em;
  --track-body:      0;
  --track-eyebrow:   0.09em;

  /* Line-heights */
  --lh-display:  1.06;
  --lh-heading:  1.08;
  --lh-subhead:  1.3;
  --lh-lead:     1.45;
  --lh-body:     1.75;
  --lh-caption:  1.55;
  --lh-eyebrow:  1.5;

  /* ══ SPACING SCALE — 8pt-aligned ══════════════════════════════════════════
     Use --space-N tokens for padding, margin, and gap values. */
  --space-1:   4px;   /* hairline (label→content) */
  --space-2:   8px;   /* tight (icon→text, dot→label) */
  --space-3:  12px;   /* close (between tags, list gaps) */
  --space-4:  16px;   /* base (paragraph→paragraph, default component padding) */
  --space-6:  24px;   /* loose (text→media paired, card→card) */
  --space-8:  32px;   /* spacious (component→component) */
  --space-12: 48px;   /* generous (sub-section→sub-section) */
  --space-16: 64px;   /* major (block→block within section) */
  --space-24: 96px;   /* hero (mobile section padding) */
  --space-30: 120px;  /* section (desktop section padding) */

  /* ══ VERTICAL RHYTHM — semantic tokens for layout rules ════════════════════
     section → section : --rhythm-section
     block → block       : --rhythm-block
     component → component : --rhythm-component
     prose → paired media : --rhythm-pair
     media → next concept : --rhythm-out
     paragraph → paragraph : --rhythm-text
     within tight content  : --rhythm-tight
     label → content       : --rhythm-label */
  --rhythm-section:    120px;
  --rhythm-block:       64px;
  --rhythm-component:   32px;
  --rhythm-pair:        24px;
  --rhythm-out:         56px;
  --rhythm-text:        16px;
  --rhythm-tight:        8px;
  --rhythm-label:        4px;

  /* Layout container */
  --container-max:    1440px;

  /* Highlight + accent (unchanged) */
  --hl-bg:      rgba(210, 130, 60, 0.10);
  --hl-border:  rgba(200, 115, 40, 0.35);
  --hl-bg-dark: rgba(220, 145, 70, 0.13);
  --hl-border-dark: rgba(220, 145, 70, 0.38);

  --orange: rgba(224, 90, 43, 1);

  /* Accent text color, AA-compliant per mode (4.5:1+ on the page bg).
     Light: darker orange #c44e21 vs white = ~4.79:1
     Dark:  lighter orange #f0875b vs #0c0c0c = ~5.4:1 (set in body.dark below) */
  --hl-text: rgba(196, 78, 33, 0.95);
}

/* Brighter accent in dark mode so it still hits AA against the dark page bg */
body.dark { --hl-text: rgba(240, 135, 91, 0.95); }

/* Responsive rhythm scaling — section spacing steps down at narrow viewports */
@media (max-width: 1100px) {
  :root {
    --rhythm-section: 96px;
  }
}
@media (max-width: 768px) {
  :root {
    --rhythm-section: 72px;
  }
}

/* Responsive size scaling — display, heading, subheading, lead step down */
@media (max-width: 1100px) {
  :root {
    --type-display:    48px;
    --type-heading:    36px;
    --type-subheading: 20px;
    --type-lead:       18px;
  }
}
@media (max-width: 768px) {
  :root {
    --type-display:    36px;
    --type-heading:    28px;
    --type-subheading: 18px;
    --type-lead:       16px;
  }
}

/* ── Typography utility classes — Phase 2 ─────────────────────────────────────
   Use these classes to apply type tokens directly. They consume the tokens
   above so changes to the system propagate everywhere automatically.

   Usage examples:
     <h1 class="t-display">…</h1>          (replaces .hero-title styling)
     <h2 class="t-heading">…</h2>
     <span class="t-eyebrow">CATEGORY</span>
     <p class="t-lead">Strong opening line.</p>
     <p class="t-body">Standard paragraph.</p>
     <p class="t-caption">Image caption.</p>
*/

.t-display {
  font-size: var(--type-display);
  font-weight: var(--weight-medium);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
}

.t-heading {
  font-size: var(--type-heading);
  font-weight: var(--weight-medium);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-heading);
}

.t-subheading {
  font-size: var(--type-subheading);
  font-weight: var(--weight-medium);
  line-height: var(--lh-subhead);
  letter-spacing: var(--track-subhead);
}

.t-lead {
  font-size: var(--type-lead);
  font-weight: var(--weight-medium);
  line-height: var(--lh-lead);
  letter-spacing: 0;
}

.t-body {
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
}

.t-caption {
  font-size: var(--type-caption);
  font-weight: var(--weight-regular);
  line-height: var(--lh-caption);
  letter-spacing: 0;
}

.t-eyebrow {
  font-size: var(--type-eyebrow);
  font-weight: var(--weight-medium);
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────────────────────
   COMPONENT SYSTEM — 10 reusable patterns (single source of truth)
   ──────────────────────────────────────────────────────────────────────────
     1. Card           — bordered content container with variants
     2. Card Grid      — gap-based grid for cards (no separator)
     3. Metric Grid    — N-column grid with 1px separator background
     4. Tag List       — flex wrapper for pills/tags
     5. Pill           — small rounded label with size + color modifiers
     6. Badge          — pill with leading dot indicator
     7. Callout        — accent-bordered emphasis block
     8. Section Visual — label + media placeholder + focus annotations
     9. Diagram Block  — bordered container for diagrams
    10. Case Nav       — bottom navigation between case studies

   See components.md for HTML examples and full spec.
   New components require justification — modifiers preferred.
*/

/* ──────────────────────────────────────────────────────────────────────────
   1. CARD — content container
   ────────────────────────────────────────────────────────────────────────── */
.card,
.card-base {
  background: var(--bg, #fafafa);
  border: 1px solid var(--border, rgba(10,10,10,0.08));
  border-radius: 10px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.dark .card,
body.dark .card-base {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.07);
}
/* Bare — no visible border, soft background only */
.card--bare {
  background: rgba(10,10,10,0.02);
  border: none;
  padding: 32px 36px;
}
body.dark .card--bare {
  background: rgba(255,255,255,0.025);
}
/* Accent — warm orange tint for emphasis cards */
.card--accent {
  background: rgba(224, 90, 43, 0.04);
  border-color: rgba(224, 90, 43, 0.18);
}
body.dark .card--accent {
  background: rgba(224, 90, 43, 0.06);
  border-color: rgba(224, 90, 43, 0.22);
}
/* Inset — subtle inset background, used inside diagrams or comparison contexts */
.card--inset {
  background: rgba(10, 10, 10, 0.02);
  border-color: var(--border);
  padding: 32px 36px;
}
body.dark .card--inset {
  background: rgba(255,255,255,0.03);
}

/* ──────────────────────────────────────────────────────────────────────────
   2. CARD GRID — gap-based grid for cards (no 1px separator)
   ────────────────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
}
.card-grid--2col { grid-template-columns: repeat(2, 1fr); }
.card-grid--3col { grid-template-columns: repeat(3, 1fr); }
.card-grid--4col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .card-grid--3col,
  .card-grid--4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .card-grid--2col,
  .card-grid--3col,
  .card-grid--4col { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────────────────
   3. METRIC GRID — N-column with 1px separator background
   ────────────────────────────────────────────────────────────────────────── */
.metric-grid {
  display: grid;
  gap: 1px;
  background: var(--border, rgba(10,10,10,0.08));
  border-radius: 12px;
  overflow: hidden;
  grid-column: 1 / -1;
}
body.dark .metric-grid { background: rgba(255,255,255,0.07); }
.metric-grid--2col { grid-template-columns: repeat(2, 1fr); }
.metric-grid--3col { grid-template-columns: repeat(3, 1fr); }
.metric-grid--4col { grid-template-columns: repeat(4, 1fr); }
/* Default cell — apply .metric-cell class to children for default padding/bg.
   Custom inner classes (e.g. .stat-block) can use their own padding instead. */
.metric-cell {
  background: var(--bg, #fafafa);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.dark .metric-cell { background: #0c0c0c; }
@media (max-width: 1100px) {
  .metric-grid--3col,
  .metric-grid--4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .metric-grid--2col,
  .metric-grid--3col,
  .metric-grid--4col { grid-template-columns: 1fr; }
}

/* (Tag list / Tag rules consolidated below in section 5b.) */

/* ──────────────────────────────────────────────────────────────────────────
   5. PILL — small rounded label
   ────────────────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-eyebrow);          /* 11px */
  font-weight: var(--weight-medium);       /* 500 */
  letter-spacing: var(--track-eyebrow);    /* 0.09em */
  text-transform: uppercase;
  background: rgba(10,10,10,0.04);
  border: 1px solid var(--border, rgba(10,10,10,0.08));
  color: var(--muted, rgba(10,10,10,0.6));
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  line-height: 1.4;
}
body.dark .pill {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}
/* Size modifiers */
.pill--sm { font-size: 10px; padding: 3px 9px; }
.pill--md { font-size: 12px; padding: 5px 12px; }
/* Color/intent modifiers */
.pill--accent {
  background: rgba(224, 90, 43, 0.06);
  border-color: rgba(224, 90, 43, 0.2);
  color: rgba(224, 90, 43, 0.9);
}
body.dark .pill--accent {
  background: rgba(224, 90, 43, 0.08);
  border-color: rgba(224, 90, 43, 0.25);
  color: var(--hl-text);
}
.pill--muted {
  background: transparent;
  color: var(--muted);
}
.pill--solid {
  background: rgba(10,10,10,0.07);
  border-color: transparent;
}
body.dark .pill--solid { background: rgba(255,255,255,0.08); }

/* ──────────────────────────────────────────────────────────────────────────
   5b. TAG — inline body-text annotations on a single line, prefixed by a
   sentence-case label ("Pain points —" / "Signature moments —") and
   separated from each other by a coloured bullet.
   Whole line takes its colour from the type:
     pain  → orange (var(--hl-text))
     value → muted green
   ────────────────────────────────────────────────────────────────────────── */
.tag-list {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.72;
  border: none;
}
/* Small horizontal dash between body content and the tag-list, in the
   same colour as the line below it (orange for pain, green for value). */
.tag-list::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.55;
  border-radius: 2px;
  margin-bottom: 10px;
}
.tag-list--tight { margin-top: 4px; }
.tag-list--loose { margin-top: 24px; }
/* Type colours apply to the whole list (label, tags, dashes, bullets). */
.tag-list:has(.tag--pain)  { color: var(--hl-text); }
.tag-list:has(.tag--value) { color: rgba(30,130,76,0.95); }
body.dark .tag-list:has(.tag--value) { color: rgba(80,200,120,0.95); }
.tag-list-label {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}
.tag-list-label::after {
  content: ' — ';
  white-space: pre;
}
.tag {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: 0;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  white-space: normal;
}
/* Bullet between consecutive tags — same colour as the line. */
.tag + .tag::before {
  content: '•';
  display: inline-block;
  margin: 0 10px;
  font-weight: 500;
  color: inherit;
  opacity: 0.85;
}

/* ──────────────────────────────────────────────────────────────────────────
   6. BADGE — pill with leading dot indicator
   ────────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(10,10,10,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
}
body.dark .badge {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(224,90,43,0.6);
  flex-shrink: 0;
}
.badge--available .badge-dot { background: #34c759; }
.badge--in-progress .badge-dot { background: rgba(224,90,43,0.7); }

/* ──────────────────────────────────────────────────────────────────────────
   7. CALLOUT — accent-bordered emphasis block
   ────────────────────────────────────────────────────────────────────────── */
.callout {
  grid-column: 1 / -1;
  background: rgba(10, 10, 10, 0.025);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 4px;
  padding: 28px 36px;
  margin: 24px 0 12px;
}
body.dark .callout {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.07);
  border-left-color: var(--orange);
}
.callout--tldr {
  border-left-color: rgba(224, 90, 43, 0.5);
}
.callout--note {
  border-left-color: var(--orange);
}
.callout--warning {
  background: rgba(224, 90, 43, 0.04);
  border-color: rgba(224, 90, 43, 0.15);
  border-left-color: rgba(224, 90, 43, 0.6);
}
body.dark .callout--warning {
  background: rgba(224, 90, 43, 0.06);
  border-color: rgba(224, 90, 43, 0.2);
}
.callout-label {
  font-size: var(--type-eyebrow);
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
  display: block;
}
.callout-title {
  font-size: var(--type-subheading);
  font-weight: var(--weight-medium);
  line-height: var(--lh-subhead);
  margin-bottom: 14px;
  color: var(--fg);
}
body.dark .callout-title { color: #f0f0f0; }
.callout p {
  font-size: var(--type-body);
  line-height: 1.7;
  margin-bottom: 12px;
  max-width: 68ch;
  color: rgba(10,10,10,0.7);
}
body.dark .callout p { color: rgba(255,255,255,0.62); }
.callout p:last-child { margin-bottom: 0; }

/* ── Orange highlight span ─────────────────────────────────────────────────── */
.hl {
  background: var(--hl-bg);
  border-bottom: 1.5px solid var(--hl-border);
  border-radius: 1px;
  padding: 0 2px;
}
body.dark .hl {
  background: var(--hl-bg-dark);
  border-bottom-color: var(--hl-border-dark);
}

/* ══ HERO TITLE — Display token ═══════════════════════════════════════════════
   Sizes responsive via --type-display token (54 → 48 → 36 at 1100/768px) */
.hero-title,
h1.hero-title {
  font-size: var(--type-display) !important;
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
}

/* ══ SECTION HEADINGS — Heading token ═════════════════════════════════════════
   Sizes responsive via --type-heading token (48 → 36 → 28 at 1100/768px) */
.section-intro h2,
h2.section-heading,
.section-heading,
.integration-heading {
  font-size: var(--type-heading) !important;
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-heading);
  line-height: var(--lh-heading);
}

/* ══ PULL QUOTES — Display size + italic orange ═══════════════════════════════
   Pull quote uses --type-display for size (responsive); orange + italic distinct */
.pull-quote p,
.pull-quote blockquote p,
.pull-quote-text {
  font-size: var(--type-display) !important;
  font-weight: var(--weight-regular);
  font-style: italic;
  letter-spacing: var(--track-display);
  line-height: 1.15;
  color: var(--orange) !important;
  max-width: 22ch;
}
body.dark .pull-quote p,
body.dark .pull-quote blockquote p,
body.dark .pull-quote-text {
  color: var(--orange) !important;
}

/* ══ BODY TEXT — Body token ═══════════════════════════════════════════════════ */
p { font-size: var(--type-body); line-height: var(--lh-body); }

.section-body,
.section-body p,
.section-content,
.section-content p,
.sub-section-body,
.sub-section-body p,
.integration-intro,
[class*="-body"] p {
  font-size: var(--type-body) !important;
  line-height: var(--lh-body);
}

/* ── Body floor — Body token applied to all descriptive / label content ──────
   These class selectors collected over time as a defensive 16px floor against
   accidental shrinkage. Migrated to consume --type-body for consistency. */
[class*="-label"]:not(input):not(select):not(.nav-link):not(.pf-dot-label):not(.hero-impact-label):not(.section-label):not(.skills-group-label),
[class*="-num"]:not(input):not(.loader-num),
[class*="-role"]:not(input):not(.hero-credit-role),
[class*="-caption"]:not(input),
[class*="-tag"]:not(input),
[class*="-note-label"],
[class*="-overline"],
[class*="-lbl"],
[class*="step-num"],
[class*="arch-node-num"],
[class*="iter-num"],
[class*="zoom-col-label"],
[class*="implication-num"],
[class*="-interaction-num"],
.tag,
kbd,
.zoom-col-label,
.sfn-label,
.sf2-lbl,
.sf2-num,
.arch-caption,
.arch-node-num,
.arch-subnode,
.sticky-note-label,
.research-quote-name,
.figma-open-link,
.pos-footnote,
.goal-note,
.stage-flow-delay,
.comp-table th,
.next-project-label {
  font-size: var(--type-body) !important;
}

/* ── Explicit content body text — Body token ─────────────────────────────── */
.interaction-body,
.iter-body,
.pattern-body,
.pattern-row-body,
.arch-node-desc,
.impact-body,
.option-body,
.zoom-row-text,
.step-summary,
.gpc-desc,
.goal-desc,
.persona-attr-val,
.layer-desc,
.refinement-item,
.tension-text,
.sticky-note-body,
.context-body,
.research-body,
.insight-body,
.tension-body,
.impl-body,
.tension-tool,
.hero-subtitle,
.hero-byline {
  font-size: var(--type-body) !important;
  line-height: 1.7;
}

/* ── Role titles — Lead tier (20px), no longer flattened to body ──────────── */
.tension-title,
.pattern-title,
.tension-card-name,
.case-nav-title {
  font-size: var(--type-lead) !important;
  font-weight: var(--weight-medium);
  line-height: 1.35;
}
body.dark .tension-title,
body.dark .pattern-title,
body.dark .tension-card-name,
body.dark .case-nav-title { color: #f0f0f0; }

/* ── Small numerical / overline labels — Eyebrow tier (11px) ──────────────── */
.pattern-num,
.case-nav-label {
  font-size: var(--type-eyebrow) !important;
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  line-height: var(--lh-eyebrow);
}

/* ── Secondary annotation text — Body token ──────────────────────────────── */
.option-tradeoff,
.tradeoff-pro,
.tradeoff-con,
.annotation-text,
.zoom-row,
.step-time,
.arch-caption {
  font-size: var(--type-body) !important;
}

/* ══ NAV — Caption token ══════════════════════════════════════════════════════ */
.nav-link {
  font-size: var(--type-caption) !important;
  color: rgba(60,60,67,0.6) !important;             /* inactive: quieted */
  position: relative !important;
  padding-bottom: 4px !important;
  transition: color 0.18s ease !important;
}
body.dark .nav-link {
  color: rgba(200,200,207,0.55) !important;
}

/* Inactive hover — colour firms up + a faint underline previews the active state */
.nav-link:not(.active):hover {
  color: rgba(10,10,10,0.95) !important;
}
body.dark .nav-link:not(.active):hover {
  color: rgba(240,240,240,0.95) !important;
}
.nav-link:not(.active)::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition:
    opacity 0.22s ease,
    transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.nav-link:not(.active):hover::after {
  opacity: 0.45;
  transform: scaleX(1);
}

/* Active nav link — solid underline at full text colour, no orange ────────── */
.nav-link.active {
  color: rgba(10,10,10,0.95) !important;
  align-self: stretch !important;
  display: flex !important;
  align-items: center !important;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  view-transition-name: nav-active-indicator;
}
body.dark .nav-link.active { color: rgba(240,240,240,0.95) !important; }

/* ── Slide the active indicator across page navigations ──────────────────────
   The View Transitions API tween between two snapshots: the underline under
   the previous active link (page A) and the underline under the new active
   link (page B). With a named view-transition, the browser interpolates
   position/size between them — the underline slides instead of fading. */
::view-transition-old(nav-active-indicator),
::view-transition-new(nav-active-indicator) {
  animation: none;                                   /* no fade — pure geometry tween */
}
::view-transition-group(nav-active-indicator) {
  animation-duration: 0.42s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(nav-active-indicator) { animation: none !important; }
  .nav-link:not(.active)::after { transition: none !important; }
}

/* ══ IMAGES — never overflow viewport ════════════════════════════════════════ */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Safari fix: `<video>` with `width: 100%; height: auto` renders at the WebKit
   default 300×150 box until metadata loads — producing a squashed, top-aligned
   band inside .hero-visual / .product-figure / .section-visual-media on the
   case-study pages. Setting `aspect-ratio: auto 16 / 9` gives Safari a layout
   hint: use the video's intrinsic ratio when known, fall back to 16/9 before
   metadata arrives. Every product video on the site samples at ≈16:9, so the
   fallback renders correctly even at first paint. The `auto` keyword lets the
   rare non-16:9 source (e.g. Quick Command's 2494×1286 ≈ 1.94:1) take over
   once its metadata lands. */
video {
  aspect-ratio: auto 16 / 9;
}

/* ══ SECTION CENTERING — 1440px max ══════════════════════════════════════════ */
.section,
.case-study-section {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* ══ NAV — consistent layout in both states; chrome appears on scroll ═══════
   Sits with breathing room above and reaches slightly wider than section
   content so the page still feels framed by it. Same padding in default
   and scrolled — only background, blur, and shadow differ on scroll.

   Padding behaviour:
   • viewport < 1440px → fixed --nav-pad inset from each edge.
   • viewport 1440–~1740px → padding grows so nav contents track the centred
     1440px content frame (gives the nav the same horizontal anchor as the
     page below it).
   • viewport > ~1740px → padding caps at --nav-pad-max. The nav stops pulling
     inward and instead grows wider with the viewport, so the nav contents
     never feel like a small centred island on ultra-wide displays. */
:root {
  --nav-pad: 56px;
  --nav-top: 96px;
  --nav-pad-max: 200px; /* cap on how far the nav can pull inward on wide screens */
}
@media (max-width: 1100px) {
  :root { --nav-pad: 40px; --nav-top: 72px; }
}
@media (max-width: 768px) {
  :root { --nav-pad: 24px; --nav-top: 48px; }
}
@media (max-width: 480px) {
  :root { --nav-pad: 20px; --nav-top: 32px; }
}

nav {
  padding-top: var(--nav-top) !important;
  padding-bottom: 24px !important;
  padding-left:  clamp(var(--nav-pad), calc((100vw - 1440px) / 2 + var(--nav-pad)), var(--nav-pad-max)) !important;
  padding-right: clamp(var(--nav-pad), calc((100vw - 1440px) / 2 + var(--nav-pad)), var(--nav-pad-max)) !important;
  align-items: center !important;
}

/* Identical inter-link spacing across every page — kills the 20px↔24px jump
   between top-level pages (index/work/resume) and case studies. */
.nav-right {
  gap: 24px !important;
}
/* Push the whole nav-right group (Home / Selected projects / Resume / lamp)
   OUTWARD toward the viewport's right edge so the lamp sits past the content
   area, not over it. The push has to scale with how much room the right
   gutter has — too aggressive on wide screens and the pendant lamp ends up
   on top of the Resume link. The breakpoints below match the nav padding
   cap at ~1740px: above the cap, padding stops growing, so we also stop
   pushing the link group outward and let the pendant sit naturally in the
   gutter without overlapping the links. */
nav .nav-right { margin-right: -120px !important; }
@media (max-width: 1500px) { nav .nav-right { margin-right: -56px !important; } }
@media (max-width: 768px)  { nav .nav-right { margin-right: 0    !important; } }
@media (min-width: 1740px) { nav .nav-right { margin-right: -32px !important; } }

/* ══ HERO CREDITS — collaborator block, bottom-right of every case study hero ══
   Sits in cols 10/-1, bottom-aligned to the hero text so the credit list
   lands flush with the bottom of the subtitle. Tokens are NOT new — they
   are byte-for-byte mirrors of existing hero tokens:
     • role label  → `.hero-eyebrow` (12px / 500 / 0.08em / uppercase / hl-text)
     • person name → `.hero-impact-statement` (18px / 500 / 1.4 / fg / -0.005em)
   When `.hero-credits` is present in the hero grid, the sibling `.hero-text`
   is also bottom-aligned via `:has()` so both columns share a baseline at
   the bottom of the hero. On viewports ≤1100px credits collapse below the
   hero text as a left-aligned horizontal list. */
.hero:has(.hero-credits) .hero-text { align-self: end; }

.hero-credits {
  grid-column: 10 / -1;
  align-self: end;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
  margin: 0;
  max-width: 100%;
}
.hero-credit-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
/* Role label — mirror of .hero-eyebrow */
.hero-credit-role {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl-text);
  display: block;
}
body.dark .hero-credit-role { color: var(--hl-text); }
/* Name — same size/weight as .hero-impact-statement, dialled down to muted
   so the eyebrow-orange role label stays the visual entry point and the
   credits don't out-shout the hero title. */
.hero-credit-name {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: -0.005em;
}
@media (max-width: 1100px) {
  .hero-credits {
    grid-column: 1 / -1;
    margin-top: 40px;
    align-self: start;
    justify-self: start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px 36px;
  }
  .hero-credit-row { align-items: flex-start; }
}
@media (max-width: 480px) {
  .hero-credits { gap: 18px 28px; margin-top: 32px; }
  .hero-credit-name { font-size: 16px; }
}

/* ══ PENDANT LIGHT — universal theme toggle (replaces .theme-btn on desktop) ══
   Hangs from top:0 ABOVE the nav (z-index 110 vs nav 100), so the cord stays
   visible during scroll instead of being covered by the nav's backdrop blur. */
.pendant {
  position: fixed;
  top: 0;
  right: 96px;
  z-index: 110;
  width: 72px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.pendant:focus-visible { outline: 2px solid rgba(224,90,43,0.55); outline-offset: 4px; border-radius: 4px; }
.pendant-cord {
  width: 1.5px;
  height: 138px;
  background: linear-gradient(to bottom, rgba(10,10,10,0.45), rgba(10,10,10,0.85));
  pointer-events: none;
  transition: height 0.18s cubic-bezier(0.5, 0, 0.7, 0.4);
}
body.dark .pendant-cord {
  background: linear-gradient(to bottom, rgba(255,255,255,0.35), rgba(255,255,255,0.7));
}
.pendant-svg {
  width: 72px;
  height: auto;
  display: block;
  pointer-events: none;
  transition: filter 0.32s ease;
}

/* Invisible spacer injected as the 4th item in .nav-right — reserves a slot
   for the lamp so the three visible nav links (Home / Selected projects /
   Resume) shift left together as viewport shrinks, exactly the way the old
   theme-btn used to. The fixed-positioned pendant tracks this slot. */
.pendant-spacer {
  display: inline-block;
  width: 56px;
  height: 32px;
  flex: 0 0 auto;
  pointer-events: none;
  visibility: hidden;
}
@media (max-width: 768px) { .pendant-spacer { display: none !important; } }
.pendant-svg path { fill: #1a1a1a; transition: fill 0.32s ease; }
body.dark .pendant-svg path { fill: rgba(240,240,240,0.85); }
/* Emission rays — hidden when lamp is "off" (light mode), visible when "on" (dark mode) */
.pendant-svg .pendant-ray {
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.dark .pendant-svg .pendant-ray {
  opacity: 1;
  fill: rgba(255, 195, 90, 0.95); /* warm yellow rays in dark mode, matching the glow */
}
/* Glow: OFF in light mode (room is bright), ON in dark mode (soft warm yellow) */
.pendant-bulb-glow {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 195, 90, 0.26) 0%, rgba(255, 195, 90, 0) 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}
body.dark .pendant-bulb-glow { opacity: 1; }
/* Pull-cord stretch + lamp swing animation states */
.pendant.is-pulling .pendant-cord { height: 156px; }
.pendant.is-pulling { transform: translateY(16px) rotate(0deg); transition: transform 0.18s cubic-bezier(0.5, 0, 0.7, 0.4); }
.pendant.is-swing-left  { transform: translateY(0) rotate(-7deg); }
.pendant.is-swing-right { transform: translateY(0) rotate(7deg); }

/* Hover dangle — runs 2 oscillations then settles. Re-triggers when the user
   leaves and re-enters. Suppressed during click (is-pulling/is-swing-*) and
   for ~600ms after click via .just-clicked so it doesn't restart on the
   still-hovering cursor right after a toggle. */
@keyframes pendant-dangle {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-1.6deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(1.4deg); }
  100% { transform: rotate(0deg); }
}
.pendant:hover:not(.is-pulling):not(.is-swing-left):not(.is-swing-right):not(.just-clicked) {
  animation: pendant-dangle 1.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) 2;
}
@media (max-width: 768px) { .pendant { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .pendant, .pendant-cord, .pendant-svg, .pendant-svg path, .pendant-bulb-glow { transition: none !important; }
  .pendant:hover { animation: none !important; }
}

/* ══ CASE NAV — canonical bottom nav for every case study ════════════════════
   Editorial-style end-of-article nav: small orange eyebrow, large title.
   Left + right text links aligned to the page edges. No cards. */
.case-nav-shared {
  max-width: var(--container-max, 1440px);
  margin: 80px auto 0 !important;
  padding: 56px var(--container-pad, 96px) 80px !important;
  border-top: 1px solid var(--border, rgba(10,10,10,0.08));
  display: flex !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
body.dark .case-nav-shared { border-top-color: rgba(255,255,255,0.07) !important; }

.case-nav-shared .cn-item {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  text-decoration: none !important;
  padding: 0;
  background: transparent;
  border: none;
  min-width: 0;
  max-width: 360px;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.case-nav-shared .cn-prev { text-align: left; align-items: flex-start; }
.case-nav-shared .cn-next { text-align: right; align-items: flex-end; }

/* Eyebrow — small, orange, with arrow that animates on hover */
.case-nav-shared .cn-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hl-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.dark .case-nav-shared .cn-label { color: var(--hl-text); }

.case-nav-shared .cn-prev .cn-label::before {
  content: '←';
  font-size: 13px;
  display: inline-block;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.case-nav-shared .cn-next .cn-label::after {
  content: '→';
  font-size: 13px;
  display: inline-block;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.case-nav-shared .cn-prev:hover .cn-label::before { transform: translateX(-3px); }
.case-nav-shared .cn-next:hover .cn-label::after  { transform: translateX(3px); }

/* Title — sized like a refined headline, dark, tight tracking */
.case-nav-shared .cn-title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.014em;
  line-height: 1.2;
  color: var(--fg, #0a0a0a);
  transition: color 0.2s ease;
}
body.dark .case-nav-shared .cn-title { color: #f0f0f0; }
.case-nav-shared .cn-item:hover .cn-title { color: var(--hl-text); }
body.dark .case-nav-shared .cn-item:hover .cn-title { color: var(--hl-text); }

/* Mobile: stack vertically with a divider between the two items */
@media (max-width: 768px) {
  .case-nav-shared {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 36px var(--container-pad, 24px) 48px !important;
    margin-top: 48px !important;
  }
  .case-nav-shared .cn-item {
    max-width: 100%;
    width: 100%;
    padding: 20px 0;
    border-bottom: 1px solid var(--border, rgba(10,10,10,0.08));
  }
  body.dark .case-nav-shared .cn-item { border-bottom-color: rgba(255,255,255,0.07); }
  .case-nav-shared .cn-item:last-child { border-bottom: none; padding-bottom: 0; }
  .case-nav-shared .cn-item:first-of-type { padding-top: 0; }
  .case-nav-shared .cn-next { text-align: left; align-items: flex-start; }
  .case-nav-shared .cn-title { font-size: 20px; }
}
@media (max-width: 1100px) {
  .case-nav-shared .cn-title { font-size: 22px; }
  .case-nav-shared .cn-item { max-width: 280px; }
}

/* ══ MOBILE NAV PATTERN (≤ 768px) ════════════════════════════════════════════
   Strip the top nav-right links on mobile (logo + theme stay) and add a
   Pinterest-inspired bottom nav with a pill-shaped active selection in orange.
   Icon + text. Thumb-reach zone, no decision overhead at the top. */
@media (max-width: 768px) {
  /* HARD LOCK: page never scrolls horizontally on mobile. Without this, any
     wide child (tables, oversized images, accidental overflows) makes the body
     wider than viewport — and `position: fixed; left:0; right:0` elements like
     the bottom nav inherit that wider width and overflow off-screen too. */
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }

  /* Hide the top primary nav links — keep logo + theme. */
  nav .nav-right .nav-link { display: none !important; }

  /* Top nav: pure white on mobile (vs page bg #fafafa) so the nav has
     visible presence even at scrollY=0 — was previously rgba(250,250,250)
     which matched the page bg exactly and appeared to "disappear." Plus a
     soft drop shadow for depth. */
  nav:not(.mobile-bottom-nav) {
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 0 rgba(10, 10, 10, 0.06), 0 4px 16px -8px rgba(10, 10, 10, 0.08) !important;
  }
  body.dark nav:not(.mobile-bottom-nav) {
    background-color: #1a1a1a !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px -8px rgba(0, 0, 0, 0.5) !important;
  }
  /* Tighter top padding on mobile so the nav reads as a true header bar.
     Force top: 0 — some pages set `nav { top: 40px }` in their @media block
     which left a 40px gap above the bar where scrolling content peeked through.
     Also force visibility so the nav can never be hidden by transforms or
     transitions during scroll. */
  nav:not(.mobile-bottom-nav),
  nav.scrolled:not(.mobile-bottom-nav) {
    top: 0 !important;
    padding-top: max(env(safe-area-inset-top, 0px), 14px) !important;
    padding-bottom: 14px !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  /* Bottom nav surface — fixed, blurred, safe-area aware. Items distributed
     evenly across the bar so they breathe within the available width. */
  .mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    z-index: 90 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background-color: rgba(250, 250, 250, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 -1px 0 rgba(10,10,10,0.06), 0 -10px 32px -10px rgba(10,10,10,0.1);
    pointer-events: auto;
    box-sizing: border-box;
  }
  body.dark .mobile-bottom-nav {
    background-color: rgba(12, 12, 12, 0.82);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.06), 0 -10px 32px -10px rgba(0,0,0,0.45);
  }

  /* Each item — icon LEFT, label RIGHT (horizontal pill). Items share width
     evenly via flex: 1 1 0 so they spread across the bar. */
  .mbn-link {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    text-decoration: none !important;
    color: rgba(60,60,67,0.7);
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.005em;
    line-height: 1;
    border-radius: 999px;
    transition: color 0.22s ease, background-color 0.28s cubic-bezier(0.2,0.7,0.3,1), transform 0.16s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    white-space: nowrap;
  }
  body.dark .mbn-link { color: rgba(200,200,207,0.6); }

  /* Icon — refined Heroicons-style stroke set */
  .mbn-link svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-width 0.18s ease, fill 0.18s ease;
    flex-shrink: 0;
  }
  .mbn-link span {
    display: block;
    font-size: 12px;
    line-height: 1;
    color: inherit;
  }
  .mbn-link:active { transform: scale(0.96); }

  /* Pill-shaped active selection — orange accent. Wraps icon + label. */
  .mbn-link.active {
    color: rgba(224, 90, 43, 1);
    background-color: rgba(224, 90, 43, 0.1);
  }
  .mbn-link.active svg {
    stroke-width: 1.9;
  }
  body.dark .mbn-link.active {
    color: rgba(240, 130, 90, 1);
    background-color: rgba(240, 130, 90, 0.14);
  }

  /* Add bottom space on mobile so fixed bottom nav doesn't cover content. */
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

  /* TTS feature paused — styles removed alongside script tag. See portfolio-tts.js.disabled. */
}

/* Always hidden above 768px — never affects desktop. */
@media (min-width: 769px) {
  .mobile-bottom-nav { display: none !important; }
}

nav.scrolled {
  background-color: rgba(250,250,250,0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06) !important;
}
body.dark nav.scrolled {
  background-color: rgba(12,12,12,0.72) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) !important;
}

/* ══ CONTRAST — hero text ════════════════════════════════════════════════════ */
.hero-subtitle {
  color: rgba(10,10,10,0.72) !important;
}
body.dark .hero-subtitle {
  color: rgba(240,240,240,0.68) !important;
}
.hero-byline {
  color: rgba(10,10,10,0.72) !important;
  font-size: var(--type-body) !important;
}
body.dark .hero-byline {
  color: rgba(240,240,240,0.68) !important;
}

/* ══ STICKY NOTES — adapt to dark mode (board matches page bg, cards stay visible) ══ */
body.dark .sticky-board  { background: #0c0c0c !important; }
body.dark .sticky-yellow,
body.dark .sticky-blue,
body.dark .sticky-green,
body.dark .sticky-note   { background: #1f7ac0 !important; }
body.dark .sticky-note,
body.dark .sticky-note p,
body.dark .sticky-note span { color: rgba(255, 255, 255, 0.95) !important; }
body.dark .sticky-sub,
body.dark .sticky-note-label { color: rgba(255, 255, 255, 0.7) !important; }

/* ══ SECTION SPACING — uses --rhythm-section token (120/96/72 responsive) ════ */
.section {
  padding-top: var(--rhythm-section) !important;
  padding-bottom: var(--rhythm-section) !important;
}

/* ══ CONTRAST REFERENCE ══════════════════════════════════════════════════════ */
/*
  LIGHT #fafafa · DARK #0c0c0c
  rgba(10,10,10,0.72) on light  → 8.1:1 AAA ✓
  rgba(240,240,240,0.68) on dark → 8.7:1 AAA ✓
  rgba(60,60,67,0.9) on light   → 7.3:1 AAA ✓
  rgba(200,200,207,0.75) on dark → 7.3:1 AAA ✓
*/
:root { --muted: rgba(10,10,10,0.72); }
body.dark { --muted: rgba(240,240,240,0.68); }

/* ══ PAGE TRANSITIONS — View Transitions API (cross-document) ════════════════
   Modern browsers (Chrome/Edge/Opera, Safari 18+) animate the transition
   between full-page navigations natively. No JS, no link-interception, no
   broken back-button. Older browsers fall through to the @supports fallback
   below — a clean fade-in on load, with no exit animation (which avoided
   adding artificial latency to every click).

   Choreography:
     - Outgoing page: 180ms fade-out (fast — gets out of the way)
     - Incoming page: 320ms fade-in (slower — gives content time to settle)
*/
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: page-fade-out 0.18s cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: page-fade-in 0.32s cubic-bezier(0, 0, 0.2, 1) both;
}

@keyframes page-fade-out { to   { opacity: 0; } }
@keyframes page-fade-in  { from { opacity: 0; } }

/* Fallback: clean fade-in for browsers without View Transitions support */
@supports not (view-transition-name: none) {
  body {
    animation: page-fade-in 0.32s cubic-bezier(0, 0, 0.2, 1) both;
  }
}

/* Respect user motion preferences — opt out fully if the OS asks for it */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
  body { animation: none !important; opacity: 1 !important; }
  /* Universal motion guard for case-study animations */
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  video[autoplay] { animation-play-state: paused !important; }
}

/* ══ MOBILE SECTION GRID FIX ════════════════════════════════════════════════
   Sections use a 12-column grid on desktop; many children declare
   `grid-column: 1 / 10` for editorial line-length (~75% width). When .section
   collapses to `grid-template-columns: 1fr` on mobile, those children claim
   9 implicit columns and content gets squeezed into a narrow lane.
   This forces every direct .section child to span full width on mobile. */
@media (max-width: 768px) {
  .section > * {
    grid-column: 1 / -1 !important;
  }
}

/* ══ SMALL-SCREEN SCALING ═══════════════════════════════════════════════════
   At ≤480px, multi-card grids and card surfaces compress so they don't feel
   oversized on small phones. Reduces grid gaps, card padding, and the largest
   display numbers. Applies portfolio-wide. */
@media (max-width: 480px) {
  /* Tighter gaps on multi-card grids */
  .insight-grid,
  .solution-grid,
  .stat-grid,
  .research-methods,
  .research-image-grid,
  .field-voices,
  .hero-impact-grid,
  .impact-grid,
  .outcome-grid,
  .gap-diagram { gap: 12px; }

  /* Tighter card padding */
  .insight-item,
  .solution-card,
  .pilot-callout,
  .problem-card,
  .evo-card,
  .field-voice,
  .goal-card-large,
  .persona-block,
  .stat-block,
  .research-method,
  .visual-card,
  .scope-phase { padding: 24px; }

  /* Display numbers shrink so they don't dominate the screen */
  .stat-number { font-size: 44px; }
  .pilot-callout-num { font-size: 36px; }
  .goal-num-large { font-size: 36px; }

  /* Sub-headline tightening */
  .hero-impact-statement { font-size: 16px; }
  .hero-impact-desc { font-size: 14px; line-height: 1.55; }
}

/* ══ ACCESSIBILITY ══════════════════════════════════════════════════════════ */
/* Skip-to-content link, hidden until focused via keyboard */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 18px;
  background: #1c1c1c;
  color: #fff;
  font-family: 'Satoshi', 'Inter Tight', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  border-radius: 8px;
  transition: top 0.18s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid rgba(224, 90, 43, 0.95);
  outline-offset: 2px;
}
body.dark .skip-link {
  background: #f0f0f0;
  color: #1c1c1c;
}

/* Universal focus-visible ring for keyboard users — overrides browser defaults
   only when keyboard navigation is used (mouse clicks won't show the ring) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(224, 90, 43, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}
body.dark a:focus-visible,
body.dark button:focus-visible,
body.dark [role="button"]:focus-visible,
body.dark [role="tab"]:focus-visible,
body.dark input:focus-visible,
body.dark textarea:focus-visible,
body.dark select:focus-visible,
body.dark summary:focus-visible,
body.dark [tabindex]:focus-visible {
  outline-color: rgba(255, 145, 92, 0.95);
}

/* ══ BOOT LOADER — fires on first visit per tab ═════════════════════════════
   Two halves meet at a horizontal seam across the middle. At 100% they
   part — top slides up, bottom slides down — with a slight anticipation
   pinch (3.5% inward) before they spring open. Reads as a slight bounce.
   Markup + JS lives in `portfolio-loader.js`. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}
.loader-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  /* Curtain colour matches the page background so when the halves part
     the transition into the page is seamless, no contrasting flash. */
  background: #fafafa;
  pointer-events: auto;
}
body.dark .loader-half { background: #0c0c0c; }
.loader-half.top    { top: 0; }
.loader-half.bottom { bottom: 0; }
.loader-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-family: 'Sacramento', cursive;
  font-weight: 400;
  font-size: clamp(90px, 14vw, 150px);
  letter-spacing: 0;
  color: #0a0a0a;
  line-height: 1;
  transition: opacity 0.22s ease;
  pointer-events: none;
  white-space: nowrap;
}
body.dark .loader-num { color: #f0f0f0; }
/* Boot gate — while the loader is up, the rest of the body is hidden so
   page content never flashes through before the curtains cover it. */
html.boot-gate body { visibility: hidden; }
html.boot-gate body .loader,
html.boot-gate body .loader * { visibility: visible; }
.loader.is-num-fading .loader-num { opacity: 0; }
/* Anticipation curtain open — 18% in, the halves push 3.5% TOWARD the
   centre (compression), then spring outward to fully off-screen. */
@keyframes loader-open-top {
  0%   { transform: translateY(0); }
  18%  { transform: translateY(3.5%); }
  100% { transform: translateY(-100%); }
}
@keyframes loader-open-bottom {
  0%   { transform: translateY(0); }
  18%  { transform: translateY(-3.5%); }
  100% { transform: translateY(100%); }
}
.loader.is-opening .loader-half.top {
  animation: loader-open-top 0.65s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}
.loader.is-opening .loader-half.bottom {
  animation: loader-open-bottom 0.65s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}
.loader.is-gone { display: none; }
@media (prefers-reduced-motion: reduce) {
  .loader { display: none !important; }
}

/* ══ DESIGN-PROCESS TIMELINE ═════════════════════════════════════════════════
   Reusable phased-timeline component used in every case study.

   Structure (each case study supplies its own phases, dots, labels):
     .process-map
       .proc-phases               position:relative; 4 absolute phase headers
         .proc-phase[data-phase]  positioned via left: % at phase x-centre
       .proc-curve-wrap           1800×320 SVG canvas + absolute label layer
         <svg .proc-curve>        bg path + per-phase highlight paths + dots
         .proc-m[data-pos][data-phase]  each with .proc-m-num, -name, -overview

   Phases highlight on hover (data-active-phase on .process-map).
   Milestones reveal an overview on hover (is-active class). Entrance
   animation drawn on viewport-entry via stroke-dashoffset + staggered fades.
   Honours prefers-reduced-motion (renders settled state immediately). */
.process-map {
  grid-column: 1 / -1;
  margin-top: 24px;
  margin-bottom: 0;
  padding: 0;
}
.proc-phases {
  position: relative;
  height: 44px;
  margin-bottom: 128px;
}
.proc-phase {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  transition: opacity 0.25s ease;
  width: max-content;
}
.proc-phase-num {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10,10,10,0.5);
  transition: color 0.2s ease;
}
body.dark .proc-phase-num { color: rgba(255,255,255,0.4); }
.proc-phase-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10,10,10,0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}
body.dark .proc-phase-sub { color: rgba(255,255,255,0.35); }
.process-map[data-active-phase] .proc-phase { opacity: 0.35; }
.process-map .proc-phase[data-active] { opacity: 1; }
.process-map .proc-phase[data-active] .proc-phase-num { color: var(--fg); }
body.dark .process-map .proc-phase[data-active] .proc-phase-num { color: #f0f0f0; }
.process-map .proc-phase[data-active] .proc-phase-sub { opacity: 1; }

.proc-curve-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1800 / 320;
}
.proc-curve { width: 100%; height: 100%; display: block; overflow: visible; }
.proc-curve-bg {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: opacity 0.3s ease, stroke 0.3s ease;
}
body.dark .proc-curve-bg { stroke: rgba(255,255,255,0.78); }
.process-map[data-active-phase] .proc-curve-bg { opacity: 0.18; }
.proc-curve-phase {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.dark .proc-curve-phase { stroke: #f0f0f0; }
.process-map[data-active-phase="1"] .proc-curve-phase.phase-1,
.process-map[data-active-phase="2"] .proc-curve-phase.phase-2,
.process-map[data-active-phase="3"] .proc-curve-phase.phase-3,
.process-map[data-active-phase="4"] .proc-curve-phase.phase-4,
.process-map[data-active-phase="5"] .proc-curve-phase.phase-5 { opacity: 1; }

.proc-dot {
  fill: var(--bg);
  stroke: var(--fg);
  stroke-width: 1.5;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.18s ease, fill 0.18s ease;
  transform-origin: center;
}
body.dark .proc-dot { stroke: rgba(255,255,255,0.78); }
.proc-dot.dot-solid { fill: var(--fg); }
body.dark .proc-dot.dot-solid { fill: #f0f0f0; }
.process-map[data-active-phase] .proc-dot { opacity: 0.25; }
.process-map[data-active-phase="1"] .proc-dot[data-phase="1"],
.process-map[data-active-phase="2"] .proc-dot[data-phase="2"],
.process-map[data-active-phase="3"] .proc-dot[data-phase="3"],
.process-map[data-active-phase="4"] .proc-dot[data-phase="4"],
.process-map[data-active-phase="5"] .proc-dot[data-phase="5"] { opacity: 1; }

.proc-m {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 140px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.25s ease;
  z-index: 1;
}
.proc-m:hover, .proc-m.is-active { z-index: 5; }
.proc-m[data-pos="top"]    { bottom: calc(100% - 37.5% + 28px); }
.proc-m[data-pos="bottom"] { top:    calc(68.75%       + 28px); }
.proc-m-num {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10,10,10,0.45);
  margin-bottom: 4px;
}
body.dark .proc-m-num { color: rgba(255,255,255,0.4); }
.proc-m-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.3;
  letter-spacing: -0.005em;
  transition: color 0.2s ease, font-weight 0.2s ease;
}
body.dark .proc-m-name { color: #f0f0f0; }
.proc-m-overview {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(10,10,10,0.55);
  margin-top: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.25s ease;
}
body.dark .proc-m-overview { color: rgba(255,255,255,0.5); }
.proc-m.is-active .proc-m-overview,
.proc-m:hover .proc-m-overview {
  max-height: 96px;
  opacity: 1;
}
.process-map[data-active-phase] .proc-m { opacity: 0.3; }
.process-map[data-active-phase="1"] .proc-m[data-phase="1"],
.process-map[data-active-phase="2"] .proc-m[data-phase="2"],
.process-map[data-active-phase="3"] .proc-m[data-phase="3"],
.process-map[data-active-phase="4"] .proc-m[data-phase="4"],
.process-map[data-active-phase="5"] .proc-m[data-phase="5"] { opacity: 1; }

@media (max-width: 900px) {
  .process-map { margin-top: 16px; }
  .proc-phases { display: none; }
  .proc-curve-wrap {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
  }
  .proc-curve { display: none; }
  .proc-m {
    position: static;
    transform: none;
    width: 100%;
    text-align: left;
    align-items: flex-start;
  }
  .proc-m-overview { max-height: 200px; opacity: 1; margin-top: 6px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Case-study soft paywall (v3 — bottom banner + content-only blur)
   ─────────────────────────────────────────────────────────────────────────
   Pattern: the reader scrolls through hero + Problem freely. Everything
   after Problem is wrapped in `.case-locked` and only the CONTENT inside
   it (text + media) is blurred — layout containers, sections, dividers,
   the side nav, page chrome, etc. stay sharp. A fixed banner pinned to
   the bottom of the viewport (cookie-banner style) holds the password
   form. Banner slides in when reader passes Problem, slides out when
   they scroll back to it. Password unlocks the whole session.

   Injection + scroll observation handled in portfolio-shared.js.
   ───────────────────────────────────────────────────────────────────────── */

/* Lock the interaction of every descendant — selecting blurred text or
   tabbing into hidden controls would defeat the lock. */
.case-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Selective blur: target CONTENT elements (text + media + icons + form
   controls) rather than their containers. The page structure — section
   padding, dividers, borders, background — stays sharp; only the readable
   content is illegible. */
.case-locked :is(p, h1, h2, h3, h4, h5, h6, li, dt, dd,
                  blockquote, figcaption, summary, label, time, code, pre,
                  span:not(.case-paywall-request-arrow):not([class*="badge"]):not([class*="dot"]):not([class*="-icon"]),
                  a, button, input, textarea, select,
                  img, picture, video, iframe, canvas, svg,
                  [class*="-title"], [class*="-desc"], [class*="-label"],
                  [class*="-text"], [class*="-num"], [class*="-name"],
                  [class*="-overview"], [class*="-stat"], [class*="-quote"]) {
  filter: blur(7px) saturate(0.7);
  -webkit-filter: blur(7px) saturate(0.7);
  transition: filter 0.55s ease;
}

/* When unlocked, lift blur from everything inside the locked region. */
body.case-unlocked .case-locked {
  pointer-events: auto;
  user-select: auto;
  -webkit-user-select: auto;
}
body.case-unlocked .case-locked * {
  filter: none !important;
  -webkit-filter: none !important;
}
body.case-unlocked .case-paywall {
  transform: translateY(110%);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   CASE PAYWALL — bottom-sticky sheet (cookies-banner pattern).
   Replicated from phisayoo/portfolio's case-studies.css (lines 3509–3927).
   Fixed to the bottom of the viewport, frosted glass, slides up on reveal.
   The `.case-locked` blur on content underneath is unchanged.
   ══════════════════════════════════════════════════════════════════════════ */
.case-paywall-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: max(42vh, 360px);
  padding: 56px 48px max(48px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 -1px 2px rgba(15, 23, 42, 0.04),
    0 -24px 60px -16px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  pointer-events: none;
}
body.dark .case-paywall-bar {
  background: rgba(20, 20, 20, 0.82);
  border-top-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 -1px 2px rgba(0, 0, 0, 0.5),
    0 -24px 60px -16px rgba(0, 0, 0, 0.7);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .case-paywall-bar { background: rgba(255, 255, 255, 0.98); }
  body.dark .case-paywall-bar { background: rgba(20, 20, 20, 0.98); }
}

/* Top fade — washes the join between blurred content above and the sheet. */
.case-paywall-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -56px;
  height: 56px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 100%);
  pointer-events: none;
}
body.dark .case-paywall-bar::before {
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0) 0%, rgba(20, 20, 20, 0.45) 100%);
}

/* Reveal once reader passes Problem; unlock hides. */
body.case-past-problem .case-paywall-bar {
  transform: translateY(0);
  pointer-events: auto;
}
body.case-unlocked .case-paywall-bar {
  transform: translateY(100%);
  pointer-events: none;
}

.case-paywall-bar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
  max-width: 1180px;
}

.case-paywall-bar-main {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: 100%;
}

/* ---- Left column: eyebrow + title + blurb ---- */
.case-paywall-bar-copy { min-width: 0; }

.case-paywall-bar-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(28, 28, 28, 0.78);
}
body.dark .case-paywall-bar-eyebrow {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(240, 240, 240, 0.82);
}
.case-paywall-bar-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1a1a;
}
body.dark .case-paywall-bar-eyebrow-dot { background: #f0f0f0; }

.case-paywall-bar-title {
  font-family: 'Satoshi', sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: #1a1a1a;
  margin: 0 0 14px;
  max-width: 18ch;
}
body.dark .case-paywall-bar-title { color: #f0f0f0; }

.case-paywall-bar-blurb {
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(60, 60, 67, 0.65);
  margin: 0;
  max-width: 38ch;
}
body.dark .case-paywall-bar-blurb { color: rgba(200, 200, 207, 0.6); }
.case-paywall-bar-blurb a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
body.dark .case-paywall-bar-blurb a {
  color: #f0f0f0;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
.case-paywall-bar-blurb a:hover { text-decoration-color: currentColor; }

/* ---- Vertical hairline divider ---- */
.case-paywall-bar-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 20%,
    rgba(0, 0, 0, 0.1) 80%,
    transparent 100%
  );
  max-height: 140px;
}
body.dark .case-paywall-bar-divider {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 20%,
    rgba(255, 255, 255, 0.12) 80%,
    transparent 100%
  );
}

/* ---- Right column: labelled form group ---- */
.case-paywall-bar-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.case-paywall-bar-label {
  font-family: 'Satoshi', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(60, 60, 67, 0.6);
}
body.dark .case-paywall-bar-label { color: rgba(200, 200, 207, 0.55); }

.case-paywall-bar-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.case-paywall-bar-input {
  width: 260px;
  padding: 14px 18px;
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  line-height: 1.3;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.case-paywall-bar-input::placeholder { color: rgba(60, 60, 67, 0.4); }
.case-paywall-bar-input:hover { border-color: rgba(0, 0, 0, 0.22); }
.case-paywall-bar-input:focus-visible {
  border-color: #1a1a1a;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(22, 21, 19, 0.08);
}
body.dark .case-paywall-bar-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f0f0f0;
}
body.dark .case-paywall-bar-input::placeholder { color: rgba(200, 200, 207, 0.42); }
body.dark .case-paywall-bar-input:focus-visible {
  border-color: #f0f0f0;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(240, 240, 240, 0.08);
}
.case-paywall-bar-input.is-error {
  border-color: rgba(192, 28, 28, 0.55);
  box-shadow: 0 0 0 3px rgba(192, 28, 28, 0.1);
}

.case-paywall-bar-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  background: #1a1a1a;
  color: #fafafa;
  border: none;
  border-radius: 12px;
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.003em;
  cursor: pointer;
  transition: opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
}
body.dark .case-paywall-bar-submit { background: #f0f0f0; color: #1a1a1a; }
.case-paywall-bar-submit:hover { opacity: 0.92; }
.case-paywall-bar-submit:hover .case-paywall-bar-arrow { transform: translateX(2px); }
.case-paywall-bar-submit:active { transform: translateY(1px); }
.case-paywall-bar-submit:disabled { opacity: 0.55; cursor: progress; }
.case-paywall-bar-arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex-shrink: 0;
}

/* Narrow viewports: collapse 3-col grid to one column, hide divider. */
@media (max-width: 860px) {
  .case-paywall-bar {
    min-height: max(44vh, 360px);
    padding: 28px 22px max(24px, env(safe-area-inset-bottom));
  }
  .case-paywall-bar-inner { gap: 22px; }
  .case-paywall-bar-main { grid-template-columns: 1fr; gap: 22px; }
  .case-paywall-bar-divider { display: none; }
  .case-paywall-bar-title { font-size: 24px; max-width: none; }
  .case-paywall-bar-blurb { font-size: 14px; max-width: none; }
  .case-paywall-bar-form { width: 100%; }
  .case-paywall-bar-field { width: 100%; }
  .case-paywall-bar-input { flex: 1 1 auto; width: auto; min-width: 0; }
}

/* Very short viewports — trim breathing room so sheet doesn't dominate. */
@media (max-height: 560px) {
  .case-paywall-bar {
    min-height: 0;
    padding: 22px 32px max(20px, env(safe-area-inset-bottom));
  }
  .case-paywall-bar-inner { gap: 16px; }
  .case-paywall-bar-title { font-size: 22px; margin-bottom: 6px; }
  .case-paywall-bar-eyebrow { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-paywall-bar { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CASE TOPSTRIP — top-of-page breadcrumb for case studies.
   Typography mirrors `.hero-eyebrow` from the existing case-study pages
   exactly: 12px / weight 500 / 0.08em letter-spacing / uppercase / Satoshi /
   var(--hl-text) (orange) color. Same eyebrow family the role labels use,
   so the topstrip reads as part of the same system, not a new register.
   Pattern: ← Selected works / 0X of 06   ·   Project Title
   ══════════════════════════════════════════════════════════════════════════ */
.case-topstrip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.12);
  font-family: 'Satoshi', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl-text);
  font-feature-settings: "tnum";
}
body.dark .case-topstrip {
  background: rgba(20, 20, 20, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .case-topstrip { background: rgba(255, 255, 255, 0.98); }
  body.dark .case-topstrip { background: rgba(20, 20, 20, 0.98); }
}
.case-topstrip-inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: var(--container-max, 1440px);
  margin: 0 auto;
  padding: 22px var(--container-pad, 96px) 20px;
  box-sizing: border-box;
}
.case-topstrip a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.case-topstrip a:hover { color: var(--fg); }
.case-topstrip-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.case-topstrip-arrow {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.case-topstrip a:hover .case-topstrip-arrow { transform: translateX(-2px); }
.case-topstrip-divider {
  color: var(--hl-text);
  opacity: 0.5;
}
/* Push page content below the fixed bar. */
body:has(.case-topstrip) { padding-top: 64px; }
@media (max-width: 768px) {
  .case-topstrip-inner { padding: 16px 32px 14px; font-size: 11px; }
  .case-topstrip-left { gap: 8px; }
  body:has(.case-topstrip) { padding-top: 52px; }
}
