/* ==========================================================================
   Aditya Pandhari — AP identity system
   Derived from the canonical AP artwork (assets/brand/source/). Graphite
   foundation, warm ivory text, and a restrained mint→aqua ribbon reserved
   for progression, state and primary action. Journey is the one deliberate
   warm chapter. See BRAND.md for usage rules.
   ========================================================================== */

@font-face {
  font-family: "Urbanist";
  src: url("assets/fonts/UrbanistVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Graphite foundation, carrying a faint mineral-green undertone rather than
     a neutral studio black, so large surfaces read as material, not void. */
  --graphite-950: #0b0e0d;
  --graphite-900: #0f1513;
  --graphite-850: #141b18;
  --graphite-800: #1a221f;
  --graphite-700: #27302c;

  /* Ivory (the mark's #FBF6EA, dimmed for long-form reading) */
  --ivory: #f3eee3;
  --ivory-bright: #fbf6ea;

  /* AP ribbon */
  --ap-mint: #9ee8c4;
  --ap-mint-light: #c4f0da;
  --ap-aqua: #6cc3ae;
  --ap-teal: #4e9c8e;
  --ap-gradient: linear-gradient(90deg, var(--ap-aqua), var(--ap-mint));
  --ap-gradient-v: linear-gradient(180deg, var(--ap-mint), var(--ap-aqua));
  --ap-glow: rgb(158 232 196 / 0.16);
  --ap-ink: #062318; /* text on mint */

  /* Semantic surfaces */
  --bg: var(--graphite-950);
  --surface-alt: var(--graphite-900);
  --surface-raised: var(--graphite-850);
  --surface-control: var(--graphite-800);

  /* Semantic text */
  --text: var(--ivory);
  --text-strong: var(--ivory-bright);
  --text-2: #b9b6ad;
  --text-3: #8f8d86;
  --accent: var(--ap-mint);
  --accent-2: var(--ap-aqua);

  /* Lines: same mineral undertone as the surfaces they sit on */
  --line: #1f2723;
  --line-strong: #313b36;
  --control-border: #656f63;
  --illum: rgb(120 199 173 / 0.055);
  --illum-strong: rgb(126 214 184 / 0.09);

  /* Journey (warm chapter): stone, parchment, dark ink, deep green */
  --stone: #e6e2da;
  --parchment: #efece6;
  --pearl: #f3f1ec;
  --ink: #17201b;
  --ink-2: #454d47;
  --ink-3: #535a54;
  --deep-green: #1f5a43;
  --rule-warm: #c9c4b8;

  /* Type */
  --font-display: "Urbanist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --t-display: clamp(2.6rem, 1.35rem + 4.6vw, 5.75rem);
  --t-h2: clamp(2rem, 1.35rem + 2.5vw, 3.6rem);
  --t-h3: clamp(1.25rem, 1.08rem + 0.65vw, 1.7rem);
  --t-h4: clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem);
  --t-lead: clamp(1.075rem, 1rem + 0.3vw, 1.225rem);
  --t-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --t-small: 0.9375rem;
  --t-caption: 0.8438rem;
  --t-label: 0.75rem;

  /* Space (8pt) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --gutter: clamp(1rem, 0.5rem + 3vw, 3.5rem);
  --shell: 86rem;
  --chapter-pad: clamp(4.5rem, 3rem + 6vw, 9rem);
  --measure: 66ch;

  /* Shape: controls are pill (the ribbon's round terminals); media and panels are near-square. */
  --r-pill: 999px;
  --r-panel: 6px;

  /* Motion: the ribbon language */
  --ease-ribbon: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-sweep: cubic-bezier(0.65, 0, 0.35, 1);
  --d-feedback: 180ms;
  --d-state: 420ms;
  --d-reveal: 900ms;
  --d-trace: 1500ms;

  --header-h: 4.5rem;
}

/* ---- 2. Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h); /* the one global offset for the sticky header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body.menu-open, body.map-opened { overflow: hidden; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
button { color: inherit; font: inherit; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-strong);
  text-wrap: balance;
}
h1 { font-size: var(--t-display); font-weight: 480; line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: var(--t-h2); font-weight: 500; line-height: 1.06; letter-spacing: -0.03em; }
h3 { font-size: var(--t-h3); font-weight: 580; line-height: 1.18; letter-spacing: -0.015em; }
h4 { font-size: var(--t-h4); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }
dl, dd { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
strong { font-weight: 620; color: var(--text-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgb(158 232 196 / 0.28); color: var(--text-strong); }

.skip-link {
  position: fixed; z-index: 1000; top: 0.75rem; left: 0.75rem;
  padding: 0.75rem 1rem; border-radius: var(--r-pill);
  background: var(--accent); color: var(--ap-ink); font-weight: 650; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.shell, .section-shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Labels echo the tracked wordmark; reserved for metadata, never headlines. */
.label, .eyebrow, .chapter-label, .journey-kicker, .credential-subhead {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---- 3. Controls -------------------------------------------------------- */
.button {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--control-border);
  border-radius: var(--r-pill);
  font-size: var(--t-small); font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--d-feedback) ease, border-color var(--d-feedback) ease,
    color var(--d-feedback) ease, transform var(--d-feedback) ease, box-shadow var(--d-state) var(--ease-ribbon);
}
.button span[aria-hidden] { transition: transform var(--d-state) var(--ease-ribbon); }
.button:active { transform: translateY(1px); }
.button-primary {
  border-color: transparent;
  background: var(--ap-gradient);
  color: var(--ap-ink);
}
.button-primary:hover { box-shadow: 0 0 0 4px var(--ap-glow), 0 10px 30px -12px rgb(158 232 196 / 0.55); }
.button-secondary { color: var(--text); background: transparent; }
.button-secondary:hover { border-color: var(--accent); color: var(--text-strong); background: rgb(158 232 196 / 0.05); }
.button:hover span[aria-hidden] { transform: translateX(3px); }


.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-list li {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 0.8125rem; line-height: 1.4;
}

.text-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: var(--s-6); }
.text-links a, .link-arrow {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem;
  color: var(--text-strong); font-weight: 600; text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left calc(100% - 0.55rem) / 0 1px no-repeat;
  transition: background-size var(--d-state) var(--ease-ribbon), color var(--d-feedback) ease;
}
.text-links a:hover, .link-arrow:hover { background-size: 100% 1px; color: var(--accent); }

/* ---- 4. Header ---------------------------------------------------------- */
.site-header {
  position: sticky; z-index: 100; top: 0;
  background: rgb(11 14 13 / 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-state) ease, background-color var(--d-state) ease;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header { background: rgb(11 14 13 / 0.88); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px); }
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  width: min(100%, var(--shell)); margin-inline: auto; padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.85rem; min-height: 2.75rem;
  text-decoration: none; white-space: nowrap; border-radius: 4px;
}
.brand-mark { width: auto; height: 1.75rem; flex: none; }
.brand-name {
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-strong);
}
.primary-navigation { display: flex; align-items: center; gap: clamp(1.1rem, 1.9vw, 2rem); }
.primary-navigation a {
  position: relative; display: inline-flex; align-items: center; min-height: 2.75rem;
  color: var(--text-2); font-size: 0.9063rem; font-weight: 500; text-decoration: none;
  transition: color var(--d-feedback) ease;
}
.primary-navigation a:hover { color: var(--text-strong); }
.primary-navigation a[aria-current] { color: var(--text-strong); }
.primary-navigation > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 2px; border-radius: 2px;
  background: var(--ap-gradient); transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-state) var(--ease-ribbon);
}
.primary-navigation > a[aria-current]::after { transform: scaleX(1); }
.nav-utilities { display: flex; align-items: center; gap: 1.25rem; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.primary-navigation .nav-contact {
  padding-inline: 1.1rem; min-height: 2.5rem; border: 1px solid var(--control-border); border-radius: var(--r-pill);
  color: var(--text-strong);
  transition: border-color var(--d-feedback) ease, color var(--d-feedback) ease;
}
.primary-navigation .nav-contact:hover { border-color: var(--accent); color: var(--accent); }
.menu-toggle {
  display: none; align-items: center; justify-content: center; gap: 0.6rem;
  min-width: 5.5rem; min-height: 2.75rem; padding-inline: 1rem;
  border: 1px solid var(--control-border); border-radius: var(--r-pill);
  background: transparent; cursor: pointer; font-size: 0.875rem; font-weight: 550;
}
.menu-icon { width: 0.95rem; display: grid; gap: 0.3rem; }
.menu-icon i { display: block; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform var(--d-state) var(--ease-ribbon); }

/* ---- 5. Footer ---------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem;
  padding-block: 2rem;
}
.footer-identity { display: flex; align-items: center; gap: 1rem; }
.footer-identity img { width: auto; height: 1.4rem; }
.footer-identity p { display: grid; gap: 0.1rem; font-size: 0.875rem; color: var(--text-3); line-height: 1.4; }
.footer-identity strong { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--text-2); font-size: 0.875rem; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---- 6. Chapter scaffolding (homepage) ----------------------------------- */
/* Chapters are hairline-separated moments in ONE continuous material (see
   the ambient field on <main>, section 6a), not independently-lit boxes. */
.chapter {
  position: relative;
  padding-block: var(--chapter-pad);
  scroll-margin-top: 0;
  border-top: 1px solid var(--line);
}
.chapter > .shell, .chapter > .chapter-split { position: relative; z-index: 1; }
.chapter-head { max-width: 46rem; }
.chapter-head .chapter-label { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; color: var(--text-2); }
/* A small solid node marks each chapter label -- never a rule or dash, so
   it can't read as punctuation. */
.chapter-label::before {
  content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; flex: none;
  background: var(--accent);
}
.chapter-head h2 + p, .chapter-head > p:last-child { margin-top: 1.4rem; max-width: 40rem; color: var(--text-2); font-size: var(--t-lead); line-height: 1.6; }
.chapter-head--wide { margin-bottom: clamp(3rem, 2rem + 3vw, 5rem); }
.capabilities { padding-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.chapter-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 2rem + 3vw, 5rem); }

