/* mugheesulhaq.online
   Hand-written styles. There is no CSS build step: edit this file, then run
   "node build.mjs" so the pages pick up the new version number. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #121110;
  --raised: #1A1816;
  --text: #ECE7E1;
  --muted: #A39D95;
  --line: #2C2925;
  --accent: #F65441;
  --on-accent: #121110;
  --mark: #6B665E;
  --dim: #3A3631;
  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 6px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --raised: #F6F5F3;
  --text: #191715;
  --muted: #5E5952;
  --line: #E3E0DB;
  --accent: #C7341F;
  --on-accent: #FFFFFF;
  --mark: #8F8A82;
  --dim: #D8D4CE;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.62 var(--sans); -webkit-font-smoothing: antialiased; }
img, video, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, select { font: inherit; color: inherit; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; font-stretch: 100%; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2.1vw, 1.65rem); }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 30; padding: .6rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip:focus { top: 1rem; color: var(--on-accent); }

figcaption { color: var(--muted); font-size: .875rem; line-height: 1.5; margin-top: .6rem; }
code { font-family: var(--mono); font-size: .92em; background: var(--raised); padding: .1em .35em; border-radius: 4px; }
s.cut { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; color: var(--muted); }
.lbl { font-weight: 600; }

.btn { display: inline-block; background: var(--accent); color: var(--on-accent); padding: .7rem 1.15rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.45; max-width: 44rem; }

/* ---------- header ---------- */
.site-head { padding-block: 1.25rem; }
.head-row { display: flex; align-items: center; gap: .75rem 1.5rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.15rem; text-decoration: none; margin-right: auto; }
.site-head nav { display: flex; gap: 1.5rem; margin-left: auto; }
.site-head nav a { color: var(--muted); font-size: .95rem; text-decoration: none; padding-block: .25rem; border-bottom: 2px solid transparent; }
.site-head nav a:hover { color: var(--text); }
.site-head nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.is-home nav { margin-left: 0; }
.theme { display: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; padding: 0; }
.js .theme { display: inline-flex; align-items: center; justify-content: center; }
.is-home .theme { margin-left: auto; }
.theme:hover { color: var(--text); border-color: var(--muted); }
@media (max-width: 40rem) {
  .site-head nav { order: 3; width: 100%; margin-left: 0; gap: 1.25rem; }
  .is-home nav { order: 0; width: auto; gap: 1rem; }
  .is-home nav a { font-size: .9rem; }
}
/* Very narrow phones: keep the home nav and the theme button on one row. */
@media (max-width: 22rem) {
  .is-home .head-row { column-gap: .5rem; }
  .is-home nav { gap: .6rem; }
  .is-home .theme { width: 2rem; height: 2rem; }
}

