/* =========================================================
   Ziyi Jiang — portfolio
   Tokens mirror the Figma "My website" variables (ZJ · *).
   ========================================================= */

/* ---------- Primitives → semantic tokens (Light) ---------- */
:root {
  --neutral-0: #ffffff;  --neutral-50: #f7f7f5; --neutral-100: #f4f4f2;
  --neutral-200: #ebebe8; --neutral-300: #d9d9d6; --neutral-400: #a3a3a5;
  --neutral-500: #8a8b8f; --neutral-600: #6e6f73; --neutral-700: #3a3b3f;
  --neutral-800: #232428; --neutral-900: #16171a;

  --bg-page: var(--neutral-0);
  --bg-surface: var(--neutral-50);
  --bg-sunken: var(--neutral-100);
  --bg-raised: var(--neutral-0);
  --bg-muted: rgba(22, 23, 26, .04);
  --bg-glass: rgba(255, 255, 255, .6);

  --text-primary: var(--neutral-800);
  --text-secondary: var(--neutral-600);
  --text-tertiary: var(--neutral-400);

  --border-subtle: rgba(22, 23, 26, .07);
  --border-default: rgba(22, 23, 26, .10);
  --border-strong: var(--neutral-900);

  --action-primary-bg: var(--neutral-900);
  --action-primary-bg-hover: var(--neutral-700);
  --action-primary-fg: var(--neutral-50);
  --action-secondary-bg: var(--neutral-0);
  --action-secondary-bg-hover: var(--neutral-100);
  --action-secondary-fg: var(--neutral-900);

  /* Accent — "Ink" mode by default (homepage) */
  --accent-fill: #16171a;
  --accent-hover: #3a3b3f;
  --accent-text: #16171a;     /* accent/text — case page title */
  --accent-ink: #16171a;      /* eyebrows, numbers, small links */
  --accent-subtle: #f4f4f2;
  --accent-on: #f7f7f5;
  --bg-inverse: #0e0f11;      /* Figma bg/page, Dark mode — About "Reconnection" band */

  /* Brand — the logo's three layers (assets/favicon.svg), light and dark */
  --logo-light: #c3cfdd; --logo-mid: #6f87a3; --logo-dot: #2f4560;
  --logo-light-dark: #51657f; --logo-mid-dark: #8299b5; --logo-dot-dark: #dbe5f1;

  /* Effects */
  --shadow-hairline: 0 1px 4px rgba(22, 23, 26, .05), 0 6px 20px rgba(22, 23, 26, .05);
  --shadow-card-hover: 0 24px 48px rgba(22, 23, 26, .08);
  --shadow-image: 0 8px 40px rgba(31, 31, 41, .10);
  --shadow-nav: 0 8px 32px rgba(22, 23, 26, .06);

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-2xl: 32px; --r-full: 999px;

  /* Layout */
  --container: 1248px;
  --gutter: clamp(20px, 6.667vw, 96px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Type */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-display: clamp(40px, 3.4vw + 16px, 64px);
  --fs-h1: clamp(34px, 1.9vw + 21px, 48px);
  --fs-h2: clamp(27px, 1.25vw + 18px, 36px);
  --fs-h3: clamp(22px, .8vw + 17px, 28px);
}

/* Per-case accent modes (ZJ · Accent / ZJ · Blue Family) */
[data-accent="cobalt"] { --accent-fill:#2f6bff; --accent-hover:#1f55e0; --accent-text:#1f55e0; --accent-ink:#1f55e0; --accent-subtle:#e6edff; --accent-on:#fff; }
[data-accent="azure"]  { --accent-fill:#2b7fd6; --accent-hover:#1f69b8; --accent-text:#1f69b8; --accent-ink:#2b7fd6; --accent-subtle:#e2eefb; --accent-on:#fff; }
[data-accent="violet"] { --accent-fill:#6b4bff; --accent-hover:#5634e6; --accent-text:#5634e6; --accent-ink:#5634e6; --accent-subtle:#ece8ff; --accent-on:#fff; }
[data-accent="moss"]   { --accent-fill:#7c8c3a; --accent-hover:#67762f; --accent-text:#67762f; --accent-ink:#67762f; --accent-subtle:#edf0de; --accent-on:#fff; }
[data-accent="amber"]  { --accent-fill:#e0a21b; --accent-hover:#c38a0e; --accent-text:#9a6b0a; --accent-ink:#9a6b0a; --accent-subtle:#fbf1da; --accent-on:#16171a; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg-page); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 16px; line-height: 26px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.page-home { background: #f2f3f4; }
h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 16px; border-radius: var(--r-full); background: var(--action-primary-bg); color: var(--action-primary-fg); font-size: 14px; font-weight: 600; }
.skip-link:focus { top: 16px; }

/* ---------- Type styles (ZJ/…) ---------- */
.display-l { font-size: var(--fs-display); line-height: .97; font-weight: 700; letter-spacing: -.04em; }
.h1 { font-size: var(--fs-h1); line-height: 1.042; font-weight: 700; letter-spacing: -.03em; }
.h2 { font-size: var(--fs-h2); line-height: 1.111; font-weight: 700; letter-spacing: -.03em; }
.h3 { font-size: var(--fs-h3); line-height: 1.214; font-weight: 700; letter-spacing: -.025em; }
.h4 { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.015em; }
.h5 { font-size: 16px; line-height: 22px; font-weight: 700; letter-spacing: -.01em; }
.body-l { font-size: 18px; line-height: 29px; }
.body-m { font-size: 16px; line-height: 26px; }
.body-s { font-size: 14px; line-height: 22px; }
.label-m { font-size: 14px; line-height: 20px; font-weight: 600; }
.label-s { font-size: 12.5px; line-height: 16px; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; }
.overline { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.mono { font-family: var(--font-mono); font-size: 12px; line-height: 16px; }

.c-primary { color: var(--text-primary); }
.c-secondary { color: var(--text-secondary); }
.c-tertiary { color: var(--text-tertiary); }
.c-accent { color: var(--accent-ink); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Nav (sticky · glass) ---------- */
.site-nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding-top: 24px; pointer-events: none; }
.nav-bar {
  pointer-events: auto; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 20px; border-radius: var(--r-full);
  background: var(--bg-glass); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-nav);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.nav-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.015em; color: #2f4560; }
.nav-logo__soft { color: #8a9bb0; font-weight: 500; }
.nav-mark { width: 22px; height: 22px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-item { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-full); font-size: 12.5px; line-height: 16px; color: var(--text-secondary); transition: background-color .18s, color .18s; }
.nav-item:hover { background: var(--bg-muted); color: var(--text-primary); }
.nav-item[aria-current="page"] { background: var(--bg-muted); color: var(--text-primary); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 12px 24px; border-radius: var(--r-full);
  font-size: 14px; line-height: 20px; font-weight: 600; box-shadow: var(--shadow-hairline);
  border: 1px solid transparent; transition: background-color .18s, border-color .18s; white-space: nowrap;
}
.btn--s { padding: 7px 16px; font-size: 12.5px; line-height: 16px; font-weight: 400; }
.btn--primary { background: var(--action-primary-bg); color: var(--action-primary-fg); }
.cta-card .btn--primary { border: 0; } /* Figma footer: primary has no border (44px), secondary 46px */
.btn--primary:hover { background: var(--action-primary-bg-hover); }
.btn--secondary { background: var(--action-secondary-bg); color: var(--action-secondary-fg); border-color: var(--border-default); }
.btn--secondary:hover { background: var(--action-secondary-bg-hover); }
a.btn:not([href]) { cursor: default; }

.text-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; line-height: 16px; color: var(--accent-ink); transition: color .18s; }
.text-link:hover { color: var(--accent-hover); }
.text-link .arrow { display: inline-block; transition: transform .2s var(--ease); }
.text-link:hover .arrow { transform: translateX(2px); }
.text-link--back:hover .arrow { transform: translateX(-2px); }
.social-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-full); font-size: 12.5px; line-height: 16px; white-space: nowrap; }
.chip--tag { background: var(--bg-muted); color: var(--text-tertiary); }
.chip--label, .chip--status { background: var(--bg-raised); color: var(--text-primary); box-shadow: var(--shadow-hairline); }
.chip--accent { background: var(--accent-fill); color: var(--accent-on); }
.chip--status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fill); flex: none; }
.chip-group { display: flex; flex-direction: column; gap: 10px; }
.chip-group .chips { gap: 8px; }

/* ---------- Images ---------- */
.shot { width: 100%; min-width: 0; height: auto; box-shadow: var(--shadow-image); background: var(--bg-sunken); }
/* Safari sizes <img> flex/grid items from their intrinsic (2x export) size unless
   min-width and an explicit width are set; column flex items also must not shrink. */
.stack > img, .cell > img, .ba__item > img, .fig > img, .edge > img, .grid2 > img, .grid3 > img { width: 100%; min-width: 0; max-width: 100%; height: auto; flex-shrink: 0; }
.fig--split > .shot { width: var(--img-w, 600px); }
.shot--flat { box-shadow: none; }
img.is-missing { background: repeating-linear-gradient(-45deg, var(--bg-sunken) 0 12px, #efefec 12px 24px); color: var(--text-tertiary); font: 12px/16px var(--font-mono); }

/* =========================================================
   HOME
   ========================================================= */
.hero { min-height: max(720px, 100svh); display: flex; align-items: center; padding-top: 104px; padding-bottom: 80px; }
.hero__inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.hero__text { flex: 1 1 660px; max-width: 660px; display: flex; flex-direction: column; gap: 32px; }
.hero__hi { color: var(--text-secondary); }
.hero__title { color: var(--text-primary); }
.hero__title .soft { color: var(--text-tertiary); }
.hero__lead { max-width: 520px; color: var(--text-secondary); }
.hero__pile { flex: 0 1 540px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pile-hint { color: var(--text-tertiary); }
.pile-hint .touch { display: none; }
@media (pointer: coarse) { .pile-hint .fine { display: none; } .pile-hint .touch { display: inline; } }

/* Tag pile */
.tag-stage { position: relative; width: 540px; max-width: 100%; height: 420px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tag-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border-default); }
.tag {
  position: absolute; left: 0; top: 0; height: 42px; padding: 10px 18px; border-radius: var(--r-full);
  background: var(--bg-page); border: 1px solid var(--border-subtle); color: var(--text-secondary);
  font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-align: left;
  transform-origin: 50% 50%; will-change: transform;
  transition: width .22s var(--ease), color .22s, box-shadow .22s;
}
.tag__label, .tag__sentence { display: block; transition: opacity .22s var(--ease); }
.tag__sentence { position: absolute; left: 18px; top: 10px; opacity: 0; }
.tag.is-open { color: var(--text-primary); box-shadow: 0 8px 24px rgba(22, 23, 26, .08); z-index: 10; }
.tag.is-open .tag__label { opacity: 0; }
.tag.is-open .tag__sentence { opacity: 1; }
.tag-stage.is-physics .tag { cursor: grab; transition: color .22s, box-shadow .22s; }
.tag-stage.is-dragging .tag { cursor: grabbing; }
.tag-stage:not(.is-ready) .tag { visibility: hidden; }
.tag-stage.is-static .tag { transition: width .15s ease, color .15s, box-shadow .15s; }
.tag-stage.is-static .tag__label, .tag-stage.is-static .tag__sentence { transition: opacity .15s ease; }
.tag-stage.is-wrap { display: flex; flex-wrap: wrap; align-content: flex-end; gap: 8px 6px; padding-bottom: 8px; height: auto; min-height: 200px; }
.tag-stage.is-wrap .tag { position: relative; transform: none !important; }

/* Section scaffolding */
.home-section { padding-block: 160px; }
.home-section--other { padding-top: 0; }
.section-title { margin-bottom: 48px; }
.section-title .soft { color: var(--text-tertiary); }

/* Masonry · 2 columns */
.masonry { display: flex; gap: 24px; align-items: flex-start; }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.project-card {
  position: relative; display: flex; flex-direction: column; gap: 0; padding: 8px 8px 0;
  background: var(--bg-raised); border-radius: var(--r-2xl); overflow: hidden;
  transition: box-shadow .15s var(--ease);
}
.project-card__text { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 24px; }
.project-card__title { color: var(--text-primary); font-size: 16px; line-height: 22px; letter-spacing: -.16px; }
.project-card__q { color: var(--text-secondary); font-size: 14px; line-height: 22px; }
.project-card .chips { margin-top: 4px; }
.project-card__media { border-radius: var(--r-xl); overflow: hidden; }
.project-card__media img { width: 100%; height: auto; }
.card-arrow {
  position: absolute; top: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-primary);
  font-size: 14px; font-weight: 600; opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.project-card:hover, .project-card:focus-visible { box-shadow: var(--shadow-card-hover); }
.project-card:hover .card-arrow, .project-card:focus-visible .card-arrow { opacity: 1; transform: none; }
.project-card:focus-visible { outline-offset: 4px; border-radius: var(--r-2xl); }

/* Other work */
.other-title { margin-bottom: 40px; }
.small-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.small-card { display: flex; flex-direction: column; gap: 20px; }
.small-card__media { border-radius: 20px; overflow: hidden; aspect-ratio: 400 / 267; transition: box-shadow .3s var(--ease); }
.small-card__media--stroke { border: 1px solid #e5e7eb; }
.small-card__media img { width: 100%; height: 100%; object-fit: cover; }
.small-card__text { display: flex; flex-direction: column; gap: 8px; }
.small-card__title { display: flex; gap: 8px; align-items: baseline; color: var(--text-primary); }
.small-card__title .arrow { opacity: 0; transition: opacity .2s, transform .2s var(--ease); transform: translate(-3px, 3px); }
.small-card__desc { color: var(--text-secondary); }
.small-card .chips { margin-top: 4px; }
a.small-card[href]:hover .small-card__media, a.small-card[href]:focus-visible .small-card__media { box-shadow: 0 16px 48px rgba(22, 23, 26, .12); }
a.small-card[href]:hover .small-card__title .arrow, a.small-card[href]:focus-visible .small-card__title .arrow { opacity: 1; transform: none; }

/* CTA / footer card */
.site-footer { padding-bottom: 96px; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 48px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.cta-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* description + © share the title's width, pushed to either end */
.cta-card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 24px; }
.cta-card__buttons { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }


/* =========================================================
   CASE STUDY
   ========================================================= */
.case { padding-top: 160px; }
.case-hero { display: flex; flex-direction: column; gap: 24px; }
.case-hero > .chip, .case-hero > .text-link { align-self: flex-start; }
.case-hero__title { color: var(--accent-text); }
.case-hero__lead { color: var(--text-secondary); max-width: 720px; }
.case-meta { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 24px; padding-block: 24px; border-block: 1px solid var(--border-subtle); }
.meta-field { display: flex; flex-direction: column; gap: 8px; }
.meta-field dt { color: var(--text-tertiary); }
.meta-field dd { color: var(--text-primary); }

.case-body { display: grid; grid-template-columns: 200px minmax(0, 952px); justify-content: space-between; gap: 96px; margin-top: 80px; }
.toc { position: sticky; top: 120px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.toc a { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text-tertiary); transition: color .2s; }
.toc a::before { content: ""; width: 2px; height: 14px; border-radius: var(--r-full); background: var(--border-subtle); transition: background-color .2s; flex: none; }
.toc a:hover { color: var(--text-secondary); }
.toc a.is-active { color: var(--text-primary); }
.toc a.is-active::before { background: var(--accent-fill); }
.case-main { display: flex; flex-direction: column; gap: 160px; min-width: 0; }
.cs { display: flex; flex-direction: column; gap: 32px; scroll-margin-top: 120px; }
.cs--48 { gap: 48px; }
.page-case .site-footer { margin-top: 80px; }

/* Section header */
.sh { display: flex; flex-direction: column; gap: 12px; }
.sh .overline { color: var(--accent-ink); }
.p { color: var(--text-secondary); }

/* Pull quote */
.pull { display: flex; gap: 24px; }
.pull::before { content: ""; width: 4px; flex: none; border-radius: var(--r-full); background: var(--accent-fill); }
.pull p { color: var(--text-primary); }

/* --gap is per-element: never inherit it from an ancestor figure/stack (inline --gap still wins) */
.fig, .stack, .grid2, .grid3 { --gap: initial; }

/* Figures (surface blocks) */
.fig { display: flex; flex-direction: column; gap: var(--gap, 24px); padding: 40px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.fig--center { align-items: center; justify-content: center; }
.fig--split { flex-direction: row; align-items: center; gap: 32px; }
.fig--split > .shot { flex: 0 1 var(--img-w, 600px); min-width: 0; }
.fig--split > .annot, .fig--split > .annot-note { flex: 0 0 var(--note-w, 240px); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.fig > .overline, .stack > .overline.c-tertiary { color: var(--text-tertiary); }

/* Question / info cards */
.cards { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; }
.qcard { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.qcard--12 { gap: 12px; }
.qcard > .mono { color: var(--accent-ink); }

/* Flow diagrams */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 8px; }
.flow--center { justify-content: center; }
.flow--g16 { gap: 16px; }
.arr { color: var(--text-tertiary); font-size: 16px; line-height: 26px; }
.node { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--bg-raised); border: 1px solid var(--border-subtle); }
.node--g4 { gap: 4px; }
.node .mono, .node .overline, .node .caption { color: var(--text-tertiary); }
.node .label-m { color: var(--text-primary); }
.node--muted .label-m { color: var(--text-secondary); }
.node--accent { background: var(--accent-subtle); border-color: var(--accent-fill); }
.node--accent .mono { color: var(--accent-ink); }
.node--dim { background: var(--bg-muted); }
.node--dim .label-m { color: var(--text-secondary); }
.node-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.vflow { display: flex; flex-direction: column; gap: 6px; }
.vflow .down { color: var(--accent-ink); font-size: 14px; line-height: 20px; font-weight: 600; }
.relations { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.relation-link { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.relation-link .caption { color: var(--accent-ink); }
.relation-link .arr { line-height: 20px; }
.lane { display: flex; align-items: center; gap: 24px; }
.lane > .overline { flex: 0 0 110px; color: var(--accent-ink); }
.lane-connector { padding-left: 134px; color: var(--text-tertiary); }
.divider { height: 1px; background: var(--border-subtle); }

/* Annotation lists */
.annot { display: flex; flex-direction: column; }
.annot > .overline { color: var(--text-tertiary); }
.annot-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.annot-row:last-child { border-bottom: 0; }
.annot-row .mono { color: var(--accent-ink); flex: none; }
.annot--tight .annot-row { padding: 12px 0; }
.annot-note { display: flex; flex-direction: column; gap: 12px; }
.annot-note > .label-m { color: var(--accent-ink); margin-top: 4px; }

/* Challenge card */
.challenge { display: flex; gap: 32px; padding: 48px; border-radius: var(--r-2xl); background: var(--accent-subtle); }
.challenge--neutral { background: var(--bg-surface); }
.challenge__glyph { color: var(--accent-ink); flex: none; min-width: 34px; }
.challenge__text { display: flex; flex-direction: column; gap: 12px; }
.challenge__text .overline { color: var(--accent-ink); }

/* Callout */
.callout { display: flex; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--accent-subtle); }
.callout::before { content: ""; width: 3px; flex: none; border-radius: var(--r-full); background: var(--accent-fill); }
.callout__text { display: flex; flex-direction: column; gap: 6px; }
.callout__text .overline { color: var(--accent-ink); }

/* Process steps */
.steps { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 12px; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.fig .step { background: var(--bg-raised); }
.step::before { content: ""; height: 3px; border-radius: var(--r-full); background: var(--accent-fill); }
.step__top { display: flex; align-items: center; gap: 8px; }
.step__top .mono { color: var(--text-tertiary); }
.step__top .overline { color: var(--accent-ink); }

/* Impact / outcome cards */
.impact { display: flex; flex-direction: column; gap: 4px; padding: 32px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.impact .display-l { color: var(--accent-ink); }
.outcome { display: flex; flex-direction: column; gap: 12px; padding: 32px; border-radius: var(--r-xl); background: var(--bg-surface); }
.outcome--16 { gap: 16px; }
/* Two labelled columns whose cards share row heights (filled column by column) */
.outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto repeat(3, auto); grid-auto-flow: column; gap: 16px; }
.outcome::before { content: ""; width: 40px; height: 3px; border-radius: var(--r-full); background: var(--accent-fill); }
.award { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.award__logo { align-self: flex-start; height: 72px; padding: 10px 14px; border-radius: var(--r-sm); background: #fff; }
.award__logo img { height: 52px; width: auto; }
.insight { display: flex; flex-direction: column; gap: 12px; padding: 32px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.insight .chip { align-self: flex-start; color: var(--accent-ink); }

/* Closing statement */
.closing { display: flex; flex-direction: column; gap: 16px; padding: 72px 64px; border-radius: var(--r-2xl); background: var(--accent-subtle); }
.closing .overline { color: var(--accent-ink); }

/* Before/After, iterations, grids */
.ba { display: flex; flex-direction: column; gap: 24px; padding: 32px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.ba__item { display: flex; flex-direction: column; gap: 12px; }
.ba__item > .overline { color: var(--text-tertiary); }
.ba__item > .overline.is-after { color: var(--accent-ink); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap, 32px); align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 24px); align-items: start; }
.cell { display: flex; flex-direction: column; gap: 12px; }
.cell .shot { margin-top: 20px; } /* Figma: 8px spacer + 12px gap */
.cell > .mono { color: var(--accent-ink); }
.edge { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-xl); background: var(--bg-surface); }
.edge__text { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px 4px; }
.edge__text .mono { color: var(--accent-ink); }
/* Edge cases: 2 columns, cards hug their own height */
.edge-grid { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 64px; align-items: flex-start; }
.edge-grid > .edge { width: calc((100% - 16px) / 2); }
/* Image + note figure: image takes the rest, note column has a fixed width */
.split { flex-direction: row; align-items: center; }
.split > img { flex: 1 1 0; min-width: 0; }
.split > :not(img) { flex: 0 0 var(--note-w, 240px); width: var(--note-w, 240px); }
/* Several screenshots side by side: top-aligned, natural heights */
.img-row { display: flex; gap: 24px; align-items: flex-start; }
.img-row > img { flex: 1 1 0; width: 100%; min-width: 0; height: auto; }
.row-text-fig { display: flex; gap: 48px; align-items: center; padding: 40px; border-radius: var(--r-2xl); background: var(--bg-surface); }
.row-text-fig > .stack { flex: 1 1 0; min-width: 0; }
.row-text-fig > .shot { flex: 0 0 360px; width: 360px; min-width: 0; }
.config { display: flex; flex-direction: column; }
.config__row { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); align-items: baseline; }
.config__row:last-child { border-bottom: 0; }
.config__row--head { padding: 16px 0 12px; border-bottom-color: var(--border-default); }
.lifecycle-row { display: flex; gap: 16px; align-items: flex-start; }
.lifecycle-row > .stack { flex: 1 1 0; min-width: 0; }
.lifecycle-row > .arrow-mid { flex: 0 0 22px; min-width: 0; text-align: center; color: var(--text-tertiary); }
.center-note { padding: 16px 0 8px; text-align: center; color: var(--text-tertiary); }
.ia { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ia > .ia-band, .ia > .ia-cols { align-self: stretch; }
.ia-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ia-col { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-xl); background: var(--bg-page); }
.ia-col--accent { border: 1px solid var(--accent-fill); }
.ia-col .spacer { height: 4px; }
.ia-band { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; align-items: center; padding: 10px 16px; border-radius: var(--r-lg); border: 1px solid var(--border-default); }
.portal { display: flex; flex-direction: column; gap: 32px; padding: 32px; border-radius: var(--r-xl); background: var(--bg-sunken); }
.portal__head { display: flex; justify-content: space-between; align-items: center; gap: 48px; }
.portal__title { display: flex; align-items: center; gap: 16px; }
.portal__title .overline { color: var(--accent-text); }
.portal__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-surface); display: grid; place-items: center; font-size: 26px; line-height: 1; flex: none; }
.portal__head > p { max-width: 360px; }
.portal-connector { display: flex; justify-content: center; }
.portal-connector span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-subtle); color: var(--accent-text); }
.phase-notes { display: flex; gap: 32px; align-items: flex-start; }
.phase-notes > .stack { flex: 0 1 420px; }
.phase-notes > .label-m { color: var(--accent-ink); flex: 1; }

/* =========================================================
   ABOUT  (Figma "About for final tweak" 316:27222)
   ========================================================= */
.about-band--white { background: var(--bg-page); }
.about-band--sunken { background: var(--bg-sunken); }
.about-photo { display: block; min-width: 0; border-radius: var(--r-lg); object-fit: cover; background: var(--bg-sunken); }

/* One full screen per section; the page snaps section by section (the path keeps one stop per state) */
:root:has(body.page-about) { scroll-snap-type: y mandatory; }
.screen {
  --g: var(--gutter);
  height: 100vh; height: 100svh; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column;
  padding: calc(96px + env(safe-area-inset-top, 0px)) var(--g) calc(40px + env(safe-area-inset-bottom, 0px));
}
.page-about .site-footer { scroll-snap-align: end; padding-top: 96px; }

/* Brand / Direction Mark — drawn by about.js: line + open head in logo-mid, offset echo in logo-light, dot in logo-dot */
.dmark { display: block; overflow: visible; flex: none; }
.dmark .stem { stroke: var(--logo-mid); stroke-linecap: round; stroke-linejoin: round; }
.dmark .echo { stroke: var(--logo-light); stroke-linecap: round; }
.dmark .tip { fill: var(--logo-dot); }

/* 01 Hero */
.about-hero__inner { flex: 1; min-height: 0; width: 100%; max-width: var(--container); margin-inline: auto; display: flex; align-items: center; gap: 80px; }
.about-hero__intro { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.about-hero__lead, .about-hero__body { max-width: 480px; }
.about-hero__media { flex: 0 1 560px; min-width: 0; height: 100%; max-height: 620px; }
.about-hero__media .about-photo, .about-ending__media .about-photo { width: 100%; height: 100%; }

/* 02 Directions — fixed composition (wide from Figma, tall for portrait), scaled to the free space by about.js */
.dirs { padding-inline: 0; }
.dirs__title { flex: none; width: 100%; max-width: calc(var(--container) + 2 * var(--g)); margin: 0 auto 24px; padding-inline: var(--g);
  opacity: 0; translate: 0 10px; transition: opacity .6s ease, translate .6s var(--ease); }
.dirs__box, .recon__box { position: relative; flex: 1; width: 100%; min-height: 0; }
.dirs__comp, .recon__comp { position: absolute; left: 0; top: 0; transform-origin: top left; }
.dirs__comp .dmark, .recon__comp .dmark { position: absolute; --ax: 1; --ay: 0; translate: 0 0; transition: translate .45s var(--ease); }
.dmark[data-d=upward] { --ax: 0; --ay: -1; }
.dmark[data-d=outward] { --ax: .7071; --ay: -.7071; }
.dcard {
  position: absolute; left: 0; top: 0; width: 320px; display: flex; flex-direction: column; gap: 16px; padding: 24px;
  border-radius: var(--r-xl); background: var(--bg-page); border: 1px solid var(--border-subtle); box-shadow: 0 14px 36px rgba(22, 23, 26, .08);
  opacity: 0; translate: 0 14px; transition: opacity .5s ease, translate .6s var(--ease);
}
.dcard .h3 { font-size: 28px; line-height: 34px; } /* fixed size: the whole composition scales */
.dirs.is-on .dirs__title { opacity: 1; translate: none; }
.dirs.is-on .dcard { opacity: 1; translate: none; --dl: calc(.35s + var(--k) * .28s);
  transition: opacity .5s ease var(--dl), translate .6s var(--ease) var(--dl), top .35s var(--ease), box-shadow .35s var(--ease); }
/* hover: the card lifts and its mark pushes a little further in its direction */
.dirs.is-on .dcard:hover { top: -8px; box-shadow: 0 24px 52px rgba(22, 23, 26, .13); }
.dirs__comp:has(.dcard[data-d=forward]:hover) .dmark[data-d=forward],
.dirs__comp:has(.dcard[data-d=upward]:hover) .dmark[data-d=upward],
.dirs__comp:has(.dcard[data-d=outward]:hover) .dmark[data-d=outward],
.recon__box:hover .dmark { translate: calc(var(--ax) * 14px) calc(var(--ay) * 14px); }
.recon__dim { transition: color .4s ease; }
.recon__box:hover .recon__dim { color: var(--neutral-400); }

/* 03–05 Forward / Upward / Outward — header, photo stack, closing line, all in one screen */
.direction__inner { flex: 1; min-height: 0; width: 100%; max-width: var(--container); margin-inline: auto; display: flex; flex-direction: column; gap: 20px; }
.direction__head { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; align-items: end; min-height: 124px; }
.direction__title .mono { margin-bottom: 12px; }
.direction__name { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.direction__text { max-width: 60ch; }
.direction__closing { padding-top: 12px; border-top: 1px solid var(--border-default); }

.stage-wrap { position: relative; flex: 1; min-height: 0; }
.photo-stack { position: absolute; left: 0; top: 0; transform-origin: top left; }
.stage-sizer { height: 1px; }
/* narrow screens: the stage becomes a horizontal track — same composition, nothing hidden */
.stage-wrap.is-track {
  overflow-x: auto; overflow-y: hidden; margin: -48px calc(-1 * var(--g)) -12px; padding: 48px 0; cursor: grab;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent);
}
.stage-wrap.is-track::-webkit-scrollbar { display: none; }
.stage-wrap.is-dragging { cursor: grabbing; }
.stage-wrap.is-dragging .photo-card { pointer-events: none; }
.stack-swipe { display: none; align-items: center; justify-content: flex-end; gap: 12px; position: relative; z-index: 2; }
.stack-swipe.is-on { display: flex; }

.photo-card {
  position: absolute; left: 0; top: 0; width: 216px; margin: 0; padding: 8px; display: flex; flex-direction: column;
  border-radius: 20px; background: var(--bg-page); border: 1px solid var(--border-subtle); box-shadow: 0 6px 18px rgba(22, 23, 26, .08);
  transform: translate(var(--rx), var(--ry)) rotate(var(--rr));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease); transition-delay: var(--dc, 0ms); will-change: transform;
}
.photo-stack.is-open .photo-card { transform: translate(var(--ox), var(--oy)) rotate(var(--or)); box-shadow: 0 18px 44px rgba(22, 23, 26, .12); transition-delay: var(--d, 0ms); }
.photo-card__img { display: block; width: 100%; height: 250px; border-radius: 14px; object-fit: cover; background: var(--bg-sunken); }
.photo-card__desc { display: flex; flex-direction: column; padding: 12px 6px 6px; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }
.photo-card__desc .overline { color: var(--text-tertiary); }
.photo-card__desc .mono { color: var(--text-tertiary); margin-top: 2px; }
.photo-card__desc .body-l { color: var(--text-primary); line-height: 26px; margin-top: 6px; }
.photo-card.is-top .photo-card__desc, .photo-stack.is-open .photo-card__desc { opacity: 1; transform: none; }
.photo-stack.is-open .photo-card__desc { transition-delay: calc(var(--d, 0ms) + 380ms); }

/* 06 Reconnection (dark) — same scaled-composition method as Directions */
.recon {
  --logo-mid: var(--logo-mid-dark); --logo-light: var(--logo-light-dark); --logo-dot: var(--logo-dot-dark);
  padding-inline: 0; background: var(--bg-inverse);
}
.recon__title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-weight: 700; letter-spacing: -.03em; color: var(--neutral-50); }
.recon__comp[data-mode=wide] .recon__title { font-size: 64px; line-height: 68px; }
.recon__comp[data-mode=wide] .recon__title br.t { display: none; }
.recon__comp[data-mode=tall] .recon__title { font-size: 52px; line-height: 56px; }
.recon__dim { color: var(--neutral-500); }
.recon__title span { display: inline-block; opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s var(--ease); }
.recon.is-on .recon__title span { opacity: 1; transform: none; }
.recon.is-on .recon__title .recon__main { transition-delay: .25s; }

/* Mark draw-in: line draws from the tail, head + dot land, echo follows; Forward → Upward → Outward. Replays on return. */
:is(.recon, .dirs) .dmark .line, :is(.recon, .dirs) .dmark .echo { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0s; }
:is(.recon, .dirs) .dmark .head, :is(.recon, .dirs) .dmark .tip { opacity: 0; transition: opacity 0s; }
:is(.recon, .dirs) .dmark .tip { transform-box: fill-box; transform-origin: center; transform: scale(.2); }
:is(.recon, .dirs).is-on .dmark .line { stroke-dashoffset: 0; transition: stroke-dashoffset .9s cubic-bezier(.6, 0, .2, 1) calc(.5s + var(--k) * .28s); }
:is(.recon, .dirs).is-on .dmark .head { opacity: 1; transition: opacity .2s ease calc(1.32s + var(--k) * .28s); }
:is(.recon, .dirs).is-on .dmark .tip { opacity: 1; transform: scale(1); transition: opacity .2s ease calc(1.42s + var(--k) * .28s), transform .45s cubic-bezier(.3, 1.6, .5, 1) calc(1.42s + var(--k) * .28s); }
:is(.recon, .dirs).is-on .dmark .echo { stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.6, 0, .2, 1) calc(.75s + var(--k) * .28s); }

/* 07 Path — a 500vh track with a sticky screen; five snap stops, one per state */
.path__track { position: relative; height: 500vh; }
.path__snap { position: absolute; left: 0; width: 1px; height: 100vh; height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; pointer-events: none; }
.path__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; gap: 24px;
  padding: calc(96px + env(safe-area-inset-top, 0px)) var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px));
}
.path__heading, .path__viewport { width: 100%; max-width: var(--container); margin-inline: auto; }
.path__heading { flex: none; display: flex; flex-direction: column; gap: 14px; }
.path__viewport { flex: 1; min-height: 0; display: flex; align-items: center; gap: 48px; }
.path__narration { position: relative; flex: 1 1 0; min-width: 0; min-height: 182px; }
.path__step { position: absolute; left: 0; right: 0; top: 32px; opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.path__step.is-on { opacity: 1; transform: none; }
.path__step .overline { margin-bottom: 12px; }
.path__step .h2 { max-width: 16ch; }
.path__canvas-wrap { flex: none; position: relative; width: 740px; height: 580px; }
.path__canvas { position: absolute; left: 0; top: 0; width: 740px; height: 580px; transform-origin: top left; }
.pobj { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; will-change: transform, opacity; }
.pobj .overline { color: var(--text-secondary); white-space: nowrap; }
.pobj--field { background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: 36px; }
.pobj--ring svg { position: absolute; inset: 0; overflow: visible; }
.pobj--ring rect { fill: none; stroke: var(--text-secondary); stroke-width: 1.75; stroke-dasharray: 7 7; stroke-linecap: round; }
.pobj__edge { position: absolute; top: -9px; right: 46px; padding: 0 12px; background: var(--bg-sunken); font: 12px/16px var(--font-mono); letter-spacing: .16em; color: var(--text-primary); white-space: nowrap; }
.pobj--id { justify-content: flex-end; gap: 6px; padding: 18px 20px; border-radius: 20px; background: var(--bg-page); border: 1px solid var(--border-subtle); box-shadow: 0 14px 36px rgba(22, 23, 26, .08); }
.pobj--id .mono { color: var(--text-tertiary); white-space: nowrap; }
.pobj--core { justify-content: center; align-items: center; border-radius: 24px; background: var(--action-primary-bg); box-shadow: 0 18px 44px rgba(22, 23, 26, .12); }
.pobj--core .h3 { position: absolute; color: var(--action-primary-fg); white-space: nowrap; }
.pobj--ann { justify-content: center; padding: 0 12px; border-radius: 12px; background: var(--bg-page); border: 1px solid var(--border-subtle); box-shadow: 0 14px 36px rgba(22, 23, 26, .06); }
.pobj--build { flex-direction: row; justify-content: space-between; align-items: center; padding: 0 14px; border-radius: 16px; background: var(--bg-page); border: 1px solid var(--text-primary); box-shadow: 0 14px 36px rgba(22, 23, 26, .12); }
.pobj--build .overline, .pobj--build .h4 { color: var(--text-primary); }

/* 08 Ending + contact form */
.about-ending__inner { flex: 1; min-height: 0; width: 100%; max-width: var(--container); margin-inline: auto; display: flex; align-items: flex-end; gap: 64px; }
.about-ending__media { flex: 1 1 0; min-width: 0; height: 100%; max-height: 560px; }
.about-ending__signoff { flex: 0 0 540px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.contact-form { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.field__input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--border-default);
  background: var(--bg-page); color: var(--text-primary); font: 16px/26px var(--font-sans); transition: border-color .18s;
}
.field__input::placeholder { color: var(--text-tertiary); opacity: 1; }
.field__input:focus { outline: none; border-color: var(--text-tertiary); }
.field__input:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.field__input--multi { display: block; height: 132px; padding-top: 13px; resize: vertical; }
.contact-form .btn--primary { border: 0; }
.contact-form__status:empty { display: none; }

@media (max-width: 1024px) {
  .about-hero__inner, .about-ending__inner { flex-direction: column; align-items: stretch; gap: 32px; }
  .about-hero__inner { justify-content: flex-start; }
  .about-hero__intro { flex: none; }
  .about-hero__media, .about-ending__media { flex: 1 1 0; height: auto; max-height: none; min-height: 0; }
  .about-ending__signoff { flex: none; width: 100%; max-width: 540px; }
  .path__viewport { flex-direction: column; align-items: stretch; gap: 16px; }
  .path__narration { flex: none; min-height: 150px; }
  .path__canvas-wrap { align-self: center; }
}
@media (max-width: 899px) {
  .direction__head { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .direction__closing { font-size: 18px; line-height: 26px; }
}
@media (max-width: 767px) {
  .about-hero__intro { gap: 16px; }
  .about-ending__signoff { gap: 16px; }
  .field__input--multi { height: 96px; }
  .path__step .h2 { font-size: 26px; line-height: 32px; }
  .path__step .h1 { font-size: 32px; line-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-card, .photo-card__desc, .path__step, .dcard, .dirs__title { transition: none !important; }
  :is(.recon, .dirs) .dmark *, .recon__title span { transition: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important; }
}

/* ---------- Blackout (V4 short case) ---------- */
.stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.grid2--stretch { align-items: stretch; }
.qcard--pad { gap: 12px; }
.subsection { padding-top: 48px; }
.chip--inline { align-self: flex-start; }
.pill-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill-step { padding: 6px 12px; border-radius: var(--r-full); background: var(--accent-subtle); color: var(--accent-ink); font-size: 14px; line-height: 20px; font-weight: 600; }
.arr--down { align-self: center; }
.carousel__label { margin-top: 8px; }

/* ---------- Carousel ---------- */
.carousel { display: flex; flex-direction: column; gap: 16px; }
.carousel__viewport { overflow: hidden; background: var(--bg-raised); box-shadow: var(--shadow-image); aspect-ratio: var(--ratio, 16 / 10); touch-action: pan-y; }
.carousel__track { display: flex; gap: 16px; height: 100%; transition: transform .45s var(--ease); }
.carousel__slide { flex: 0 0 100%; height: 100%; }
.carousel__slide img { width: 100%; height: 100%; object-fit: contain; }
.carousel__controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.carousel__dots { display: flex; align-items: center; gap: 8px; }
.carousel__dot { padding: 8px 2px; display: flex; }
.carousel__dot span { display: block; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--border-strong); transition: width .3s var(--ease), background-color .3s; }
.carousel__dot[aria-current="true"] span { width: 24px; background: var(--accent-fill); }
.carousel__nav { display: flex; align-items: center; gap: 12px; }
.carousel__count { color: var(--text-tertiary); min-width: 55px; text-align: right; }
.carousel__btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); border: 1px solid var(--border-subtle); color: var(--text-primary); font-size: 14px; font-weight: 600; transition: background-color .18s, opacity .18s; }
.carousel__btn:hover:not(:disabled) { background: var(--bg-sunken); }
.carousel__btn:disabled { opacity: .4; color: var(--text-tertiary); cursor: default; }
@media (prefers-reduced-motion: reduce) { .carousel__track { transition: none; } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .case-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 1024px) {
  .hero { min-height: 0; padding-top: 152px; }
  .hero__inner { flex-direction: column; align-items: stretch; gap: 56px; }
  .hero__text { max-width: 720px; flex-basis: auto; }
  .hero__pile { flex-basis: auto; align-items: stretch; }
  .tag-stage { width: 100%; height: 360px; }
  .pile-hint { text-align: center; }
  .small-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { --cols: 3 !important; }
  .fig--split { flex-direction: column; align-items: stretch; }
  .fig--split > .shot, .fig--split > .annot, .fig--split > .annot-note { flex-basis: auto; }
  .fig--split > .shot { width: 100%; }
}
@media (max-width: 860px) {
  .masonry { flex-direction: column; align-items: stretch; }
  .masonry__col { display: contents; }
  .masonry .project-card { order: var(--order); }
  .home-section { padding-block: 112px; }
  .home-section--other { padding-top: 0; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .case-meta { --cols: 2 !important; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .stats { --cols: 2 !important; }
  .grid2, .grid3, .ia-cols { grid-template-columns: minmax(0, 1fr); }
  .outcome-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .outcome-grid > .overline:not(:first-child) { margin-top: 16px; }
  .row-text-fig { flex-direction: column; align-items: stretch; gap: 32px; }
  .row-text-fig > .stack { flex: none; width: 100%; }
  .row-text-fig > .shot { flex-basis: auto; width: min(100%, 360px); align-self: center; }
  .portal__head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .lane { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lane > .overline { flex-basis: auto; }
  .lane-connector { padding-left: 0; }
  .phase-notes { flex-direction: column; gap: 12px; }
  .case-main { gap: 112px; }
}
@media (max-width: 767px) {
  .split { flex-direction: column; align-items: stretch; }
  .split > :not(img) { flex-basis: auto; width: auto; }
  .img-row { flex-direction: column; align-items: stretch; }
  .edge-grid { row-gap: 32px; }
  .edge-grid > .edge { width: 100%; }
  .lifecycle-row { flex-direction: column; align-items: stretch; }
  .lifecycle-row > .arrow-mid { align-self: center; transform: rotate(90deg); }
}
@media (max-width: 640px) {
  .nav-bar { padding-left: 16px; }
  .nav-logo__text { display: none; }
  .nav-mark { width: 26px; height: 26px; }
  .nav-item { padding: 0 10px; }
  .hero { padding-top: 128px; padding-bottom: 56px; }
  .hero__text { gap: 24px; }
  .tag-stage { height: 300px; }
  .project-card__text { padding: 16px 12px 24px; }
  .small-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-card { padding: 32px 24px; border-radius: var(--r-xl); }
  .site-footer { padding-bottom: 40px; }
  .case { padding-top: 128px; }
  .case-meta { --cols: 1 !important; }
  .fig, .ba, .row-text-fig { padding: 20px; border-radius: var(--r-xl); }
  .challenge { flex-direction: column; gap: 12px; padding: 28px 24px; border-radius: var(--r-xl); }
  .closing { padding: 40px 24px; border-radius: var(--r-xl); }
  .steps { --cols: 1 !important; }
  .impact, .outcome, .insight { padding: 24px; }
  .body-l { font-size: 17px; line-height: 28px; }
  .config__row { grid-template-columns: 1fr; gap: 2px; }
  .config__row--head { display: none; }
  .relations { justify-content: flex-start; }
}

/* =========================================================
   Garage (Figma "Garage V3 / Quick · cards" + overlay)
   ========================================================= */
.garage-hero { padding-top: 200px; }
.garage-hero .display-l { margin-bottom: 24px; }
.garage-hero__lead { max-width: 640px; }
.home-section.garage-section { padding-top: 96px; }

.garage-card__media { position: relative; background-size: cover; background-position: center; }
.garage-card__preview { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); }
.garage-card__preview.is-loaded { opacity: 1; }
.garage-card__note { position: absolute; z-index: 1; top: 16px; left: 16px; max-width: calc(100% - 32px); }

.garage-overlay {
  width: min(1040px, calc(100vw - 48px)); height: min(720px, calc(100dvh - 96px));
  max-width: none; max-height: none; margin: auto; padding: 0; border: 0; overflow: hidden;
  border-radius: var(--r-2xl); background: var(--bg-sunken);
  box-shadow: 0 8px 32px rgba(22, 23, 26, .10), 0 32px 96px 8px rgba(22, 23, 26, .10);
}
.garage-overlay::backdrop { background: rgba(35, 36, 40, .4); }
.garage-overlay[open] { animation: garage-in .35s var(--ease); }
.garage-overlay[open]::backdrop { animation: garage-fade .35s ease; }
@keyframes garage-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes garage-fade { from { opacity: 0; } to { opacity: 1; } }
.garage-overlay__frame { display: block; width: 100%; height: 100%; border: 0; }
.garage-overlay__close {
  position: absolute; top: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-primary);
  font-size: 14px; font-weight: 600; transition: background-color .18s;
}
.garage-overlay__close:hover { background: var(--bg-page); }
html.is-overlay-open { overflow: hidden; }

@media (max-width: 1024px) { .garage-hero { padding-top: 152px; } }
@media (max-width: 860px) { .home-section.garage-section { padding-top: 64px; } }
@media (max-width: 640px) {
  .garage-hero { padding-top: 128px; }
  .garage-overlay { width: 100vw; height: 100dvh; border-radius: 0; }
  .garage-overlay__close { top: calc(16px + env(safe-area-inset-top)); right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .garage-overlay[open], .garage-overlay[open]::backdrop { animation: none; }
  .garage-card__preview { transition: none; }
}

/* Garage · project sheet (Figma "Garage V3 / Overlay · Bouldero") */
.garage-overlay.is-sheet { height: auto; max-height: min(1200px, calc(100dvh - 96px)); background: var(--bg-page); }
.garage-overlay__scroll { max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
.garage-overlay.is-sheet .garage-overlay__close { top: 48px; right: 48px; z-index: 2; }
.gsheet { display: flex; flex-direction: column; gap: 40px; padding: 48px; }
.gsheet__head { display: flex; flex-direction: column; gap: 16px; max-width: 640px; padding-right: 56px; }
.gsheet__head .h2 { margin-top: -2px; }
.gsheet__links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.gsheet__gallery {
  display: flex; gap: 16px; padding: 48px 0 48px 48px; margin: 0; list-style: none;
  border-radius: var(--r-lg); background: #e7e9df;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 48px; scrollbar-width: thin;
}
.gsheet__gallery::after { content: ""; flex: 0 0 32px; }
.gsheet__gallery li { flex: 0 0 auto; scroll-snap-align: start; }
.gsheet__gallery img {
  display: block; width: auto; height: 464px; aspect-ratio: 1170 / 2532; border-radius: 19px; background: var(--bg-page);
  box-shadow: 0 0 0 1px var(--border-subtle), 0 2px 6px rgba(22, 23, 26, .06), 0 14px 32px rgba(22, 23, 26, .10);
}
.gsheet__gallery:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }
.gsheet__info { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 48px; align-items: start; }
.gsheet__body { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.gsheet__meta { margin: 0; }
.gsheet__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.gsheet__row dd { margin: 0; text-align: right; }

@media (max-width: 860px) { .gsheet__info { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
@media (max-width: 640px) {
  .garage-overlay.is-sheet { max-height: none; height: 100dvh; }
  .garage-overlay.is-sheet .garage-overlay__scroll { height: 100%; max-height: none; }
  .garage-overlay.is-sheet .garage-overlay__close { top: calc(16px + env(safe-area-inset-top)); right: 16px; }
  .gsheet { padding: 24px 20px 40px; padding-top: calc(24px + env(safe-area-inset-top)); gap: 32px; }
  .gsheet__head { padding-right: 48px; }
  .gsheet__gallery { padding: 24px 0 24px 24px; scroll-padding-inline: 24px; gap: 12px; }
  .gsheet__gallery::after { flex-basis: 12px; }
  .gsheet__gallery img { height: min(464px, 58dvh); border-radius: 16px; }
}

/* ---------- Blackout V6 ---------- */
.p strong, .ctx-card strong { font-weight: 600; color: var(--text-primary); }
.ctx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ctx-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.job-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.job-step { padding: 10px 16px; border-radius: var(--r-full); background: var(--bg-surface); color: var(--text-primary); font-size: 15px; line-height: 20px; font-weight: 500; }
.job-steps .arr { color: var(--text-tertiary); }
.shot-item { display: flex; flex-direction: column; gap: 12px; margin: 0; min-width: 0; }
.shot-item figcaption { display: flex; flex-direction: column; gap: 4px; }
.cov__head, .cov__row { display: grid; grid-template-columns: minmax(0, 1fr) 480px; align-items: center; }
.cov__head { grid-template-columns: minmax(0, 1fr) repeat(3, 160px); padding-bottom: 16px; border-bottom: 1px solid var(--bg-sunken); }
.cov__head > span:not(:first-child) { text-align: center; }
.cov__rows { list-style: none; margin: 0; padding: 0; }
.cov__row { padding: 18px 0; border-bottom: 1px solid var(--bg-sunken); }
.cov__row:last-child { border-bottom: 0; padding-bottom: 0; }
.cov__flow { display: flex; flex-direction: column; gap: 4px; padding-right: 24px; min-width: 0; }
.cov__flow .mono { margin-right: 6px; }
.cov__where { display: none; color: var(--accent-ink); }
.cov__map { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); height: 16px; }
.cov__cell { display: grid; place-items: center; position: relative; z-index: 1; }
.cov__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-fill); }
.cov__bar { position: absolute; top: 6px; height: 4px; border-radius: 2px; background: var(--accent-fill); opacity: .35; }
.status-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.status-group { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--r-xl); background: var(--bg-surface); }
.status-group ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text-primary); }
@media (max-width: 1024px) {
  .cov__head, .cov__row { grid-template-columns: minmax(0, 1fr) 360px; }
  .cov__head { grid-template-columns: minmax(0, 1fr) repeat(3, 120px); }
}
@media (max-width: 860px) {
  .ctx-cards, .status-groups { grid-template-columns: minmax(0, 1fr); }
  .cards--learn { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cov__head, .cov__map { display: none; }
  .cov__row { grid-template-columns: minmax(0, 1fr); }
  .cov__flow { padding-right: 0; }
  .cov__where { display: block; }
  .ctx-card, .status-group { padding: 20px; }
}

/* =========================================================
   Clinexi V8 (Figma "Clinexi / Case Study · V8" 574:31398)
   ========================================================= */
/* Context: 3 equal cards with arrows between */
.cx-ctx { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.cx-ctx > .arr { align-self: center; font-size: 22px; line-height: 34px; }
.cx-ctx > .node { padding: 14px 16px; }
/* Annotations under a visual: top rule, optional mono number */
.cx-notes { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 24px; }
.cx-note { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--border-subtle); min-width: 0; }
/* Before → After (IA and workflow) */
.cx-ba { display: grid; grid-template-columns: 250px auto minmax(0, 1fr); gap: 24px; align-items: start; }
.cx-ba--wf { grid-template-columns: 280px auto minmax(0, 1fr); gap: 32px; }
.cx-ba__arr { font-size: 22px; line-height: 34px; margin-top: -8px; }
.cx-ba__before, .cx-ba__after { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cx-ba__before { gap: 8px; }
.cx-ba__after { gap: 12px; }
.cx-ba--wf .cx-ba__before { gap: 12px; }
.cx-ba__before > img { width: 100%; min-width: 0; height: auto; flex-shrink: 0; }
.cx-ia__group { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-xl); background: var(--bg-page); }
.cx-ia__kids { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-ia__kids > .node, .cx-ba__before > .node { padding: 10px 14px; }
.cx-flags { display: flex; flex-direction: column; gap: 8px; }
.cx-flag { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-lg); background: var(--accent-subtle); border: 1px solid var(--accent-fill); }
.cx-wf-steps { display: flex; flex-direction: column; gap: 12px; }
.cx-wf-step { display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--bg-raised); border: 1px solid var(--border-subtle); }
.cx-wf-step > .mono { flex: none; padding-top: 2px; }
.cx-wf-step__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* The 5 steps in the product */
.cx-pstep { display: flex; flex-direction: column; gap: 10px; margin: 0; min-width: 0; }
.cx-pstep > img { width: 100%; min-width: 0; height: auto; flex-shrink: 0; }
.cx-pstep__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cx-down { font-size: 22px; line-height: 34px; }