/* ---- 6a. Ambient material -------------------------------------------------
   One field of light for the whole document. Ellipses this large, this soft,
   positioned as fractions of the total page height, never line up with any
   single section's edges -- the eye reads depth in the material, not a
   gradient inside a component. */
main { position: relative; isolation: isolate; }
main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64rem 40rem at 80% 2%,   var(--illum-strong), transparent 60%),
    radial-gradient(58rem 42rem at 8% 24%,   var(--illum), transparent 63%),
    radial-gradient(60rem 42rem at 88% 46%,  var(--illum), transparent 62%),
    radial-gradient(56rem 40rem at 10% 70%,  var(--illum), transparent 62%),
    radial-gradient(60rem 42rem at 85% 92%,  var(--illum-strong), transparent 60%);
}

/* ---- 7. Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(56rem, calc(100svh - var(--header-h)));
  display: grid; align-items: center;
  padding-block: clamp(3.5rem, 2rem + 6vw, 6rem) clamp(9rem, 6rem + 8vw, 14rem);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 2rem + 3vw, 5rem); align-items: end;
}
.hero-role {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 620; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
.hero-role span { width: 1.75rem; height: 1px; background: var(--line-strong); }
.hero h1 { max-width: 15ch; }
.hero-intro { max-width: 38rem; margin-top: clamp(1.5rem, 1rem + 1vw, 2.25rem); color: var(--text-2); font-size: var(--t-lead); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(2rem, 1.5rem + 1vw, 2.75rem); }
.current-role {
  position: relative; max-width: 25rem;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--line-strong);
}
.current-role::before {
  content: ""; position: absolute; top: -1px; left: 0; width: 3.5rem; height: 1px; background: var(--ap-gradient);
}
.current-role .label { margin-bottom: 1rem; }
.current-role h2 { font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem); font-weight: 520; line-height: 1.25; letter-spacing: -0.015em; }
.role-facts { display: grid; margin-top: 1.5rem; }
.role-facts div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding-block: 0.8rem; border-top: 1px solid var(--line); }
.role-facts dt { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding-top: 0.2rem; }
.role-facts dd { font-size: var(--t-small); color: var(--text); }
.hero-trace {
  position: absolute; left: 0; right: 0; bottom: clamp(0.5rem, 0.25rem + 1vw, 1.5rem); z-index: -1;
  width: 100%; height: clamp(7rem, 5rem + 6vw, 12.5rem);
  pointer-events: none; overflow: visible;
  filter: drop-shadow(0 0 6px rgb(158 232 196 / 0.35));
}

/* ---- 8. Capabilities: the progression trace ------------------------------ */
.capability-trace { position: relative; --fill: 0; }
.capability-trace::before, .capability-trace::after {
  content: ""; position: absolute; top: 0.9rem; bottom: 0.9rem; left: 1.35rem; width: 1px;
}
.capability-trace::before { background: var(--line-strong); }
.capability-trace::after {
  width: 2px; margin-left: -0.5px; border-radius: 2px;
  background: var(--ap-gradient-v); transform: scaleY(var(--fill)); transform-origin: top;
  transition: transform var(--d-trace) var(--ease-ribbon);
}
.capability {
  position: relative;
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  padding-block: 0 clamp(2.5rem, 2rem + 2vw, 3.75rem);
}
.capability:last-child { padding-bottom: 0; }
.capability-index {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--bg);
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.04em;
  color: var(--text-3); font-variant-numeric: tabular-nums;
  transition: color var(--d-state) ease, border-color var(--d-state) ease, box-shadow var(--d-state) var(--ease-ribbon), background-color var(--d-state) ease;
}
.capability.is-active .capability-index, .capability:hover .capability-index, .capability:focus-within .capability-index {
  border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--ap-glow);
}
.capability-body { padding-top: 0.45rem; }
.capability-body h3 { transition: color var(--d-state) ease; }
.capability-body > p { margin-top: 0.75rem; max-width: 62ch; color: var(--text-2); }
.capability-evidence {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.25rem; margin-top: 1.1rem !important;
  font-size: var(--t-small);
}
.capability-evidence span { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.capability-evidence a {
  display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong);
  transition: color var(--d-feedback) ease, text-decoration-color var(--d-feedback) ease;
}
.capability-evidence a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---- 9. Selected work ---------------------------------------------------- */
.work-list { counter-reset: work; border-bottom: 1px solid var(--line); }
.work-item { position: relative; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
/* The ribbon sweeps across a project's top rule on hover/focus. */
.work-item::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: var(--ap-gradient); transform: scaleX(0); transform-origin: left;
  transition: transform 700ms var(--ease-ribbon);
}
.work-item:hover::before, .work-item:focus-within::before, .work-item--featured::before { transform: scaleX(1); }
.work-item--featured::before { transform: scaleX(0.18); }
.work-item--featured:hover::before, .work-item--featured:focus-within::before { transform: scaleX(1); }
.work-item > article {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem;
  padding-block: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
}
.work-index {
  font-family: var(--font-display); font-size: clamp(2.5rem, 2rem + 2vw, 4rem); font-weight: 250; line-height: 0.9;
  letter-spacing: -0.04em; color: var(--text-3); font-variant-numeric: tabular-nums;
  transition: color var(--d-state) ease;
}
.work-item:hover .work-index, .work-item:focus-within .work-index { color: var(--accent); }
.work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; color: var(--text-3); font-size: 0.8438rem; }
.work-kind { font-family: var(--font-display); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; font-size: var(--t-label); color: var(--text-2); }
.work-item--research .work-kind { color: var(--accent); }
.work-flag { padding: 0.15rem 0.6rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 0.75rem; color: var(--text-2); }
.work-main h3 { margin-top: 0.9rem; max-width: 30ch; font-size: clamp(1.45rem, 1.2rem + 1vw, 2.15rem); font-weight: 540; letter-spacing: -0.022em; }
.work-main h3 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) left 100% / 0 1px no-repeat; transition: background-size 600ms var(--ease-ribbon); }
.work-main h3 a:hover { background-size: 100% 1px; }
.work-question { max-width: 58rem; margin-top: 1rem; color: var(--text-2); font-size: var(--t-small); line-height: 1.6; }
.work-question span { margin-right: 0.35rem; font-family: var(--font-display); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; font-size: var(--t-label); color: var(--accent-2); }
.work-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem;
  margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px dashed var(--line);
}
.work-grid dt { margin-bottom: 0.5rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.work-grid dd { color: var(--text); font-size: var(--t-small); line-height: 1.62; }
.work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; margin-top: 1.75rem; }
.work-cta {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; padding-inline: 1.2rem;
  border-radius: var(--r-pill); background: var(--ap-gradient); color: var(--ap-ink);
  font-size: var(--t-small); font-weight: 650; text-decoration: none;
  transition: box-shadow var(--d-state) var(--ease-ribbon);
}
.work-cta:hover { box-shadow: 0 0 0 4px var(--ap-glow); }
.work-cta span { transition: transform var(--d-state) var(--ease-ribbon); }
.work-cta:hover span { transform: translateX(3px); }
.work-related { color: var(--text-3); font-size: 0.875rem; }
.work-related a { color: var(--text-2); }
.work-related a:hover { color: var(--accent); }
.work-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: var(--s-7); }
.work-footer p { color: var(--text-3); font-size: var(--t-small); }
.work-footer p a { color: var(--text-2); }
.work-footer p a:hover { color: var(--accent); }

/* ---- 10. Experience: career progression --------------------------------- */
.career { position: relative; }
.career-axis { display: none; }
.role-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
.role {
  position: relative; padding: 0 0 2.75rem 2.25rem;
  border-left: 1px solid var(--line-strong);
}
.role--current { border-left-color: transparent; padding-bottom: 0; }
.role::before {
  content: ""; position: absolute; top: 0.3rem; left: -0.4rem; width: 0.8rem; height: 0.8rem; border-radius: 50%;
  border: 1px solid var(--ap-aqua); background: var(--bg);
}
.role--current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--ap-glow); }
.role-period { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.role--current .role-period { color: var(--text-2); }
.role-now { padding: 0.1rem 0.6rem; border-radius: var(--r-pill); background: rgb(158 232 196 / 0.12); color: var(--accent); font-size: 0.6875rem; letter-spacing: 0.14em; }
.role h3 { margin-top: 0.75rem; font-size: clamp(1.5rem, 1.25rem + 1vw, 2.2rem); font-weight: 520; letter-spacing: -0.025em; }
.role--past h3 { color: var(--text); }
.role-org { margin-top: 0.4rem; color: var(--text-2); font-size: var(--t-small); }
.role-detail { display: grid; gap: 1.1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.role-detail dt { margin-bottom: 0.3rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.role-detail dd { color: var(--text-2); font-size: var(--t-small); line-height: 1.62; }
.role--current .role-detail dd { color: var(--text); }

/* ---- 11. Journey: the warm chapter --------------------------------------- */
.journey {
  --text: var(--ink); --text-strong: var(--ink); --text-2: var(--ink-2); --text-3: var(--ink-3);
  --accent: var(--deep-green); --line: var(--rule-warm); --line-strong: #a9a291; --control-border: #736d5f;
  color-scheme: light;
  position: relative;
  background: var(--stone);
  color: var(--ink);
  padding-block: var(--chapter-pad);
  scroll-margin-top: 0;
}
.journey ::selection { background: rgb(31 90 67 / 0.2); color: var(--ink); }
.journey :focus-visible { outline-color: var(--deep-green); }
.journey .chapter-label { color: var(--deep-green); }
.journey .chapter-label::before { background: var(--deep-green); }
.journey-opener { max-width: 54rem; }
.journey-opener .chapter-label { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; }
.journey-opener h2 { font-size: clamp(2.5rem, 1.5rem + 4vw, 5.25rem); font-weight: 460; letter-spacing: -0.035em; line-height: 1.02; max-width: 14ch; }
.journey-opener > p { margin-top: 1.6rem; max-width: 40rem; color: var(--ink-2); font-size: var(--t-lead); }
.journey-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.25rem; }
.journey-toc a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 1.1rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  color: var(--ink); font-size: 0.875rem; font-weight: 550; text-decoration: none;
  transition: background-color var(--d-feedback) ease, border-color var(--d-feedback) ease, color var(--d-feedback) ease;
}
.journey-toc a:hover { background: var(--ink); border-color: var(--ink); color: var(--stone); }
.journey-part { margin-top: clamp(4rem, 3rem + 5vw, 8rem); scroll-margin-top: 1.5rem; }
.journey-part-title {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem); padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  font-size: var(--t-label); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--deep-green);
}
.journey-kicker { color: var(--deep-green); margin-bottom: 0.9rem; }