/* ---------- home: hero ---------- */
/* The name, the pitch and a plain portrait are in the HTML. The training panel only adds to them. */
.hero { padding-block: clamp(1rem, 3vw, 2.25rem) clamp(3rem, 7vw, 5.5rem); overflow-x: clip; }
.hero-grid { display: grid; gap: 1.5rem; grid-template-areas: "name" "pitch" "live" "links"; }
.name-box { grid-area: name; container-type: inline-size; }
.name { font-weight: 800; font-stretch: 125%; text-transform: uppercase; line-height: .9; letter-spacing: -0.02em; font-size: clamp(3rem, 13.5vw, 8.5rem); }
@supports (font-size: 1cqw) { .name { font-size: 15cqw; } }
.name .l1, .name .l2 { display: block; white-space: nowrap; will-change: transform; }
.name .l2 { color: var(--bg); -webkit-text-stroke: .028em var(--text); paint-order: stroke fill; }
.nw { white-space: nowrap; }
.hero-pitch { grid-area: pitch; }
.hero-line { font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.4; max-width: 34rem; }
.hero-links { grid-area: links; align-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); grid-template-rows: auto auto 1fr; column-gap: clamp(2rem, 4vw, 3.5rem); grid-template-areas: "name live" "pitch live" "links live"; }
  .name-box { padding-top: clamp(.5rem, 2vw, 1.75rem); }
}
@media (max-width: 30rem) {
  .hero-links .btn { flex: 1 0 100%; text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .fx .name .l1 { transform: translateX(calc(var(--q, 0) * -7vw)); }
  .fx .name .l2 { transform: translateX(calc(var(--q, 0) * 7vw)); }
}

/* ---------- the training panel ---------- */
/* Dark in both themes: it is a screen showing a picture being learnt. */
.live { grid-area: live; align-self: start; background: #0B0A09; color: #ECE7E1; border: 1px solid #2C2925; border-radius: 10px; overflow: hidden; font-family: var(--mono); font-size: .8rem; line-height: 1.45; }
.live-stage { position: relative; aspect-ratio: 1; background: #000; touch-action: pan-y; cursor: crosshair; }
.live-stage > img, .live-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-stage > canvas { opacity: 0; transition: opacity .35s; }
.is-live .live-stage > canvas { opacity: 1; }
.live-ui { display: grid; gap: .75rem; padding: .9rem 1rem 1rem; }
.live-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.live-read dt { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #A39D95; }
.live-read dd { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-curve { display: block; width: 100%; height: 44px; border-bottom: 1px solid #2C2925; }
.live-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.live-ctl label, .live-form label { color: #A39D95; }
.live-ctl input[type="range"] { flex: 1 1 7rem; min-width: 0; accent-color: #F65441; }
.live button { font: inherit; color: inherit; background: none; border: 1px solid #3A3631; border-radius: 4px; padding: .35rem .6rem; cursor: pointer; }
.live button:hover { border-color: #F65441; color: #F65441; }
.live :focus-visible { outline-color: #F65441; }
.live-msg { color: #ECE7E1; }
.live-msg:empty { display: none; }
.live-stage .live-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: .65rem .85rem; background: rgba(11, 10, 9, .9); border-top: 2px solid #F65441; cursor: default; }
.live .live-link { border: 0; padding: 0; color: #F65441; text-decoration: underline; text-underline-offset: .2em; }
.live-cap { font-family: var(--sans); font-size: .85rem; line-height: 1.5; color: #A39D95; }
.live-wide .live-stage { aspect-ratio: 3 / 1; cursor: default; }
.play .live { margin-top: 2rem; max-width: 50rem; }
.live-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.live-form input { flex: 1 1 10rem; min-width: 0; font: inherit; font-size: 1rem; color: #ECE7E1; background: #171513; border: 1px solid #3A3631; border-radius: 4px; padding: .5rem .65rem; }
.live .live-form button { background: #F65441; border-color: #F65441; color: #121110; font-weight: 600; padding: .55rem .9rem; }
.live .live-form button:hover { color: #121110; filter: brightness(1.08); }

/* ---------- the band of project names under the hero ---------- */
.runby { overflow: hidden; padding-block: clamp(1.25rem, 3vw, 2.25rem); border-block: 1px solid var(--line); }
.runby p { display: flex; gap: .55em; width: max-content; white-space: nowrap; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(2.2rem, 6.5vw, 5.25rem); line-height: 1.08; text-transform: uppercase; letter-spacing: -0.01em; color: var(--dim); transform: translateX(calc(var(--p, .5) * -32%)); will-change: transform; }
.runby p + p { color: var(--bg); -webkit-text-stroke: 1.5px var(--mark); paint-order: stroke fill; transform: translateX(calc(-36% + var(--p, .5) * 32%)); }
.runby span + span::before { content: '/'; margin-right: .55em; color: var(--accent); -webkit-text-stroke: 0; }

/* ---------- motion tied to scrolling ---------- */
/* site.js adds "fx" to <html> only when it runs and motion is allowed, so nothing is hidden without it. */
@media (prefers-reduced-motion: no-preference) {
  .rv { transition: opacity .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s), transform .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }
  .fx .rv:not(.in) { opacity: 0; transform: translateY(1.75rem); }
  .fx [data-split].rv:not(.in) { opacity: 1; transform: none; }
  [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
  [data-split] .w > span { display: inline-block; transition: transform .8s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 70ms); }
  .fx [data-split]:not(.in) .w > span { transform: translateY(115%); }
}

/* ---------- side rail: where you are on the page ---------- */
.rail { display: none; }
@media (min-width: 88rem) {
  .rail { position: fixed; right: 1rem; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: .15rem; }
  .rail a { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding-block: .4rem; font-size: .72rem; color: var(--muted); text-decoration: none; }
  .rail a::after { content: ''; width: 1rem; height: 2px; background: var(--mark); transition: width .3s, background-color .3s; }
  .rail a span { opacity: 0; transform: translateX(.4rem); transition: opacity .3s, transform .3s; }
  .rail a:hover span, .rail a:focus-visible span, .rail a[aria-current] span { opacity: 1; transform: none; }
  .rail a[aria-current] { color: var(--text); }
  .rail a[aria-current]::after { width: 1.75rem; background: var(--accent); }
}

/* ---------- home: bands, projects, facts ---------- */
.band > .wrap { border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.band h2, .contact h2 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1; font-size: clamp(2.1rem, 6vw, 4.5rem); }
.band h2 { margin-bottom: 1.75rem; }
.start { color: var(--muted); max-width: 44rem; margin-bottom: 1rem; }
.after { margin-top: 2rem; }

.chart-panel { background: var(--raised); border-radius: var(--radius); padding: 1.5rem; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
.facts > div { border-top: 1px solid var(--line); padding-top: .7rem; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { font-weight: 600; font-size: 1.35rem; line-height: 1.25; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.facts dd.n { font-weight: 400; font-size: .85rem; color: var(--muted); line-height: 1.4; margin-top: .2rem; }
.facts s.cut { font-weight: 500; }
@media (min-width: 56rem) { .facts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .facts dd { font-size: 1.15rem; } .facts dd.n { font-size: .85rem; } }

.sub { margin-top: clamp(2.5rem, 6vw, 4rem); margin-bottom: 1rem; }
.more-list li { border-top: 1px solid var(--line); }
.more-list li:last-child { border-bottom: 1px solid var(--line); }
.more-list a { display: grid; gap: .25rem 2rem; padding-block: 1.1rem; text-decoration: none; }
.more-list a:hover { color: inherit; }
.more-list a:hover .ml-name { color: var(--accent); }
@media (min-width: 46rem) { .more-list a { grid-template-columns: 4fr 8fr; align-items: baseline; } }
.ml-name { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.ml-desc { color: var(--muted); }

/* ---------- tally: one bar per logged run ---------- */
.tally { margin-top: 2rem; }
.tally-row { display: grid; grid-template-columns: 11.5rem 1fr; gap: .5rem 1rem; align-items: center; padding-block: .3rem; }
.tally-label { font-size: .9rem; color: var(--muted); text-decoration: none; }
.tally-label:hover { color: var(--text); }
.tally-bars { display: flex; flex-wrap: wrap; gap: 6px 5px; }
.t { position: relative; width: 18px; height: 8px; border-radius: 1px; background: var(--muted); }
.t.k { background: var(--dim); }
.t.k::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; margin-top: -1px; background: var(--accent); transform-origin: left center; transition: transform .45s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 9ms); }
.js .tally:not(.in) .t.k::after { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .t.k::after { transition: none; }
  .js .tally:not(.in) .t.k::after { transform: none; }
}
.tally figcaption { margin-top: 1rem; }
@media (max-width: 40rem) {
  .tally-row { grid-template-columns: 1fr; gap: .25rem; padding-block: .45rem; }
  .t { width: 12px; height: 6px; }
  .tally-bars { gap: 5px 4px; }
}

/* ---------- home: three killed runs ---------- */
.kcards { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 56rem) { .kcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kcard { background: var(--raised); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.kmeta { font-size: .85rem; color: var(--muted); }
.kcard h3 { font-size: 1.25rem; line-height: 1.25; }
.kres { font-weight: 600; font-variant-numeric: tabular-nums; }
.knote { color: var(--muted); font-size: .95rem; }
.klink { margin-top: auto; padding-top: .4rem; font-size: .95rem; }
.kcard h3 s, .run[data-verdict="killed"] .run-title { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; }

/* ---------- run rows ---------- */
.runs { container-type: inline-size; border-top: 1px solid var(--line); }
.run { border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.run summary { list-style: none; cursor: pointer; padding-block: .8rem; }
.run summary::-webkit-details-marker { display: none; }
.run-sum { display: grid; grid-template-columns: 3.6rem minmax(0, 1.4fr) minmax(0, 1fr) 6rem 1rem; gap: .25rem 1rem; align-items: baseline; }
.run-sum::after { content: '+'; color: var(--muted); text-align: right; }
.run[open] .run-sum::after { content: '\2212'; }
.run-id { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.run-title { font-weight: 500; }
.run-result { font-variant-numeric: tabular-nums; }
.run-verdict { font-size: .9rem; color: var(--muted); }
.run[data-verdict="shipped"] .run-verdict { color: var(--text); font-weight: 600; }
.run summary:hover .run-id { color: var(--text); }
.run-body { padding: 0 0 1.1rem 4.6rem; max-width: 50rem; }
.run-body p + p { margin-top: .5rem; }
.run-setup { color: var(--muted); font-size: .95rem; }
@container (max-width: 44rem) {
  .run-sum { grid-template-columns: 3.2rem minmax(0, 1fr) 1rem; grid-template-areas: "id title mark" ". result ." ". verdict ."; }
  .run-id { grid-area: id; }
  .run-title { grid-area: title; }
  .run-result { grid-area: result; }
  .run-verdict { grid-area: verdict; }
  .run-sum::after { grid-area: mark; }
  .run-body { padding-left: 0; }
}

/* ---------- experiments page ---------- */
.vlegend { display: grid; gap: .35rem 2rem; margin-top: 2rem; font-size: .9rem; color: var(--muted); }
@media (min-width: 46rem) { .vlegend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vlegend b { color: var(--text); font-weight: 600; }
.filters { display: none; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 2.5rem; }
.js .filters { display: flex; }
.fbtn { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: var(--radius); padding: .35rem .8rem; font-size: .9rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.fbtn:hover { color: var(--text); border-color: var(--muted); }
.fbtn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
#fproj { margin-left: auto; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .6rem; font-size: .9rem; max-width: 100%; }
@media (max-width: 40rem) { #fproj { margin-left: 0; width: 100%; } }
.fcount { display: none; color: var(--muted); font-size: .9rem; margin-top: .75rem; }
.js .fcount { display: block; }
.run-group { margin-top: 3rem; }
.run-group h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.rg-meta { color: var(--muted); font-size: .95rem; margin: .35rem 0 1rem; max-width: 46rem; }

/* ---------- inner pages ---------- */
.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem); }
.crumb { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.crumb a { text-decoration: none; }
.crumb a::before { content: '\2190\00a0'; }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-top: 1.25rem; }
.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-top: 2rem; }
@media (min-width: 56rem) { .meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.meta dt { font-size: .85rem; color: var(--muted); }
.meta dd { font-size: .95rem; margin-top: .1rem; }

.work-top { margin-bottom: 2.5rem; }
.work-top .fig { max-width: 900px; }
/* On wide screens the caption sits beside the picture, level with its bottom edge. */
@media (min-width: 64rem) {
  .work-top .fig { max-width: none; display: grid; grid-template-columns: minmax(0, 900px) minmax(0, 1fr); gap: 1.5rem; align-items: end; }
  .work-top .fig figcaption { margin: 0 0 .15rem; }
}
.work-top .chart-panel { max-width: 46rem; }
.work .facts-4 { margin-bottom: clamp(2rem, 4vw, 3rem); }
.work, .runs-page, .about-page { padding-bottom: clamp(3rem, 7vw, 5rem); }

.sec { padding-block: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 60rem) {
  .sec { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
  .sec.wide { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}
.sec > h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.sec-body > * + * { margin-top: 1.1rem; }
.sec-body > p, .sec-body > ul, .sec-body > .formula { max-width: 43rem; }
.sec-body > .fig, .sec-body > .pair, .sec-body > .table-wrap, .sec-body > .chart-panel { max-width: 52rem; }
.sec-body > ul { list-style: disc; padding-left: 1.25rem; }
.sec-body > ul li + li { margin-top: .5rem; }
.sec-body > ul li::marker { color: var(--mark); }
.sec-body > ul.xp { list-style: none; padding-left: 0; }
.xp li + li { margin-top: 1.1rem; }
.xp .when { display: block; font-size: .85rem; color: var(--muted); }
.xp .what { display: block; font-weight: 500; }
.xp .xp-more { display: block; color: var(--muted); }

.fig img { border-radius: var(--radius); width: 100%; }
.pair { display: grid; gap: 1.5rem; }
@media (min-width: 40rem) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem 1rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .85rem; font-weight: 400; color: var(--muted); }
tbody th { font-weight: 500; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); font-size: .9rem; }

.formula { font-family: var(--mono); font-size: .9rem; line-height: 1.7; background: var(--raised); border-radius: var(--radius); padding: 1rem 1.25rem; overflow-x: auto; white-space: pre; }
.credit { color: var(--muted); font-size: .875rem; margin-top: .75rem; }
.loop { width: 100%; border-radius: var(--radius); background: var(--raised); margin-bottom: 2.5rem; }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 1rem; }
.pager a { text-decoration: none; display: block; }
.pager .pl { display: block; font-size: .85rem; color: var(--muted); }
.pager .pn { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.pager .next { text-align: right; grid-column: 2; }
.pager a:hover { color: inherit; }
.pager a:hover .pn { color: var(--accent); }

/* ---------- annotation plates ---------- */
.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 46rem) { .plates { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .plates { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.plate { display: block; border-radius: 4px; overflow: hidden; }
.plate img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.plates-more { margin-top: .75rem; }
.plates-more summary { cursor: pointer; color: var(--muted); font-size: .95rem; padding-block: .4rem; width: fit-content; }
.plates-more summary:hover { color: var(--text); }
.plates-more[open] summary { margin-bottom: .75rem; }
.plates-group, .plates-full { margin-top: 2rem; }
.plates-full .fig + .fig { margin-top: 1.5rem; }
.sub-s { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: .75rem; }

/* ---------- charts: one bar-list component ---------- */
.chart { container-type: inline-size; }
.chart-title { font-size: .95rem; font-weight: 600; color: var(--text); margin: 0 0 .9rem; line-height: 1.35; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.legend li { display: flex; align-items: center; gap: .45rem; }
.sw { width: .7rem; height: .7rem; border-radius: 2px; background: var(--mark); flex: none; }
.sw.emph { background: var(--accent); }
.bars { display: flex; flex-direction: column; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 13rem) minmax(0, 1fr); gap: 0 .9rem; align-items: stretch; min-height: 28px; padding-inline: .4rem; margin-inline: -.4rem; border-radius: 4px; }
/* Where subgrid is supported the label column is only as wide as the longest label in the chart. */
@supports (grid-template-columns: subgrid) {
  .bars { display: grid; grid-template-columns: fit-content(13rem) minmax(0, 1fr); column-gap: .9rem; }
  .bar-row { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
.bar-row:hover, .bar-row:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); }
.bar-label { font-size: .9rem; line-height: 1.3; align-self: center; padding-block: .3rem; }
.bar-tracks { border-left: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-block: .4rem; min-width: 0; }
.bar-line { display: flex; align-items: center; gap: .5rem; }
.bar { flex: none; height: 14px; width: calc(var(--v) * (100% - var(--reserve, 5rem))); min-width: 2px; background: var(--mark); border-radius: 0 4px 4px 0; }
.bar.emph { background: var(--accent); }
.bar-val { font-size: .9rem; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-tag { color: var(--muted); font-weight: 400; }
.chart-note { color: var(--muted); font-size: .875rem; line-height: 1.5; margin-top: .9rem; }
@container (max-width: 30rem) {
  .bars { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(0, 1fr); padding-block: .3rem; }
  .bar-label { padding-block: 0 .2rem; }
  .bar-tracks { padding-block: .15rem; }
}
.tip { position: fixed; z-index: 20; pointer-events: none; max-width: 18rem; padding: .5rem .7rem; border-radius: var(--radius); background: var(--text); color: var(--bg); font-size: .85rem; line-height: 1.4; }
.tip b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.tip span { display: block; }
.tip .x { opacity: .8; margin-top: .2rem; }

/* ---------- about ---------- */
.about-row { display: grid; gap: 1.75rem; }
@media (min-width: 46rem) { .about-row { grid-template-columns: 220px minmax(0, 40rem); gap: 3rem; align-items: start; } }
.about-row img { width: 220px; border-radius: var(--radius); }
.about-row div > * + * { margin-top: 1rem; }
.about-top { display: grid; gap: 2rem; padding-bottom: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 52rem) { .about-top { grid-template-columns: 280px minmax(0, 43rem); gap: 3.5rem; align-items: start; } }
.about-top img { width: 280px; max-width: 60%; border-radius: var(--radius); }
@media (min-width: 52rem) { .about-top img { max-width: 100%; } }
.about-top .prose > * + * { margin-top: 1rem; }
.skills { display: grid; gap: 1rem; max-width: 43rem; }
.skills dt { font-size: .85rem; color: var(--muted); }

/* ---------- outside work (only rendered when data/site.js has items) ---------- */
.off { display: grid; gap: 2rem; }
@media (min-width: 46rem) { .off { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.off img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: .8rem; }
.off h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.off p { color: var(--muted); }

/* ---------- contact ---------- */
.contact > .wrap { border-top: 1px solid var(--line); padding-block: clamp(4rem, 9vw, 7rem) 3rem; }
.contact h2 { margin-bottom: 1rem; }
.contact p { max-width: 40rem; }
.big-mail { display: inline-block; margin-top: 1.5rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 5.4vw, 4rem); line-height: 1.1; letter-spacing: -0.02em; text-decoration-thickness: 3px; text-underline-offset: .12em; overflow-wrap: anywhere; }
.contact-links { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 2rem; }
.fine { color: var(--muted); font-size: .875rem; margin-top: 3rem; }

/* ---------- learned headings (home) ----------
   live.js lays a canvas over the heading and a fresh small network learns the letters from noise.
   The real text stays in the page and owns the layout; it fades back in when the network is done. */
.lh { position: relative; transition: color .7s ease; }
.lh > canvas { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .7s ease; }
.lh.is-learning { color: transparent; transition: none; }
.lh.is-learning > canvas { opacity: 1; transition: none; }

/* ---------- selected work: the sideways track ----------
   Phones: a swipe row. Wide screens without the script or with reduced motion: a grid.
   Wide screens with the script: the section pins and the row moves sideways as you scroll ("track-on", set by site.js). */
.work > .wrap { border-top: 0; padding-top: 0; }
.track-head { border-top: 1px solid var(--line); padding-top: clamp(3.5rem, 8vw, 6.5rem); display: grid; gap: .5rem 3rem; }
.band .track-head h2 { margin-bottom: 0; }
.track-intro .start { margin-bottom: 0; }
.track-hint { display: none; }
.track-row { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 2rem 1.25rem 1.25rem; scroll-padding-inline: 1.25rem; scrollbar-width: thin; scrollbar-color: var(--mark) transparent; }
.track-foot { display: none; }
.panel { position: relative; flex: 0 0 min(84vw, 26rem); scroll-snap-align: start; display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .3s; }
.panel:hover, .panel:focus-within { border-color: var(--mark); }
.panel-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #0B0A09; flex: none; container-type: inline-size; }
.panel-media img { width: 100%; height: 100%; object-fit: cover; transform: translateX(calc(var(--o, 0) * -6%)) scale(1.14); transition: filter .4s; }
.panel:hover .panel-media img { filter: brightness(1.08); }
.panel-chart { background: var(--bg); padding: 1.25rem; aspect-ratio: auto; display: flex; flex-direction: column; justify-content: center; }
.panel-chart .chart-title { font-size: .85rem; }
.panel-big { display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: #0B0A09; color: #ECE7E1; }
.panel-big span { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(2rem, 15cqi, 4.75rem); line-height: .95; letter-spacing: -0.02em; text-align: center; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .1em .3em; }
.panel-big s { font-size: .5em; color: #6B665E; text-decoration-color: #F65441; text-decoration-thickness: .1em; }
.panel-big b { font-weight: 800; }
.panel-text { padding: 1.2rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: .65rem; flex: 1 1 auto; min-height: 0; }
.panel-n { font-family: var(--mono); font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel-n span { color: var(--accent); }
.panel h3 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.015em; font-size: clamp(1.25rem, 1.9vw, 1.7rem); line-height: 1; }
.panel h3 a { text-decoration: none; }
.panel h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.panel h3 a:focus-visible { outline: 0; }
.panel:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.panel-fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15em .45em; font-family: var(--display); font-variant-numeric: tabular-nums; }
.panel-fig b { font-weight: 800; font-stretch: 125%; font-size: clamp(1.7rem, 2.8vw, 2.5rem); line-height: 1; letter-spacing: -0.02em; }
.panel-fig s { color: var(--mark); font-size: 1.15rem; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.panel-k { flex-basis: 100%; font-family: var(--sans); font-size: .82rem; line-height: 1.4; color: var(--muted); }
.panel-line { color: var(--muted); font-size: .93rem; line-height: 1.5; }
.panel-go { margin-top: auto; padding-top: .3rem; font-size: .9rem; font-weight: 600; }
.panel-go::after { content: '\2192'; display: inline-block; margin-left: .4em; color: var(--accent); transition: transform .3s; }
.panel:hover .panel-go::after { transform: translateX(.3em); }
/* The big figure is already in the media slot of panels without a picture. */
.panel:has(.panel-big) .panel-fig b, .panel:has(.panel-big) .panel-fig s { display: none; }
@media (min-width: 60rem) {
  .track-head { grid-template-columns: auto minmax(0, 30rem); align-items: end; justify-content: space-between; }
  html:not(.track-on) .track-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.25rem; overflow: visible; width: min(100% - 2.5rem, 72rem); margin-inline: auto; padding-inline: 0; }
  html:not(.track-on) .panel { grid-column: span 2; }
  html:not(.track-on) .panel.lead { grid-column: span 3; }
}
.track-on .track { position: relative; }
.track-on .track-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(1rem, 3.5vh, 2.25rem); }
.track-on .track-head { border-top: 0; padding-top: 0; }
.track-on .track-hint { display: block; color: var(--muted); font-size: .85rem; margin-top: .6rem; font-family: var(--mono); }
.track-on .track-row { width: max-content; overflow: visible; scroll-snap-type: none; padding: 0 max(1.25rem, calc((100vw - 72rem) / 2)); gap: 1.5rem; will-change: transform; }
.track-on .panel { width: 27rem; flex: 0 0 auto; height: min(60vh, 38rem); }
.track-on .panel .panel-media { aspect-ratio: auto; flex: 0 0 52%; }
.track-on .panel.lead { width: min(66vw, 64rem); flex-direction: row; }
.track-on .panel.lead .panel-media { flex: 0 0 50%; height: 100%; }
.track-on .panel.lead .panel-text { padding: clamp(1.4rem, 2.5vw, 2.25rem); justify-content: safe center; gap: .8rem; overflow: hidden; }
.track-on .panel.lead h3 { font-size: clamp(1.4rem, 2vw, 2rem); }
.track-on .panel.lead .panel-fig b { font-size: clamp(2rem, 3.2vw, 3rem); }
.track-on .track-foot { display: flex; align-items: center; gap: 1rem; }
.track-bar { display: block; flex: 1; height: 2px; background: var(--line); }
.track-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(var(--tp, 0)); }
@media (max-height: 40rem) { .track-on .track-hint, .track-on .track-intro .start { display: none; } }

/* ---------- experiments: the wall of runs ---------- */
.wall { margin-top: 2.5rem; }
.wall-count { display: flex; flex-wrap: wrap; gap: 1rem clamp(2rem, 6vw, 4.5rem); margin-bottom: 1.75rem; }
.wall-count dt { font-size: .85rem; color: var(--muted); }
.wall-count dd { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(2.8rem, 8vw, 6rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wall-count div:nth-child(2) dd { color: var(--mark); }
.wall-count div:nth-child(3) dd { color: var(--accent); }
.wall-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr)); gap: 4px; }
.c { position: relative; font-family: var(--mono); font-size: .66rem; line-height: 1; padding: .95rem .2rem; text-align: center; border-radius: 3px; background: var(--dim); color: var(--text); cursor: default; transition: background-color .35s, color .35s, box-shadow .35s; }
.c[data-v="shipped"] { background: var(--accent); color: var(--on-accent); }
.c[data-v="killed"] { background: transparent; box-shadow: inset 0 0 0 1px var(--dim); color: var(--mark); }
.c[data-v="killed"]::after { content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; margin-top: -1px; background: var(--accent); transform-origin: left center; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.c:hover { box-shadow: inset 0 0 0 2px var(--text); }
.fx .wall-cells .c:not(.on) { background: transparent; color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); }
.fx .wall-cells .c:not(.on)::after { transform: scaleX(0); }
.wall figcaption { margin-top: 1.25rem; max-width: 46rem; }
@media (max-width: 40rem) { .wall-cells { grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 3px; } .c { font-size: .56rem; padding: .75rem .1rem; } }

/* ---------- about: words light up as you read down ---------- */
.fx .read .rw { color: var(--dim); transition: color .25s; }
.fx .read .rw.on { color: inherit; }

/* ---------- contact: copy the address ---------- */
.contact .mail-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem 1.5rem; max-width: none; }
.copy { border: 1px solid var(--line); background: none; border-radius: var(--radius); padding: .45rem .85rem; font-size: .9rem; color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--muted); }
.copied { color: var(--muted); font-size: .9rem; min-height: 1.4em; margin-top: .5rem; }
.track-on .rail a[aria-current][href="#work"] span { opacity: 0; }

/* =====================================================================
   Model output: the lab figures on the work pages and their stills.
   Every box, mask and point below was saved from a real model run (data/lab.json).
   lab.js adds "ready" to a figure; without it each figure still shows a static result.
   ===================================================================== */
.sec-body > .lab, .sec-body > .flow { max-width: 56rem; }
.work-top .lab { max-width: 64rem; }
.lab-items { position: relative; border-radius: 10px; overflow: hidden; background: #0B0A09; border: 1px solid var(--line); }
.lab-item + .lab-item { border-top: 1px solid #2C2925; }
.lab.ready .lab-item:not(.on) { display: none; }
.lab.ready .lab-item + .lab-item { border-top: 0; }
/* Corner marks, like a viewfinder. */
.lab-items::before { content: ''; position: absolute; inset: .6rem; z-index: 3; pointer-events: none; opacity: .75;
  background:
    linear-gradient(#ECE7E1, #ECE7E1) 0 0 / 14px 1.5px, linear-gradient(#ECE7E1, #ECE7E1) 0 0 / 1.5px 14px,
    linear-gradient(#ECE7E1, #ECE7E1) 100% 0 / 14px 1.5px, linear-gradient(#ECE7E1, #ECE7E1) 100% 0 / 1.5px 14px,
    linear-gradient(#ECE7E1, #ECE7E1) 0 100% / 14px 1.5px, linear-gradient(#ECE7E1, #ECE7E1) 0 100% / 1.5px 14px,
    linear-gradient(#ECE7E1, #ECE7E1) 100% 100% / 14px 1.5px, linear-gradient(#ECE7E1, #ECE7E1) 100% 100% / 1.5px 14px;
  background-repeat: no-repeat; }
.cmp, .det, .cf, .exg, .d3 { position: relative; width: 100%; overflow: hidden; background: #0B0A09; }
.cmp > img, .det > img, .cf > img, .exg > img, .d3 > img, .cf > canvas, .exg > canvas, .d3 > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf > canvas, .exg > canvas, .d3 > canvas { object-fit: fill; pointer-events: none; }

/* A scan line runs down the frame once when it comes into view, and the photo comes up from grey behind it. */
@media (prefers-reduced-motion: no-preference) {
  .fx .lab .lab-items::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 4; pointer-events: none; opacity: 0; background: #F65441; box-shadow: 0 0 22px 5px rgba(246, 84, 65, .45); }
  .fx .lab.in .lab-items::after { animation: lab-scan 1.5s cubic-bezier(.45, 0, .2, 1) .15s 1; }
  .lab-item img { transition: filter 1.3s ease .2s; }
  .fx .lab:not(.in) .lab-item img { filter: grayscale(1) brightness(.55); }
}
@keyframes lab-scan { 0% { top: 0; opacity: 1; } 88% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* Controls: the same small instrument row under every figure. */
.lab-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .85rem; font-family: var(--mono); font-size: .8rem; }
.lab-ctl button { font: inherit; background: none; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: .38rem .7rem; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.lab-ctl button:hover { color: var(--text); border-color: var(--muted); }
.lab-ctl button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.lab-pick, .seg { display: inline-flex; }
.lab-pick button, .seg button { border-radius: 0; margin-left: -1px; font-variant-numeric: tabular-nums; }
.lab-pick button:first-child, .seg button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.lab-pick button:last-child, .seg button:last-child { border-radius: 0 4px 4px 0; }
.lab-range { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); }
.lab-range input { width: 8.5rem; accent-color: var(--accent); }
.lab-range output { color: var(--text); font-variant-numeric: tabular-nums; min-width: 2.6em; }
.lab-out { flex-basis: 100%; color: var(--text); min-height: 1.3em; }
.lab-out::before { content: '> '; color: var(--accent); }
.lab-out:empty::before { content: none; }
.lab-stat { position: relative; font-family: var(--mono); font-size: .78rem; line-height: 1.45; color: #ECE7E1; background: #171513; border-top: 1px solid #2C2925; padding: .6rem .9rem; }
.lab figcaption { max-width: 46rem; }

/* Before and after: drag anywhere on the photo. The range input covers the stage so keys work too. */
.cmp-b { clip-path: inset(0 0 0 var(--x, 50%)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .5); pointer-events: none; z-index: 2; }
.cmp-line::after { content: '\2194'; position: absolute; top: 50%; left: 50%; width: 2.4rem; height: 2.4rem; margin: -1.2rem 0 0 -1.2rem; border-radius: 50%; background: #fff; color: #121110; display: grid; place-items: center; font-size: 1.15rem; box-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.cmp-tag { position: absolute; top: 1.1rem; z-index: 2; font-family: var(--mono); font-size: .72rem; line-height: 1.2; color: #ECE7E1; background: rgba(11, 10, 9, .8); padding: .32rem .55rem; border-radius: 4px; pointer-events: none; max-width: 44%; }
.cmp-tag.a { left: 1.1rem; }
.cmp-tag.b { right: 1.1rem; text-align: right; }
.cmp-range { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.cmp:has(.cmp-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Detections drawn as SVG over the photo. */
.det-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; fill: none; stroke: #F65441; overflow: hidden; pointer-events: none; z-index: 1; }
.det-svg g.b > :first-child { stroke-dasharray: 1; stroke-dashoffset: 0; fill: rgba(246, 84, 65, .1); transition: stroke-dashoffset 1.2s cubic-bezier(.6, 0, .2, 1) .35s; }
.det-svg g.b.off { display: none; }
.det-svg g.b[data-layer="parts"] { stroke: #5FD4C4; }
.det-svg g.b[data-layer="parts"] > :first-child { fill: rgba(95, 212, 196, .1); }
.det-svg text { fill: #fff; stroke: rgba(11, 10, 9, .85); stroke-width: .28em; stroke-linejoin: round; paint-order: stroke; font-family: var(--mono); transition: opacity .4s 1.3s; }
.det-svg.many text { opacity: 0; }
.det-svg.many g.b > :first-child { fill: none; }
@media (prefers-reduced-motion: no-preference) {
  .fx .lab:not(.in) .det-svg g.b > :first-child, .fx .tile:not(.in) .det-svg g.b > :first-child { stroke-dashoffset: 1; }
  .fx .lab:not(.in) .det-svg text, .fx .tile:not(.in) .det-svg text { opacity: 0; }
}

/* Click-to-detect: the heat map is drawn in patches, so keep them square and sharp. */
.cf { cursor: crosshair; }
.cf-heat, .exg-mask { image-rendering: pixelated; }
.cf .cf-pca { opacity: 0; transition: opacity .45s; }
.cf.pca .cf-pca { opacity: 1; }
/* Without the script, half the photo shows the feature colours or the depth. */
.lab:not(.ready) .cf .cf-pca, .lab:not(.ready) .d3 .d3-col { opacity: 1; clip-path: inset(0 0 0 50%); }

/* Depth: photo, colour-coded depth, or the point cloud. */
.d3 .d3-col, .d3 .d3-cloud { opacity: 0; transition: opacity .45s; }
.d3.v-depth .d3-col { opacity: 1; }
.d3.v-cloud.drawn .d3-cloud { opacity: 1; background: radial-gradient(120% 90% at 50% 45%, #1C1A17, #0B0A09); }
.d3.v-cloud { cursor: grab; touch-action: pan-y; }
.d3.v-cloud:active { cursor: grabbing; }

/* Scene type: a grid of photos with the model's scores under each. */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem 1rem; }
.cls-grid.one { grid-template-columns: minmax(0, 34rem); }
.cls-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.cls-bars { margin-top: .55rem; font-family: var(--mono); font-size: .74rem; line-height: 1.3; }
.cls-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; color: var(--muted); padding-block: .18rem; }
.cls-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-bars li b { font-weight: 400; font-variant-numeric: tabular-nums; }
.cls-bars li::after { content: ''; grid-column: 1 / -1; height: 3px; border-radius: 2px; background: linear-gradient(var(--mark), var(--mark)) left / calc(var(--v) * 100%) 100% no-repeat, var(--line); transition: background-size 1s cubic-bezier(.2, .7, .2, 1) .2s; }
.cls-bars li.top { color: var(--text); }
.cls-bars li.top::after { background: linear-gradient(var(--accent), var(--accent)) left / calc(var(--v) * 100%) 100% no-repeat, var(--line); }
.cls-bars li:nth-child(n+4) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .fx .lab:not(.in) .cls-bars li::after { background-size: 0 100%, auto; }
}

/* Pipeline steps: boxes joined by arrows, with a light that runs along them. */
.flow ol { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; counter-reset: step; }
.flow li { position: relative; flex: 1 1 9.5rem; max-width: 15rem; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: .8rem .95rem .9rem; counter-increment: step; }
.flow li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--mono); font-size: .7rem; color: var(--accent); margin-bottom: .3rem; }
.flow li b { display: block; font-weight: 600; line-height: 1.3; }
.flow li span { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: .3rem; }
.flow li:not(:last-child)::after { content: '\2192'; position: absolute; right: -1.75rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.15rem; line-height: 1; }
@media (max-width: 40rem) {
  .flow ol { flex-direction: column; gap: 1.9rem; }
  .flow li { max-width: none; flex: none; }
  .flow li:not(:last-child)::after { content: '\2193'; right: auto; left: 1.1rem; top: auto; bottom: -1.6rem; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .fx .flow.in li { animation: flow-pulse 4.2s ease-in-out calc(var(--i, 0) * .45s + .5s) infinite; }
}
@keyframes flow-pulse {
  0%, 22%, 100% { border-color: var(--line); box-shadow: none; }
  8% { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
}

/* Stills: one frame of a project's model output, used in the track, the tiles and the next-project link. */
.still { position: relative; overflow: hidden; background: #0B0A09; }
.still > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.still-b { transition: clip-path .9s cubic-bezier(.2, .7, .2, 1); }
.still-cmp .still-b { clip-path: inset(0 0 0 50%); }
.still-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; z-index: 2; transition: left .9s cubic-bezier(.2, .7, .2, 1); }
.still-cf .still-b, .still-d3 .still-b { clip-path: inset(0 50% 0 0); }
.still-cf::after, .still-d3::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; z-index: 2; transition: left .9s cubic-bezier(.2, .7, .2, 1); }
a:hover .still-cmp .still-b, .panel:hover .still-cmp .still-b { clip-path: inset(0 0 0 10%); }
a:hover .still-line, .panel:hover .still-line { left: 10%; }
a:hover .still-cf .still-b, a:hover .still-d3 .still-b, .panel:hover .still-cf .still-b, .panel:hover .still-d3 .still-b { clip-path: inset(0 90% 0 0); }
a:hover .still-cf::after, a:hover .still-d3::after, .panel:hover .still-cf::after, .panel:hover .still-d3::after { left: 10%; }
.still-tag { position: absolute; left: .85rem; bottom: .85rem; z-index: 2; font-family: var(--mono); font-size: .76rem; font-weight: 600; background: #F65441; color: #121110; padding: .3rem .55rem; border-radius: 4px; }
.panel-lab .still { position: absolute; inset: 0; transform: translateX(calc(var(--o, 0) * -6%)) scale(1.14); }
.panel-lab .still > img { transform: none; }

/* ---------- home: everything else, as tiles ---------- */
.tiles-head { margin-top: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vw, 4rem); display: grid; gap: .75rem 3rem; }
@media (min-width: 60rem) { .tiles-head { grid-template-columns: auto minmax(0, 30rem); align-items: end; justify-content: space-between; } }
.sub-big { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1; font-size: clamp(1.9rem, 4.6vw, 3.5rem); }
.tiles-head p { color: var(--muted); }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 2rem; grid-auto-flow: dense; }
@media (min-width: 40rem) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } .tile.wide { grid-column: span 2; flex-direction: row; } }
.tile { --d: calc(var(--i, 0) * 90ms); position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .3s, opacity .7s cubic-bezier(.2, .7, .2, 1) var(--d), transform .7s cubic-bezier(.2, .7, .2, 1) var(--d); }
.tile:hover { color: inherit; border-color: var(--mark); }
.tile:focus-visible { outline-offset: 3px; }
.tile-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0B0A09; flex: none; }
.tile-media .still { position: absolute; inset: 0; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.tile:hover .tile-media .still { transform: scale(1.045); }
@media (min-width: 64rem) { .tile.wide .tile-media { flex: 0 0 58%; aspect-ratio: auto; min-height: 21rem; } }
.tile-big { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem 1.15rem; color: #ECE7E1;
  background-color: #0B0A09; background-image: linear-gradient(rgba(236, 231, 225, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 231, 225, .045) 1px, transparent 1px); background-size: 22px 22px; background-position: -1px -1px; }
.tile-num { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .3em; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(2rem, 4vw, 3.1rem); line-height: .95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-num b { font-weight: 800; }
.tile-num s { font-size: .48em; color: #6B665E; text-decoration-color: #F65441; text-decoration-thickness: .1em; }
.tile-flow { display: flex; flex-wrap: wrap; gap: .25rem .45rem; font-family: var(--mono); font-size: .68rem; line-height: 1.35; }
.tile-flow li { color: #8A847C; transition: color .3s; }
.tile-flow li:not(:last-child)::after { content: ' \2192'; color: #F65441; }
.tile:hover .tile-flow li { color: #ECE7E1; }
.tile:hover .tile-flow li:nth-child(2) { transition-delay: .06s; }
.tile:hover .tile-flow li:nth-child(3) { transition-delay: .12s; }
.tile:hover .tile-flow li:nth-child(4) { transition-delay: .18s; }
.tile:hover .tile-flow li:nth-child(5) { transition-delay: .24s; }
.tile:hover .tile-flow li:nth-child(6) { transition-delay: .3s; }
.tile:hover .tile-flow li:nth-child(n+7) { transition-delay: .36s; }
.tile-text { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1 1 auto; min-width: 0; }
@media (min-width: 64rem) { .tile.wide .tile-text { justify-content: center; padding: 1.5rem 1.6rem; } }
.tile-n { display: flex; justify-content: space-between; gap: .75rem; font-family: var(--mono); font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-n span { color: var(--accent); text-align: right; }
.tile h4 { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.01em; font-size: clamp(1.1rem, 1.55vw, 1.35rem); line-height: 1.02; text-wrap: balance; transition: color .3s; }
.tile:hover h4 { color: var(--accent); }
.tile-fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .4em; font-family: var(--display); font-variant-numeric: tabular-nums; }
.tile-fig b { font-weight: 800; font-stretch: 125%; font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; }
.tile-fig s { color: var(--mark); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.tile-fig > span:last-child { flex-basis: 100%; font-family: var(--sans); font-size: .8rem; line-height: 1.4; color: var(--muted); }
.tile:has(.tile-big) .tile-fig b, .tile:has(.tile-big) .tile-fig s { display: none; }
.tile-line { color: var(--muted); font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tile-text::after { content: '\2192'; margin-top: auto; padding-top: .2rem; color: var(--accent); transition: transform .3s; }
.tile:hover .tile-text::after { transform: translateX(.35em); }

/* ---------- experiments: one lane per project ---------- */
.wall-cells { display: flex; flex-direction: column; gap: .9rem; }
.lane { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: .35rem 1.1rem; align-items: center; }
.lane-name { font-family: var(--mono); font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-cells { display: flex; flex-wrap: wrap; gap: 4px; }
.lane .c { width: 3.4rem; flex: none; transition: background-color .35s, color .35s, box-shadow .35s, transform .7s cubic-bezier(.3, 1.6, .5, 1), opacity .5s; }
html:not(.fx) .lane .c[data-v="killed"], .fx .lane .c[data-v="killed"].on { transform: translateY(.45rem) rotate(-5deg); opacity: .6; }
html:not(.fx) .lane .c[data-v="killed"]:nth-child(even), .fx .lane .c[data-v="killed"].on:nth-child(even) { transform: translateY(.4rem) rotate(4deg); }
.fx .lane .c[data-v="shipped"].on { box-shadow: 0 0 0 1px var(--accent), 0 0 20px -3px var(--accent); }
.lane .c:hover { transform: none; opacity: 1; }
@media (max-width: 40rem) {
  .lane { grid-template-columns: minmax(0, 1fr); }
  .lane .c { width: 2.6rem; }
}

/* ---------- about: the portrait as ViT patches ---------- */
@media (min-width: 46rem) { .about-row:has(.vit) { grid-template-columns: 260px minmax(0, 40rem); } }
.vit { width: 260px; max-width: 100%; --s: clamp(0, max(calc((0.42 - var(--p, 0.5)) / 0.32), calc((var(--p, 0.5) - 0.82) / 0.18)), 1); }
.vit-img { position: relative; aspect-ratio: 1; }
.vit-img > img, .about-row .vit img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.vit-grid { display: none; position: absolute; inset: 0; grid-template-columns: repeat(14, 1fr); grid-template-rows: repeat(14, 1fr); }
@media (prefers-reduced-motion: no-preference) {
  .fx .vit-grid { display: grid; }
  .fx .vit-img > img { opacity: 0; }
  .vit-grid i { display: block; background-image: url(/assets/img/portrait-400.webp); background-size: 1400% 1400%; background-position: calc(var(--x) * 100% / 13) calc(var(--y) * 100% / 13); box-shadow: inset 0 0 0 .5px rgba(11, 10, 9, calc(.25 + var(--s) * .6));
    transform: translate(calc(var(--dx) * var(--s)), calc(var(--dy) * var(--s))) rotate(calc(var(--r) * var(--s))) scale(calc(1 - var(--s) * .3)); opacity: calc(1 - var(--s) * .7); will-change: transform; }
}

/* ---------- case studies: head and next project ---------- */
.work .page-head h1 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: .95; font-size: clamp(2.3rem, 6.6vw, 5.6rem); max-width: 18ch; }
.crumb span { margin-left: .9rem; font-family: var(--mono); font-size: .8rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.pager { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; padding-top: 2.5rem; }
.pager .nx { grid-column: 1 / -1; display: grid; gap: 1.5rem; padding: 1.4rem; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .3s; }
.pager .nx:hover { border-color: var(--mark); }
@media (min-width: 52rem) { .pager .nx { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; padding: 2rem 2rem 2rem 2.25rem; } }
.nx .pn { display: block; margin-top: .45rem; font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: .95; font-size: clamp(1.8rem, 4.4vw, 3.4rem); text-wrap: balance; transition: color .3s; }
/* size the title by its own column so a long word ("enhancements") never runs under the picture */
.nx-text { min-width: 0; container-type: inline-size; }
@supports (font-size: 1cqi) { .nx .pn { font-size: clamp(1.5rem, 8cqi, 3.4rem); } }
.nx-line { display: block; color: var(--muted); margin-top: 1rem; max-width: 34rem; font-size: .98rem; line-height: 1.5; }
.nx-line::after { content: '\2192'; display: block; margin-top: 1rem; color: var(--accent); font-size: 1.4rem; transition: transform .3s; }
.nx:hover .nx-line::after { transform: translateX(.4em); }
.nx-media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #0B0A09; }
.nx-media .still { position: absolute; inset: 0; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.nx:hover .nx-media .still { transform: scale(1.04); }
.nx-big { display: flex; align-items: center; justify-content: center; height: 100%; padding: 1rem; color: #ECE7E1; text-align: center; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(1.8rem, 4.5vw, 3.6rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  background-image: linear-gradient(rgba(236, 231, 225, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 231, 225, .045) 1px, transparent 1px); background-size: 22px 22px; }
.pager .all { grid-column: 2; text-align: right; }

/* ---------- photo credits page ---------- */
.cr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 1rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
.cr { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: 1rem; background: var(--raised); border-radius: 8px; font-size: .9rem; line-height: 1.5; }
.cr-img img { width: 6.5rem; height: 6.5rem; object-fit: cover; border-radius: 4px; }
.cr-t { font-weight: 600; overflow-wrap: anywhere; }
.cr p + p { margin-top: .3rem; }
.cr p:not(.cr-t) { color: var(--muted); }
.cr .lbl { color: var(--text); font-weight: 500; }
@media (max-width: 30rem) { .cr { grid-template-columns: minmax(0, 1fr); } }

/* Fixes after the first browser check. */
.vit .vit-img > *, .vit .vit-grid > * { margin: 0; }
/* A still inside a fixed box fills it; its own aspect ratio only applies where it sets the height. */
.panel-lab .still, .tile-media .still, .nx-media .still { width: 100%; height: 100%; aspect-ratio: auto !important; }
.still .det-svg text { display: none; }
@media (min-width: 40.01rem) { .lane { align-items: start; } .lane-name { padding-top: .72rem; } }
.still-det > img { object-position: var(--op, 0 50%); }
/* Detect covers with live: true (detLive in build.mjs). The outline is always there; these marks only add to it. */
.det-live .dl-br { stroke: #fff; stroke-width: .13em; stroke-linecap: square; transform-box: fill-box; transform-origin: center; transition: transform .35s cubic-bezier(.2, .7, .2, 1), stroke .35s; }
.det-live .dl-echo { opacity: 0; stroke-width: .1em; transform-box: fill-box; transform-origin: center; }
.det-live .dl-run { stroke: #fff; stroke-width: .13em; stroke-dasharray: 16 84; display: none; }
.det-live .dl-scan { display: none; stroke: rgba(255, 255, 255, .55); stroke-width: .05em; }
.det-live .dl-scan-a { stroke: rgba(246, 84, 65, .2); stroke-width: .8em; }
.still .det-live text.dl-t { display: block; opacity: 0; transition: opacity .3s; }
a:hover .det-live text.dl-t, .panel:hover .det-live text.dl-t, .panel:focus-within .det-live text.dl-t { opacity: 1; }
a:hover .det-live .dl-br, .panel:hover .det-live .dl-br, .panel:focus-within .det-live .dl-br { stroke: #F65441; }
@media (prefers-reduced-motion: no-preference) {
  .det-live .dl-echo { animation: dl-echo 2.6s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: calc(var(--k) * .45s); }
  .det-live .dl-run { display: inline; animation: dl-run 2.6s linear infinite; animation-delay: calc(var(--k) * .45s); }
  .det-live .dl-scan { display: inline; animation: dl-scan 5.2s linear infinite; }
  a:hover .det-live .dl-br, .panel:hover .det-live .dl-br, .panel:focus-within .det-live .dl-br { transform: scale(.86); }
  .still-live > img, .still-live > .det-svg { transform-origin: var(--zo, 50% 50%); transition: transform .8s cubic-bezier(.2, .7, .2, 1), filter .4s; }
  .panel:hover .panel-lab .still-live > img, .panel:focus-within .panel-lab .still-live > img, a:hover .still-live > img,
  .panel:hover .still-live > .det-svg, .panel:focus-within .still-live > .det-svg, a:hover .still-live > .det-svg { transform: scale(1.28); }
}
@keyframes dl-echo { 0% { transform: scale(1); opacity: .95; } 72%, 100% { transform: scale(var(--grow)); opacity: 0; } }
@keyframes dl-run { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes dl-scan { from { transform: translateY(0); } to { transform: translateY(var(--h)); } }
/* Covers for projects without a single model-output still (coverMedia in build.mjs):
   four small before/afters in one tile, and line drawings from data/drawings.js. */
.still-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.mcell { position: relative; overflow: hidden; min-height: 0; }
.mcell > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcell .still-tag { left: .45rem; bottom: .45rem; font-size: .64rem; padding: .16rem .4rem; }
.still-draw { background-color: #0B0A09; background-image: linear-gradient(rgba(236, 231, 225, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 231, 225, .045) 1px, transparent 1px); background-size: 22px 22px; background-position: -1px -1px; }
.still-draw svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.still-dtag { position: absolute; top: .6rem; right: .65rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #8A847C; border: 1px solid rgba(236, 231, 225, .16); border-radius: 4px; padding: .14rem .4rem; }
.drw { fill: none; stroke: #8A847C; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.drw .ink { stroke: #ECE7E1; }
.drw .acc { stroke: #F65441; }
.drw .fill { fill: #0B0A09; }
.drw .accfill { fill: #F65441; stroke: none; }
.drw .dash { stroke-dasharray: 4 4; }
.drw text { font-family: var(--mono); font-size: 9px; fill: #8A847C; stroke: none; }
.drw text.l { fill: #ECE7E1; }
.drw text.a { fill: #F65441; font-weight: 600; }
.drw text.s { font-size: 7.5px; fill: #ECE7E1; }
.drw text.d { fill: #121110; font-weight: 600; }
/* overlays on a photo (photoSvg in data/drawings.js): everything is visible at rest, the motion only adds to it */
.still-ill > img { filter: brightness(.86) saturate(.94); }
.ill-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 10, 9, .34), rgba(11, 10, 9, .04) 32%, rgba(11, 10, 9, .04) 60%, rgba(11, 10, 9, .46)); }
.still-ill .still-dtag { color: #ECE7E1; background: rgba(11, 10, 9, .74); border-color: rgba(236, 231, 225, .3); }
.drw-ph { stroke: #ECE7E1; stroke-width: 1.4; }
.drw-ph text { font-size: 9.6px; font-weight: 600; fill: #ECE7E1; paint-order: stroke; stroke: rgba(11, 10, 9, .86); stroke-width: 2.8px; }
.drw-ph text.a { fill: #FF7663; }
.drw-ph text.n { font-size: 8.4px; }
.drw-ph .ph-under { stroke: rgba(11, 10, 9, .62); stroke-width: 3.6; }
.drw-ph .ph-ants { stroke-dasharray: 5 4; }
.drw-ph .ph-br { stroke: #F65441; stroke-width: 2.4; }
.drw-ph .ph-scrim { fill: rgba(11, 10, 9, .8); stroke: none; }
.kp-quad { fill: rgba(246, 84, 65, .26); stroke: #F65441; stroke-width: 1.9; }
.drw-ph .kp-run { stroke: #fff; stroke-width: 2.4; stroke-dasharray: 9 91; display: none; }
.drw-ph .kp-dot { fill: #F65441; stroke: #0B0A09; stroke-width: 1; }
.drw-ph .kp-ring { stroke: #fff; stroke-width: 1.4; }
.drw-ph .kp-pulse { stroke: #F65441; stroke-width: 1.6; opacity: 0; transform-box: fill-box; transform-origin: center; }
.drw-ph .kp-scan { display: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1; }
.drw-ph .kp-scan-a { stroke: rgba(246, 84, 65, .22); stroke-width: 9; }
.drw-ph .me-mask { stroke: #F65441; stroke-opacity: .5; stroke-width: 40; }
.drw-ph .me-tick { stroke-width: 1; }
.drw-ph .me-brush circle:last-of-type { stroke: #fff; stroke-width: 1.6; }
.rg-p { stroke: #F65441; stroke-width: 2.6; stroke-dasharray: 9 120; opacity: 0; }
.rg-web { opacity: .6; }
.au-rs { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .drw-ph .ph-ants { animation: ph-ants 1.1s linear infinite; }
  .drw-ph .kp-run { display: inline; animation: kp-run 3.6s linear infinite; }
  .drw-ph .kp-scan { display: inline; animation: kp-scan 5.5s linear infinite; }
  .drw-ph .kp-pulse { animation: kp-pulse 2.4s ease-out infinite; }
  .kp-pt2 .kp-pulse { animation-delay: .6s; } .kp-pt3 .kp-pulse { animation-delay: 1.2s; } .kp-pt4 .kp-pulse { animation-delay: 1.8s; }
  .drw-ph .me-brush { animation: me-brush 2.8s ease-in-out infinite alternate; } .drw-ph .me-mask { animation: me-mask 2.8s ease-in-out infinite alternate; }
  .rg-pa { animation: rg-pa 6s infinite linear; } .rg-pb { animation: rg-pb 6s infinite linear; }
  .au-grid { animation: au-grid 12s infinite; } .au-rs { animation: au-rs 12s infinite; }
  .au-t1 { animation: au-t1 12s infinite; } .au-t2 { animation: au-t2 12s infinite; } .au-t3 { animation: au-t3 12s infinite; } .au-t4 { animation: au-t4 12s infinite; } .au-t5 { animation: au-t5 12s infinite; } .au-t6 { animation: au-t6 12s infinite; } .au-t7 { animation: au-t7 12s infinite; } .au-t8 { animation: au-t8 12s infinite; } .au-t9 { animation: au-t9 12s infinite; } .au-t10 { animation: au-t10 12s infinite; }
}
@keyframes ph-ants { to { stroke-dashoffset: -9; } }
@keyframes kp-run { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes kp-scan { from { transform: translateY(-6px); } to { transform: translateY(206px); } }
@keyframes kp-pulse { 0% { transform: scale(1); opacity: .95; } 70%, 100% { transform: scale(3.6); opacity: 0; } }
@keyframes me-brush { from { transform: translateY(0); } to { transform: translateY(42px); } }
@keyframes me-mask { from { stroke-opacity: .38; } to { stroke-opacity: .58; } }
@keyframes rg-pa { 0% { stroke-dashoffset: 9; opacity: 1; } 40% { stroke-dashoffset: -100; opacity: 1; } 41%, 100% { stroke-dashoffset: -100; opacity: 0; } }
@keyframes rg-pb { 0%, 49% { stroke-dashoffset: 9; opacity: 0; } 50% { stroke-dashoffset: 9; opacity: 1; } 95% { stroke-dashoffset: -100; opacity: 1; } 96%, 100% { stroke-dashoffset: -100; opacity: 0; } }
@keyframes au-grid { 0%, 31% { opacity: 1; } 34%, 44% { opacity: .3; } 47%, 100% { opacity: 1; } }
@keyframes au-rs { 0%, 31% { opacity: 0; } 34%, 44% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes au-t1 { 0%, 6% { opacity: 0; } 8%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t2 { 0%, 11% { opacity: 0; } 13%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t3 { 0%, 16% { opacity: 0; } 18%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t4 { 0%, 21% { opacity: 0; } 23%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t5 { 0%, 26% { opacity: 0; } 28%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t6 { 0%, 50% { opacity: 0; } 52%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t7 { 0%, 55% { opacity: 0; } 57%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t8 { 0%, 60% { opacity: 0; } 62%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t9 { 0%, 65% { opacity: 0; } 67%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes au-t10 { 0%, 70% { opacity: 0; } 72%, 90% { opacity: 1; } 95%, 100% { opacity: 0; } }

.lab-stat { z-index: 4; }
/* Portrait photos: narrow the frame so it fits the screen; the photo keeps its shape, so boxes stay aligned. */
.lab-item > .det, .lab-item > .cmp { max-width: calc(min(82vh, 52rem) * var(--ar, 10)); margin-inline: auto; }

/* Runs, about and credits pages: the same heavy wide titles as the home page and case studies.
   Their titles are learned headings too (live.js), so every page opens with a network drawing its name. */
.page-head h1 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: .95; font-size: clamp(1.9rem, 9vw, 7rem); max-width: 18ch; overflow-wrap: anywhere; }
.page-head .lede { max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.sec > h2, .run-group > h2 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; }
.sec > h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.run-group > h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
/* Section rows: a thin accent tick before each heading. */
.sec > h2::before { content: ""; display: block; width: 1.6rem; height: 3px; margin-bottom: .7rem; background: var(--accent); }
/* A learned title hugs its words, so the noise it starts from covers only the title. */
.page-head h1[data-learn] { width: fit-content; }
