/* Self-hosted fonts (all SIL Open Font License, see fonts/licenses):
   Departure Mono — pixel headlines and big type · Atkinson Hyperlegible Next — reading text · Commit Mono — labels and metadata */
@font-face { font-family: 'Departure Mono'; font-weight: 400; font-display: swap; src: url(../fonts/departure-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-weight: 200 800; font-style: normal; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-wght.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-weight: 200 800; font-style: italic; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2) format('woff2'); }
@font-face { font-family: 'Commit Mono'; font-weight: 400; font-display: swap; src: url(../fonts/commit-mono-latin-400.woff2) format('woff2'); }
@font-face { font-family: 'Commit Mono'; font-weight: 700; font-display: swap; src: url(../fonts/commit-mono-latin-700.woff2) format('woff2'); }

/* ══ Design tokens ══════════════════════════════════════════════
   One source for colour, type, radius and elevation. Components use
   these names only; see docs/DESIGN_SYSTEM.md. Values are the current
   dark + orange theme (a light theme would redefine this block only). */
:root {
  /* surfaces */
  --bg: #131313;              /* page */
  --bg-page: #030303;         /* the four main views (Immersive, Flat, Index, About) and the 3D room: 99% black (decided 25 Nov); project pages keep --bg */
  --bezel: #000;              /* kiosk / screen frames (round 26) */
  --surface: #1b1b1b;         /* cards, quote cards, media placeholders */
  --surface-sunken: #0d0d0d;  /* behind hover media / previews */
  --media-bg: #000;           /* letterboxing behind photos and video, grid gaps */
  /* text */
  --ink-strong: #fff;         /* pixel headline faces */
  --ink: #f4f1ea;             /* body text */
  --ink-soft: #e2ded6;        /* long-form paragraphs on dark */
  --ink-muted: #a8a49b;       /* labels, metadata, captions */
  --ink-faint: rgba(255, 255, 255, .25); /* inactive dots */
  --line: rgba(220, 220, 220, .18);
  /* accent */
  --accent: #ff9d00;
  --accent-hi: #ffb540;       /* hover, links, highlights */
  --on-accent: #131313;       /* text on an orange fill */
  --accent-wash: color-mix(in srgb, var(--accent) 6%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-glow-strong: color-mix(in srgb, var(--accent) 28%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 50%, transparent);
  /* overlays */
  --glass: color-mix(in srgb, var(--bg) 62%, transparent);        /* floating bars */
  --glass-strong: color-mix(in srgb, var(--bg) 80%, transparent); /* labels on media */
  --scrim-page: var(--bg);   /* project page: opaque, nothing shows through (UI-15) */
  --scrim-media: rgba(0, 0, 0, .7);    /* text shadow over video posters */
  /* text over photos: dark enough at the text line for WCAG AA on any image, even a white drawing */
  --scrim-card: linear-gradient(180deg, transparent 36%, color-mix(in srgb, var(--bg-page) 62%, transparent) 62%, color-mix(in srgb, var(--bg-page) 94%, transparent));
  --scrim-caption: linear-gradient(180deg, transparent, rgba(0, 0, 0, .84) 52%);
  --scrim-lightbox: rgba(0, 0, 0, .92);
  --shadow-1: 0 18px 40px rgba(0, 0, 0, .45);
  --shadow-2: 0 22px 60px rgba(0, 0, 0, .58);
  /* effects */
  --extrude: 1px 1px 0 #bdbdbd, 2px 2px 0 #7a7a7a, 3px 3px 0 #444;
  --extrude-lg: 1px 1px 0 #cfcfcf, 2px 2px 0 #9b9b9b, 3px 3px 0 #6c6c6c, 4px 4px 0 #3e3e3e;
  --extrude-accent: 1px 1px 0 #b86f00, 2px 2px 0 #7f4c00, 3px 3px 0 #3f2600;
  --extrude-soft: 1px 1px 0 #6c6c6c, 2px 2px 0 #333;         /* name and category menus: two quiet steps */
  --extrude-soft-accent: 1px 1px 0 #9a5d00, 2px 2px 0 #4a2d00;
  --glitch-cyan: #8fd3ff;
  --room-line: #bdbdbd;       /* grid lines of the 3D room (read by scene.js) */
  /* component palettes (illustrations, not UI colours) */
  --device-hi: #2a2a2a; --device-mid: #1c1c1c; --device-lo: #0c0c0c; --device-edge: #3b3b3b; --device-bezel: #070707;
  --device-radius: 48px;
  --portrait-glow: #6a3a16; --portrait-dark: #1c1410;
  --clay-bg: #e9e9e9;         /* matches the clay render background */

  /* type families */
  --pixel: 'Departure Mono', 'Courier New', monospace;
  --mono: 'Commit Mono', ui-monospace, Menlo, monospace;
  --sans: 'Atkinson Hyperlegible Next', 'Helvetica Neue', Arial, sans-serif;
  /* ── type ──
     Text (sans / mono) grows on one fluid ramp: 0 px on a 375 px phone → 1 px at 1920 px and wider.
     A size that goes from A to B is clamp(A, A + (B − A) × ramp, B).
     The pixel font (Departure Mono) is drawn on an 11 px grid (each letter 7 × 11): it is only crisp at
     11, 22, 33, 44, 55, 66, 77 px, so pixel sizes step through those values per screen tier instead. */
  --ramp: calc((100vw - 375px) / 1545);
  --text-micro: 11px;         /* uppercase labels */
  --text-caption: 12px;       /* metadata, captions, counters */
  --text-small: 13px;         /* secondary notes */
  --text-body-sm: 15px;       /* compact body: CV, tool names */
  --text-body: clamp(15px, calc(15px + 3 * var(--ramp)), 18px);  /* body: 15 → 18 */
  --text-lead: clamp(17px, calc(17px + 5 * var(--ramp)), 22px);  /* subtitles, intros, testimonial: 17 → 22 */
  --text-meta: clamp(12px, calc(12px + 3 * var(--ramp)), 15px);  /* project subheader, location line: 12 → 15 */
  --text-tag: clamp(12px, calc(12px + 1 * var(--ramp)), 13px);   /* project category pills: 12 → 13 */
  --text-meta-lg: clamp(14px, calc(14px + 3 * var(--ramp)), 17px); /* project client · year · event, under the title: 14 → 17 */
  /* pixel sizes — the 11 px grid */
  --px-1: 11px; --px-2: 22px; --px-3: 33px; --px-4: 44px; --px-5: 55px; --px-6: 66px; --px-7: 77px;
  /* roles (phone values; tablet ≥ 768, desktop ≥ 1440 and large ≥ 1920 are set further down) */
  --type-title: var(--px-4);    /* project title          44 · 55 · 66 · 77 */
  --type-section: var(--px-2);  /* Challenge…, About h3   22 · 22 · 33 · 33 */
  --type-sub: var(--px-2);      /* gallery headings, cards, prev/next   22 · 22 · 22 · 33 */
  --type-menu: var(--px-2);     /* category filters       22 · 33 · 44 · 44 */
  --type-menu-index: var(--px-2); /* Index category filters 22 · 33 · 33 · 33 (a table page: one step smaller) */
  --type-stat: var(--px-3);     /* stat numbers           33 · 33 · 44 · 44 */
  --type-brand: var(--px-2);    /* the name in the top bar 22 · 33 · 33 · 33 */
  --type-row: var(--px-2);      /* Index row titles, text-only brand names: 22 */
  --type-label: 18px;           /* small pixel labels (clay loops, room labels) — off-grid exception, kept small */
  /* radius */
  --radius-xs: 2px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius-round: 50%;
  /* spacing (padding, margin, gap) */
  --space-1: 2px;  --space-2: 4px;  --space-3: 6px;  --space-4: 8px;  --space-5: 12px; --space-6: 16px;  --space-7: 20px;
  --space-8: 24px; --space-9: 32px; --space-10: 40px; --space-11: 48px; --space-12: 56px; --space-13: 72px;
  /* motion + layout */
  --ease: cubic-bezier(.22, .9, .27, 1);
  /* motion durations: 1 hover/colour · 2 small moves · 3 panels, fades · 4 large moves, media zoom */
  --dur-1: .2s; --dur-2: .35s; --dur-3: .55s; --dur-4: .8s;
  --pad: clamp(16px, 3vw, 40px);
  /* breakpoints (media queries can't read variables; keep these in sync):
     560 small phone · 680 phone · 900 tablet · 1100 narrow desktop */
}
@media (min-width: 768px) { :root { --type-title: var(--px-5); --type-menu: var(--px-3); --type-menu-index: var(--px-3); --type-brand: var(--px-3); } }
@media (min-width: 1440px) { :root { --type-title: var(--px-6); --type-section: var(--px-3); --type-menu: var(--px-4); --type-stat: var(--px-4); } }
@media (min-width: 1920px) { :root { --type-title: var(--px-7); --type-sub: var(--px-3); } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg-page); color: var(--ink); }
body { font-family: var(--sans); font-size: var(--text-body); line-height: 1.62; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

/* ── 3D room canvas ─────────────────────────────── */
#room { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; z-index: 0; transition: opacity var(--dur-3) var(--ease), filter var(--dur-3) var(--ease); }
body:not([data-view="immersive"]) #room { opacity: 0; pointer-events: none; }
body.project-open #room { filter: blur(6px) brightness(.5); }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

/* ── Top bar ───────────────────────────────────── */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); padding: var(--pad); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { text-decoration: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.brand-name { font-family: var(--pixel); font-weight: 400; font-size: var(--type-brand); line-height: 1; letter-spacing: .02em; }
.brand-role { font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); text-align: center; white-space: nowrap; }

/* extruded pixel title like the mockup */
.glitch { position: relative; color: var(--ink-strong); text-shadow: var(--extrude-soft); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.glitch::before { color: var(--ink-strong); transform: translate(-2px, 0); clip-path: inset(10% 0 55% 0); } /* round 55: white glitch (was orange + cyan) */
.glitch::after { color: rgba(255, 255, 255, .55); transform: translate(2px, 0); clip-path: inset(60% 0 8% 0); }
.brand:hover .glitch::before, .brand:hover .glitch::after, .glitch.zap::before, .glitch.zap::after { opacity: .85; animation: jitter var(--dur-2) steps(2) 2; }
@keyframes jitter { 0% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, -1px); } 100% { transform: translate(0, 0); } }

.views { display: flex; gap: var(--space-2); background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: var(--space-2); }
.views a { text-decoration: none; font-size: var(--text-caption); letter-spacing: .06em; text-transform: uppercase; padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill); display: flex; align-items: center; gap: var(--space-3); color: var(--ink-muted); transition: color var(--dur-1), background var(--dur-1); }
.views a .dot { display: none; }
.views a:hover { color: var(--ink); }
.views a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

/* ── Views ─────────────────────────────────────── */
.view { position: fixed; inset: 0; z-index: 5; display: none; }
body[data-view="immersive"] .view-immersive,
body[data-view="flat"] .view-flat,
body[data-view="index"] .view-index,
body[data-view="about"] .view-about { display: block; }
.view-immersive { pointer-events: none; }

/* ── Filters (shared) ──────────────────────────── */
.filters { display: flex; flex-direction: column; gap: 0; }
.filter { font-family: var(--pixel); font-size: var(--type-menu); line-height: 1.15; color: var(--ink); text-align: left; position: relative; transition: color var(--dur-1), transform var(--dur-2) var(--ease), opacity var(--dur-1); text-shadow: var(--extrude-soft); }
.filter { display: block; width: fit-content; }
.filter .count { position: absolute; left: 100%; top: var(--ct, .18em); margin-left: var(--space-3); font-family: var(--mono); font-size: var(--text-caption); line-height: 1; color: var(--ink-muted); text-shadow: none; }
.filter .lbl { display: inline-block; }
@media (hover: hover) { .filter:hover { color: var(--accent-hi); } } /* touch: no sticky hover colour after a tap (round 31) */
.filter[aria-pressed="true"] { color: var(--accent); text-shadow: var(--extrude-soft-accent); }
.filters.has-active .filter[aria-pressed="false"] { opacity: .45; }
.filter-clear { font-family: var(--mono); font-size: var(--text-caption); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); text-align: left; margin-top: var(--space-5); opacity: 0; pointer-events: none; transition: opacity var(--dur-1); }
.filters.has-active .filter-clear { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .filter-clear:hover { color: var(--accent-hi); } }

