/* Self-hosted. No external host may be contacted at render time.
   These live here rather than in an @import-ed fonts.css for two reasons:
   @import serialises the fetch (the browser must parse this file before it
   even discovers the second one), and an imported file's URL never passes
   through the renderer, so it could never carry a ?v= cache key. */
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/bricolage-grotesque-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/bricolage-grotesque-latin-700-normal.woff2') format('woff2');}
@font-face{font-family:'Archivo';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/archivo-400-normal.woff2') format('woff2');}
@font-face{font-family:'Archivo';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/archivo-600-normal.woff2') format('woff2');}
@font-face{font-family:'Archivo';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/archivo-700-normal.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/jetbrains-mono-400-normal.woff2') format('woff2');}

/* ============================================================
   Yann Pires-Cabral, portfolio.
   Concept: an evidence file. Every figure links to the artefact
   behind it. Neutral ground so the work supplies the colour; one
   signal accent for anything you can act on.

   Shape system: 14px on media and cards, full pill on anything
   interactive (buttons, chips, tabs). Nothing else.
   Layers: 10 topbar, 20 progress, 30 lightbox (native top layer).
   ============================================================ */

:root {
  --bg:       #0E0F11;
  --bg-2:     #15171A;
  --bg-3:     #1E2125;
  --fg:       #ECEDEF;
  --fg-dim:   #A7ABB2;
  --fg-mute:  #8B9099;   /* 5.8:1 on --bg, clears AA at small sizes */
  --accent:   #FF8A5B;
  --on-accent:#16110E;
  --rule:     rgba(236, 237, 239, 0.12);
  --rule-soft:rgba(236, 237, 239, 0.06);
  --shadow:   0 28px 60px -22px rgba(0, 0, 0, 0.7);

  --radius: 14px;
  --maxw: 1240px;
  --gut: clamp(1rem, 4.5vw, 3.5rem);
  --bar: 64px;

  --display: 'Bricolage Grotesque', 'Archivo', system-ui, sans-serif;
  --body: 'Archivo', system-ui, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* Light theme: the system preference unless the reader chose otherwise,
   and the reader's explicit choice either way. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F5F7; --bg-2: #FCFCFD; --bg-3: #E8EAEE;
    --fg: #121418; --fg-dim: #464B53; --fg-mute: #5C6169;
    --accent: #C2410C; --on-accent: #FFF7F2;
    --rule: rgba(18, 20, 24, 0.13); --rule-soft: rgba(18, 20, 24, 0.06);
    --shadow: 0 28px 60px -26px rgba(30, 35, 45, 0.32);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F4F5F7; --bg-2: #FCFCFD; --bg-3: #E8EAEE;
  --fg: #121418; --fg-dim: #464B53; --fg-mute: #5C6169;
  --accent: #C2410C; --on-accent: #FFF7F2;
  --rule: rgba(18, 20, 24, 0.13); --rule-soft: rgba(18, 20, 24, 0.06);
  --shadow: 0 28px 60px -26px rgba(30, 35, 45, 0.32);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

a { color: inherit; }
img, video { display: block; max-width: 100%; }
figure { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; text-wrap: balance; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gut); top: 0.75rem; z-index: 40;
  background: var(--accent); color: var(--on-accent);
  padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 600;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5ch;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 0.95rem/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--rule); }
.btn--ghost:hover { border-color: var(--fg-mute); }
.btn--sm { padding: 0.6rem 1rem; font-size: 0.88rem; }

/* ---------- reading progress ---------- */

.progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block;
      position: fixed; inset: 0 0 auto 0; z-index: 20;
      height: 2px;
      background: var(--accent);
      transform-origin: 0 50%;
      animation: progress linear both;
      animation-timeline: scroll(root);
    }
  }
}
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--bar);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.4s;
}
.topbar.is-scrolled { border-bottom-color: var(--rule); }
@media (prefers-reduced-transparency: reduce) { .topbar { background: var(--bg); backdrop-filter: none; } }