/* Education ledger: compact, two rows, no cards. */
.education-list { display: grid; }
.education-entry {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem 3rem;
  padding-block: 1.75rem; border-bottom: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}
.education-entry:first-child { padding-top: 0; }
.education-status { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--deep-green); padding-top: 0.35rem; }
.education-main h4 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.85rem); font-weight: 540; letter-spacing: -0.02em; }
.education-inst { margin-top: 0.35rem; color: var(--ink-2); font-weight: 520; }
.education-summary { margin-top: 0.85rem !important; max-width: 60ch; color: var(--ink-2); font-size: var(--t-small); }
.education-note { margin-top: 0.5rem !important; color: var(--ink-3); font-size: 0.875rem; }
.education-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 1rem; font-size: 0.9063rem; }
.education-links a { display: inline-flex; align-items: center; min-height: 2.75rem; gap: 0.35rem; color: var(--deep-green); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(31 90 67 / 0.35); }
.education-links a:hover { text-decoration-color: currentColor; }

/* Leadership: a two-step ascent. */
.leadership { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 4rem; align-items: end; }
.leadership-intro h4 { font-size: clamp(1.4rem, 1.15rem + 1vw, 2.1rem); font-weight: 520; letter-spacing: -0.025em; }
.leadership-intro p { margin-top: 0.9rem; max-width: 52ch; color: var(--ink-2); }
/* A single connected track between two clearly-marked stops: the start node
   is hollow and muted, the track fills solid toward the summit node, which
   is filled, larger-reading and gets the ring emphasis. There is no gap
   between "the line" and "the nodes" -- they're one element, so it can't
   read as a disconnected or broken mark. */
.leadership-progress { padding-top: 2.25rem; }
.leadership-track { position: relative; height: 2px; margin-inline: 0.4rem; background: var(--line-strong); border-radius: 2px; }
.leadership-track-fill { position: absolute; inset: 0; border-radius: 2px; background: var(--deep-green); transform-origin: left; }
.leadership-node {
  position: absolute; top: 50%; width: 0.7rem; height: 0.7rem; border-radius: 50%;
  transform: translateY(-50%); background: var(--parchment); border: 2px solid var(--line-strong);
}
.leadership-node--start { left: -0.4rem; }
.leadership-node--summit { right: -0.4rem; background: var(--deep-green); border-color: var(--deep-green); box-shadow: 0 0 0 4px rgb(31 90 67 / 0.16); }
.leadership-stops { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-top: 1rem; }
.leadership-stop { display: grid; gap: 0.4rem; }
.leadership-stop--summit { text-align: right; }
.leadership-year { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.1em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.leadership-role { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); font-weight: 580; color: var(--ink); }
.leadership-stop--summit .leadership-role { color: var(--deep-green); }

/* Recognition: editorial plates, alternating. */
.recognition-grid { display: grid; gap: clamp(3.5rem, 3rem + 3vw, 6rem); }
.award { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 4rem; align-items: center; }
.award-media { position: relative; }
.award-media img { width: 100%; aspect-ratio: var(--ar, 3 / 2); object-fit: cover; background: var(--parchment); }
.award-media figcaption { margin-top: 0.75rem; color: var(--ink-3); font-size: var(--t-caption); line-height: 1.5; }
.award-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--deep-green); }
.award-body h4 { margin-top: 0.9rem; font-size: clamp(2rem, 1.4rem + 2.2vw, 3.4rem); font-weight: 460; letter-spacing: -0.035em; line-height: 1.02; }
.award-issuer { margin-top: 0.9rem; color: var(--ink-2); font-weight: 520; }
.award-context { margin-top: 1rem !important; max-width: 48ch; color: var(--ink-2); }
.award-verify { display: inline-flex; min-height: 2.75rem; align-items: center; margin-top: 0.75rem; color: var(--deep-green); font-weight: 600; }

/* F1: experiential, photography-led. */
.f1-story { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 3rem); }
.f1-lead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 4rem; align-items: end; }
.f1-text h4 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.4rem); font-weight: 460; letter-spacing: -0.035em; line-height: 1.02; max-width: 13ch; }
.f1-text p:last-child { margin-top: 1.25rem; max-width: 52ch; color: var(--ink-2); font-size: var(--t-lead); line-height: 1.6; }
.f1-media { min-width: 0; }
.f1-media img, .f1-media video { width: 100%; background: var(--parchment); }
.f1-media img { object-fit: cover; }
.f1-media--portrait img { aspect-ratio: 4 / 5; }
.f1-media--wide img { aspect-ratio: 1280 / 663; }
.f1-media--tall img { aspect-ratio: 3 / 4; }
.f1-media--landscape img { aspect-ratio: 1280 / 738; }
.f1-media figcaption { margin-top: 0.7rem; color: var(--ink-3); font-size: var(--t-caption); line-height: 1.5; }
.f1-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 2vw, 3rem); align-items: end; }
.journey-gallery { border-top: 1px solid var(--ink); }
.journey-gallery summary, .disclosure summary {
  display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 620; font-size: 1.05rem;
}
.journey-gallery summary::-webkit-details-marker, .disclosure summary::-webkit-details-marker { display: none; }
.summary-meta { color: var(--text-3); font-size: 0.875rem; font-weight: 550; }
.summary-icon { position: relative; width: 1.75rem; height: 1.75rem; margin-left: auto; border: 1px solid var(--control-border); border-radius: 50%; flex: none; }
.summary-icon::before, .summary-icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 0.65rem; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); transition: transform var(--d-state) var(--ease-ribbon); }
.summary-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
details[open] > summary .summary-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.f1-video-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 0.75rem 2rem; }
.f1-video video { aspect-ratio: 16 / 9; height: auto; object-fit: cover; }

/* ---- 12. Credentials (homepage summary) ----------------------------------- */
.credential-featured { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(3rem, 2rem + 3vw, 5rem); }
.credential-subhead { color: var(--text-2); margin-bottom: 1.75rem; }
.progression-track { position: relative; }
.progression-connector {
  position: absolute; left: 1.75rem; top: 1.75rem; bottom: 1.75rem; width: 1px;
  background: var(--ap-gradient-v); transform-origin: top;
}
.progression-steps { position: relative; display: grid; gap: 1.25rem; }
.progression-step { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1.1rem; align-items: center; }
.progression-step-badge {
  position: relative; z-index: 1; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--graphite-950); border: 1px solid var(--line-strong);
  transition: border-color var(--d-state) ease, box-shadow var(--d-state) var(--ease-ribbon);
}
.progression-step-badge img { width: 2.4rem; height: 2.4rem; object-fit: contain; }
.progression-step-badge img[src*="architect-professional"] { width: 2.1rem; height: 2.1rem; }
.progression-step:hover .progression-step-badge, .progression-step:focus-within .progression-step-badge { border-color: var(--accent); box-shadow: 0 0 0 5px var(--ap-glow); }
.progression-step-info { min-width: 0; }
.progression-step-level { display: block; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.progression-step-title { margin-top: 0.2rem; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.progression-step-meta { margin-top: 0.15rem; color: var(--text-3); font-size: 0.8125rem; }
.progression-step-verify, .credential-badge-verify, .trace-node-link, .archive-verify, .archive-crossref-verify {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.25rem;
  color: var(--text-2); font-size: 0.8125rem; font-weight: 600; text-decoration: none;
  transition: color var(--d-feedback) ease;
}
.progression-step-verify:hover, .credential-badge-verify:hover, .trace-node-link:hover, .archive-verify:hover, .archive-crossref-verify:hover { color: var(--accent); text-decoration: underline; }
.progression-arrow { display: none; }

.credential-grid { display: grid; gap: 1rem; }
.credential-badge-card {
  display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1.1rem; align-items: center;
  padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface-raised);
  transition: border-color var(--d-state) ease;
}
.credential-badge-card:hover, .credential-badge-card:focus-within { border-color: var(--line-strong); }
.credential-badge-card img { width: 3.5rem; height: 3.5rem; object-fit: contain; }
.credential-badge-info h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.credential-badge-info p { margin-top: 0.15rem; color: var(--text-3); font-size: 0.8125rem; }

/* Learning rail: seamless loop (JS) with manual scroll fallback. */
.learning-shelf { margin-top: clamp(3.5rem, 3rem + 3vw, 5.5rem); }
.learning-shelf-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.learning-shelf-header .credential-subhead { margin: 0; }
.rail-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding-inline: 1rem;
  border: 1px solid var(--control-border); border-radius: var(--r-pill); background: transparent; cursor: pointer;
  font-size: 0.8125rem; font-weight: 600; color: var(--text-2);
}
.rail-toggle:hover { border-color: var(--accent); color: var(--text-strong); }
.rail-toggle::before { content: ""; width: 0.55rem; height: 0.65rem; border-inline: 2px solid currentColor; box-sizing: border-box; }
.rail-toggle[aria-pressed="true"]::before { width: 0; height: 0; border-style: solid; border-width: 0.35rem 0 0.35rem 0.6rem; border-color: transparent transparent transparent currentColor; }
.learning-trace { position: relative; overflow: hidden; border-block: 1px solid var(--line); }
.learning-trace.is-looping {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  cursor: grab; touch-action: pan-y;
}
.learning-trace.is-dragging { cursor: grabbing; }
.learning-trace.is-dragging a { pointer-events: none; }
.learning-trace.is-manual { overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.trace-track { display: flex; width: max-content; will-change: transform; }
.trace-nodes { position: relative; display: flex; flex: none; }
.trace-nodes::before { content: ""; position: absolute; top: 2.05rem; left: 0; right: 0; height: 1px; background: var(--line-strong); }
.trace-node { position: relative; flex: none; width: 16rem; padding: 1.5rem 1.75rem 1.5rem 0; scroll-snap-align: start; user-select: none; -webkit-user-select: none; }
.trace-node-dot { position: absolute; top: 1.75rem; left: 0; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--surface-alt); }
.trace-node-body { padding-top: 1.5rem; }
.trace-node-type { display: block; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); }
.trace-node-title { margin-top: 0.35rem; font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: var(--text-strong); letter-spacing: 0; }
.trace-node-meta { margin-top: 0.25rem; color: var(--text-3); font-size: 0.8125rem; }
.trace-node-status { color: var(--text-3); }
.trace-node img { -webkit-user-drag: none; }
.credentials-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; margin-top: var(--s-7); }
.credentials-cta p { max-width: 40rem; color: var(--text-3); font-size: var(--t-small); }