.filters-float { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); align-items: center; pointer-events: none; }
.filters-float .filter, .filters-float .filter-clear { pointer-events: auto; text-align: center; }
.filters-float .filter-clear { text-align: center; }

.hint { position: absolute; left: 50%; bottom: calc(var(--pad) - 4px); transform: translateX(-50%); margin: 0; font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.hint-touch { display: none; }
@media (hover: none) { .hint-desktop { display: none; } .hint-touch { display: inline; } }

.portal-label { position: absolute; transform: translate(-50%, 0); padding: var(--space-3) var(--space-5) var(--space-4); background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius-sm); white-space: nowrap; font-size: var(--text-caption); opacity: 0; transition: opacity var(--dur-1); backdrop-filter: blur(6px); }
.portal-label b { display: block; font-family: var(--pixel); font-weight: 400; font-size: var(--type-label); color: var(--ink); }
.portal-label span { color: var(--accent-hi); letter-spacing: .04em; }
.portal-label em { display: block; font-style: normal; font-size: var(--text-micro); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-top: var(--space-1); }
.portal-label.on { opacity: 1; }
body.project-open .view-immersive, body.project-open #labels { visibility: hidden; }
.portal-tip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Flat view ─────────────────────────────────── */
.view-flat { display: none; grid-template-columns: minmax(280px, clamp(300px, 30vw, 560px)) 1fr; }
body[data-view="flat"] .view-flat { display: grid; }
.flat-side { position: relative; overflow: hidden; padding: calc(var(--pad) + 190px) var(--pad) var(--pad) var(--pad); /* left edge = the name's left edge */ display: flex; flex-direction: column; gap: var(--space-9); border-right: 1px solid var(--media-bg); }
.grid-bg { position: absolute; inset: 0; z-index: -1; background: var(--bg-page); }
.grid-bg::before { content: ''; position: absolute; inset: -40% -20%; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 46px 46px; transform: perspective(500px) rotateY(38deg) translateX(-12%); transform-origin: left center; mask-image: linear-gradient(90deg, #000 30%, transparent 95%); }
.grid-bg::before { display: none; } /* Flat: no grid any more (only the Immersive room has one) */
.flat-name { display: none; font-family: var(--pixel); font-weight: 400; font-size: var(--type-title); line-height: .95; margin: 0; color: var(--ink-strong); text-shadow: var(--extrude); }
.flat-count { display: none; margin-top: auto; color: var(--ink-muted); font-size: var(--text-caption); letter-spacing: .08em; text-transform: uppercase; }
.flat-grid { overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: var(--space-2); background: var(--media-bg); align-content: start; }
/* cards keep their proportion at any width (an in-flow spacer sets the height; grid rows follow it) */
.flat-grid .card::before { content: "" ; display: block; padding-top: 62.5%; }
.flat-grid .card.feature::before { padding-top: 42.86%; }
.card { position: relative; background: var(--accent); overflow: hidden; cursor: pointer; text-align: left; color: var(--on-accent); isolation: isolate; }
.card.feature { grid-column: span 2; }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-4) var(--ease), filter var(--dur-3); filter: none; }
.card::after { content: ''; position: absolute; inset: 0; background: var(--scrim-card); z-index: 1; }
.card:hover img, .card:focus-visible img, .card.hovering img { transform: scale(1.04); }
/* hover layer: the same loop video / crossfading photos the bubbles show */
.card-hover { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-2) var(--ease); pointer-events: none; background: var(--surface-sunken); } /* opaque: transparent PNGs never show the cover underneath */
.card.hovering .card-hover.ready { opacity: 1; }
.card .card-hover img, .card .card-hover video { opacity: 0; background: var(--surface-sunken); transition: opacity var(--dur-2) ease var(--dur-3), transform var(--dur-4) var(--ease); }
.card .card-hover .on { opacity: 1; z-index: 1; transition: opacity var(--dur-3) ease, transform var(--dur-4) var(--ease); } /* the new item fades in on top; the old one leaves after */
.card-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-7) var(--space-7); z-index: 2; color: var(--ink); }
.card-meta b { display: block; font-family: var(--pixel); font-weight: 400; font-size: var(--type-sub); line-height: 1.05; }
.card-meta span { font-size: var(--text-caption); color: var(--accent-hi); letter-spacing: .05em; }
.card-tier { position: absolute; top: 14px; left: 16px; z-index: 2; font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; background: var(--glass-strong); color: var(--ink); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.card.is-out { display: none; }

/* ── Index view ────────────────────────────────── */
.view-index, .view-about { overflow-y: auto; }
.index-wrap, .about-wrap { max-width: 1180px; margin: 0 auto; padding: calc(var(--pad) + 200px) var(--pad) calc(var(--pad) * 2); }
body[data-view="index"] .topbar, body[data-view="about"] .topbar { background: linear-gradient(var(--bg-page) 0%, var(--bg-page) 62%, transparent 100%); padding-bottom: var(--space-12); }
.index-title { font-family: var(--pixel); font-weight: 400; font-size: var(--type-title); margin: 0 0 var(--space-7); }
.filters-index { flex-direction: row; flex-wrap: wrap; gap: var(--space-3) var(--space-9); margin-bottom: var(--space-8); }
.filters-index .filter { font-size: var(--type-menu-index); text-shadow: none; }
.filters-index .filter-clear { margin: 0; align-self: center; }
.index-table { width: 100%; border-collapse: collapse; }
.index-table th { text-align: left; font-weight: 500; font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); padding: var(--space-5) var(--space-5); border-bottom: 1px solid var(--line); }
.index-table th button { letter-spacing: inherit; text-transform: inherit; }
.index-table th button[data-dir]::after { content: ' ↓'; color: var(--accent); }
.index-table th button[data-dir="desc"]::after { content: ' ↑'; }
.index-table td { padding: var(--space-6) var(--space-5); border-bottom: 1px solid var(--line); vertical-align: middle; }
.index-table tbody tr { cursor: pointer; transition: background var(--dur-1); }
.index-table tbody tr:hover, .index-table tbody tr:focus-visible { background: var(--accent-soft); outline: none; }
.index-table td.t { font-family: var(--pixel); font-size: var(--type-row); line-height: 1.1; white-space: nowrap; }
.index-table td.y, .index-table td.c, .index-table td.k { white-space: nowrap; }
.index-table .tags { display: flex; flex-wrap: nowrap; gap: var(--space-2); }
.tag { font-size: var(--text-micro); letter-spacing: .04em; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-4); color: var(--ink-muted); white-space: nowrap; }
.index-table tr.is-out { display: none; }
.index-preview { position: fixed; width: 240px; height: 240px; overflow: hidden; background: var(--surface-sunken); border-radius: var(--radius-round); pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.8); transition: opacity var(--dur-1), transform var(--dur-2) var(--ease); z-index: 6; box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.index-preview.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── About ─────────────────────────────────────── */
.about-wrap h2 { font-family: var(--pixel); font-weight: 400; font-size: var(--type-title); margin: 0 0 var(--space-8); }
.about-wrap p { max-width: 62ch; font-size: var(--text-body); }
.about-links { display: flex; gap: var(--space-5); flex-wrap: wrap; margin-top: var(--space-8); }
.btn { display: inline-flex; align-items: center; gap: var(--space-4); text-decoration: none; font-size: var(--text-small); letter-spacing: .04em; border: 1px solid var(--accent); color: var(--accent-hi); padding: var(--space-4) var(--space-6); border-radius: var(--radius-pill); transition: background var(--dur-1), color var(--dur-1); }
.btn:hover { background: var(--accent); color: var(--on-accent); }