@media (max-width: 1024px) {
  .cx-ba { grid-template-columns: 200px auto minmax(0, 1fr); gap: 16px; }
  .cx-ba--wf { grid-template-columns: 220px auto minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .cx-ctx, .cx-ba, .cx-ba--wf { grid-template-columns: minmax(0, 1fr); }
  .cx-ctx > .arr, .cx-ba__arr { justify-self: center; transform: rotate(90deg); margin: 0; }
  .cx-notes { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cx-ba--wf .cx-ba__before > img { max-width: 360px; align-self: center; }
}
@media (max-width: 640px) {
  .fig.cx-edge { gap: 40px; }
  .cx-wf-step { gap: 12px; padding: 12px 14px; }
  .cx-ia__group { padding: 14px; }
  .fig.cx-steps { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card, .card-arrow { transition: none; }
}

/* Case-study reading hierarchy; figure and annotation typography stays independent. */
.page-case .case-hero__title {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -.03em;
  max-width: 26ch;
  text-wrap: balance;
}
.page-case .case-hero__lead {
  font-size: 16px;
  line-height: 1.65;
  max-width: 65ch;
}
.page-case .cs > .sh > h2 {
  font-size: clamp(24px, 1.9vw, 28px);
  line-height: 1.25;
  letter-spacing: -.025em;
  max-width: 38ch;
  text-wrap: balance;
}
.page-case .cs > h3,
.page-case .subsection > h3 {
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -.015em;
}
.page-case .cs > .p,
.page-case .cs > .sh > .p,
.page-case .subsection > .p {
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: normal;
  max-width: 65ch;
}
.page-case .cs > .pull > p {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  letter-spacing: -.015em;
  max-width: 52ch;
}

/* MSC decision screenshots occupy half of their figure's content width. */
.page-case :is(#decision-01, #decision-02) .fig.split > .shot[src*="/images/msc/"] {
  flex: 0 1 50%;
  width: 50%;
  height: auto;
  align-self: center;
}

/* Clinexi exports: crop transparent top/bottom bands without editing source images. */
.page-case img.shot[src$="/clinexi/01-original-pdf.png"] {
  aspect-ratio: 4096 / 2560;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/05-screener-current.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/06-screener-history.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/11-old-action-section.png"] {
  aspect-ratio: 3099 / 4096;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/14-questionnaire.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/17-medication-after.png"] {
  aspect-ratio: 2880 / 2606;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/21-resources-final.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/27-step-4-follow-up.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/22-final-experience.png"] {
  aspect-ratio: 2880 / 2350;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/18-resources-v1-full.png"] {
  aspect-ratio: 2880 / 3462;
  object-fit: cover;
  object-position: center bottom;
}
.page-case img.shot[src$="/clinexi/20-resources-v2.png"] {
  aspect-ratio: 2880 / 2454;
  object-fit: cover;
  object-position: center top;
}
.page-case img.shot[src$="/clinexi/23-suicide-alert.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center top;
}
.page-case img.shot[src$="/clinexi/24-suicide-assessment.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center top;
}
.page-case img.shot[src$="/clinexi/25-suicide-escalate.png"] {
  aspect-ratio: 2880 / 2048;
  object-fit: cover;
  object-position: center top;
}

/* ---------- Blackout V8 · core-experience stories + prototype videos ---------- */
.bx-story { display: flex; flex-direction: column; gap: 24px; }
.bx-story > .overline { margin-top: 24px; }
.bx-video { padding: 40px; gap: 16px; margin: 0; }
.bx-video__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 12px;
  background: var(--neutral-200); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); object-fit: cover; }
.bx-fig { gap: 16px; }
.bx-fig--g24 { gap: 24px; }
.bx-foot { margin: 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-tertiary); }
.bx-tagrow { display: flex; justify-content: flex-end; }
.bx-row { display: grid; gap: 24px; align-items: start; }
.bx-row--p1 { grid-template-columns: minmax(0, 560fr) minmax(0, 288fr); }
.bx-row--half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bx-col { display: flex; flex-direction: column; gap: 12px; margin: 0; min-width: 0; }
.bx-col > img { width: 100%; height: auto; }
.bx-ann { display: flex; align-items: center; gap: 8px; min-height: 100px; margin: 0;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-primary); }
.bx-ann__bar { flex: none; width: 12px; height: 4px; border-radius: 1px; background: var(--accent-fill); }
.bx-anns { display: flex; flex-wrap: wrap; column-gap: 32px; }
.bx-chip { display: inline-flex; align-items: center; padding: 10px 16px; border-radius: var(--r-full);
  font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.bx-chip--solid { background: var(--bg-surface); color: var(--text-primary); }
.bx-chip--dashed, .bx-chip--dashed-s { border: 1px dashed var(--neutral-400); color: var(--neutral-400); }
.bx-chip--dashed { padding: 10px 16px; }
.bx-chip--dashed-s { padding: 6px 12px; font-size: 12px; line-height: 20px; }
.bx-chip--warm { background: var(--accent-subtle); color: var(--accent-ink); }
.bx-arrow { color: var(--text-tertiary); font-size: 15px; line-height: 20px; }
.bx-branch, .bx-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.bx-flow { gap: 10px; }
.bx-branch__opts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
@media (max-width: 760px) {
  .bx-video { padding: 20px; }
  .bx-row--p1, .bx-row--half { grid-template-columns: minmax(0, 1fr); }
  .bx-ann { min-height: 0; padding-top: 8px; }
  .bx-chip { white-space: normal; }
}