/* ---- 13. About + closing ------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 6rem; }
.about h2 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.8rem); max-width: 12ch; }
.about-copy { max-width: var(--measure); color: var(--text-2); font-size: var(--t-lead); line-height: 1.7; }
.about-copy p:first-child { color: var(--text); }

.closing { padding-block: var(--chapter-pad) clamp(3rem, 2rem + 3vw, 5rem); border-top: 1px solid var(--line); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 6rem; align-items: center; scroll-margin-top: 2rem; }
.contact-mark { width: min(100%, 16rem); }
.contact-mark img { width: 100%; }
.contact-copy .chapter-label { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; color: var(--text-2); }
.contact-copy h2 { max-width: 16ch; }
.contact-copy > p:not(.chapter-label) { margin-top: 1.4rem; max-width: 36rem; color: var(--text-2); font-size: var(--t-lead); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.resume {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end;
  margin-top: clamp(4rem, 3rem + 4vw, 7rem); padding-top: 2.5rem; border-top: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.resume h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.2rem); font-weight: 520; }
.resume p { margin-top: 0.8rem; max-width: 52ch; color: var(--text-2); font-size: var(--t-small); }
.resume-actions { display: grid; justify-items: start; gap: 0.25rem; }
.resume-channel { color: var(--text-3) !important; font-size: 0.875rem !important; }
.resume-channel a { overflow-wrap: anywhere; color: var(--text-2); }

/* ---- 14. Project index + shared project hero ----------------------------- */
.project-hero { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.project-hero .eyebrow, .project-hero .breadcrumb { margin-bottom: 1.5rem; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; font-size: 0.875rem; color: var(--text-3); }
.breadcrumb a { display: inline-flex; min-height: 2.75rem; align-items: center; color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { color: var(--line-strong); }
.project-hero h1 { max-width: 20ch; font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.9rem); font-weight: 480; line-height: 1.04; }
.project-hero-summary { max-width: 44rem; margin-top: 1.5rem; color: var(--text-2); font-size: var(--t-lead); line-height: 1.6; }
.project-hero .hero-actions, .project-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.index-intro-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 2rem; }
.index-intro-meta a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; color: var(--text); text-decoration: none; font-weight: 550; }
.index-intro-meta a:hover { color: var(--accent); }
.index-intro-meta b { font-family: var(--font-display); font-weight: 300; font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }

.project-index-group { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6.5rem); scroll-margin-top: 0; border-top: 1px solid var(--line); }
.project-index-group--academic { background: var(--surface-alt); }
.pi-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 4rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.pi-head h2 { font-size: clamp(1.9rem, 1.35rem + 2vw, 3rem); }
.pi-count { font-family: var(--font-display); font-weight: 300; color: var(--text-3); margin-left: 0.4rem; font-variant-numeric: tabular-nums; }
.pi-head p { max-width: 40rem; color: var(--text-2); }
.pi-list { display: grid; border-top: 1px solid var(--line); }
.pi-item { position: relative; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.pi-item::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--ap-gradient); transform: scaleX(0); transform-origin: left; transition: transform 700ms var(--ease-ribbon); }
.pi-item:hover::before, .pi-item:focus-within::before { transform: scaleX(1); }
.pi-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 3rem; padding-block: clamp(2rem, 1.5rem + 1.5vw, 3rem); }
.pi-num { font-family: var(--font-display); font-weight: 250; font-size: 2.5rem; line-height: 0.9; letter-spacing: -0.04em; color: var(--text-3); font-variant-numeric: tabular-nums; transition: color var(--d-state) ease; }
.pi-item:hover .pi-num, .pi-item:focus-within .pi-num { color: var(--accent); }
.pi-main { min-width: 0; }
.pi-main h3 { margin-top: 0.75rem; font-size: clamp(1.35rem, 1.15rem + 0.9vw, 2rem); font-weight: 540; letter-spacing: -0.02em; max-width: 32ch; }
.pi-main h3 a { text-decoration: none; }
.pi-main h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.pi-problem { margin-top: 0.9rem; max-width: 60ch; color: var(--text-2); }
.pi-contribution { margin-top: 0.75rem !important; max-width: 60ch; color: var(--text); font-size: var(--t-small); }
.pi-contribution span { margin-right: 0.35rem; font-family: var(--font-display); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; font-size: var(--t-label); color: var(--text-3); }
.pi-main .tag-list { margin-top: 1.25rem; }
.pi-aside { position: relative; z-index: 1; display: grid; align-content: start; gap: 1rem; min-width: 0; }
.pi-evidence { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pi-evidence li { padding: 0.2rem 0.6rem; border-radius: var(--r-pill); background: rgb(158 232 196 / 0.08); color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.pi-item--professional .pi-evidence li { background: var(--surface-control); color: var(--text-2); }
.pi-figures { padding-top: 1rem; border-top: 1px solid var(--line); }
.pi-figures-title { font-size: 0.8125rem; color: var(--text-2); }
.pi-figures dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.75rem 1.25rem; margin-top: 0.6rem; }
.pi-figures dl div { min-width: 0; }
.pi-figures dt { overflow-wrap: anywhere; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.pi-figures dd { margin-top: 0.15rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pi-figures-note { margin-top: 0.6rem !important; color: var(--text-3); font-size: 0.8125rem; }
.pi-preview { display: block; overflow: hidden; border-radius: var(--r-panel); background: #f2f5f2; }
.pi-preview img { width: 100%; aspect-ratio: 3507 / 2480; object-fit: cover; transition: transform 900ms var(--ease-ribbon); }
.pi-item:hover .pi-preview img { transform: scale(1.025); }
.pi-action { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; justify-self: start; padding-inline: 1.15rem; border-radius: var(--r-pill); background: var(--ap-gradient); color: var(--ap-ink); font-size: var(--t-small); font-weight: 650; text-decoration: none; transition: box-shadow var(--d-state) var(--ease-ribbon); }
.pi-action:hover { box-shadow: 0 0 0 4px var(--ap-glow); }
.pi-private { color: var(--text-3); font-size: 0.8125rem; }

/* ---- 15. Case studies ---------------------------------------------------- */
.project-page { --shell: 88rem; }
.cs-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 5rem; align-items: end; }
.project-hero-context { margin-top: 1.25rem; color: var(--text-3); font-size: var(--t-small); overflow-wrap: anywhere; }
.project-hero-facts { padding-top: 1.5rem; border-top: 1px solid var(--line-strong); position: relative; min-width: 0; }
.project-hero-facts::before { content: ""; position: absolute; top: -1px; left: 0; width: 3.5rem; height: 1px; background: var(--ap-gradient); }
.project-hero-facts .label { margin-bottom: 0.75rem; }
.project-hero-facts > dl { display: grid; }
.project-hero-facts > dl > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
.project-hero-facts > dl dt { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding-top: 0.15rem; }
.project-hero-facts > dl dd { font-size: var(--t-small); }
.hero-result { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border-radius: var(--r-panel); background: rgb(158 232 196 / 0.06); border: 1px solid rgb(158 232 196 / 0.18); }
.hero-result p:first-child { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero-result dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.hero-result dt { font-size: 0.75rem; color: var(--text-3); }
.hero-result dd { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cs-hero-side { display: grid; gap: 1.75rem; min-width: 0; }
.hero-map { position: relative; margin: 0; }
.hero-map img { width: 100%; aspect-ratio: 3507 / 2480; object-fit: cover; border-radius: var(--r-panel); background: #f2f5f2; }
.hero-map figcaption { margin-top: 0.6rem; color: var(--text-3); font-size: var(--t-caption); }

/* Sticky chapter navigation with reading progress. */
.section-nav, .archive-nav {
  position: sticky; top: var(--header-h); z-index: 40;
  display: flex; gap: 0.25rem; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 0.5rem max(var(--gutter), calc((100% - var(--shell)) / 2 + var(--gutter)));
  background: var(--bg); border-block: 1px solid var(--line);
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar, .archive-nav::-webkit-scrollbar { display: none; }
.section-nav a, .archive-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding-inline: 0.85rem;
  border-radius: var(--r-pill); color: var(--text-3); font-size: 0.8125rem; font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: color var(--d-feedback) ease, background-color var(--d-feedback) ease;
}
.section-nav a b { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--line-strong); transition: color var(--d-feedback) ease; }
.section-nav a:hover, .archive-nav a:hover { color: var(--text-strong); }
.section-nav a[aria-current="true"], .archive-nav a[aria-current="true"] { background: rgb(158 232 196 / 0.1); color: var(--accent); }
.section-nav a[aria-current="true"] b { color: var(--accent); }
.reading-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ap-gradient); transform: scaleX(0); transform-origin: left; pointer-events: none; }

.project-section {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem 4rem;
  padding-block: clamp(3rem, 2rem + 3vw, 5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 3.75rem;
}
.cs-head { min-width: 0; }
.cs-num { font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; color: var(--accent); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 0.6rem; }
.cs-num::after { content: ""; width: 0.35rem; height: 0.35rem; border-radius: 50%; background: var(--accent); }
.cs-head h2 { margin-top: 0.9rem; font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.6rem); max-width: 18ch; }
.cs-body { min-width: 0; }
.project-section-note { max-width: 58ch; margin-bottom: 2rem; color: var(--text-3); font-size: var(--t-small); }
.project-prose { max-width: var(--measure); color: var(--text-2); font-size: var(--t-lead); line-height: 1.7; }
.project-prose p + p { margin-top: 1rem; }
.project-prose h3 { font-size: 1.15rem; margin-bottom: 0.75rem; color: var(--text-strong); }
.project-prose strong { color: var(--text); }
.project-list-plain { display: grid; gap: 0.85rem; max-width: 52rem; }
.project-list-plain li { position: relative; padding-left: 1.75rem; color: var(--text-2); line-height: 1.6; }
.project-list-plain li::before { content: ""; position: absolute; top: 0.62em; left: 0.15rem; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent); }
.project-disclosure-note { max-width: 62ch; margin-top: 2rem; padding: 1rem 1.25rem; border-left: 2px solid var(--line-strong); background: var(--surface-alt); color: var(--text-2); font-size: var(--t-small); line-height: 1.6; }

.glance-grid { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.glance-grid > div { padding: 1.1rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
.glance-grid dt { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.glance-grid dd { color: var(--text); }

.problem-grid, .data-grid, .hybrid-grid, .evaluation-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.research-questions { padding: 1.5rem 1.75rem; border-radius: var(--r-panel); background: var(--surface-raised); border: 1px solid var(--line); }
.research-questions-title { margin-bottom: 1.25rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.research-questions ol { display: grid; gap: 1.25rem; counter-reset: rq; }
.research-questions li { position: relative; padding-left: 2.25rem; counter-increment: rq; }
.research-questions li::before { content: counter(rq, decimal-leading-zero); position: absolute; top: 0.15rem; left: 0; font-family: var(--font-display); font-size: 0.8125rem; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.research-questions h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 620; letter-spacing: 0; }
.research-questions p { margin-top: 0.3rem; color: var(--text-2); font-size: 0.9063rem; line-height: 1.55; }
.dataset-label { display: inline-flex; margin-bottom: 1.75rem; padding: 0.4rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--text-2); font-family: var(--font-mono); font-size: 0.8125rem; }
.data-prep-title { margin-bottom: 1rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }

/* Research trace → a pipeline of connected stages. */
.research-trace { position: relative; display: grid; gap: 0; counter-reset: stage; }
.research-trace::before { content: ""; position: absolute; top: 1.25rem; bottom: 1.25rem; left: 1.25rem; width: 1px; background: var(--ap-gradient-v); opacity: 0.6; }
.trace-step { position: relative; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1.1rem; padding-block: 0.4rem; }
.trace-step-index { position: relative; z-index: 1; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--bg); font-family: var(--font-display); font-size: 0.75rem; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; transition: border-color var(--d-state) ease, color var(--d-state) ease; }
.trace-step:has(details[open]) .trace-step-index, .trace-step:hover .trace-step-index { border-color: var(--accent); color: var(--accent); }
.trace-step-details summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.5rem; cursor: pointer; list-style: none; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.trace-step-details summary::-webkit-details-marker { display: none; }
.trace-step-details summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 1.25rem; transition: transform var(--d-state) var(--ease-ribbon); }
.trace-step-details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.trace-step-details p { margin: 0.25rem 0 1rem; max-width: 56ch; color: var(--text-2); font-size: var(--t-small); line-height: 1.6; }

/* Model explorer: a segmented control over a comparison panel. */
.model-explorer { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-raised); overflow: hidden; }
.model-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem; border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.model-tab {
  flex: 1 1 auto; min-height: 2.75rem; padding: 0.5rem 1rem; border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2); font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background-color var(--d-feedback) ease, color var(--d-feedback) ease, border-color var(--d-feedback) ease;
}
.model-tab:hover { color: var(--text-strong); border-color: var(--line-strong); }
.model-tab[aria-selected="true"] { background: var(--ap-gradient); color: var(--ap-ink); }
.model-panel-content { padding: clamp(1.5rem, 1.25rem + 1.5vw, 2.5rem); }
.model-panel-fullname { font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem); font-weight: 540; color: var(--text-strong); letter-spacing: -0.02em; }
.model-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 3rem; margin-top: 1.5rem; }
.model-panel-block p:last-child { color: var(--text-2); line-height: 1.6; }
.model-panel-label { margin-bottom: 0.4rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.model-panel-block--strength .model-panel-label { color: var(--accent); }
.model-panel-block--weakness .model-panel-label { color: #e9b872; }
.model-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 1.75rem; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--line); }
.model-metric { display: grid; gap: 0.2rem; padding: 1rem 1.1rem; background: var(--surface-alt); }
.model-metric-label { font-size: 0.75rem; font-weight: 600; color: var(--text-3); }
.model-metric-value { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 400; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.model-metric-rank { font-size: 0.75rem; color: var(--text-3); }
.model-metric.is-best .model-metric-value, .model-metric.is-best .model-metric-rank { color: var(--accent); }
.model-metric-note { margin-top: 1rem; max-width: 64ch; color: #e9b872; font-size: 0.875rem; }

.hybrid-ratio { display: grid; gap: 1rem; padding: 1.75rem; border-radius: var(--r-panel); background: var(--surface-raised); border: 1px solid var(--line); }
.hybrid-ratio-bar { display: flex; height: 0.75rem; border-radius: var(--r-pill); overflow: hidden; gap: 3px; }
.hybrid-ratio-segment { display: block; height: 100%; border-radius: var(--r-pill); }
.hybrid-ratio-segment--svd { background: var(--ap-gradient); }
.hybrid-ratio-segment--ae { background: var(--control-border); }
.hybrid-ratio-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.875rem; color: var(--text-2); }
.hybrid-ratio-legend li { display: flex; align-items: center; gap: 0.5rem; }
.hybrid-ratio-legend-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; }
.hybrid-ratio-legend-dot--svd { background: var(--accent); }
.hybrid-ratio-legend-dot--ae { background: var(--control-border); }
.hybrid-ratio-arrow { display: none; }
.hybrid-ratio-result { justify-self: start; padding: 0.4rem 1rem; border: 1px solid var(--accent); border-radius: var(--r-pill); color: var(--accent); font-size: 0.875rem; font-weight: 600; }
.hybrid-ratio-formula { font-family: var(--font-mono); font-size: 1rem; color: var(--text-strong); }
.hybrid-ratio-disclaimer { color: var(--text-3); font-size: 0.8125rem; }