.topbar__inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.topbar__name { font: 700 1.02rem/1 var(--display); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.topbar__nav { display: none; gap: 1.6rem; margin-inline: auto; }
.topbar__nav a {
  position: relative;
  font-size: 0.9rem; color: var(--fg-dim); text-decoration: none; white-space: nowrap;
  padding-block: 0.4rem;
  transition: color 0.25s;
}
.topbar__nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.4s var(--ease);
}
.topbar__nav a:hover, .topbar__nav a.is-active { color: var(--fg); }
.topbar__nav a.is-active::after { transform: scaleX(1); }
.topbar__end { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
@media (min-width: 1040px) {
  .topbar__nav { display: flex; }
  .topbar__end { margin-left: 0; }
}

/* The toggle is a single geometric mark: a disc half lit. */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--rule); color: var(--fg);
  cursor: pointer; transition: border-color 0.25s, transform 0.25s var(--ease);
}
.theme-toggle:hover { border-color: var(--fg-mute); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: transform 0.6s var(--ease);
}
[data-theme="light"] .theme-toggle span { transform: rotate(180deg); }

/* ---------- hero ---------- */

.hero {
  padding-top: calc(var(--bar) + clamp(2.5rem, 7vh, 5rem));
  padding-bottom: clamp(3rem, 8vh, 5rem);
}
.hero__grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 960px) {
  .hero { min-height: min(100dvh, 940px); display: flex; align-items: center; }
  .hero > .wrap { width: 100%; }
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.hero__who { display: flex; align-items: center; gap: clamp(0.9rem, 1.6vw, 1.25rem); }
/* The source is 347px, so it stays sharp on a 2x screen up to about 170px.
   120px is the cap for that reason, not for looks. */
.hero__portrait img {
  width: clamp(72px, 8.5vw, 120px); height: clamp(72px, 8.5vw, 120px);
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--rule);
}
.hero__role-title { font-size: 0.98rem; color: var(--fg-dim); }