/* ── Project page ──────────────────────────────── */
.project { position: fixed; inset: 0; z-index: 40; }
.project[hidden] { display: none; }
.project-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--scrim-page); animation: projIn var(--dur-3) var(--ease); }
@keyframes projIn { from { opacity: 0; clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%)); } to { opacity: 1; clip-path: circle(150% at var(--ox, 50%) var(--oy, 50%)); } }
.project-close { position: fixed; top: var(--pad); right: var(--pad); z-index: 3; width: 44px; height: 44px; border-radius: var(--radius-round); border: 1px solid var(--line); background: var(--glass-strong); font-size: var(--text-body-sm); }
.project-close:hover { border-color: var(--accent); color: var(--accent-hi); }
.project-inner { max-width: 1180px; margin: 0 auto; padding: calc(var(--pad) * 2.6) var(--pad) calc(var(--pad) * 2); }
.p-title { font-family: var(--pixel); font-weight: 400; font-size: var(--type-title); line-height: 1.1; margin: 0 0 var(--space-4); text-shadow: var(--extrude); }
.p-tagline { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; color: var(--ink); margin: 0 0 var(--space-8); }
.p-tags { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-5); }
/* client · year · event: right under the title, the facts that frame the project */
.p-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) 0; margin: 0 0 var(--space-5); font-family: var(--mono); font-size: var(--text-meta-lg); line-height: 1.45; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.p-meta b { color: var(--accent-hi); font-weight: 700; }
.p-meta > * + *::before { content: '·'; margin: 0 .6em; color: var(--ink-muted); }
/* phones: the event gets its own line instead of starting a line with a dot */
@media (max-width: 680px) { .p-meta .p-event { flex-basis: 100%; } .p-meta .p-event::before { content: none; } }
.p-tags .tag { font-size: var(--text-tag); line-height: 1.3; padding: var(--space-3) var(--space-5); color: var(--ink); }
.p-badges { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-bottom: var(--space-9); }
.p-hero { border-radius: var(--radius-md); overflow: hidden; background: var(--media-bg); margin-bottom: var(--space-9); }
.p-hero img, .p-hero video { width: 100%; max-height: 78vh; object-fit: contain; margin: 0 auto; }
.p-hero.vertical video { max-height: 80vh; width: auto; }
.p-stats { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-11); margin: 0 0 var(--space-10); padding: var(--space-8) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.p-stats div b { display: block; font-family: var(--pixel); font-size: var(--type-stat); font-weight: 400; color: var(--accent-hi); line-height: 1; }
.p-stats div span { font-size: var(--text-caption); color: var(--ink-muted); letter-spacing: .05em; }
.p-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-9) var(--space-12); margin-bottom: var(--space-11); }
.p-sections h3, .p-ai h3 { font-family: var(--pixel); font-weight: 400; font-size: var(--type-section); margin: 0 0 var(--space-3); color: var(--accent-hi); }
.p-sections p { margin: 0; color: var(--ink-soft); }
.p-ai { border: 1px dashed var(--accent-line); border-radius: var(--radius-md); padding: var(--space-7) var(--space-7); margin-bottom: var(--space-11); }
.p-ai p { margin: 0; color: var(--ink-soft); }
.p-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.m { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--surface); min-height: 160px; }
.m.wide { grid-column: span 2; }
.m.vertical { grid-row: span 2; }
.m img, .m video { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.m video { cursor: default; }
.m figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-8) var(--space-5) var(--space-4); font-size: var(--text-caption); color: var(--ink); background: var(--scrim-caption); pointer-events: none; }
.m-glb { aspect-ratio: 1 / 1; background: none; overflow: visible; }
.m-glb::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: 6%; height: 6%; border-radius: var(--radius-round); background: radial-gradient(closest-side, var(--accent-glow), transparent); filter: blur(6px); pointer-events: none; }
.m-glb figcaption { background: none; color: var(--ink-muted); text-align: center; }
.m-glb.big { grid-column: span 2; aspect-ratio: 16 / 10; }
.m-glb canvas { width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; display: block; }
.m-glb .glb-status { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--text-caption); color: var(--ink-muted); }
/* playable embeds (click to load) */
.p-feature { margin: 0 0 var(--space-9); }
.p-feature .m, .p-hero .m { min-height: 0; background: none; }
.m-embed { display: flex; flex-direction: column; gap: var(--space-4); overflow: visible; background: none; min-height: 0; }
.embed-box { position: relative; aspect-ratio: var(--ar); width: 100%; border-radius: var(--radius-md); overflow: hidden; background: var(--media-bg); }
.m-embed.portrait .embed-box { width: min(100%, calc(78vh * var(--r))); margin: 0 auto; }
.p-gallery .m-embed.portrait .embed-box { width: 100%; }
.embed-box img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; filter: brightness(.72); transition: filter var(--dur-2), transform var(--dur-3) var(--ease); }
.embed-box:hover img { filter: brightness(.9); transform: scale(1.02); }
.embed-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-play { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6); color: var(--ink); font-family: var(--pixel); font-size: var(--type-sub); text-shadow: 0 2px 12px var(--scrim-media); }
.embed-icon { display: grid; place-items: center; width: clamp(64px, 8vw, 96px); aspect-ratio: 1; border-radius: var(--radius-round); background: var(--accent); color: var(--on-accent); font-size: var(--px-2); --vp: clamp(20px, 2.4vw, 30px); box-shadow: 0 0 0 0 var(--accent-line); animation: pulse 2.2s infinite; transition: transform var(--dur-1); }
.embed-box:hover .embed-icon { transform: scale(1.08); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70% { box-shadow: 0 0 0 22px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.m-embed .embed-cap { position: static; display: flex; justify-content: space-between; gap: var(--space-5); padding: 0 var(--space-1); background: none; color: var(--ink-muted); pointer-events: auto; }
.embed-cap a { color: var(--accent-hi); text-decoration: none; white-space: nowrap; margin-left: auto; }
.embed-cap a:hover { text-decoration: underline; }
/* highlighted launch card (for sites that can't be embedded) */
.m-launch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: stretch; text-decoration: none; border: 1px solid var(--accent-line); border-radius: var(--radius-md); overflow: hidden; background: radial-gradient(circle at 80% 20%, var(--accent-glow), transparent 60%), var(--surface); transition: border-color var(--dur-1), transform var(--dur-2) var(--ease); }
.m-launch:hover { border-color: var(--accent-hi); transform: translateY(-2px); }
.launch-visual { background: var(--media-bg); min-height: 260px; }
.launch-visual video, .launch-visual img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; }
.launch-body { display: flex; flex-direction: column; justify-content: center; gap: var(--space-5); padding: clamp(20px, 3vw, var(--space-10)); }
.launch-body small { font-size: var(--text-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.launch-body b { font-family: var(--pixel); font-weight: 400; font-size: var(--type-stat); line-height: 1.05; color: var(--ink); }
.launch-body p { margin: 0; color: var(--ink-soft); max-width: 46ch; }
.launch-cta { align-self: flex-start; margin-top: var(--space-3); padding: var(--space-5) var(--space-7); border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-weight: 700; letter-spacing: .04em; transition: background var(--dur-1); }
.m-launch:hover .launch-cta { background: var(--accent-hi); }
@media (max-width: 680px) { .m-launch { grid-template-columns: 1fr; } .launch-visual { min-height: 0; } }
.m-ph { display: grid; place-items: center; text-align: center; padding: var(--space-7); min-height: 200px; border: 1px dashed var(--line); background: repeating-linear-gradient(135deg, var(--accent-wash) 0 12px, transparent 12px 24px); color: var(--ink-muted); font-size: var(--text-small); }
.m-ph b { display: block; font-family: var(--pixel); font-weight: 400; color: var(--accent); font-size: var(--text-body-sm); margin-bottom: var(--space-2); }
.p-credit { margin: var(--space-6) 0 0; font-size: var(--text-caption); color: var(--ink-muted); }
.p-nav { display: flex; justify-content: space-between; gap: var(--space-6); margin-top: var(--space-12); padding-top: var(--space-8); border-top: 1px solid var(--line); }
.p-nav button { text-align: left; max-width: 46%; }
.p-nav button:last-child { text-align: right; }
.p-nav small { display: block; font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.p-nav b { font-family: var(--pixel); font-weight: 400; font-size: var(--type-sub); }
.p-nav button:hover b { color: var(--accent-hi); }

/* ── Lightbox ──────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 60; background: var(--scrim-lightbox); display: grid; place-items: center; padding: 4vmin; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(100%, 92vw); max-height: 90vh; object-fit: contain; }
.lightbox-close { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: var(--radius-round); border: 1px solid var(--line); }

/* ── Loader ────────────────────────────────────── */
.loader { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); transition: opacity var(--dur-4) var(--ease); font-size: var(--text-caption); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.loader.done { opacity: 0; pointer-events: none; }
.loader span { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
  .views a { padding: var(--space-3) var(--space-4); }
  .views a .dot { display: none; }
  .p-sections { grid-template-columns: 1fr; }
  .p-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .topbar { flex-direction: column; align-items: stretch; gap: var(--space-5); padding: var(--space-6) var(--space-6) 0; }
  .brand { align-items: center; text-align: center; }
  .views { align-self: center; }
  .views a { font-size: var(--text-micro); padding: calc(var(--space-2) + 1px) var(--space-5) calc(var(--space-2) - 1px); } /* +1 px on top: the capitals sat 0.8 px high in the pill (measured) */
  .hint { bottom: 16px; font-size: var(--text-micro); }
  body[data-view="flat"] .view-flat { display: block; overflow-y: auto; }
  .flat-side { padding: 170px var(--space-6) var(--space-6); gap: var(--space-5); border-right: 0; }
  .flat-name { display: none; }
  .flat-count { margin: 0; }
  .flat-grid { grid-template-columns: 1fr; grid-auto-rows: auto; overflow: visible; }
  .flat-grid .card.feature::before { padding-top: 75%; }
  .card.feature { grid-column: auto; }
  .index-wrap, .about-wrap { padding-top: 170px; }
  .index-preview { display: none; }
  .p-gallery { grid-template-columns: 1fr; }
  .m.wide { grid-column: auto; }
  .m.vertical { grid-row: auto; }
  .project-inner { padding-top: var(--space-13); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.p-hero:has(.m-embed) { background: none; overflow: visible; }

.filters-side .filter { margin-right: var(--space-9); }
.index-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6) var(--space-8); margin-bottom: var(--space-8); }
.index-head .filters-index { margin-bottom: 0; }
.view-index .index-wrap { padding-top: calc(var(--pad) + 120px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── About ──────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: minmax(240px, clamp(300px, 27vw, 560px)) minmax(0, 1fr); gap: clamp(28px, 5vw, var(--space-13)); align-items: start; }
.about-wrap h2 { margin-bottom: var(--space-5); }
.about-lead { font-size: var(--text-lead); max-width: 60ch; }
.about-wrap h3 { font-family: var(--pixel); font-weight: 400; font-size: var(--type-section); color: var(--accent-hi); margin: var(--space-11) 0 var(--space-6); }
.about-wrap .chips { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.about-wrap .chips .tag { font-size: var(--text-caption); padding: var(--space-2) var(--space-5); color: var(--ink); }
.cv { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cv li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-2) var(--space-7); padding: var(--space-6) 0; border-bottom: 1px solid var(--line); }
.cv li > span { color: var(--ink-muted); font-size: var(--text-small); white-space: nowrap; }
.cv li b { font-weight: 700; }
.cv li em { font-style: normal; color: var(--accent-hi); }
.cv li p { grid-column: 2; margin: var(--space-1) 0 0; font-size: var(--text-body-sm); color: var(--ink-soft); max-width: 64ch; }
.about-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-10); }
.about-note { border: 1px dashed var(--accent-line); border-radius: var(--radius-md); padding: var(--space-6) var(--space-6); color: var(--ink-muted); font-size: var(--text-small); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-cols { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .cv li { grid-template-columns: 1fr; }
  .cv li p { grid-column: 1; }
}

/* About portrait: one floating circle with a 2D / 3D switch */
.about-portrait { position: sticky; top: 170px; display: flex; flex-direction: column; align-items: center; gap: var(--space-7); user-select: none; }
.about-wrap .orb-hint { margin: calc(var(--space-2) * -1) 0 0; font-size: var(--text-micro); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); transition: opacity var(--dur-2); }
.orb-hint .hint-touch { display: none; }
@media (hover: none) { .orb-hint .hint-desktop { display: none; } .orb-hint .hint-touch { display: inline; } }
@media (max-width: 900px) { .about-portrait { position: relative; top: 0; width: min(320px, 76vw); margin: 0 auto var(--space-4); } }

/* horizontal slider (long sequences: wireframes, flows, decks) */
.m-slider { grid-column: 1 / -1; --sl-h: clamp(320px, 62vh, 640px); margin: var(--space-7) 0 var(--space-9); min-width: 0; }
.m-slider.tall { --sl-h: clamp(380px, 74vh, 760px); }
.m-slider.wide { --sl-h: clamp(220px, 50vh, 560px); }
.m-slider.short { --sl-h: clamp(220px, 40vh, 420px); }
.sl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-6); }
.sl-head h4 { font-family: var(--pixel); font-weight: 400; font-size: var(--type-section); color: var(--accent-hi); margin: 0; }
.sl-head p { margin: var(--space-2) 0 0; font-size: var(--text-small); color: var(--ink-muted); max-width: 64ch; }
.sl-ctrl { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.sl-count { font-size: var(--text-caption); color: var(--ink-muted); letter-spacing: .06em; margin-right: var(--space-3); font-variant-numeric: tabular-nums; }
.sl-count b { color: var(--ink); font-weight: 400; }
.sl-btn { width: 40px; height: 40px; border-radius: var(--radius-round); border: 1px solid var(--line); color: var(--ink); font-size: var(--text-body-sm); transition: border-color var(--dur-1), background var(--dur-1), opacity var(--dur-1); }
.sl-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.sl-btn:disabled { opacity: .3; cursor: default; }
.sl-track { display: flex; gap: var(--space-6); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: var(--space-1); cursor: grab; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 70px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 70px), transparent); }
.m-slider.at-end .sl-track { -webkit-mask-image: none; mask-image: none; }
.sl-track::-webkit-scrollbar { display: none; }
.sl-track:focus-visible { outline: 1px dashed var(--accent); outline-offset: 6px; }
.sl-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.sl-track.dragging img { pointer-events: none; }
.sl-item { flex: 0 0 auto; margin: 0; width: min(calc(var(--sl-h) * (var(--ar))), 86vw); scroll-snap-align: start; }
.sl-item img, .sl-item video { height: var(--sl-h); width: 100%; object-fit: contain; border-radius: var(--radius-md); background: var(--surface); cursor: zoom-in; }
.sl-item video { cursor: default; }
.sl-item figcaption { flex: none; display: flex; gap: var(--space-4); align-items: baseline; padding: var(--space-4) var(--space-1) 0; font-size: var(--text-caption); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-item figcaption b { font-weight: 400; color: var(--accent); }
.sl-bar { position: relative; height: 2px; margin-top: var(--space-6); background: var(--line); border-radius: var(--radius-xs); overflow: hidden; }
.sl-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: var(--radius-xs); transition: transform .12s linear; }
@media (max-width: 680px) {
  .m-slider, .m-slider.tall { --sl-h: clamp(300px, 62vh, 560px); }
  .m-slider.wide { --sl-h: clamp(160px, 30vh, 300px); }
  .sl-head { flex-direction: column; align-items: flex-start; }
  .sl-btn { display: none; }
}
/* lightbox navigation when opened from a slider */
.lightbox-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: var(--radius-round); border: 1px solid var(--line); color: var(--ink); font-size: var(--type-label); background: var(--glass); display: none; }
.lightbox-nav.prev { left: 16px; } .lightbox-nav.next { right: 16px; }
.lightbox-nav:hover { border-color: var(--accent); }
.lightbox.has-set .lightbox-nav { display: block; }
.lightbox-count { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: var(--text-caption); color: var(--ink-muted); letter-spacing: .06em; }
.m-vctl { background: var(--media-bg); } .m-vctl video { object-fit: contain; cursor: default; } .m-vctl figcaption { position: static; background: none; padding: var(--space-4) var(--space-1) 0; color: var(--ink-muted); }
.m-full { grid-column: 1 / -1; }
.filter .lbl, .filter .count { pointer-events: none; } /* labels are shifted with negative margins: let the button boxes take the clicks so neighbours never steal them */
.filter::before { content: ''; position: absolute; inset: -6px -4px; } /* a bit more hit area around each word (stays inside the row gap) */