.metrics-explainer { display: grid; gap: 1.25rem; }
.metrics-explainer-item span { display: block; font-family: var(--font-display); font-size: 0.875rem; font-weight: 650; letter-spacing: 0.06em; color: var(--accent); }
.metrics-explainer-item p { margin-top: 0.25rem; color: var(--text-2); font-size: var(--t-small); line-height: 1.55; }
.evaluation-side { display: grid; gap: 2rem; }
.evaluation-charts { display: grid; gap: 2.25rem; }
.eval-chart { margin: 0; padding: 1.5rem; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--surface-alt); }
.eval-chart-title { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; font-family: var(--font-display); font-size: 0.875rem; font-weight: 650; letter-spacing: 0.04em; color: var(--text-strong); }
.eval-chart-title span { font-family: var(--font-body); font-weight: 500; letter-spacing: 0; color: var(--text-3); font-size: 0.8125rem; }
.eval-bar-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 3.25rem; align-items: center; gap: 1rem; padding-block: 0.45rem; }
.eval-bar-label { font-size: 0.875rem; color: var(--text-2); }
.eval-bar-track { position: relative; height: 0.5rem; border-left: 1px solid var(--line-strong); }
.eval-bar-fill { display: block; height: 100%; border-radius: 0 var(--r-pill) var(--r-pill) 0; background: var(--control-border); transform-origin: left; transition: transform 1100ms var(--ease-ribbon); }
.eval-bar-row.is-best .eval-bar-fill { background: var(--ap-gradient); }
.eval-bar-row.is-best .eval-bar-label, .eval-bar-row.is-best .eval-bar-value { color: var(--accent); font-weight: 600; }
.eval-bar-value { font-family: var(--font-mono); font-size: 0.8438rem; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.evaluation-caveats { padding: 1.25rem 1.5rem; border-left: 2px solid #e9b872; background: var(--surface-alt); border-radius: 0 var(--r-panel) var(--r-panel) 0; }
.evaluation-caveats-title { margin-bottom: 0.75rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: #e9b872; }
.evaluation-caveats ul { display: grid; gap: 0.75rem; }
.evaluation-caveats li { color: var(--text-2); font-size: 0.9063rem; line-height: 1.6; }

.user-testing-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--line); }
.user-testing-col { padding: 1.5rem; background: var(--surface-alt); }
.user-testing-col h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; margin-bottom: 1rem; }
.user-testing-col h3::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--c, var(--accent)); }
.user-testing-col[data-col="challenged"] { --c: #e9b872; }
.user-testing-col[data-col="changed"] { --c: var(--text-2); }
.user-testing-col ul { display: grid; gap: 0.6rem; }
.user-testing-col li { color: var(--text-2); font-size: var(--t-small); line-height: 1.55; }

.project-section--limitations .cs-num { color: #e9b872; }
.project-section--limitations .cs-num::after { background: #e9b872; }
.limitations-list { counter-reset: limitation; display: grid; max-width: 58rem; border-top: 1px solid var(--line); }
.limitations-list li { counter-increment: limitation; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); color: var(--text-2); line-height: 1.6; }
.limitations-list li::before { content: counter(limitation, decimal-leading-zero); font-family: var(--font-display); font-size: 0.875rem; font-weight: 650; color: #e9b872; font-variant-numeric: tabular-nums; padding-top: 0.1rem; }
.artifacts-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.education-related-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.education-related-list a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.5rem 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--text); font-size: var(--t-small); font-weight: 550; text-decoration: none; transition: border-color var(--d-feedback) ease, color var(--d-feedback) ease; }
.education-related-list a:hover { border-color: var(--accent); color: var(--accent); }


.flood-media-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 2rem; }
.flood-media-grid:first-child { margin-top: 0; }
.flood-media-card { min-width: 0; counter-increment: figure; }
.flood-media-card .map-frame { position: relative; padding: 0.5rem; border: 1px solid var(--line-strong); border-radius: 2px; background: #f2f5f2; }
.flood-media-card img { width: 100%; aspect-ratio: 3326 / 2901; object-fit: contain; background: #f2f5f2; }
.flood-media-grid--context .flood-media-card img { aspect-ratio: 3507 / 2480; }
.flood-media-card figcaption { display: grid; gap: 0.25rem; padding-top: 0.85rem; }
.flood-media-card figcaption strong { display: flex; align-items: baseline; gap: 0.6rem; font-family: var(--font-display); font-size: 1rem; font-weight: 620; }
.flood-media-card figcaption strong::before { content: "Fig. " counter(figure, decimal-leading-zero); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.flood-media-card figcaption span { color: var(--text-3); font-size: var(--t-caption); line-height: 1.5; }
.flood-page main { counter-reset: figure; }
.map-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.map-open-label { position: absolute; right: 0.75rem; bottom: 0.75rem; padding: 0.4rem 0.8rem; border-radius: var(--r-pill); background: rgb(12 13 14 / 0.86); color: var(--ivory); font-size: 0.75rem; font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity var(--d-state) ease, transform var(--d-state) var(--ease-ribbon); }
.map-open:hover .map-open-label, .map-open:focus-visible .map-open-label { opacity: 1; transform: none; }
@media (hover: none) { .map-open-label { opacity: 1; transform: none; } }
.risk-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1.5rem; font-size: 0.8125rem; color: var(--text-2); }
.risk-legend li { display: flex; align-items: center; gap: 0.45rem; }
.flood-legend-swatch { width: 0.65rem; height: 0.65rem; border-radius: 2px; flex: none; }
.flood-bar-segment--high, .flood-legend-swatch--high { background: #eb533d; }
.flood-bar-segment--medium, .flood-legend-swatch--medium { background: #e7b260; }
.flood-bar-segment--low, .flood-legend-swatch--low { background: #a8dfbb; }
.flood-data-groups { display: grid; gap: 1.25rem; }
.flood-data-group h3 { margin-bottom: 0.6rem; font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.flood-data-group ul { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.flood-data-group li { padding: 0.25rem 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 0.8125rem; color: var(--text-2); }
.framework-stages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--line); }
.framework-stage { padding: 1.5rem; background: var(--surface-alt); }
.framework-stage h3 { font-size: 1.15rem; }
.framework-stage h3 span { display: block; margin-bottom: 0.35rem; font-size: var(--t-label); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.framework-stage p { margin-top: 0.6rem; color: var(--text-2); font-size: var(--t-small); line-height: 1.6; }
.framework-stage p strong { color: var(--text); }

/* District comparison: both districts side by side, same scales. */
.district-compare { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--line); }
.district { padding: clamp(1.25rem, 1rem + 1vw, 2rem); background: var(--surface-alt); min-width: 0; }
.district h3 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem); font-weight: 540; }
.district-scope { margin-top: 0.25rem; color: var(--text-3); font-size: 0.8125rem; }
.flood-chart-card { margin-top: 1.5rem; }
.flood-chart-card h4 { margin-bottom: 0.6rem; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.flood-stacked-bar { display: flex; gap: 2px; width: 100%; height: 0.9rem; border-radius: 2px; overflow: hidden; }
.flood-bar-segment { display: block; min-width: 2px; transform-origin: left; transition: transform 1100ms var(--ease-ribbon); }
.flood-chart-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.6rem; font-size: 0.8125rem; color: var(--text-3); }
.flood-chart-legend li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.flood-chart-legend strong { margin-left: auto; font-family: var(--font-mono); font-weight: 500; font-size: 0.8125rem; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.flood-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.flood-metric-card span { display: block; font-size: 0.75rem; color: var(--text-3); line-height: 1.35; }
.flood-metric-card strong { display: block; margin-top: 0.3rem; font-family: var(--font-display); font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem); font-weight: 450; font-variant-numeric: tabular-nums; }
.flood-metric-card small { display: block; color: var(--text-3); font-size: 0.75rem; }

.map-dialog { width: min(96vw, 1500px); max-width: none; max-height: 94dvh; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-panel); background: var(--bg); color: var(--ivory); overscroll-behavior: contain; }
.map-dialog::backdrop { background: rgb(5 6 7 / 0.9); }
.map-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.map-dialog-header h2 { font-size: 1.1rem; letter-spacing: -0.01em; }
.map-dialog button, .map-dialog a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.5rem 1.1rem; border: 1px solid var(--control-border); border-radius: var(--r-pill); background: transparent; color: var(--ivory); font-size: 0.875rem; font-weight: 550; text-decoration: none; cursor: pointer; }
.map-dialog button:hover, .map-dialog a:hover { border-color: var(--ap-mint); }
.map-dialog img { width: 100%; height: min(70dvh, 1000px); object-fit: contain; background: #f2f5f2; border-radius: 2px; }
.map-dialog figcaption { padding-block: 0.75rem; color: var(--text-2); font-size: var(--t-small); }
.map-dialog-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---- 16. Credentials archive page ---------------------------------------- */
.archive-hero { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.archive-hero .breadcrumb { margin-bottom: 1rem; }
.archive-hero .eyebrow { margin-bottom: 1.25rem; }
.archive-hero h1 { max-width: 13ch; font-size: clamp(2.6rem, 1.6rem + 4vw, 5.5rem); }
.archive-hero .project-hero-summary a { color: var(--text); }
.archive-hero .project-hero-summary a:hover { color: var(--accent); }
.archive-section { scroll-margin-top: 3.75rem; }
.archive-section-note { max-width: 58ch; margin-bottom: 1.5rem; color: var(--text-3); font-size: var(--t-small); }
.archive-list { display: grid; border-top: 1px solid var(--line); }
.archive-empty { padding-block: 1rem; color: var(--text-3); }
.archive-item, .archive-programme summary {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  padding-block: 1.1rem; border-bottom: 1px solid var(--line);
}
.archive-item { position: relative; scroll-margin-top: 4rem; }
.archive-item:hover { background: linear-gradient(90deg, rgb(158 232 196 / 0.04), transparent 70%); }
.archive-item--professional .archive-item-type { color: var(--accent); }
.archive-badge { width: 3rem; height: 3rem; object-fit: contain; border-radius: 50%; }
.archive-badge--placeholder { display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface-raised); font-family: var(--font-display); font-weight: 650; color: var(--text-2); }
.archive-item-body { min-width: 0; }
.archive-item-type { display: block; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.archive-item-body h3 { margin-top: 0.2rem; font-family: var(--font-body); font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; }
.archive-item-meta { margin-top: 0.15rem; color: var(--text-3); font-size: 0.8438rem; }
.archive-status--expired { color: #e9b872; }
.archive-item > .archive-verify { justify-self: end; }
.archive-list--path { position: relative; border-top: 0; }
.archive-list--path::before { content: ""; position: absolute; left: 1.5rem; top: 2.2rem; bottom: 2.2rem; width: 1px; background: var(--ap-gradient-v); }
.archive-list--path .archive-item { border-bottom: 0; }
.archive-list--path .archive-badge { position: relative; z-index: 1; background: var(--bg); box-shadow: 0 0 0 6px var(--bg); }
.archive-list--path .archive-item:hover { background: none; }
.archive-list--path .archive-item:hover .archive-badge { box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--ap-glow); }
.archive-programme { border-bottom: 1px solid var(--line); scroll-margin-top: 4rem; }
.archive-programme summary { border-bottom: 0; cursor: pointer; list-style: none; }
.archive-programme summary::-webkit-details-marker { display: none; }
.archive-chevron { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--control-border); border-radius: 50%; color: var(--text-2); font-size: 0.875rem; transition: transform var(--d-state) var(--ease-ribbon), border-color var(--d-feedback) ease, color var(--d-feedback) ease; }
.archive-programme summary:hover .archive-chevron { border-color: var(--accent); color: var(--accent); }
.archive-programme[open] .archive-chevron { transform: rotate(180deg); }
.archive-programme-body { padding: 0 0 1.25rem 4.25rem; }
.archive-child-list { --archive-track-center: 0.25rem; position: relative; display: grid; margin-top: 0.5rem; }
.archive-child-list::before { content: ""; position: absolute; top: 0.9rem; bottom: 0.9rem; left: var(--archive-track-center); width: 1px; background: var(--ap-gradient-v); opacity: 0.7; }
.archive-child { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.55rem 0 0.55rem 1.5rem; scroll-margin-top: 4rem; }
.archive-child-dot { position: absolute; top: 50%; left: var(--archive-track-center); width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); }
.archive-child h4 { font-family: var(--font-body); font-size: 0.9063rem; font-weight: 580; letter-spacing: 0; }
.archive-child p { color: var(--text-3); font-size: 0.8125rem; }
.archive-crossref-note { margin: 1.5rem 0 0.5rem; color: var(--text-3); font-size: 0.8125rem; }
.archive-crossref-list { display: grid; }
.archive-crossref { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding-block: 0.6rem; border-bottom: 1px dashed var(--line); }
.archive-crossref-badge { width: 2rem; height: 2rem; object-fit: contain; border-radius: 50%; }
.archive-crossref-badge--placeholder { display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: 0.75rem; font-weight: 650; color: var(--text-3); }
.archive-crossref-title { color: var(--text); font-size: 0.9063rem; font-weight: 550; text-decoration: none; }
.archive-crossref-title:hover { color: var(--accent); text-decoration: underline; }
.archive-crossref-meta { color: var(--text-3); font-size: 0.8125rem; }
.archive-section--warm .archive-item-type { color: #d9c9a3; }
.archive-timeline { border-top: 0; }
.archive-timeline-item { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.85rem 0 0.85rem 1.5rem; border-bottom: 1px solid var(--line); scroll-margin-top: 4rem; }
.archive-timeline-item:not(:has(.archive-timeline-badge)) { grid-template-columns: minmax(0, 1fr); }
.archive-timeline::before { content: ""; position: absolute; }
.archive-timeline-dot { position: absolute; top: 50%; left: 0.2rem; width: 0.45rem; height: 0.45rem; margin-top: -0.225rem; border-radius: 50%; background: var(--text-3); }
.archive-timeline-badge { width: 2rem; height: 2rem; object-fit: contain; border-radius: 50%; }
.archive-timeline-date { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.archive-timeline-item h3 { margin-top: 0.1rem; font-family: var(--font-body); font-size: 0.9375rem; font-weight: 580; letter-spacing: 0; }
.archive-timeline-item .archive-verify { min-height: 2rem; }

/* ---- 16b. Signature: the AP trace, material light, closing controls -------- */
/* The trace (a thin seafoam→mint line taken from the logo's ribbon) marks
   entry, progression, state and relationship. Material light is placed only
   at brand entry, featured work, and chapter thresholds. */

/* Hero: a second, smaller pool of light where the trace rises, echoing the
   glow under the ribbon in the artwork. */
/* Featured work: hover/focus response lives in colour and the trace sweep
   (below) only -- no local light, so a row's own rectangle never shows. */
.work-item > article, .pi-item > .pi-row { position: relative; z-index: 1; }

/* Active chapter in case-study and archive navigation: a trace underline. */
.section-nav a, .archive-nav a { position: relative; }
.section-nav a::after, .archive-nav a::after {
  content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.3rem; height: 1px;
  background: var(--ap-gradient); transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-state) var(--ease-ribbon);
}
.section-nav a[aria-current="true"]::after, .archive-nav a[aria-current="true"]::after { transform: scaleX(1); }

/* Journey: graphite gives way to architectural paper. The threshold is
   marked by the trace, and the paper carries a soft daylight, not a flat fill. */
.journey { background: var(--stone); }
.journey::after {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(72rem 40rem at 14% 0%,   var(--pearl), transparent 60%),
    radial-gradient(54rem 34rem at 90% 20%,  rgb(255 255 255 / 0.3), transparent 66%),
    radial-gradient(60rem 38rem at 6% 46%,   rgb(255 255 255 / 0.22), transparent 64%),
    radial-gradient(66rem 40rem at 92% 68%,  var(--pearl), transparent 62%),
    radial-gradient(56rem 34rem at 10% 92%,  rgb(255 255 255 / 0.24), transparent 62%);
}
.journey > .shell { position: relative; z-index: 1; }
.journey::before {
  content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--deep-green) 18%, var(--ap-aqua) 60%, transparent);
  transform-origin: left; opacity: 0.7;
}
.journey-part-title { border-bottom-color: var(--rule-warm); }
.journey-part-title::after { content: ""; flex: none; order: -1; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--deep-green); }