.hero__name {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-size: clamp(2.9rem, 6.3vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.hero__name span { display: block; }

.hero__role {
  margin-top: clamp(1.25rem, 3vh, 1.75rem);
  max-width: 44ch;
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.5;
  color: var(--fg-dim);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: clamp(1.75rem, 4vh, 2.5rem); }

/* The work stack: real artefacts, fanned, each a link to its evidence. */
.hero__stack { width: 100%; max-width: 560px; justify-self: center; }
.stack {
  position: relative;
  aspect-ratio: 1 / 0.96;
  transform: perspective(1400px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform 0.6s var(--ease);
}
.stack__card {
  position: absolute;
  width: 62%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transform: rotate(var(--r));
  transition: transform 0.55s var(--ease), box-shadow 0.4s;
}
.stack__card img { width: 100%; height: auto; }
.stack__card:nth-child(1) { left: 0; top: 6%; --r: -7deg; z-index: 1; }
.stack__card:nth-child(2) { right: 0; top: 0; --r: 5deg; z-index: 2; }
.stack__card:nth-child(3) { left: 17%; bottom: 0; --r: -1.5deg; z-index: 3; width: 66%; }
.stack__card:hover, .stack__card:focus-visible {
  z-index: 5;
  transform: rotate(0deg) translateY(-10px) scale(1.035);
}
.stack__caption {
  margin-top: 1.25rem;
  text-align: center;
  font: 400 0.82rem/1.4 var(--mono);
  color: var(--fg-mute);
  min-height: 1.4em;
}
@media (max-width: 959px) {
  .hero__stack { max-width: 460px; }
}

/* ---------- bands under the hero ---------- */

.band { padding-block: clamp(2.5rem, 6vh, 4rem); }
.band--index { padding-top: clamp(2rem, 5vh, 3.5rem); }
.band__title { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -0.02em; margin-bottom: 1.5rem; }

.metrics { display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric:first-child { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .metrics { grid-template-columns: 1.9fr 1fr 1fr 1fr; }
  .metric:first-child { grid-column: auto; }
}

.metric {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  transition: border-color 0.3s;
}
.metric:hover, .metric:focus-visible { border-top-color: var(--accent); }
.metric__num {
  font: 700 clamp(2.2rem, 3.6vw, 3.1rem)/0.95 var(--display);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.metric:first-child .metric__num { font-size: clamp(3rem, 6.4vw, 5.4rem); }
.metric__label { font-size: 0.93rem; color: var(--fg-dim); line-height: 1.4; max-width: 30ch; }
.prov { font-size: 0.84rem; color: var(--fg-mute); transition: color 0.25s; }
.metric:hover .prov, .metric:focus-visible .prov { color: var(--accent); }

/* The thirty-second read: four rows, one jump each. */
.domain-nav { border-bottom: 1px solid var(--rule); }
.domain-nav__row {
  position: relative;
  isolation: isolate;
  display: grid; gap: 0.5rem 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.domain-nav__row::before {
  content: ''; position: absolute; inset: 0 calc(var(--gut) * -0.5); z-index: -1;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: var(--radius);
  transform: scaleY(0.4); opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s;
}
.domain-nav__row:hover::before, .domain-nav__row:focus-visible::before { transform: none; opacity: 1; }
.domain-nav__name {
  font: 700 clamp(1.45rem, 2.6vw, 2.15rem)/1.05 var(--display);
  letter-spacing: -0.025em;
  transition: transform 0.45s var(--ease), color 0.25s;
}
.domain-nav__row:hover .domain-nav__name { transform: translateX(6px); color: var(--accent); }
.domain-nav__lede { color: var(--fg-dim); font-size: 0.98rem; line-height: 1.5; }
.domain-nav__skills { color: var(--fg); font-size: 0.9rem; line-height: 1.5; }
.domain-nav__go {
  display: none;
  font-size: 1.3rem; color: var(--fg-mute);
  transition: transform 0.45s var(--ease), color 0.25s;
}
.domain-nav__row:hover .domain-nav__go { transform: translateX(6px); color: var(--accent); }
@media (min-width: 900px) {
  .domain-nav__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1.1fr) 1.5rem; align-items: center; }
  .domain-nav__go { display: block; justify-self: end; }
}

/* ---------- domains ---------- */

.domain { padding-top: clamp(5rem, 13vh, 9rem); }
.domain__head { max-width: 60rem; }
.domain__title {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.domain__lede {
  margin-top: 1.25rem;
  max-width: 50ch;
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  color: var(--fg-dim);
}

.domain__skills, .chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 1.75rem 0 0; padding: 0; list-style: none;
}
.domain__skills li, .chips li {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 0.88rem;
  line-height: 1.3;
}

/* ---------- exhibits (flagship work) ---------- */

.exhibit { padding-block: clamp(3.5rem, 9vh, 6rem); }

.exhibit__grid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
.exhibit__title { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.02; letter-spacing: -0.03em; }
.meta { margin-top: 0.6rem; font: 400 0.84rem/1.4 var(--mono); color: var(--fg-mute); }
.exhibit__body { margin-top: 1.25rem; max-width: 60ch; }

@media (min-width: 960px) {
  .exhibit--split .exhibit__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  /* The claim stays in view while the evidence scrolls past it. */
  .exhibit--split .exhibit__text { position: sticky; top: calc(var(--bar) + 2rem); }
}

.exhibit__media { display: grid; gap: clamp(0.75rem, 1.6vw, 1.1rem); }
.stills { display: grid; gap: clamp(0.75rem, 1.6vw, 1.1rem); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 599px) { .stills { grid-template-columns: minmax(0, 1fr); } }

.exhibit--stacked .exhibit__text { max-width: 62ch; }
@media (min-width: 960px) {
  .exhibit--stacked .exhibit__media { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .exhibit--stacked .stills { grid-template-columns: minmax(0, 1fr); }
}

/* Arriving from a metric: the claim's title underlines itself, so the reader
   sees where the proof starts. Pure CSS, works with scripting off. */
.exhibit:target .exhibit__title {
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 3px no-repeat;
  animation: sweep 1.1s var(--ease) 0.2s both;
}
@keyframes sweep { from { background-size: 0% 3px; } to { background-size: 100% 3px; } }

.links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin-top: 1.5rem; }
.link {
  font-weight: 600; font-size: 0.93rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
  transition: border-color 0.25s, color 0.25s;
}
.link::after { content: ' \2197'; color: var(--accent); }
.link--in::after { content: ' \2192'; }
.link:hover, .link:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- media ---------- */

.fig {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--rule-soft);
  background: var(--bg-2);
}
.fig img, .fig video { width: 100%; height: auto; }
/* Source media runs up to 1600px square. Uncapped in a wide column a square
   asset renders taller than the viewport and the page becomes a slideshow. */
.fig img { max-height: 78vh; object-fit: cover; }
.fig video { max-height: 62vh; object-fit: cover; }
.fig__zoom { display: block; cursor: zoom-in; overflow: hidden; }
.fig__zoom img { transition: transform 0.8s var(--ease); }
.fig__zoom:hover img { transform: scale(1.025); }
.fig figcaption { padding: 0.8rem 1rem 0.95rem; font-size: 0.86rem; color: var(--fg-dim); line-height: 1.45; }

/* ---------- chapters ---------- */

.chapters {
  margin-top: clamp(3rem, 7vh, 4.5rem);
  padding-top: clamp(2rem, 4vh, 2.5rem);
  border-top: 1px solid var(--rule);
  display: grid; gap: 3rem;
}
.chapter__title { font-size: clamp(1.35rem, 2.3vw, 1.8rem); letter-spacing: -0.02em; line-height: 1.15; }
.chapter__body { margin-top: 0.9rem; max-width: 60ch; color: var(--fg-dim); }
.chapter__media {
  margin-top: 1.5rem;
  display: grid; gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: start;
  max-width: 820px;
}

/* Upgraded by main.js to tabs. Without scripting the chapters stay stacked. */
.chapters.is-tabs { display: block; }
.tabs__list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 2rem; }
.tab {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent; color: var(--fg-dim);
  font: 600 0.92rem/1 var(--body);
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.25s var(--ease);
}
.tab:hover { color: var(--fg); border-color: var(--fg-mute); }
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chapters.is-tabs .chapter[hidden] { display: none; }
@media (min-width: 960px) {
  /* auto + 1fr rows: the media sets the height, and the second row absorbs
     it, so the title and body stay together at the top. */
  .chapters.is-tabs .chapter { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; gap: 0 clamp(2rem, 5vw, 4.5rem); align-items: start; }
  .chapters.is-tabs .chapter__title, .chapters.is-tabs .chapter__body { grid-column: 1; }
  .chapters.is-tabs .chapter__media { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .chapters.is-tabs .chapter:not([hidden]) { animation: rise 0.55s var(--ease) both; }
}

/* ---------- pipeline explainer: a workflow canvas ----------
   Without scripting it is an ordered list with every step written out.
   main.js adds .is-live: nodes snake across a grid, wires are drawn in an
   SVG layer behind them, and a packet walks the steps. */

.pipeline {
  margin-top: clamp(3rem, 7vh, 4.5rem);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background:
    radial-gradient(circle, var(--rule) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--bg-2);
}
.pipeline__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pipeline__title { font-size: clamp(1.3rem, 2.3vw, 1.75rem); letter-spacing: -0.02em; }
.pipeline__canvas { position: relative; margin-top: 1.5rem; }
.pipeline__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pipeline__nodes { position: relative; display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

.node__card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
  width: 100%;
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.45s var(--ease);
}
.node__card:hover { border-color: var(--fg-mute); }
.node--human .node__card { border-style: dashed; }
.node__tag { font: 400 0.74rem/1.2 var(--mono); color: var(--accent); }
.node__name { font: 700 1.02rem/1.25 var(--display); letter-spacing: -0.01em; }
.node__human { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--fg-mute); }
/* A semantic marker, not decoration: it flags the steps a person owns. */
.node__human::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.node__detail { padding: 0.6rem 0.25rem 0.4rem; }
.node__body { color: var(--fg-dim); font-size: 0.95rem; max-width: 62ch; }
.node__nocode { margin-top: 0.5rem; font-size: 0.9rem; color: var(--fg-dim); max-width: 62ch; }
.node__nocode span { display: block; font: 400 0.74rem/1.4 var(--mono); color: var(--fg-mute); }

.pipeline.is-live .node__detail { display: none; }
.pipeline.is-live .node.is-active .node__card {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow);
  transform: translateY(-3px);
}
.pipeline.is-live .pipeline__nodes { gap: 1.75rem; }
/* Equal heights along a row, so every wire meets a node at the same line. */
.pipeline.is-live .node { display: flex; }
.pipeline.is-live .node__card { height: 100%; justify-content: flex-start; }
@media (min-width: 900px) {
  /* A snake: steps 1 to 4 run left to right, the wire drops, 5 to 8 run back. */
  .pipeline.is-live .pipeline__nodes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3rem 3.25rem; }
  .pipeline.is-live .node:nth-child(1) { grid-area: 1 / 1; }
  .pipeline.is-live .node:nth-child(2) { grid-area: 1 / 2; }
  .pipeline.is-live .node:nth-child(3) { grid-area: 1 / 3; }
  .pipeline.is-live .node:nth-child(4) { grid-area: 1 / 4; }
  .pipeline.is-live .node:nth-child(5) { grid-area: 2 / 4; }
  .pipeline.is-live .node:nth-child(6) { grid-area: 2 / 3; }
  .pipeline.is-live .node:nth-child(7) { grid-area: 2 / 2; }
  .pipeline.is-live .node:nth-child(8) { grid-area: 2 / 1; }
}