/* section heading inside a project gallery (project · client · year) */
.m-sec { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); margin: var(--space-9) 0 var(--space-1); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.m-sec p { margin: var(--space-2) 0 0; max-width: 68ch; color: var(--ink-soft); }
.m-sec h4 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: var(--type-sub); color: var(--ink); }
.m-sec span { font-size: var(--text-caption); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hi); }
.p-gallery > .m-sec:first-child { margin-top: 0; }
/* iPhone mockup */
.m-phone { grid-column: span 1; background: none; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: var(--space-5); min-height: 0; padding: var(--space-3) 0 var(--space-2); }
.phone { position: relative; width: min(100%, 290px); aspect-ratio: 9 / 19.5; padding: var(--space-5); border-radius: var(--device-radius); background: linear-gradient(145deg, var(--device-hi), var(--device-lo) 45%, var(--device-mid));
  box-shadow: inset 0 0 0 1.5px var(--device-edge), inset 0 0 0 5px var(--device-bezel), var(--shadow-2); }
.phone::before, .phone::after { content: ''; position: absolute; width: 3px; border-radius: var(--radius-xs); background: var(--device-hi); }
.phone::before { left: -3px; top: 22%; height: 9%; }
.phone::after { right: -3px; top: 28%; height: 13%; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--device-radius) - 10px); overflow: hidden; background: var(--media-bg); }
.phone-screen video, .phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-island { position: absolute; top: 20px; left: 50%; width: 30%; height: 22px; transform: translateX(-50%); border-radius: var(--radius-pill); background: var(--media-bg); pointer-events: none; }
.m-phone figcaption { position: static; background: none; padding: 0; color: var(--ink-muted); text-align: center; }
@media (max-width: 680px) { .m-phone { grid-column: auto; } }


/* Index preview: same hover media as the bubbles (video or slideshow) */
.index-preview img, .row-preview img, .index-preview .card-hover img, .index-preview .card-hover video, .row-preview .card-hover img, .row-preview .card-hover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.index-preview .card-hover, .row-preview .card-hover { border-radius: var(--radius-round); }
.index-preview.hovering .card-hover.ready, .row-preview.hovering .card-hover.ready { opacity: 1; }
.index-preview .card-hover img, .index-preview .card-hover video, .row-preview .card-hover img, .row-preview .card-hover video { opacity: 0; transition: opacity var(--dur-2) ease var(--dur-3); }
.index-preview .card-hover .on, .row-preview .card-hover .on { opacity: 1; z-index: 1; transition: opacity var(--dur-3) ease; }
/* row thumbnails were for touch screens: removed — the floating preview stays for mouse users (UI-22) */
.index-table td.pv, .index-table th.pv-h { display: none; }
.index-table td.pv { width: 76px; padding: var(--space-2) var(--space-4); }
.row-preview { position: relative; width: 64px; height: 64px; border-radius: var(--radius-round); overflow: hidden; background: var(--surface-sunken); box-shadow: 0 0 0 2px var(--accent); animation: rowpv var(--dur-2) var(--ease); }
@keyframes rowpv { from { transform: scale(.6); opacity: 0; } }
@media (hover: none) { .index-table tr.live { background: var(--accent-soft); } }

/* Client testimonial as a chat bubble */
.p-quote { margin: var(--space-4) 0 var(--space-11); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); max-width: 620px; }
.p-quote .bubble { position: relative; margin: 0; padding: var(--space-6) var(--space-7); background: var(--accent); color: var(--on-accent); font-size: var(--text-lead); line-height: 1.45; border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm); box-shadow: 0 12px 36px var(--accent-glow); }
.p-quote .bubble::after { content: ''; position: absolute; left: -7px; bottom: 0; width: 18px; height: 18px; background: var(--accent); clip-path: path('M18 0 C18 10 12 16 0 18 C8 18 14 17 18 14 Z'); }
.p-quote figcaption { padding-left: var(--space-4); font-size: var(--text-caption); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }

/* elastic pill (views menu) */
.has-pill { position: relative; isolation: isolate; }
.has-pill .pill { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: var(--radius-pill); background: var(--accent); z-index: -1; pointer-events: none; will-change: transform, width; box-shadow: 0 0 16px 1px var(--accent-glow-strong); }
.views.has-pill a[aria-current="page"] { background: transparent; color: var(--on-accent); transition: color var(--dur-1) ease .08s; }

/* labels, metadata and small UI stay in the mono */
.views a, .tag, .hint, .filter .count, .filter-clear, .p-meta, .p-credit, .p-stats span, .m-sec span, .card-meta span,
.index-table th, .index-table td.k, .index-table td.y, figcaption, .cv li > span, .brand-role, .glb-status, .portal-label span, .portal-label em,
.p-nav small, .btn { font-family: var(--mono); }

/* About: 3D phone portrait */
.about-phone { position: relative; width: 100%; aspect-ratio: 4 / 5; cursor: grab; touch-action: none; }
.about-phone.dragging { cursor: grabbing; }
.about-phone canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity var(--dur-4) var(--ease); }
.about-phone.ready canvas { opacity: 1; }
.about-phone::before { content: ''; position: absolute; left: 18%; right: 18%; bottom: 3%; height: 7%; border-radius: var(--radius-round); background: radial-gradient(closest-side, var(--accent-glow), transparent); filter: blur(6px); }
.about-phone-2d { width: min(260px, 70%); margin: 0 auto; }
.about-phone-2d .phone-screen img { object-position: 50% 100%; background: radial-gradient(circle at 50% 45%, var(--portrait-glow), var(--portrait-dark) 70%); }
@media (max-width: 680px) { .view-index .index-wrap { padding-top: 170px; } .index-head { gap: var(--space-5); } }

/* the phone grows with the window and starts level with the role line under "About" */
.about-wrap { max-width: clamp(1180px, 78vw, 1700px); }
.view-about .about-wrap { padding-top: calc(var(--pad) + 110px); }
@media (max-width: 680px) { .view-about .about-wrap { padding-top: 160px; } }

/* portrait hero image on a blurred copy of itself */
.p-hero.blur-bg { position: relative; isolation: isolate; }
.p-hero.blur-bg .hero-bg { position: absolute; inset: -60px; background-position: center; background-size: cover; filter: blur(44px) saturate(1.1); opacity: .6; z-index: -1; }
.p-hero.blur-bg img { position: relative; }
.p-hero.vertical img { max-height: 82vh; width: auto; }
/* clay → wireframe → textured loops, side by side */
.m-evo { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-5); }
.m-evo figure { margin: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.m-evo video { width: 100%; aspect-ratio: 356 / 480; object-fit: cover; border-radius: var(--radius-md); background: var(--clay-bg); }
.m-evo figcaption { display: flex; flex-direction: column; gap: var(--space-2); }
.m-evo figcaption b { font-family: var(--pixel); font-weight: 400; font-size: var(--type-label); color: var(--ink); }
.m-evo figcaption span { font-size: var(--text-small); line-height: 1.4; color: var(--ink-muted); }
@media (max-width: 1100px) { .m-evo { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--space-8); } }
@media (max-width: 560px) { .m-evo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* About: brands + tools */
.brands { list-style: none; margin: var(--space-2) 0 var(--space-5); padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-10); }
.brands li { display: flex; align-items: center; height: 34px; opacity: .78; transition: opacity var(--dur-1); }
.brands li:hover { opacity: 1; }
.brands img { height: 26px; width: auto; max-width: 150px; filter: brightness(0) invert(1); } /* every logo in plain white */
.brands img.logo-microsoft, .brands img.logo-nespresso, .brands img.logo-santander { height: 24px; }
.brands img.logo-amazon { height: 30px; }
.brands img.logo-vast { height: 22px; }
.brands img.logo-cielo, .brands img.logo-wurth { height: 22px; }
.brands li span { font-family: var(--sans); font-weight: 700; font-size: var(--type-row); letter-spacing: -.01em; color: var(--ink-strong); }
.tool-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-7) var(--space-8); }
.tool-cat { display: block; font-family: var(--mono); font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-hi); margin-bottom: var(--space-4); }
.tool-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.tool-group li { display: flex; align-items: center; gap: var(--space-5); font-size: var(--text-body-sm); }
.tool-ic { flex: none; width: 26px; height: 26px; display: inline-grid; place-items: center; color: var(--ink); background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: 20px 20px; mask-size: 20px 20px; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.tool-ic.mono { background: none; -webkit-mask: none; mask: none; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); font-family: var(--mono); font-style: normal; font-size: var(--text-micro); font-weight: 700; }
.cv li b a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.cv li b a:hover { color: var(--accent-hi); }
@media (max-width: 680px) { .flat-grid .card::before { padding-top: 75%; } }

/* About: where I live / where I'm from */
.about-where { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-8); margin: 0 0 var(--space-7); font-family: var(--mono); font-size: var(--text-caption); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.about-where span { display: inline-flex; align-items: center; gap: var(--space-4); }
.about-where svg { width: 15px; height: 15px; color: var(--accent-hi); flex: none; }
/* Experience / education: organisation, role, place on their own lines */
.cv-stack .cv-org { display: block; font-style: normal; color: var(--accent-hi); font-family: var(--mono); font-size: var(--text-small); letter-spacing: .04em; margin-bottom: var(--space-1); }
.cv-stack b { font-weight: 700; }
.cv-stack .cv-note { color: var(--ink-muted); font-weight: 400; }
.cv-stack .cv-place { display: block; color: var(--ink-muted); font-size: var(--text-small); margin-top: var(--space-1); }
.cv li > span { white-space: nowrap; }
.cv.cv-stack li { grid-template-columns: 170px minmax(0, 1fr); }
@media (max-width: 680px) { .cv.cv-stack li { grid-template-columns: 1fr; } .cv.cv-stack li p { grid-column: 1; } }
.cv.cv-stack li p { grid-column: 2; }
/* tools: four columns on wide screens */
.tool-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .tool-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* colleague quotes: a stack of cards that flips through on a timer */
.qstack { position: relative; margin: var(--space-2) 0 var(--space-4); max-width: 720px; }
.qcards { position: relative; transition: height var(--dur-2) var(--ease); perspective: 1400px; }
.qcard { position: absolute; left: 0; right: 0; top: 0; margin: 0; padding: var(--space-8) var(--space-8) var(--space-7); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; gap: var(--space-6);
  transform-origin: 50% 0; transition: transform var(--dur-4) cubic-bezier(.2,.9,.25,1.15), opacity var(--dur-3) ease, box-shadow var(--dur-3); will-change: transform; cursor: pointer; }
.qcard blockquote { margin: 0; font-size: var(--text-body); line-height: 1.55; color: var(--ink-soft); }
.qcard figcaption { font-family: var(--mono); font-size: var(--text-caption); letter-spacing: .04em; color: var(--ink-muted); }
.qcard[data-pos="0"] { z-index: 4; transform: none; opacity: 1; box-shadow: var(--shadow-1); }
.qcard[data-pos="1"] { z-index: 3; transform: translateY(14px) scale(.965); opacity: .7; }
.qcard[data-pos="2"] { z-index: 2; transform: translateY(26px) scale(.93); opacity: .45; }
.qcard[data-pos="3"] { z-index: 1; transform: translateY(36px) scale(.9); opacity: 0; pointer-events: none; }
.qcard[data-pos="1"] *, .qcard[data-pos="2"] *, .qcard[data-pos="3"] * { visibility: hidden; }
.qcard.leaving { animation: qflip var(--dur-4) cubic-bezier(.5,0,.3,1) both; z-index: 5; }
@media (prefers-reduced-motion: reduce) { .qcard, .qcard.leaving { transition: none; animation: none; } }