/* Case-study close: artifacts and related education share one band. */
.case-close {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 4rem;
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  border-top: 1px solid var(--line);
}
.case-close-group { min-width: 0; scroll-margin-top: 3.75rem; }
.case-close-group h2 { margin: 0.6rem 0 1.25rem; font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem); }

/* Next / previous case study: one strong control; the trace completes on hover. */
.case-next {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem 3rem;
  padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); border-top: 1px solid var(--line);
}
.case-next-link {
  position: relative; display: grid; gap: 0.5rem; min-width: min(100%, 28rem);
  padding-bottom: 1.1rem; text-decoration: none; color: var(--text-strong);
}
.case-next-label { font-family: var(--font-display); font-size: var(--t-label); font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.case-next-title { font-family: var(--font-display); font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2.25rem); font-weight: 520; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.case-next-arrow { display: inline-block; color: var(--accent); transition: transform var(--d-state) var(--ease-ribbon); }
.case-next-trace { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-strong); overflow: hidden; }
.case-next-trace::after { content: ""; position: absolute; inset: 0; background: var(--ap-gradient); transform: scaleX(0.14); transform-origin: left; transition: transform 700ms var(--ease-ribbon); }
.case-next-link:hover .case-next-trace::after, .case-next-link:focus-visible .case-next-trace::after { transform: scaleX(1); }
.case-next-link:hover .case-next-arrow, .case-next-link:focus-visible .case-next-arrow { transform: translateX(4px); }
.case-next-link--prev .case-next-trace::after { transform-origin: right; }
.case-next-link--prev:hover .case-next-arrow, .case-next-link--prev:focus-visible .case-next-arrow { transform: translateX(-4px); }
.case-next-all { font-size: var(--t-small); }

/* Credentials: active-year chapters keep the record focused on milestones. */
.learning-record { margin: 2.5rem 0 0; max-width: 54rem; }
.record-chapters > ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 0.75rem; }
.record-chapter { min-width: 0; padding: 0.9rem 1rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: color-mix(in srgb, var(--surface-raised) 55%, transparent); }
.record-chapter-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 1rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--line); }
.record-chapter-heading strong { color: var(--text); font-family: var(--font-display); font-size: 0.9375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.record-chapter-heading span { color: var(--text-3); font-size: 0.75rem; }
.record-years { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 0.25rem; padding-top: 0.75rem; }
.record-year { display: grid; justify-items: center; gap: 0.55rem; }
.record-stack { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; gap: 0.35rem; min-height: 4rem; }
.record-dot { display: block; width: 0.7rem; height: 0.7rem; border-radius: 50%; transition: transform var(--d-feedback) ease; }
.record-dot:hover { transform: scale(1.35); }
.record-dot--foundation { background: var(--control-border); }
.record-dot--learning { border: 1.5px solid var(--ap-aqua); }
.record-dot--certification { background: var(--accent); box-shadow: 0 0 0 3px var(--ap-glow); }
.record-label { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.record-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.4rem; margin-top: 1.1rem; font-size: 0.875rem; color: var(--text-2); }
.record-summary { color: var(--text); font-weight: 550; }
.record-recent { color: var(--text); }
.record-key { display: inline-flex; align-items: center; gap: 0.5rem; }
.record-key::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; }
.record-key--foundation::before { background: var(--control-border); }
.record-key--learning::before { border: 1.5px solid var(--ap-aqua); }
.record-key--certification::before { background: var(--accent); }
.archive-section.project-section { padding-block: clamp(2.5rem, 2rem + 2.5vw, 4rem); }