.wire { fill: none; stroke-width: 2; stroke-linecap: round; }
.wire--base { stroke: var(--rule); }
.wire--lit { stroke: var(--accent); }
/* Hidden unless a packet is in flight; the class lives on the svg. */
.packet { fill: var(--accent); opacity: 0; }
.packet-halo { fill: var(--accent); opacity: 0; }
.pipeline__wires.is-moving .packet { opacity: 1; }
.pipeline__wires.is-moving .packet-halo { opacity: 0.22; }

.pipeline__panel {
  position: relative;
  display: grid; gap: 1rem 2.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.pipeline__panel[hidden] { display: none; }
@media (min-width: 900px) { .pipeline__panel { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.panel__timer {
  position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}
.pipeline__panel.is-timing .panel__timer { animation: timer var(--dwell, 3400ms) linear forwards; }
@keyframes timer { to { transform: scaleX(1); } }
.panel__tag { font: 400 0.8rem/1.3 var(--mono); color: var(--accent); }
.panel__name { margin-top: 0.3rem; font: 700 clamp(1.3rem, 2.2vw, 1.65rem)/1.15 var(--display); letter-spacing: -0.02em; }
.panel__body { margin-top: 0.6rem; color: var(--fg); max-width: 60ch; }
.panel__human { margin-top: 0.8rem; display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--fg-dim); }
.panel__human::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--accent); }
.panel__side { padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--rule-soft); align-self: start; }
.panel__label { font: 400 0.76rem/1.4 var(--mono); color: var(--fg-mute); }
.panel__nocode { margin-top: 0.4rem; font-size: 0.95rem; color: var(--fg-dim); }
@media (prefers-reduced-motion: no-preference) {
  .pipeline__panel .panel__main, .pipeline__panel .panel__side { animation: rise 0.5s var(--ease) both; }
  .pipeline__panel .panel__side { animation-delay: 0.08s; }
  .js .pipeline.is-live .node { opacity: 0; transform: translateY(14px) scale(0.98); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--k, 0) * 70ms); }
  .js .pipeline.is-live.is-drawn .node { opacity: 1; transform: none; }
}