/* ══ Accessibility & navigation (batch 2) ══════════════════════ */
/* skip link: hidden until a keyboard user tabs to it */
.skip-link { position: fixed; top: var(--space-4); left: 50%; z-index: 100; transform: translate(-50%, -160%); padding: var(--space-4) var(--space-6); border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: var(--text-caption); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; transition: transform var(--dur-1) var(--ease); }
.skip-link:focus-visible { transform: translate(-50%, 0); outline-color: var(--ink); }
/* focus rings that are never clipped: inside the edge for tiles, a bar for table rows */
.card:focus-visible { outline: none; }
.card:focus-visible::after { box-shadow: inset 0 0 0 3px var(--accent-hi); } /* drawn on the overlay so the photo can't cover it */
.index-table tbody tr:focus-visible { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
img[data-zoom]:focus-visible { outline-offset: -3px; }
.sl-track:focus-visible { outline-style: solid; }

/* About: collapsible sections (native <details>) */
.about-more { margin-top: var(--space-11); border-top: 1px solid var(--line); }
.fold { border-bottom: 1px solid var(--line); }
.fold summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-2) var(--space-6); padding: var(--space-7) 0; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.about-wrap .fold summary h3 { margin: 0; transition: color var(--dur-1); }
.fold-meta { font-family: var(--mono); font-size: var(--text-meta-lg); letter-spacing: .04em; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-ic { position: relative; width: 16px; height: 16px; align-self: center; }
.fold-ic::before, .fold-ic::after { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--accent-hi); transition: transform var(--dur-2) var(--ease); }
.fold-ic::after { transform: rotate(90deg); }
.fold[open] .fold-ic::after { transform: rotate(0deg); }
.fold summary:hover h3 { color: var(--ink); }
.fold summary:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
.fold-body { padding: 0 0 var(--space-9); }
.fold-body .cv { border-top: 0; }
.fold-body h4 { margin: 0 0 var(--space-5); font-family: var(--mono); font-weight: 400; font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.fold[open] .fold-body { animation: fold-in var(--dur-2) var(--ease); }
@keyframes fold-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 680px) { .fold summary { grid-template-columns: minmax(0, 1fr) auto; } .fold-meta { grid-row: 2; grid-column: 1; } .fold-ic { grid-row: 1; grid-column: 2; } }
/* "show all" is invisible until a filter is on, so it must not take keyboard focus either */
.filter-clear { visibility: hidden; transition: opacity var(--dur-1), visibility 0s var(--dur-1); }
.filters.has-active .filter-clear { visibility: visible; transition: opacity var(--dur-1), visibility 0s; }

/* ══ Video player: a big centre button (batch 3) ═════════════════ */
.vp-frame { position: relative; width: 100%; }
.p-hero.vertical .vp-frame { width: fit-content; max-width: 100%; margin: 0 auto; }
.vp-frame video { display: block; width: 100%; }
.vp-host { position: relative; }
[data-player][data-state="idle"] video, [data-player][data-state="ended"] video { cursor: pointer; }
.vp-btn { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: clamp(64px, 8vw, 96px); aspect-ratio: 1; border-radius: var(--radius-round); background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-1); transition: opacity var(--dur-1), transform var(--dur-1) var(--ease), background var(--dur-1); }
.vp-btn:hover { background: var(--accent-hi); transform: translate(-50%, -50%) scale(1.06); }
.vp-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
[data-player][data-state="idle"] .vp-btn { animation: pulse 2.2s infinite; }
/* while playing the button steps aside (the browser bar takes over); it comes back on hover, on keyboard focus and on pause */
[data-player][data-state="playing"] .vp-btn { opacity: 0; pointer-events: none; }
/* round 39: no pause button on hover — a click on the playing video pauses it (the play button returns) */
[data-player][data-state="playing"] .vp-btn:focus-visible { opacity: 1; pointer-events: auto; }
/* icons drawn in CSS: ▶ play · ❚❚ pause · ↻ replay */
.vp-icon { width: 0; height: 0; transform: translateX(calc(var(--vp, 28px) / 6)); border-left: calc(var(--vp, 28px)) solid currentColor; border-top: calc(var(--vp, 28px) * .6) solid transparent; border-bottom: calc(var(--vp, 28px) * .6) solid transparent; }
.vp-btn { --vp: clamp(20px, 2.4vw, 30px); }
[data-player][data-state="playing"] .vp-icon { transform: none; width: calc(var(--vp) * .8); height: var(--vp); border: 0; border-left: calc(var(--vp) * .28) solid currentColor; border-right: calc(var(--vp) * .28) solid currentColor; }
[data-player][data-state="ended"] .vp-icon { transform: none; width: calc(var(--vp) * 1.25); height: calc(var(--vp) * 1.25); border: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 9A8 8 0 1 1 12 4' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'/%3E%3Cpath d='M11 .6 16.2 4 11 7.4Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 9A8 8 0 1 1 12 4' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'/%3E%3Cpath d='M11 .6 16.2 4 11 7.4Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.vp-host .vp-btn, .vp-small .vp-btn { width: clamp(48px, 5vw, 64px); --vp: clamp(16px, 1.6vw, 22px); }
@media (prefers-reduced-motion: reduce) { [data-player] .vp-btn { animation: none; } }

/* Index on tablets: stacked rows up to 900 px, wrapping titles and tags up to 1100 px (no sideways scroll) */
@media (max-width: 1100px) { .index-table td.t { white-space: normal; } .index-table .tags { flex-wrap: wrap; } }
@media (max-width: 900px) {
  /* index rows become two lines on phones and tablets in portrait: title + year on top, client + categories below */
  .index-table thead { display: none; }
  .index-table, .index-table tbody { display: block; }
  .index-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "t t" "m y" "c c"; align-items: center; padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
  .index-table td { border: 0; padding: var(--space-1) var(--space-4); }
  .index-table td.t { grid-area: t; white-space: normal; font-size: var(--type-row); }
  .index-table td.y { grid-area: y; color: var(--ink-muted); font-size: var(--text-body); padding-left: 0; }
  .index-table td.y::before { content: '·\00a0'; }
  .index-table td.k { grid-area: m; color: var(--ink-muted); font-size: var(--text-body); padding-right: var(--space-2); }
  .index-table td.c { grid-area: c; overflow-x: auto; scrollbar-width: none; }
}

/* Flat on tablets in portrait (681–900 px): filters on top like the phone, two card columns (UI-17) */
@media (min-width: 681px) and (max-width: 900px) {
  body[data-view="flat"] .view-flat { display: block; overflow-y: auto; }
  .flat-side { padding: calc(var(--pad) + 96px) var(--pad) var(--space-8); gap: var(--space-6); border-right: 0; }
  .flat-grid { overflow: visible; }
}

/* Phones and tablets in portrait: one category menu, the same in Immersive, Flat and Index —
   a wrapped row at the top (the Index spacing), so the middle of the screen is left to the content */
@media (max-width: 900px) {
  .filters-side { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) var(--space-9); }
  .filters-side .filter { font-size: var(--type-menu); text-shadow: none; margin-right: 0; }
  .filters-side .filter-clear { margin: 0; align-self: center; }
}
@media (max-width: 680px) {
  .filters-float { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) var(--space-9); left: var(--space-6); right: var(--space-6); top: 170px; transform: none; }
  .filters-float .filter { font-size: var(--type-menu); text-shadow: none; }
  .filters-float .filter, .filters-float .filter-clear { text-align: left; }
  .filters-float .filter-clear { margin: 0; align-self: center; }
  /* a dark band behind the name and the menu so they read over the room */
  /* no dark fade behind the phone header any more (Victor, 25 Nov): the room reads as on desktop */
}

/* project header spacing: phone values above; from 1440 px a little more air (kept tight on purpose) */
@media (min-width: 1440px) {
  .p-tags { margin-bottom: var(--space-6); }
  .p-title { margin-bottom: var(--space-5); }
  .p-meta { margin-bottom: var(--space-6); }
  .p-tagline { margin-bottom: var(--space-9); }
}

/* ══ Round 5 ═══════════════════════════════════════════════════ */
/* About location line: a label, not body text (a paragraph rule was making it 17 px) */
.about-wrap .about-where { font-size: var(--text-meta); }
/* labels and counters always in the mono */
.orb-hint, .sl-count, .sl-btn, .lightbox-nav, .lightbox-count { font-family: var(--mono); }
.index-table td.k, .index-table td.y { font-size: var(--text-body); }

/* Close buttons: filled orange like the other primary buttons, a crisp CSS-drawn ✕ */
.project-close, .lightbox-close { width: 40px; height: 40px; border: 0; border-radius: var(--radius-round); background: var(--accent); color: var(--on-accent); font-size: 0; display: grid; place-items: center; box-shadow: var(--shadow-1); transition: background var(--dur-1), transform var(--dur-1); }
.project-close:hover, .lightbox-close:hover { background: var(--accent-hi); color: var(--on-accent); transform: scale(1.06); }
.project-close::before, .project-close::after, .lightbox-close::before, .lightbox-close::after { content: ''; grid-area: 1 / 1; width: 18px; height: 2.5px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.project-close::after, .lightbox-close::after { transform: rotate(-45deg); }
.project-close:focus-visible, .lightbox-close:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Phones: a compact header — name, role, view menu and category menu close together, menu centred */
@media (max-width: 680px) {
  :root { --head-phone: 128px; } /* where the category menu starts (just under the view menu) */
  .topbar { padding: var(--space-5) var(--space-6) 0; gap: var(--space-4); } /* role → view pill: 8 px; the category menu follows at the same distance (main.js) */
  .brand { gap: var(--space-1); }
  .views a { padding: calc(var(--space-2) + 1px) var(--space-5) calc(var(--space-2) - 1px); }
  .filters-side, .filters-float, .filters-index { justify-content: center; gap: var(--space-2) var(--space-9); } /* the column gap leaves room for each word's count */
  .filters-side .filter, .filters-float .filter, .filters-index .filter { text-align: center; }
  .filters-float { top: var(--head-phone); }
  /* when the categories wrap to two lines, keep the lines close: 24 px pitch (still a 24 px tap target) */
  .filters-float { row-gap: 0; }
  .filters-float .filter { line-height: 24px; }
  /* Index and About: the header's fade stops just under the view pill, so the category menu right below it stays bright */
  body[data-view="index"] .topbar, body[data-view="about"] .topbar { padding-bottom: var(--space-4); background: linear-gradient(var(--bg-page) 0%, var(--bg-page) 70%, transparent 100%); }
  /* phone category menu a step under the name (UI-44): about 18 px, sized so each font pixel is a whole number of
     device pixels on this screen (main.js sets --type-menu-phone: 18.33 px at 3x, 16.5 px at 2x) */
  .filters-side .filter, .filters-float .filter, .filters-index .filter { font-size: var(--type-menu-phone, var(--px-2)); }
  .flat-side { padding-top: var(--head-phone); }
  .view-index .index-wrap { padding-top: var(--head-phone); }
  .index-head { justify-content: center; }
}

/* Wide screens (≥ 1600 px): a wider page, bigger media, less scrolling */
@media (min-width: 1600px) {
  .project-inner { max-width: min(88vw, 1880px); }
  .index-wrap { max-width: min(84vw, 1600px); }
  .p-hero img, .p-hero video { max-height: 82vh; }
  .p-sections { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-9) var(--space-10); }
  .p-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-10); align-items: start; margin-bottom: var(--space-11); }
  .p-pair > .p-quote, .p-pair > .p-ai { margin: 0; max-width: none; }
  .p-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); }
  .m-slider { --sl-h: clamp(360px, 66vh, 760px); }
  .m-slider.tall { --sl-h: clamp(420px, 76vh, 880px); }
}
/* About is a long list page: its section headings stay one step smaller than the project page's (22 · 22 · 22 · 33) */
.about-wrap h3 { font-size: var(--type-sub); }