@media (min-width: 821px) {
  .case-close { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  .js-motion .journey::before { transform: scaleX(0); transition: transform 1400ms var(--ease-sweep); }
  .js-motion .journey.is-revealed::before { transform: scaleX(1); }
  .js-motion .leadership-track-fill { transform: scaleX(0); transition: transform 900ms 200ms var(--ease-ribbon); }
  .js-motion .journey-part.is-revealed .leadership-track-fill { transform: scaleX(1); }
  .js-motion .leadership-node--summit { opacity: 0; transform: translateY(-50%) scale(0.3); transition: opacity 400ms 950ms var(--ease-ribbon), transform 400ms 950ms var(--ease-ribbon); }
  .js-motion .journey-part.is-revealed .leadership-node--summit { opacity: 1; transform: translateY(-50%) scale(1); }
  .js-motion .learning-record .record-dot { opacity: 0; transform: scale(0.4); transition: opacity 400ms var(--ease-ribbon), transform 400ms var(--ease-ribbon); transition-delay: calc(300ms + var(--order) * 55ms); }
  .js-motion .learning-record.is-revealed .record-dot { opacity: 1; transform: none; }
  .js-motion .case-close-group .cs-num::after { opacity: 0; transform: scale(0.3); transition: opacity 500ms 150ms var(--ease-ribbon), transform 500ms 150ms var(--ease-ribbon); }
  .js-motion .case-close-group.is-revealed .cs-num::after { opacity: 1; transform: none; }
}


/* Tablet: keep the F1 essay editorial rather than a stack of full-width
   portraits (each would otherwise be ~950px tall at 820px). */
@media (min-width: 560px) and (max-width: 820px) {
  .f1-media--portrait { max-width: 30rem; }
  .f1-pair { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
}

/* ---- 17. Motion ----------------------------------------------------------- */
/* Everything below is additive: content is fully visible without JS or with
   reduced motion. .js-motion is only set when motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  /* AP mark entrance in the header. */
  .brand-mark { animation: ap-mark-in 1100ms var(--ease-ribbon) both; }
  .brand-name { animation: ap-fade-in 900ms 250ms var(--ease-ribbon) both; }
  @keyframes ap-mark-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
  @keyframes ap-fade-in { from { opacity: 0; } to { opacity: 1; } }

  /* Hero: masked line reveals, then the ribbon trace sweeps in. */
  .hero-role, .hero h1, .hero-intro, .hero-actions, .current-role { animation: ap-rise 1000ms var(--ease-ribbon) both; }
  .hero h1 { animation-delay: 90ms; }
  .hero-intro { animation-delay: 220ms; }
  .hero-actions { animation-delay: 320ms; }
  .current-role { animation-delay: 480ms; }
  .current-role::before { animation: ap-draw-x 1200ms 900ms var(--ease-ribbon) both; transform-origin: left; }
  .hero-trace { animation: ap-sweep var(--d-trace) 420ms var(--ease-sweep) both; }
  @keyframes ap-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes ap-sweep { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes ap-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  /* Chapter reveals (IntersectionObserver adds .is-revealed). */
  /* Headings rise out of a mask along one axis; supporting copy follows once
     the heading has landed. Blocks without a heading simply resolve in. */
  .js-motion [data-reveal] :is(h2, .f1-text h4) { clip-path: inset(0 0 100% 0); transform: translateY(0.35em); transition: clip-path 900ms var(--ease-ribbon), transform 900ms var(--ease-ribbon); }
  .js-motion [data-reveal].is-revealed :is(h2, .f1-text h4) { clip-path: inset(-0.2em -0.2em -0.3em -0.2em); transform: none; }
  .js-motion [data-reveal] > :not(h2):not(h4):not(.chapter-label) { opacity: 0; transition: opacity 700ms 320ms var(--ease-ribbon); }
  .js-motion [data-reveal].is-revealed > :not(h2):not(h4):not(.chapter-label) { opacity: 1; }
  .js-motion [data-reveal] .chapter-label::before { opacity: 0; transform: scale(0.3); transition: opacity 500ms 150ms var(--ease-ribbon), transform 500ms 150ms var(--ease-ribbon); }
  .js-motion [data-reveal].is-revealed .chapter-label::before { opacity: 1; transform: none; }

  /* Image reveal: directional mask sweep (the ribbon's left-to-right motion). */
  .js-motion [data-reveal-media] img { clip-path: inset(0 100% 0 0); transform: scale(1.04); transition: clip-path 1200ms var(--ease-sweep), transform 1600ms var(--ease-ribbon); }
  .js-motion [data-reveal-media].is-revealed img { clip-path: inset(0 0 0 0); transform: none; }
  .js-motion [data-reveal-media] figcaption { opacity: 0; transition: opacity 700ms 500ms ease; }
  .js-motion [data-reveal-media].is-revealed figcaption { opacity: 1; }

  /* Work rows and archive rows rise in sequence. */
  .js-motion .work-item > article, .js-motion .pi-row, .js-motion .role, .js-motion .award, .js-motion .education-entry {
    opacity: 0; transform: translateY(24px); transition: opacity var(--d-reveal) var(--ease-ribbon), transform var(--d-reveal) var(--ease-ribbon);
  }
  .js-motion .is-revealed > article, .js-motion .is-revealed > .pi-row, .js-motion .role.is-revealed, .js-motion .award.is-revealed, .js-motion .education-entry.is-revealed { opacity: 1; transform: none; }
  .js-motion .role--current { transition-delay: 160ms; }

  /* Career axis and certification path draw as progression. */
  .js-motion .progression-connector { transform: scaleY(0); transition: transform 1400ms var(--ease-ribbon); }
  .js-motion .credential-progression.is-revealed .progression-connector { transform: scaleY(1); }
  .js-motion .career-seg { transform: scaleX(0); transition: transform 1200ms var(--ease-ribbon); }
  .js-motion .career-seg--now { transition-delay: 500ms; }
  .js-motion .career.is-revealed .career-seg { transform: scaleX(1); }
  .js-motion .career-node { opacity: 0; transition: opacity 400ms 450ms ease; }
  .js-motion .career.is-revealed .career-node { opacity: 1; }

  /* Charts settle into their values. */
  .js-motion .eval-chart .eval-bar-fill, .js-motion .district .flood-bar-segment { transform: scaleX(0); }
  .js-motion .is-revealed .eval-bar-fill, .js-motion .is-revealed .flood-bar-segment { transform: scaleX(1); }
  .js-motion .is-revealed .eval-bar-row:nth-child(3) .eval-bar-fill { transition-delay: 80ms; }
  .js-motion .is-revealed .eval-bar-row:nth-child(4) .eval-bar-fill { transition-delay: 160ms; }
  .js-motion .is-revealed .eval-bar-row:nth-child(5) .eval-bar-fill { transition-delay: 240ms; }
  .js-motion .is-revealed .eval-bar-row:nth-child(6) .eval-bar-fill { transition-delay: 320ms; }

  /* Case-study chapter markers draw. */
  .js-motion .project-section .cs-num::after { opacity: 0; transform: scale(0.3); transition: opacity 500ms 150ms var(--ease-ribbon), transform 500ms 150ms var(--ease-ribbon); }
  .js-motion .project-section.is-revealed .cs-num::after { opacity: 1; transform: none; }

  /* Model explorer panel crossfade on selection. */
  .model-panel-content { animation: ap-fade-up 420ms var(--ease-ribbon) both; }
  @keyframes ap-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .map-dialog[open] { animation: ap-fade-up 360ms var(--ease-ribbon) both; }
  .archive-programme[open] .archive-child { animation: ap-fade-up 420ms var(--ease-ribbon) both; animation-delay: calc(var(--i, 0) * 45ms); }

  /* Reading progress: scroll-driven where supported (progressive enhancement). */
  @supports (animation-timeline: scroll()) {
    .reading-progress { animation: ap-draw-x linear both; animation-timeline: scroll(root); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---- 18. Responsive ------------------------------------------------------- */
@media (min-width: 640px) {
  .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .work-grid > div:last-child { grid-column: 1 / -1; }
  .f1-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance-grid > div { grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; }
  .model-panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-testing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .framework-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 821px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem); }
  .work-item > article { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 2rem; }
  .education-entry { grid-template-columns: 12rem minmax(0, 1fr); }
  .leadership { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .award { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .award:nth-child(even) .award-media { order: 2; }
  .f1-lead { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .f1-pair { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); }
  .about-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .contact { grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); }
  .contact-mark { width: 100%; }
  .resume { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .resume-actions { justify-items: end; text-align: right; }
  .pi-row { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(15rem, 20rem); }
  .pi-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .district-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flood-media-grid--paired, .flood-media-grid--context { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Career becomes a horizontal axis: data engineering → ML engineering. */
  .career-axis { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0; margin-bottom: 2.25rem; }
  .career-seg { height: 2px; border-radius: 2px; transform-origin: left; }
  .career-seg--past { background: linear-gradient(90deg, var(--ap-teal), var(--ap-aqua)); }
  .career-seg--now { background: var(--ap-gradient); }
  .career-node { width: 0.9rem; height: 0.9rem; margin-inline: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--ap-glow); }
  .role-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
  .role, .role--current { padding: 0; border-left: 0; }
  .role::before { display: none; }
}

@media (min-width: 900px) {
  .chapter-split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 6rem; align-items: start; }
  .chapter-split > .chapter-head { position: sticky; top: calc(var(--header-h) + 3rem); }
  .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 2.5rem; }
  .work-grid > div:last-child { grid-column: auto; }
  .credential-featured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; }
  .credential-grid { grid-template-columns: minmax(0, 1fr); }
  .project-section { grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); }
  .cs-head { position: sticky; top: calc(var(--header-h) + 5rem); align-self: start; }
  .cs-hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 1fr); }
  .problem-grid { grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 1fr); gap: 3.5rem; }
  .data-grid { grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 1fr); gap: 3.5rem; }
  .hybrid-grid { grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 1fr); gap: 3.5rem; align-items: center; }
  .evaluation-grid { grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1.25fr); gap: 3.5rem; }
  .research-trace { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
  .research-trace::before { top: 1.25rem; bottom: auto; left: 1.25rem; right: 1.25rem; width: auto; height: 1px; background: var(--ap-gradient); }
  .trace-step { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
  .trace-step-details summary { min-height: 2.75rem; }
  .flood-media-grid--focused { max-width: 62rem; }
}

@media (min-width: 1600px) {
  :root { --t-body: 1.0938rem; }
}

@media (max-width: 1100px) {
  .brand-name { display: none; }
}

@media (max-width: 820px) {
  :root { --header-h: 4rem; }
  .brand-name { display: inline; }
  .menu-toggle { display: inline-flex; }
  .primary-navigation {
    position: fixed; inset: var(--header-h) 0 0; z-index: 99;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 1rem var(--gutter) 2rem; overflow-y: auto; background: var(--bg);
  }
  .primary-navigation.is-open { display: flex; animation: ap-fade-in 240ms ease both; }
  .primary-navigation > a { min-height: 3.5rem; border-bottom: 1px solid var(--line); color: var(--text); font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; }
  .primary-navigation > a::after { display: none; }
  .primary-navigation > a[aria-current] { color: var(--accent); }
  .nav-utilities { gap: 0.75rem; margin-top: 1.5rem; padding: 0; border: 0; }
  .nav-utilities a { flex: 1; justify-content: center; min-height: 3rem; border: 1px solid var(--control-border); border-radius: var(--r-pill); }
  .menu-toggle[aria-expanded="true"] .menu-icon i:first-child { transform: translateY(0.18rem) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon i:last-child { transform: translateY(-0.18rem) rotate(-45deg); }
  .hero { min-height: auto; }
  .current-role { max-width: none; }
  .eval-bar-row { grid-template-columns: 7rem minmax(0, 1fr) 3rem; gap: 0.75rem; }
}

@media (max-width: 560px) {
  .brand-name { display: none; }
  .hero-actions .button, .contact-actions .button { flex: 1 1 100%; }
  .work-index { font-size: 2.25rem; }
  .flood-metric-grid { gap: 0.75rem; }
  .model-metrics { grid-template-columns: minmax(0, 1fr); }
  .hero-result dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .archive-item, .archive-programme summary { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .archive-item > .archive-verify { grid-column: 2; justify-self: start; }
  .archive-programme summary .archive-chevron { grid-column: 2; grid-row: 2; justify-self: start; }
  .archive-programme-body { padding-left: 1rem; }
  .archive-badge { width: 2.5rem; height: 2.5rem; }
  .archive-list--path::before { left: 1.25rem; }
  .trace-node { width: 13.5rem; }
  .project-hero-facts > dl > div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .role-facts div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .flood-chart-legend { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .site-header, .section-nav, .archive-nav, .hero-trace, .rail-toggle { display: none; }
  body { background: #fff; color: #111; }
}