/* ---------- how work gets checked ---------- */

.flow { margin-top: clamp(2.5rem, 6vh, 3.5rem); }
.flow__title { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.015em; }
.flow__steps {
  position: relative;
  display: grid; gap: 1.5rem;
  margin: 1.5rem 0 0; padding: 0; list-style: none;
  counter-reset: none;
}
.flow__step { position: relative; padding-top: 1.4rem; }
/* The connecting rail: neutral underneath, accent drawn across on reveal. */
.flow__steps::before, .flow__steps::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 2px;
}
.flow__steps::before { background: var(--rule); }
.flow__steps::after { background: var(--accent); transform-origin: 0 50%; }
.flow__step::before {
  content: ''; position: absolute; left: 0; top: -5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.flow__name { font: 700 1.15rem/1.2 var(--display); letter-spacing: -0.01em; }
.flow__body { margin-top: 0.45rem; font-size: 0.94rem; color: var(--fg-dim); max-width: 34ch; }
@media (min-width: 820px) {
  .flow__steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
}
@media (max-width: 819px) {
  .flow__steps { padding-left: 1.5rem; }
  .flow__steps::before, .flow__steps::after { left: 5px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .flow__steps::after { transform-origin: 50% 0; }
  .flow__step { padding-top: 0; }
  .flow__step::before { left: calc(-1.5rem - 0px); top: 0.25rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .flow .flow__steps::after { transform: scaleX(0); transition: transform 1.4s var(--ease) 0.2s; }
  .js .flow.is-in .flow__steps::after { transform: none; }
  .js .flow .flow__step { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .js .flow.is-in .flow__step { opacity: 1; transform: none; }
  .js .flow.is-in .flow__step:nth-child(2) { transition-delay: 0.25s; }
  .js .flow.is-in .flow__step:nth-child(3) { transition-delay: 0.5s; }
  .js .flow.is-in .flow__step:nth-child(4) { transition-delay: 0.75s; }
  @media (max-width: 819px) {
    .js .flow .flow__steps::after { transform: scaleY(0); }
  }
}

/* ---------- what broke, and how I found it ---------- */

.incidents { padding-block: clamp(2rem, 5vh, 3rem) clamp(2.5rem, 6vh, 3.5rem); }
.incidents__title { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.025em; }
.incidents__list { margin: 1.75rem 0 0; padding: 0; list-style: none; counter-reset: incident; }
.incident {
  counter-increment: incident;
  display: grid; gap: 0.6rem 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.incident:last-child { border-bottom: 1px solid var(--rule); }
.incident__what { font: 700 clamp(1.15rem, 1.9vw, 1.45rem)/1.25 var(--display); letter-spacing: -0.015em; }
.incident__what::before {
  content: counter(incident);
  display: inline-grid; place-items: center;
  width: 1.7em; height: 1.7em; margin-right: 0.7rem;
  border-radius: 999px; border: 1px solid var(--accent);
  font: 400 0.75em/1 var(--mono); color: var(--accent);
  vertical-align: 0.12em;
}
.incident__body { color: var(--fg-dim); max-width: 62ch; }
@media (min-width: 900px) {
  .incident { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: baseline; }
}

/* ---------- supporting work ---------- */

.support {
  display: grid; gap: clamp(0.75rem, 1.6vw, 1.1rem);
  padding-bottom: clamp(1rem, 3vh, 2rem);
}
@media (min-width: 820px) {
  .support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.card {
  position: relative;
  isolation: isolate;
  display: flex; flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  padding: clamp(1.4rem, 2.6vw, 2rem);
}
/* A light that follows the pointer across the card's surface. */
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover::before { opacity: 1; }
.card .meta { margin-top: 0; }
.card__title { margin-top: 0.5rem; font-size: clamp(1.35rem, 2.1vw, 1.7rem); letter-spacing: -0.02em; line-height: 1.12; }
.card__body { margin-top: 0.85rem; color: var(--fg-dim); font-size: 0.97rem; max-width: 62ch; }
.card .links { margin-top: 1.25rem; }

/* Text-only cards must read as a deliberate choice, not a missing image. */
.card--text {
  background:
    repeating-linear-gradient(135deg, var(--rule-soft) 0 1px, transparent 1px 11px),
    var(--bg-2);
}
.card--text .card__body { color: var(--fg); }
.card__note {
  margin-top: auto;
  padding-top: 1.25rem;
  font: 400 0.8rem/1.4 var(--mono);
  color: var(--fg-mute);
}

.card--media { padding: 0; }
.card--media .fig { border: 0; border-radius: 0; border-bottom: 1px solid var(--rule-soft); }
.card--media .card__text { padding: clamp(1.4rem, 2.6vw, 2rem); }

.card--loan { border-left: 3px solid var(--accent); }
.card--loan .meta { color: var(--accent); }
.card--loan .link { align-self: flex-start; margin-top: 1.25rem; }

/* ---------- arc ---------- */

.arc-section { margin-top: clamp(4rem, 10vh, 7rem); padding-block: clamp(4rem, 10vh, 7rem); border-top: 1px solid var(--rule); }
.arc-section__grid { display: grid; gap: 3rem; }
@media (min-width: 960px) {
  .arc-section__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); }
  .arc-section__head { position: sticky; top: calc(var(--bar) + 2rem); align-self: start; }
}
.arc-section__title { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -0.035em; }
.facts { margin-top: 1.75rem; }
.facts__where { color: var(--fg-dim); }
.facts .chips { margin-top: 1rem; }

.arc { position: relative; margin: 0; padding: 0 0 0 2rem; list-style: none; display: grid; gap: 2.75rem; }
.arc::before, .arc::after {
  content: ''; position: absolute; left: 5px; top: 0.45rem; bottom: 0.45rem; width: 2px; border-radius: 2px;
}
.arc::before { background: var(--rule); }
.arc::after { background: var(--accent); transform-origin: 50% 0; transform: scaleY(0); }
/* The line fills as the reader moves through the years. Without
   scroll-driven animation support it simply stays as the neutral rule. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .arc::after { animation: draw linear both; animation-timeline: view(); animation-range: entry 30% cover 70%; }
  }
}
@keyframes draw { to { transform: scaleY(1); } }
.arc__item { position: relative; }
.arc__item::before {
  content: ''; position: absolute; left: calc(-2rem + 1px); top: 0.3rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.arc__when { font: 400 0.86rem/1.4 var(--mono); color: var(--accent); }
.arc__what { margin-top: 0.6rem; max-width: 60ch; font-size: 1.05rem; }

/* ---------- contact ---------- */

.contact { padding-block: clamp(5rem, 14vh, 9rem) 3rem; border-top: 1px solid var(--rule); }
.contact__title { font-size: clamp(3rem, 9vw, 7.5rem); line-height: 0.92; letter-spacing: -0.045em; }
.contact__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 2.25rem; }
.contact__address {
  font: 500 clamp(1.25rem, 3.3vw, 2.3rem)/1.2 var(--display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.25s, color 0.25s;
}
.contact__address:hover { color: var(--accent); text-decoration-color: var(--accent); }
.contact__list { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.colophon {
  margin-top: clamp(4rem, 10vh, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  max-width: 62ch;
  font-size: 0.9rem;
  color: var(--fg-mute);
}

/* ---------- lightbox (built by main.js) ---------- */

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: clamp(1rem, 4vw, 3rem);
  border: 0; background: transparent; color: #ECEDEF;
  display: none; place-items: center; align-content: center; gap: 1rem;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgba(9, 10, 12, 0.88); backdrop-filter: blur(6px); }
.lightbox__img {
  max-width: min(94vw, 1600px); max-height: 82vh; width: auto; height: auto;
  border-radius: 10px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}
.lightbox__cap { max-width: 70ch; text-align: center; font-size: 0.92rem; color: #B7BBC2; }
.lightbox__close { position: fixed; top: 1rem; right: 1rem; color: #ECEDEF; border-color: rgba(236, 237, 239, 0.25); }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lightbox__img { animation: zoom-in 0.45s var(--ease) both; }
}
@keyframes zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Gated on .js, which an inline head script sets. Without it every
     .reveal block would sit at opacity 0 forever when scripting is off. */
  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .hero__who, .hero__name, .hero__role, .hero__cta { animation: rise 0.9s var(--ease) both; }
  .hero__name { animation-delay: 0.07s; }
  .hero__role { animation-delay: 0.16s; }
  .hero__cta { animation-delay: 0.24s; }

  /* Cards deal in, then hand transform back to the hover state: fill-mode
     backwards, never both, or the last keyframe would pin the transform. */
  .stack__card { animation: deal 1s var(--ease) backwards; animation-delay: calc(0.3s + var(--i) * 0.12s); }
}
/* Masked line reveals: each headline line rises out of its own clip, so the
   type arrives the way it reads, top line first. */
.ln { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.ln > span { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .hero__name { animation: none; }
  .hero__name .ln > span { animation: line-up 1.05s var(--ease) both; }
  .hero__name .ln + .ln > span { animation-delay: 0.1s; }
  .js .domain__title .ln > span { transform: translateY(105%); transition: transform 1s var(--ease); }
  .js .domain__head.is-in .domain__title .ln > span { transform: none; }

  /* Evidence images settle from a slight zoom as they scroll into view.
     Scroll-driven, so it costs no script and stops when the reader stops. */
  @supports (animation-timeline: view()) {
    .exhibit .fig--hero picture { display: block; animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  }

  .topbar { animation: bar-in 0.8s var(--ease) 0.1s both; }
}
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes bar-in { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------- the one marquee: every tool across the four domains ---------- */

.marquee {
  display: flex; gap: 0;
  margin-top: clamp(4rem, 10vh, 6rem);
  padding-block: 1.1rem;
  border-block: 1px solid var(--rule);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  flex: none;
  display: flex; gap: 2.5rem;
  margin: 0; padding: 0 2.5rem 0 0; list-style: none;
}
.marquee__track li {
  font: 500 clamp(1.1rem, 2vw, 1.5rem)/1.2 var(--display);
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: var(--fg-dim);
}
.marquee__track li::after { content: '/'; margin-left: 2.5rem; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 60s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .marquee__track[aria-hidden] { display: none; }
  .marquee__track { flex-wrap: wrap; padding-inline: var(--gut); gap: 0.5rem 2.5rem; }
}
@keyframes marquee { to { transform: translateX(-100%); } }

/* Magnetic buttons: main.js writes --mx/--my from the pointer. */
.btn--primary { translate: var(--bx, 0) var(--by, 0); transition: translate 0.35s var(--ease), transform 0.25s var(--ease), background-color 0.25s; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes deal { from { opacity: 0; transform: translateY(48px) rotate(0deg) scale(0.96); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
  .stack { transform: none !important; }
}