/* ══ Round 6: gallery runs + portrait heroes on wide screens ═════ */
/* each run of tiles is its own grid; columns follow the number of tiles (desktop: up to 3, wide: up to 4) */
.p-run { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: inherit; align-items: start; }
.p-run[data-n="1"] { grid-template-columns: minmax(0, min(100%, 960px)); }
.p-run[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-run > .m img { max-height: 82vh; }
.p-run[data-n="1"] > .m:not(.m-phone):not(.m-glb) { background: none; }
.p-run[data-n="1"] > .m:not(.m-phone):not(.m-glb) img { object-fit: contain; width: auto; max-width: 100%; border-radius: var(--radius-md); }
.p-run > .m-phone { align-self: center; }
@media (max-width: 900px) { .p-run, .p-run[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); } .p-run[data-n="1"] { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) { .p-run, .p-run[data-n] { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1600px) {
  .p-run[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .p-run[data-n="1"] { grid-template-columns: minmax(0, min(100%, 1240px)); }
  /* 3D viewers get room to turn: a run of models is at most 3 across, the big one spans 2 */
  .p-run:has(> .m-glb)[data-n="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* portrait hero: title and facts on the left, the tall media on the right, both above the fold
   (round 55: from 1024 px, so a 14" laptop gets it too, not only 1600 px and up) */
@media (min-width: 1024px) {
  .p-top.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-11); align-items: center; margin-bottom: var(--space-9); }
  .p-top.split .p-tagline { margin-bottom: var(--space-8); text-wrap: balance; }
  .p-top.split .p-meta .p-event { flex-basis: 100%; }
  .p-top.split .p-meta .p-event::before { content: none; }
  .p-top.split .p-hero { margin: 0; background: none; overflow: visible; border-radius: var(--radius-md); }
  .p-top.split .p-hero .hero-bg { display: none; }
  .p-top.split .p-hero img, .p-top.split .p-hero video { max-height: 80vh; width: auto; border-radius: var(--radius-md); }
  .p-top.split .p-top-media { justify-self: end; }
  .p-top.split .p-credit { margin-top: var(--space-4); }
  /* a phone hero keeps the whole device above the fold (9 / 19.5 frame, caption below) */
  .p-top.split .p-hero .m-phone .phone { width: min(330px, calc((100vh - 170px) * 9 / 19.5)); }
  .p-top.split .p-top-media { padding-right: var(--space-9); }
}

/* ══ Left column layout — the default on desktop (UI-34, chosen 25 Nov; #classic shows the old centred room menu) ══
   One block at the top left on every page: name → view menu → categories. Name + role and the view pill share
   one centre line (set in fitBrand, main.js); the categories start where the word IMMERSIVE starts inside the
   view menu (--inset, which follows the pill if it has to move: --views-shift), and the categories always start at the same
   height (--menu-top, measured from the view menu). Phones keep their own centred header. */
:root { --inset: calc(1px + var(--space-2) + var(--space-5) + var(--views-shift, 0px)); --menu-top: 160px; }
@media (min-width: 681px) {
  body[data-layout="left"] .topbar { flex-direction: column; align-items: flex-start; gap: var(--space-6); }
  body[data-layout="left"] .filters-float { left: calc(var(--pad) + var(--inset)); top: var(--menu-top); transform: none; align-items: flex-start; }
  body[data-layout="left"] .filters-float .filter, body[data-layout="left"] .filters-float .filter-clear { text-align: left; }
  body[data-layout="left"] .flat-side { padding-top: var(--menu-top); padding-left: calc(var(--pad) + var(--inset)); }
  body[data-layout="left"] .index-wrap, body[data-layout="left"] .about-wrap { margin: 0; padding-left: calc(var(--pad) + var(--inset)); }
  body[data-layout="left"] .view-index .index-wrap, body[data-layout="left"] .view-about .about-wrap { padding-top: var(--menu-top); }
  /* the category menu: one size everywhere (the Index size), lighter layers */
  .filters-float .filter, .filters-side .filter { font-size: var(--type-menu-index); }
}
/* ══ About, round 8 ═══════════════════════════════════════════ */
.about-where svg { width: 22px; height: 22px; fill: var(--accent-hi); }
.about-where span { gap: var(--space-4); }
/* brands: the logos sit closer to each other than to their heading */
.brands { margin: 0; gap: var(--space-6) var(--space-9); }
.brands li { height: 30px; }
/* skills as a menu: big readable items, a "+" that turns into "−" on hover (the collapsible headings' plus) */
.plus-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4) var(--space-9); }
.plus-list li { display: flex; align-items: baseline; gap: var(--space-5); font-family: var(--mono); font-size: var(--text-body); line-height: 1.4; color: var(--ink); transition: color var(--dur-1), transform var(--dur-2) var(--ease); }
.plus-list li i { position: relative; flex: none; width: 11px; height: 11px; top: 1px; }
.plus-list li i::before, .plus-list li i::after { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 3px; background: var(--accent-hi); transition: transform var(--dur-2) var(--ease); }
.plus-list li i::after { transform: rotate(90deg); }
.plus-list li:hover { color: var(--accent-hi); transform: translateX(4px); }
.plus-list .nw { white-space: nowrap; }
.plus-list li:hover i::after { transform: rotate(0deg); }
/* colleague quotes: a stack like notifications — no border, a shadow, the cards behind peek out below */
.qstack { cursor: pointer; padding-bottom: var(--space-8); outline-offset: 6px; border-radius: var(--radius-lg); user-select: none; -webkit-tap-highlight-color: transparent; }
.qcard { border: 0; background: var(--surface); }
.qcard figcaption { display: flex; justify-content: space-between; gap: var(--space-6); }
.qcount { flex: none; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.qcard[data-pos="0"] { box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
.qcard[data-pos="1"] { transform: translateY(12px) scale(.955); opacity: .6; box-shadow: var(--shadow-1); }
.qcard[data-pos="2"] { transform: translateY(23px) scale(.91); opacity: .3; }
.qcard[data-pos="3"] { transform: translateY(30px) scale(.88); opacity: 0; }
.qcard { transition: transform .55s cubic-bezier(.2, .9, .25, 1.08), opacity .4s ease, box-shadow .4s; }
.qcard.leaving { animation: qlift .6s cubic-bezier(.4, 0, .2, 1) both; z-index: 5; }
.qcard.arriving { animation: qdrop .5s cubic-bezier(.2, .9, .25, 1.08) both; }
@keyframes qlift { 0% { transform: none; opacity: 1; } 45% { transform: translateY(-22px) scale(1.02); opacity: 0; } 46%, 100% { transform: translateY(30px) scale(.88); opacity: 0; } }
@keyframes qdrop { from { transform: translateY(-22px) scale(1.02); opacity: 0; } to { transform: none; opacity: 1; } }
@media (hover: hover) { .qstack:hover .qcard[data-pos="0"] { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .qcard.arriving { animation: none; } .plus-list li, .plus-list li:hover { transform: none; } }
.qcard { overflow: hidden; }
.qcards { transition: height .45s cubic-bezier(.2, .9, .25, 1.08); }
.qcard { transform-origin: 50% 100%; }

/* Flat on wide screens (≥ 1600 px): every project on one screen — 5 columns × 4 rows of tiles,
   the first project 2 × 2, the second 2 × 1, the rest squares or near-squares (16 projects = 20 cells) */
@media (min-width: 1600px) {
  .flat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: calc((100vh - 9px) / 4); grid-auto-flow: dense; }
  .flat-grid .card::before, .flat-grid .card.feature::before { display: none; }
  .flat-grid .card.feature { grid-column: span 2; grid-row: span 2; }
  .flat-grid .card.feature2 { grid-column: span 2; }
  .flat-grid .card-meta b { font-size: var(--px-2); }
  .flat-grid .card.feature .card-meta b { font-size: var(--px-3); }
}

/* About, round 9: facts line, square bullets, list columns */
.about-facts { display: flex; flex-wrap: wrap; gap: var(--space-5) var(--space-10); margin: 0 0 var(--space-8); }
.about-facts div { display: flex; flex-direction: column; gap: var(--space-1); }
.about-facts dt { font-family: var(--mono); font-size: var(--text-micro); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.about-facts dd { margin: 0; font-family: var(--mono); font-size: var(--text-meta-lg); color: var(--ink); }
.about-facts div:first-child dd { color: var(--accent-hi); }
.plus-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-9); align-items: start; }
@media (min-width: 1280px) { .plus-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .plus-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .plus-list { grid-template-columns: minmax(0, 1fr); } }
.plus-list li { line-height: 1.35; }
.plus-list li i { width: 7px; height: 7px; top: -.1em; background: var(--accent-hi); transition: transform .5s var(--ease); }
.plus-list li i::before, .plus-list li i::after { content: none; }
.plus-list li:hover { transform: none; }
.plus-list li:hover i { transform: rotate(180deg); }
.about-cols .plus-list { grid-template-columns: minmax(0, 1fr); }

/* rows of categories (phones, Index): the hidden "show all" must not take room on a line, or the lines stop
   being centred; on phones it gets a line of its own when it shows (UI-42) */
.filters-index:not(.has-active) .filter-clear { display: none; }
@media (max-width: 680px) {
  .filters:not(.has-active) .filter-clear { display: none; }
  .filters .filter-clear { flex-basis: 100%; text-align: center; margin-top: var(--space-6); } /* a clear step below the categories, so it isn't tapped by accident */
}
/* category menus answer the pointer like the About lists: a column menu leans right, the Index row lifts (UI-42) */
@media (hover: hover) {
  .filters-float .filter:hover, .filters-side .filter:hover, .filters-float .filter:focus-visible, .filters-side .filter:focus-visible { transform: translateX(4px); }
  .filters-index .filter:hover, .filters-index .filter:focus-visible { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) { .filter:hover, .filter:focus-visible { transform: none !important; } }

/* ══ Pixel cursors (UI-40) ══════════════════════════════════════
   Hand-built on a pixel grid (docs/scripts/make_cursors.py): white fill, #131313 border, no anti-aliasing.
   1 CSS px per grid cell (the classic cursor size): 2 device px per cell on retina (@2x), 1 px on standard
   screens. Four states:
   arrow (default) · hand, tilted (anything clickable) · open hand (something you can drag) · closed hand (dragging). */
html, .m video, .sl-item video, .m-vctl video, .sl-btn:disabled { cursor: url(../assets/ui/cursor-arrow.png) 0 0, default; cursor: -webkit-image-set(url(../assets/ui/cursor-arrow.png) 1x, url(../assets/ui/cursor-arrow@2x.png) 2x) 0 0, default; cursor: image-set(url(../assets/ui/cursor-arrow.png) 1x, url(../assets/ui/cursor-arrow@2x.png) 2x) 0 0, default; }
#room, .m-glb canvas, .sl-track, .about-phone, .is-grab { cursor: url(../assets/ui/cursor-open.png) 8 9, grab; cursor: -webkit-image-set(url(../assets/ui/cursor-open.png) 1x, url(../assets/ui/cursor-open@2x.png) 2x) 8 9, grab; cursor: image-set(url(../assets/ui/cursor-open.png) 1x, url(../assets/ui/cursor-open@2x.png) 2x) 8 9, grab; }
a[href], button:not(:disabled), summary, [role="button"], label[for], select,
.card, .index-table tbody tr, .embed-box img, .fold summary, .qstack, .is-hand, #room.is-hand,
[data-player][data-state="idle"] video, [data-player][data-state="ended"] video { cursor: url(../assets/ui/cursor-hand.png) 6 0, pointer; cursor: -webkit-image-set(url(../assets/ui/cursor-hand.png) 1x, url(../assets/ui/cursor-hand@2x.png) 2x) 6 0, pointer; cursor: image-set(url(../assets/ui/cursor-hand.png) 1x, url(../assets/ui/cursor-hand@2x.png) 2x) 6 0, pointer; }
#room.is-grabbing, .m-glb canvas:active, .sl-track.dragging, .about-phone.dragging, .is-grabbing { cursor: url(../assets/ui/cursor-closed.png) 8 6, grabbing; cursor: -webkit-image-set(url(../assets/ui/cursor-closed.png) 1x, url(../assets/ui/cursor-closed@2x.png) 2x) 8 6, grabbing; cursor: image-set(url(../assets/ui/cursor-closed.png) 1x, url(../assets/ui/cursor-closed@2x.png) 2x) 8 6, grabbing; }

/* ══ Round 26: Reddit Magic Mirror review ════════════════════ */
/* gallery figures never had the browser's default figure margin (1em 40px) reset */
figure.m, .m-anat { margin: 0; }

/* Challenge / Solution / My role / Impact as cards */
.p-sections { gap: var(--space-6); }
.p-sections section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-8) var(--space-8) var(--space-9); }
@media (min-width: 1600px) { .p-sections { gap: var(--space-6); } }
@media (max-width: 680px) { .p-sections section { padding: var(--space-7) var(--space-6) var(--space-8); } }

/* "Is it AI?": no dashed box (round 26) */
.p-ai { border: 0; border-radius: 0; padding: 0; }
.p-ai p { margin: var(--space-5) 0 0; max-width: 72ch; color: var(--ink-muted); }

/* kiosk frame: a plain black bezel with a hairline edge (like the Cloud Stacker screens) */
.sl-frame.kiosk { position: absolute; z-index: 2; pointer-events: none; left: 50%; top: 0; transform: translateX(-50%);
  width: calc(var(--fw) + 2 * var(--bz)); height: calc(var(--fw) * 16 / 9 + 2 * var(--bz));
  border: var(--bz) solid var(--bezel); border-radius: calc(var(--bz) * 1.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 60px rgba(0, 0, 0, .5); }

/* framed slider: the frame stays in the middle, each slide snaps into it, the neighbours wait dimmed outside */
.m-slider.framed { --fw: min(calc(var(--sl-h) * 9 / 16), 62vw); --bz: max(10px, calc(var(--fw) * .045)); }
.sl-stage { position: relative; }
.m-slider.framed .sl-track, .m-slider.framed.at-end .sl-track { scroll-snap-type: x mandatory; gap: calc(2 * var(--bz) + var(--space-9)); padding: var(--bz) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.m-slider.framed .sl-track::before, .m-slider.framed .sl-track::after { content: ''; flex: 0 0 calc(50% - var(--fw) / 2 - 2 * var(--bz) - var(--space-9)); }
.m-slider.framed .sl-item { width: var(--fw); scroll-snap-align: center; opacity: .3; transition: opacity var(--dur-2); }
.m-slider.framed .sl-item.is-on { opacity: 1; }
.m-slider.framed .sl-item img { height: calc(var(--fw) * 16 / 9); border-radius: calc(var(--bz) * .7); object-fit: cover; }
.m-slider.framed .sl-item figcaption { display: none; }
.sl-cap { display: flex; justify-content: center; gap: var(--space-4); margin: var(--space-7) 0 0; font-family: var(--mono); font-size: var(--text-caption); color: var(--ink-muted); }
.sl-cap b { font-weight: 400; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .m-slider.framed .sl-item { transition: none; } }

/* annotated screen: the same kiosk frame, labels in two columns, each line ends on the element it names */
.m-anat { grid-column: 1 / -1; margin: var(--space-9) 0; }
.an-stage { --fw: clamp(200px, 24vw, 340px); --bz: max(10px, calc(var(--fw) * .045)); --lw: clamp(120px, 16vw, 230px); position: relative; }
.an-screen { position: relative; width: var(--fw); margin: 0 auto; padding: var(--bz) 0; }
.an-screen img { display: block; width: var(--fw); height: calc(var(--fw) * 16 / 9); object-fit: cover; border-radius: calc(var(--bz) * .7); background: var(--surface); cursor: zoom-in; }
.an-labels { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.an-l { position: absolute; top: calc(var(--bz) + var(--y) * var(--fw) * 16 / 9); transform: translateY(-100%); border-bottom: 1px solid var(--accent); padding-bottom: var(--space-3);
  font-size: var(--text-small); line-height: 1.25; color: var(--ink); }
.an-l span { display: block; max-width: calc(var(--lw) - var(--space-5)); }
.an-l.l { left: calc(50% - var(--fw) / 2 - var(--bz) - var(--lw)); right: calc(50% + var(--fw) / 2 - var(--x) * var(--fw)); }
.an-l.r { left: calc(50% - var(--fw) / 2 + var(--x) * var(--fw)); right: calc(50% - var(--fw) / 2 - var(--bz) - var(--lw)); text-align: right; }
.an-l.r span { margin-left: auto; }
.an-l::after { content: ''; position: absolute; bottom: -4px; width: 7px; height: 7px; border-radius: var(--radius-round); background: var(--accent); }
.an-l.l::after { right: -4px; }
.an-l.r::after { left: -4px; }
.m-anat figcaption { margin-top: var(--space-7); text-align: center; font-family: var(--mono); font-size: var(--text-caption); color: var(--ink-muted); }
@media (max-width: 680px) { .an-stage { --fw: 150px; --lw: 94px; } .an-l { font-size: var(--text-caption); } }
@media (max-width: 680px) {
  /* phones: a smaller frame and a tighter gap so the next screen peeks in at the edge (it can be swiped) */
  .m-slider.framed { --fw: min(calc(var(--sl-h) * 9 / 16), 58vw); }
  .m-slider.framed .sl-track, .m-slider.framed.at-end .sl-track { gap: calc(2 * var(--bz) + var(--space-5));
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
  .m-slider.framed .sl-track::before, .m-slider.framed .sl-track::after { flex-basis: calc(50% - var(--fw) / 2 - 2 * var(--bz) - var(--space-5)); }
}

/* ══ Round 27: Magic Mirror, second pass ═════════════════════ */
/* section cards: a step bigger text, collapsible to a three-line preview (one card opens on its own) */
:root { --text-card: clamp(16px, calc(16px + 4 * var(--ramp)), 20px); } /* card text: 16 → 20 */
.p-sections { align-items: start; }
.p-card h3 { margin: 0 0 var(--space-4); }
.p-card-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--space-6); font: inherit; color: inherit; text-align: left; padding: 0; transition: color var(--dur-1); }
.p-card-btn:hover:not(:disabled) { color: var(--ink); }
.p-card-btn:disabled { cursor: inherit; }
.p-card-btn:disabled .fold-ic { display: none; }
.p-card-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 6px; border-radius: var(--radius-sm); }
.p-card .fold-ic { flex: none; }
.p-card.is-open .fold-ic::after { transform: rotate(0deg); }
.p-sections .p-card p { font-size: var(--text-card); line-height: 1.6; max-height: calc(3 * 1.6em); overflow: hidden; cursor: pointer; transition: max-height var(--dur-3) var(--ease);
  -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); }
.p-sections .p-card.is-open p, .p-sections .p-card.fits p { max-height: none; cursor: auto; -webkit-mask-image: none; mask-image: none; }
@media (prefers-reduced-motion: reduce) { .p-sections .p-card p { transition: none; } }

/* "Is it AI?" (round 29): no pill — same look as About › What I do (heading + "+" list item) */
.p-ai h3 { display: block; line-height: inherit; margin: 0 0 var(--space-6); }
.p-ai .plus-list.ai-answer { display: block; }
.p-ai p { margin-top: var(--space-6); }

/* framed slider: the caption carries the position (3/11 Eye colour), dots replace the progress bar */
.m-slider.framed .sl-count { display: none; }
.sl-cap { gap: 0; }
.sl-cap i { font-style: normal; color: var(--ink-muted); }
.sl-cap span { margin-left: var(--space-5); color: var(--ink); }
.sl-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin-top: var(--space-5); }
.sl-dot { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-round); }
.sl-dot::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-round); background: var(--line); transition: background var(--dur-1), transform var(--dur-1); }
.sl-dot:hover::before { background: var(--ink-muted); }
.sl-dot[aria-current]::before { background: var(--accent); transform: scale(1.25); }
.sl-dot:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 0; }

/* close buttons: only the orange disc and the ✕; a small press-in on hover; keyboard focus = a thin orange ring */
.project-close:hover, .lightbox-close:hover { transform: scale(.97); }
.project-close:focus-visible, .lightbox-close:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

/* ══ Round 28: section cards uniform on wider screens ═══════ */
/* wider than a phone: every card is at least title + three lines tall, rows share one height, and the cards open together */
@media (min-width: 681px) {
  .p-sections { align-items: stretch; }
  .p-sections .p-card p { min-height: calc(3 * 1.6em); }
}

/* ══ Round 31: Flat covers load on black ═════════════════════ */
/* while a cover loads the card is near-black (was orange), and the image fades in when it arrives */
.card { background: var(--surface-sunken); }
.flat-grid .card > img { opacity: 0; transition: opacity var(--dur-3) var(--ease), transform var(--dur-4) var(--ease), filter var(--dur-3); }
.flat-grid .card > img.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .flat-grid .card > img { transition: none; } }

/* ══ Round 32: the room's hint fades out after 10 s ═══════════ */
.hint { transition: opacity var(--dur-4) var(--ease), visibility 0s; }
.hint.gone { opacity: 0; visibility: hidden; transition: opacity var(--dur-4) var(--ease), visibility 0s var(--dur-4); }
@media (prefers-reduced-motion: reduce) { .hint, .hint.gone { transition: none; } }

/* ══ Round 33: About top fade + menu leaves while the room is zoomed ══ */
/* About: only a thin fade above the name (it ends where the name starts); the page scrolls up behind the header */
body[data-view="about"] .topbar { background: none; }
body[data-view="about"] .topbar::before { content: ''; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: calc(var(--pad) + 16px); /* round 35: a touch taller */ background: linear-gradient(var(--bg-page), transparent); pointer-events: none; }
@media (max-width: 680px) { body[data-view="about"] .topbar::before { height: calc(var(--space-5) + 12px); } }

/* Room zoomed in (round 33, reworked in round 35): the header (name, view pill) and the category words leave one
   after another — to the left on the web, upwards on phones — accelerating away with no wind-up; on zoom out they
   spring back in with a slight overshoot. Full navigation returns with the zoom out. Reduced motion: they just fade. */
.topbar .brand, .topbar .views { transition: translate .7s cubic-bezier(.3, 1.45, .5, 1) calc(var(--i, 0) * 45ms), opacity var(--dur-1), visibility 0s; }
.topbar .brand { --i: 0; } .topbar .views { --i: 1; }
.filters-float .filter { --j: calc(var(--i, 0) + 2); transition: color var(--dur-1), transform var(--dur-2) var(--ease), opacity var(--dur-1), translate .7s cubic-bezier(.3, 1.45, .5, 1) calc(var(--j) * 45ms); }
.filters-float .filter-clear { --j: calc(var(--i, 0) + 2); transition: opacity var(--dur-1), visibility 0s var(--dur-1), translate .7s cubic-bezier(.3, 1.45, .5, 1) calc(var(--j) * 45ms); }
.filters-float.has-active .filter-clear { transition: opacity var(--dur-1), visibility 0s, translate .7s cubic-bezier(.3, 1.45, .5, 1) calc(var(--j) * 45ms); }
body.room-zoomed .topbar .brand, body.room-zoomed .topbar .views, body.room-zoomed .filters-float .filter, body.room-zoomed .filters-float .filter-clear {
  --out: -120vw 0; translate: var(--out); pointer-events: none; visibility: hidden;
  transition: color var(--dur-1), transform var(--dur-2) var(--ease), opacity var(--dur-1), visibility 0s .9s, translate .5s cubic-bezier(.55, 0, .85, .35) calc(var(--j, var(--i, 0)) * 40ms); }
@media (max-width: 680px) { body.room-zoomed .topbar .brand, body.room-zoomed .topbar .views, body.room-zoomed .filters-float .filter, body.room-zoomed .filters-float .filter-clear { --out: 0 -60vh; } }
@media (prefers-reduced-motion: reduce) {
  body.room-zoomed .topbar .brand, body.room-zoomed .topbar .views, body.room-zoomed .filters-float .filter, body.room-zoomed .filters-float .filter-clear { translate: none; opacity: 0; }
}

/* ══ Round 34: no text selection over the room on touch ═══════ */
/* iOS selected hidden text under a long press (hold-to-move) and greyed the screen with its callout */
#room, #labels, .portal-label, .hint, body[data-view="immersive"]:not(.project-open) { /* project pages stay selectable */ -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* ══ Round 37: phone About — the 3D phone a little higher, its hint closer ══ */
@media (max-width: 680px) {
  .view-about .about-wrap { padding-top: 128px; } /* was 160 */
  .about-wrap .orb-hint { margin-top: -18px; }    /* was −4: closer to the phone, still below its glow */
}

/* ══ Round 38: phone About — the header is solid down to the view pill, then fades ══ */
/* the page scrolls up and disappears under the name and the pill instead of passing behind them */
@media (max-width: 680px) {
  body[data-view="about"] .topbar::before { height: calc(100% + 14px); background: linear-gradient(var(--bg-page) calc(100% - 22px), transparent); }
}

/* ══ Round 39 ══════════════════════════════════════════════════ */
/* desktop/laptop: the category pills start level with the top of the close button (was pad × 2.6) */
@media (min-width: 901px) { .project-inner { padding-top: var(--pad); } }
/* section text: bold highlights and bullet lists (My role) */
.p-card p b { color: var(--ink-strong); font-weight: 700; }
.p-card p.p-bul .p-li { display: block; position: relative; padding-left: 1.1em; }
.p-card p.p-bul .p-li + .p-li { margin-top: .25em; }
.p-card p.p-bul .p-li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; background: var(--accent-hi); }
/* "Is it AI?": the answer sits on the question's line, larger; the note runs below */
.p-ai { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-11); align-items: baseline; }
.p-ai h3 { margin: 0; }
.p-ai .plus-list.ai-answer li { font-size: clamp(19px, calc(19px + 6 * var(--ramp)), 26px); }
.p-ai > p { grid-column: 1 / -1; }

/* ══ Round 40 ══════════════════════════════════════════════════ */
/* phones: player inside the screen, scrollable tall screen */
.phone-screen .vp-frame { height: 100%; }
.phone-screen .vp-frame video { height: 100%; object-fit: cover; }
.phone-screen .vp-btn { width: clamp(56px, 5vw, 72px); --vp: clamp(18px, 1.7vw, 24px); }
.phone-screen.scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.phone-screen.scroll::-webkit-scrollbar { display: none; }
.phone-screen.scroll img { height: auto; object-fit: initial; }
.phone-screen.scroll:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
/* a run of phones only: up to four across from 901 px; a swipe row on phones */
@media (min-width: 901px) { .p-run.phones[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .p-run.phones:not([data-n="1"]) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: var(--space-5); margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
  .p-run.phones::-webkit-scrollbar { display: none; }
  .p-run.phones:not([data-n="1"]) > .m-phone { flex: 0 0 46%; scroll-snap-align: start; }
}
/* explicit grid (clay drafts 2 × 2), kept at two columns on phones too */
@media (max-width: 680px) { .p-run.p-grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); } }
/* evo with its own ratio / four columns (Snoo wardrobe) */
.m-evo video { aspect-ratio: var(--evo-ar, 356 / 480); }
.m-evo.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .m-evo.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.phone .phone-screen .vp-frame { width: 100%; max-width: none; margin: 0; }
/* round 40: whole image in a run (no crop), caption below like the phones */
.m.m-fit { background: none; min-height: 0; overflow: visible; display: flex; flex-direction: column; gap: var(--space-5); }
.m.m-fit img { height: auto; object-fit: contain; border-radius: var(--radius-md); }
.m.m-fit figcaption { position: static; background: none; padding: 0; color: var(--ink-muted); text-align: center; }
.p-run > .m-fit { align-self: center; }
/* round 40: a phone as the hero */
.p-hero:has(> .m-phone) { background: none; overflow: visible; display: flex; justify-content: center; }
.p-hero .m-phone .phone { width: min(100%, 330px); }
.p-hero .phone-screen video, .p-hero .phone-screen img { width: 100%; height: 100%; max-height: none; border-radius: 0; object-fit: cover; }
.phone-screen.scroll { position: absolute; inset: var(--space-5); width: auto; height: auto; }
@media (max-width: 680px) { .p-run.phones:not([data-n="1"]) > .m-fit { flex: 0 0 46%; scroll-snap-align: start; } }

/* ══ Round 44 ══════════════════════════════════════════════════ */
/* framed slider in a phone: rounder bezel + dynamic island (same geometry as the kiosk) */
.sl-frame.iphone { position: absolute; z-index: 2; pointer-events: none; left: 50%; top: 0; transform: translateX(-50%);
  width: calc(var(--fw) + 2 * var(--bz)); height: calc(var(--fw) * 16 / 9 + 2 * var(--bz));
  border: var(--bz) solid var(--device-lo); border-radius: calc(var(--bz) * 4.2);
  box-shadow: 0 0 0 1.5px var(--device-hi), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 60px rgba(0, 0, 0, .5); }
.sl-frame.iphone::after { content: ""; position: absolute; top: calc(var(--bz) * -.78); left: 50%; width: 24%; height: calc(var(--bz) * .56); transform: translateX(-50%); border-radius: 999px; background: #000; }
.m-slider.framed.f-phone .sl-item img { border-radius: calc(var(--bz) * 3.2); }
/* large board: preview at column width, opens big in the lightbox to explore */
.m-pan img { cursor: zoom-in; }
.lightbox.pan { display: block; place-items: start; overflow: auto; padding: 72px 4vw 4vw; cursor: grab; overscroll-behavior: contain; }
.lightbox.pan.dragging { cursor: grabbing; }
.lightbox.pan img { display: block; margin: 0; max-width: none; max-height: none; width: max(240vw, 2400px); height: auto; user-select: none; -webkit-user-drag: none; }
/* interests board: icon tile + subreddit pills */
.m-int { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-8) var(--space-7); }
.int-card { margin: 0; display: grid; grid-template-columns: 44% minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.int-card img { width: 100%; height: auto; display: block; }
.int-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.int-card li { font-family: var(--sans); font-weight: 700; font-size: clamp(11px, calc(11px + 2 * var(--ramp)), 14px); line-height: 1.2; color: #131313; padding: .3em .75em .32em; border-radius: 999px 999px 999px 4px; max-width: 100%; overflow-wrap: anywhere; }
.int-card li:nth-child(5n+1) { background: #ff4500; } .int-card li:nth-child(5n+2) { background: #ff5fc2; } .int-card li:nth-child(5n+3) { background: #ffbf0b; }
.int-card li:nth-child(5n+4) { background: #aeef0f; } .int-card li:nth-child(5n+5) { background: #00e2b7; }
@media (max-width: 680px) { .m-int { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7) var(--space-4); } .int-card { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); } .int-card img { width: 78%; } }

/* ══ Round 45 ══════════════════════════════════════════════════ */
.launch-meta { font-family: var(--mono); font-size: var(--text-small); color: var(--ink-muted) !important; }
.launch-body p + p:not(.launch-meta) { margin-top: calc(var(--space-5) * -1 + 2px); }
/* asset board: vector pieces on a grid (desktop landscape, phones portrait) */
.m-board { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--cd), minmax(0, 1fr)); grid-template-areas: var(--ad); gap: var(--space-5); }
.bd-cell { margin: 0; background: #000; border-radius: var(--radius-md); padding: clamp(12px, 2vw, 24px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); min-width: 0; }
.bd-cell > img { max-width: 100%; height: auto; display: block; }
.bd-cell figcaption { font-family: var(--mono); font-size: var(--text-caption); color: var(--ink-muted); text-align: center; }
.bd-rows { align-items: stretch; }
.bd-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.bd-row > img { width: 44px; height: auto; }
.bd-row div { display: flex; flex-direction: column; gap: 4px; }
.bd-row div img { height: 14px; width: auto; max-width: 100%; align-self: flex-start; }
.bd-row span { font-family: var(--mono); font-size: var(--text-caption); color: var(--ink-muted); }
@media (max-width: 900px) { .m-board { grid-template-columns: repeat(var(--cm), minmax(0, 1fr)); grid-template-areas: var(--am); gap: var(--space-4); } }
.m.m-inset img { background: #000; padding: 18% 14%; box-sizing: border-box; aspect-ratio: 1; object-fit: contain; }
/* round 46: five-card evo (Cloud Stacker blocks) */
.m-evo.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .m-evo.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .m-evo.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* round 47: phone screen showing the whole video (black bars) */
.phone-screen.contain { background: #000; }
.phone-screen.contain video, .p-hero .phone-screen.contain video { object-fit: contain; }
.p-grid > .m-fit img { max-width: min(100%, 420px); margin: 0 auto; }

/* ══ Round 48 ══════════════════════════════════════════════════ */
.bd-cell { background: var(--bd-bg, #000); }
.m-board[style*="--bd-bg"] .bd-cell img[data-zoom] { cursor: zoom-in; }
/* kiosk frame with square corners (Cloud Stacker screens already carry their own border) */
.m-slider.framed.sharp .sl-item img { border-radius: 0; }
.m-slider.framed.sharp .sl-frame.kiosk { border-radius: calc(var(--bz) * .6); }
/* small grid: low-res material stays modest even on big screens */
.p-run.p-grid.small { max-width: 820px; }
/* "Is it AI?": the note matches the answer (two sizes in all), half the gap under the title */
.p-ai { row-gap: 0; }
.p-ai > p { margin-top: var(--space-4); font-family: var(--mono); font-size: clamp(15px, calc(15px + 3 * var(--ramp)), 18px); line-height: 1.5; color: var(--ink); max-width: 72ch; }
/* slider headers read like the section headings: white title, white body text */
.sl-head h4 { font-size: var(--type-sub); color: var(--ink); }
.sl-head p { font-size: var(--text-body); color: var(--ink-soft); }
/* Flat cards: text a little lower, tighter title / subtitle, tight wrapped subtitle */
.card-meta span { display: block; line-height: 1.3; margin-top: 4px; }
@media (min-width: 1600px) { .flat-grid .card-meta { padding-bottom: var(--space-5); } }
.p-ai .plus-list.ai-answer li, .p-ai > p { font-family: var(--mono); font-size: clamp(17px, calc(17px + 5 * var(--ramp)), 22px); line-height: 1.45; }

/* ---------- round 49 ---------- */
/* media shown on one form factor only */
@media (max-width: 680px) { .only-desktop { display: none !important; } }
@media (min-width: 681px) { .only-phone { display: none !important; } }
.p-run.p-grid.small[data-n="1"] { max-width: 560px; }
@media (max-width: 680px) { .p-run.p-grid[data-n="1"] { grid-template-columns: minmax(0, 1fr); } }
/* "Is it AI?" card: orange tint + border (Victor picked option 3); answer bold; heading over answer on phones */
.p-ai { background: color-mix(in srgb, var(--accent) 12%, #161616); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: var(--radius-md); padding: clamp(24px, 4vw, 44px); }
.p-ai .plus-list.ai-answer li { font-weight: 700; color: var(--ink); }
@media (max-width: 680px) { .p-ai { grid-template-columns: minmax(0, 1fr); } .p-ai h3 { margin-bottom: var(--space-3); } }
.p-run.p-grid.small[data-n="1"] { margin-inline: auto; }
