/* =========================================================
   D4 — ZIHE WANG. D1 and D3 together, on one grid.
   Home is D3: the capsule intro and the toy box. WORK is D1's main page layout (GALLERY, six
   big works) or a table (INDEX). From D1: the white page, Sticky (was Margarine) / Metrophobic / Intel One
   Mono, black outline tag pills, the cards that wipe open. From D3: the buttons, toy yellow in
   small doses, the lid between pages, springy hops.

   THE GRID (Figma "GRID SYSTEM", 1512px frame, updated 2026-10-17): 48px side margins, 4 columns
   of 345px, 12px gutters (content 1416 wide); the content starts at 130px; rows sit 20px apart. Every block on every
   page starts and ends on a column edge. All sizes scale with the screen width (--u = one
   Figma px). Phones (≤720px): 2 columns, 16px margins. Press G to see the columns.
   ========================================================= */
/* Sticky: the hand-drawn display face, served from the site (typefaces/sticky.ttf) */
@font-face { font-family: 'Sticky'; src: url('assets/fonts/sticky.ttf') format('truetype'); font-display: swap; }
/* symbols2 */
@font-face {
  font-family: 'Intel One Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/intelonemono-1.woff2) format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
@font-face {
  font-family: 'Intel One Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/intelonemono-2.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Intel One Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/intelonemono-3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Intel One Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/intelonemono-4.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Metrophobic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/metrophobic-5.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Metrophobic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/metrophobic-6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Metrophobic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/metrophobic-7.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/silkscreen-8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/google/silkscreen-9.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6c6c6c;
  --faint: #b7b7b7;
  --soft: #cccccc;
  --line: #e4e4e4;
  --block: #d9d9d9;
  --accent: #ffd84d;            /* toy yellow (D3), only in small doses */
  --photo-radius: 4px;           /* every rectangular photo / film gets 4px corners */
  --shadow: 0 2px 6px rgba(0, 0, 0, .06), 0 24px 60px rgba(0, 0, 0, .12);

  --font-display: 'Sticky', 'Comic Sans MS', cursive;   /* the hand-drawn display face (typefaces/sticky.ttf) */
  --font-ui: 'Metrophobic', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Intel One Mono', ui-monospace, Menlo, monospace;
  --font-pixel: 'Silkscreen', ui-monospace, monospace;

  /* the grid */
  --u: calc(100vw / 1512);
  --m: max(16px, calc(48 * var(--u)));      /* side margin */
  --g: max(8px, calc(12 * var(--u)));       /* gutter */
  --row: max(12px, calc(20 * var(--u)));    /* space between rows */
  --top: max(92px, calc(130 * var(--u)));   /* where the content starts */

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-wipe: cubic-bezier(.77, 0, .18, 1);
  --ease-settle: cubic-bezier(.16, 1, .3, 1);
}

/* CH (i18n.js sets <html lang="zh-CN">): Chinese letters fall back to the system's Chinese face;
   the display and pixel faces (Sticky, Silkscreen) have none, so Fusion Pixel stands in for them */
:root:lang(zh) {
  --font-ui: 'Metrophobic', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-display: 'Sticky', 'Fusion Pixel 12px Monospaced Simplified Chinese', 'PingFang SC', 'Microsoft YaHei', cursive;
  --font-mono: 'Intel One Mono', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-monospace, monospace;
  --font-pixel: 'Silkscreen', 'Fusion Pixel 12px Monospaced Simplified Chinese', 'PingFang SC', monospace;
}
/* Chinese reads better with more room between the lines */
:root:lang(zh) :is(.ab-intro, .ab-small, .ab-closing, .p-text) { line-height: 1.7; }
/* Chinese sizes (2026-11-13): Chinese letters look bigger and denser than Latin ones at the same size,
   so the long reading text steps down a size and opens up, and the tiny labels step up a size so
   they stay readable */
:root:lang(zh) .pf-words .p-text { font-size: 20px; line-height: 1.8; }   /* 24px in English */
:root:lang(zh) .p-sub { font-size: 18px; line-height: 1.6; }   /* 20px in English */
:root:lang(zh) :is(.p-cap, .lb-cap) { font-size: 15px; line-height: 1.7; }   /* 16px in English */
:root:lang(zh) .tags li { font-size: 13px; letter-spacing: 0; }   /* 12px in English */
:root:lang(zh) :is(.ab-cv-head, .ab-cv-when) { font-size: 12px; letter-spacing: .02em; }   /* 11px in English */
:root:lang(zh) .ab-cv-item { line-height: 1.6; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--accent); }
.mono { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.retro { font-family: var(--font-pixel); letter-spacing: .02em; text-transform: uppercase; }

/* ---------- the grid: four columns between the margins ---------- */
.g {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  padding-inline: var(--m);
}
/* press G: the four columns, the gutters and the 130px start line */
.guides {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  padding-inline: var(--m);
  pointer-events: none;
}
.guides i { background: rgba(255, 40, 90, .05); box-shadow: inset 1px 0 rgba(255, 40, 90, .45), inset -1px 0 rgba(255, 40, 90, .45); }
.guides::after { content: ''; position: absolute; left: 0; right: 0; top: var(--top); height: 1px; background: rgba(255, 40, 90, .45); }
body.show-grid .guides { display: grid; }

/* ============ Nav (D3's form): a logo pill and a pill of numbered links, frosted ============
   Figma: ZIHE WANG at x 71 (the pill starts on the margin, 23px of padding), the links end on the
   right margin; the current page is black; words roll over on hover */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, calc(36 * var(--u))) var(--m) 0;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.logo, .nav ul, .p-back {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 2px rgba(14, 14, 14, .06), 0 4px 14px rgba(14, 14, 14, .06);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  height: 44px;
  padding: 0 max(16px, calc(23 * var(--u)));
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 18px;
  transition: transform .4s var(--ease-spring);
}
/* the logo: the pixel ZIHE WANG (LOGO/6x/Asset 20@6x), sized by its height. Under the mouse it rolls
   over like the page links, and the mark (assets/logo-mark.webp) comes up in its place: the roll is
   taller than the name (--logo-roll) so the mark reads; both sit centred in it */
.logo { --logo-h: 15px; --logo-roll: 26px; }
.logo img { display: block; height: var(--logo-h); width: auto; max-width: none; }
.logo .roll { height: var(--logo-roll); line-height: 0; }
.logo .roll > span { display: flex; align-items: center; justify-content: center; height: var(--logo-roll); }
.logo img.logo-mark { height: var(--logo-roll); }
.logo:hover .roll > span { transform: translateY(-100%); }
/* the title beside the name, in one row: who this is, at a glance */
.logo-title { font-family: var(--font-ui); font-size: 15px; line-height: 1; color: var(--muted); }   /* the same face and size as the page links */
.logo:active { transform: scale(.95); transition-duration: .1s; }
.nav ul { display: flex; gap: 2px; margin: 0; padding: 4px; border-radius: 999px; list-style: none; }
.nav ul a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .3s var(--ease-spring);
}
.nav ul a:hover { background: rgba(14, 14, 14, .06); }
.nav ul a:not([aria-disabled]):active { transform: scale(.95); transition-duration: .1s; }
.nav ul a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav ul a[aria-disabled="true"] { color: var(--muted); cursor: default; }
.nav .no { margin-right: 6px; font-family: var(--font-mono); font-size: 11px; opacity: .5; }
/* the word rolls over: written twice, the copy slides up on hover */
.roll { display: inline-block; height: 1.25em; overflow: hidden; line-height: 1.25; }
.roll > span { display: block; transition: transform .5s var(--ease-settle); }
.nav ul a:hover .roll > span { transform: translateY(-100%); }
/* the language switch (i18n.js), last in the pill after a hairline: only the language it switches
   to (中文 / EN), in the numbers' monospace, black; the word only, no background and no motion */
.nav .lang { display: flex; align-items: center; }
.nav .lang::before { content: ''; width: 1px; height: 16px; margin: 0 4px; background: rgba(14, 14, 14, .15); }
/* the project page's bar, two pills like the site nav: on the left "← WORK" (it turns over to BACK
   TO WORK, like the logo), on the right the work's name with its № and year in small grey
   monospace, then the language switch; a long name is cut short with …, the arrow always shows */
.p-back {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 44px;
  padding: 0 max(16px, calc(23 * var(--u)));
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
  transition: transform .4s var(--ease-spring);
}
/* over the work's cover: the two pills are frosted glass, the picture blurred behind them */
.p-nav .p-back, .p-nav ul { background: rgba(255, 255, 255, .4); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
.p-back .roll { text-align: center; }
.p-back:hover .roll > span { transform: translateY(-100%); }
.p-back:active { transform: scale(.95); transition-duration: .1s; }
.p-nav ul { min-width: 0; align-items: center; margin-left: 12px; }
.p-nav li { flex: none; }
.p-nav .p-nav-name { display: flex; align-items: baseline; gap: 10px; flex: 0 1 auto; min-width: 0; padding: 0 12px 0 16px; }
.p-nav-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.p-nav-meta { flex: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.nav .lang button { height: 36px; padding: 0 14px 0 12px; border: 0; background: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink); cursor: pointer; }

/* ============ Parts ============ */
/* the disciplines (and on a WORK card the client's field first): plain grey words in a row, a dot
   between them, no pills (2026-11-09) */
.tags { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.tags li { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 12px; line-height: 1.5; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.tags li + li::before { content: '·'; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  border-radius: 12.5px;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.chip { background: none; color: var(--ink); cursor: pointer; transition: background .25s, color .25s, scale .3s var(--ease-out); }
.chip:hover { background: #f2f2f2; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip:active { scale: .94; transition-duration: .1s; }
/* buttons, D3's way: a white pill on a soft shadow that lifts on hover and gives under a press;
   the pressed / chosen one turns black. The dark one carries the yellow dot */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(14, 14, 14, .06), 0 4px 14px rgba(14, 14, 14, .06);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  transition: transform .4s var(--ease-spring), box-shadow .3s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.96); transition-duration: .1s; }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; height: 52px; padding: 0 24px; }
.btn-dark::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* secondary buttons (GALLERY / INDEX): the word only, no pill and no motion; the chosen one is
   black, the other grey until the mouse is on it */
.btn-secondary { padding: 8px 0; border: 0; background: none; font-family: var(--font-ui); font-size: 14px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.btn-secondary:hover, .btn-secondary[aria-pressed="true"] { color: var(--ink); }
.btn-secondary[aria-pressed="true"] { cursor: default; }
/* a group of choices (LIST / SHELF): the pills sit together in one white capsule */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg); box-shadow: 0 1px 2px rgba(14, 14, 14, .06), 0 4px 14px rgba(14, 14, 14, .06); }
.segmented .btn { height: 32px; box-shadow: none; }
.segmented .btn:hover { transform: none; }
.segmented .btn:not([aria-pressed="true"]):hover { background: rgba(14, 14, 14, .06); }
.segmented .btn:active { transform: scale(.95); }
/* the yellow sticker (D3), set in the pixel face */
.sticker {
  display: inline-flex;
  align-items: center;
  gap: .77em;
  padding: .7em 1.08em;
  border-radius: .62em;
  background: var(--accent);
  font-size: clamp(16px, calc(30 * var(--u)), 30px);
  white-space: nowrap;
  rotate: -3deg;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .1);
  transition: rotate .5s var(--ease-spring), scale .5s var(--ease-spring), box-shadow .3s;
}
.sticker::before { content: ''; width: .62em; height: .62em; border-radius: 50%; background: var(--ink); }
.sticker:hover { rotate: 0deg; scale: 1.06; box-shadow: var(--shadow); }
.sticker:active { scale: .97; transition-duration: .1s; }

/* ============ Home (D3): the toy box, one screen, no scrolling ============ */
body.is-home { height: 100vh; height: 100svh; overflow: hidden; }
.box {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  align-content: start;
  background: var(--bg);
}
/* a soft shade along the floor where the toys land */
.box::after { content: ''; position: absolute; inset: auto 0 0; height: 28%; background: linear-gradient(to top, rgba(0, 0, 0, .045), transparent); pointer-events: none; }
/* the wordmark spans columns 1–4 exactly (main.js sets its size), each letter bobbing on its own beat */
.wordmark {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0;
  padding-top: max(150px, 24vh);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.wordmark .ch { display: inline-block; animation: bob-letter 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.45s); }
@keyframes bob-letter { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.035em; } }
/* the one way on: the yellow sticker under the wordmark, above the toys */
.go-work { grid-column: 1 / -1; justify-self: center; position: relative; z-index: 4; margin-top: max(18px, calc(28 * var(--u))); }
.toys { position: absolute; inset: 0; z-index: 2; }
.toy { position: absolute; left: 0; top: 0; max-width: none; cursor: grab; -webkit-user-drag: none; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .16)); will-change: transform; }
.toy.is-held { cursor: grabbing; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .22)); }
/* the hint and SHAKE end on the right margin, at the foot of column 4 */
.box-tools { position: absolute; right: var(--m); bottom: 22px; z-index: 3; display: flex; align-items: center; gap: 14px; }

/* ============ Home intro (D3): the capsule-toy machine ============ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 30px;
  background: var(--bg);
  cursor: pointer;
  transition: opacity .4s ease;
}
.intro.is-gone { opacity: 0; pointer-events: none; }
.skip { position: absolute; top: max(20px, calc(47 * var(--u))); right: var(--m); padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.skip:active { opacity: .55; }
.capsule { position: relative; width: clamp(140px, 15vw, 210px); aspect-ratio: 1; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .18)); }
.cap-top, .cap-bottom { position: absolute; left: 0; width: 100%; height: 50%; transition: transform .8s var(--ease-spring), opacity .5s ease; }
.cap-top { top: 0; border-radius: 999px 999px 0 0; background: radial-gradient(circle at 32% 30%, #fff6c9 0%, var(--accent) 38%, #f2b705 100%); }
.cap-bottom { bottom: 0; border-radius: 0 0 999px 999px; background: radial-gradient(circle at 40% 10%, #ffffff 0%, #e9e7e1 90%); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .08); }
.capsule.is-shaking { animation: wobble .5s ease-in-out 2; }
@keyframes wobble { 0%, 100% { rotate: 0deg; } 25% { rotate: -9deg; } 75% { rotate: 9deg; } }
.capsule.is-open .cap-top { transform: translate(-40%, -150%) rotate(-38deg); opacity: 0; }
.capsule.is-open .cap-bottom { transform: translate(30%, 130%) rotate(24deg); opacity: 0; }
.intro-count { margin: 0; font-size: clamp(14px, 1.3vw, 18px); font-variant-numeric: tabular-nums; }

/* ============ Work (D1's main page layout): GALLERY and INDEX ============ */
.work { padding-top: var(--top); padding-bottom: 140px; align-items: end; }
/* the headline: one line, small enough that the first row of work and its names show on the first screen
   (it was two lines at 72, which pushed the work down to about 390px) */
.headline {
  grid-column: 1 / 4;   /* columns 1–3; GALLERY / INDEX keep column 4 */
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, calc(40 * var(--u)), 40px);
  line-height: 1.2;
}
.headline .line { display: inline-block; vertical-align: top; overflow: hidden; }   /* the two lines run as one, and wrap on a phone */
.headline .line > span { display: inline-block; }
/* the ball after the name (2026-11-09, in place of the ":)"): the Play Area's ball in sunglasses, in black and white,
   drawn flat in 2D; its face turns toward the mouse as if the ball turned to it (main.js setupEyes,
   after the eye on x.ai/bot) */
.headline .eyes-mark { display: inline-block; width: .9em; height: .9em; margin-left: .02em; vertical-align: -.09em; }   /* 10% bigger (2026-11-09, was .82em) */
.eyes-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.eyes-mark circle { fill: var(--ink); }   /* black and white (2026-11-09): a black ball */
.eyes-mark .cool-fill { fill: var(--bg); }   /* white lenses */
.eyes-mark .cool-line { fill: none; stroke: var(--bg); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }   /* the bridge and the smile */
/* the second line: what I am good at, under the headline */
.headline-sub { grid-column: 1 / 4; grid-row: 2; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, calc(40 * var(--u)), 40px); line-height: 1.2; color: var(--ink); }   /* in the headline's own face and size (2026-11-09) */
/* the GALLERY / INDEX switch ends on the right margin, level with the foot of the headline */
.views[hidden] { display: none; }
.views { grid-column: 4; grid-row: 1 / span 2; justify-self: end; display: flex; gap: 24px; margin-bottom: -8px; }   /* level with the foot of the second line (the buttons carry 8px of padding) */
.gallery-view, .index-view { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin-top: clamp(24px, calc(40 * var(--u)), 40px); }
.gallery-view[hidden], .index-view[hidden] { display: none; }
/* GALLERY: a pair (2 + 2 columns, 3:2), then one wide card (4 columns, 21:9), and again; the cards line up at the top */
.gallery-view { column-gap: calc(8 * var(--u)); row-gap: clamp(40px, calc(64 * var(--u)), 64px); align-items: start; }   /* cards 8pt apart side by side (2026-11-09); rows well over that, so a name belongs to the picture above it */
.card { display: block; grid-column: var(--start) / span var(--span); transition: scale .35s var(--ease-out); }
.card:active { scale: .985; transition-duration: .12s; }
.card-media { position: relative; aspect-ratio: var(--ar); background: var(--block); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-media img { transform: scale(1.035); filter: brightness(.96); }
.card:hover .card-media.whole img { transform: none; }   /* `coverWhole`: never zoomed, so the full height shows */
.card:hover .card-media video { transform: scale(1.035); }
.card-title { margin: 16px 0 6px; font-size: 18px; }
.hover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease, transform .9s var(--ease-out); }
.is-playing > .hover-video { opacity: 1; }
/* the hover icon (main.js setupTrinkets): the touched work's small object trails the mouse inside
   its card; 64px, about half the size D1 used */
.trinket { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; will-change: transform; }
.trinket img {
  display: block;
  max-width: 64px;
  max-height: 64px;
  translate: -50% -50%;
  filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff) drop-shadow(0 6px 10px rgba(0, 0, 0, .22));
  opacity: 0;
  scale: .3;
  transition: opacity .2s ease, scale .45s var(--ease-spring);
}
.trinket.is-on img { opacity: 1; scale: 1; }
/* INDEX: a table on the grid. № and name over columns 1–2, disciplines column 3, year column 4 */
.index-view { align-items: start; }
.index-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .2s;
}
.index-head { padding: 0 0 12px; border-bottom-color: var(--ink); cursor: default; }
.index-row:not(.index-head):hover { background: #f5f5f3; }
.index-row:not(.index-head):active { background: #ececea; }
.i-name { grid-column: 1 / 3; display: flex; align-items: baseline; gap: 20px; font-size: clamp(17px, calc(21 * var(--u)), 21px); }
.i-name .no { flex: none; width: 2.6em; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.index-row:hover .no { color: var(--ink); }
.i-name a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease-out); }
.index-row:hover .i-name a { background-size: 100% 1px; }
.index-head > :nth-child(1) { grid-column: 1 / 3; }
.index-head > :nth-child(2), .i-tags { grid-column: 3; }
.i-tags .tags { gap: 6px 8px; }
.yr { grid-column: 4; justify-self: end; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ============ Project (Figma "GRID SYSTEM") ============ */
.project { padding-top: var(--top); padding-bottom: 140px; }
/* the cover across all four columns, 1416 × 660 */
.p-hero { position: relative; grid-column: 1 / -1; margin: 0; aspect-ratio: 1416 / 660; }
/* edge to edge: the cover's row has no side margins and the cover no rounded corners (main.js also
   drops the page's top margin, so it starts at the window's top, the nav pills floating on it) */
.p-hero-row { padding-inline: 0; --photo-radius: 0px; }
.p-hero .wipe { background: var(--block); }
.p-hero .wipe img, .p-hero .wipe video { width: 100%; height: 100%; object-fit: cover; }
.p-hero.contain .wipe { background: #f3f3f3; }
.p-hero.contain .wipe img { object-fit: contain; }
/* a film at the top is never cropped: the frame takes the film's own shape (--har) and shows all of it,
   with no parallax zoom */
.p-hero.vid { aspect-ratio: var(--har); }
.p-hero.vid .wipe video { object-fit: contain; }
/* a picture at the top fills the first screen (Figma "GRID SYSTEM", 2026-11-09), cut to fit; no opening */
.p-hero:not(.vid) { aspect-ratio: auto; height: 100vh; height: 100svh; }
/* the name 24pt under the cover, its line and tags under it, 26pt to the first row */
.p-head { margin-top: max(16px, calc(24 * var(--u))); }
.p-title {
  grid-column: 1 / 4;
  margin: 0;
  font-weight: 400;
  font-size: clamp(40px, calc(72 * var(--u)), 72px);
  line-height: 1.125;
  text-transform: uppercase;
  text-wrap: balance;
}
.p-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: max(12px, calc(19 * var(--u))); }
/* under the name, on a line of its own and in ink: what the work is (`lead`, data.js), or its subtitle;
   the disciplines follow under it in grey (2026-11-09) */
.p-sub { flex-basis: 100%; margin: 0; font-size: 20px; line-height: 1.4; color: var(--ink); }
.p-body { display: grid; row-gap: var(--row); margin-top: max(20px, calc(26 * var(--u))); }
/* a row of the grid: every cell starts on a column and spans whole columns (--start, --span);
   empty columns are left as they fall. In a row of pictures, the widest one sets the height
   (.dom keeps its own proportions) and the others fill that height, cropped at the edges */
.p-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); padding-inline: var(--m); align-items: start; }
.p-row > * { grid-column: var(--start) / span var(--span); grid-row: 1; }
.p-row.pics { align-items: stretch; }
.cell { position: relative; margin: 0; min-height: 0; }
.cell.dom { aspect-ratio: var(--r); }
/* a row of several pictures: one height for all of them, from the row's own width (--hr = one
   column's shape at that height), so they always line up exactly; each fills it, cropped at the edges */
.p-row.same { container-type: inline-size; }
.p-row.same .cell { aspect-ratio: auto; height: calc((100cqw - 3 * var(--g)) / 4 / var(--hr)); }
.cell .wipe { position: absolute; inset: 0; background: var(--block); overflow: hidden; }
.cell img, .cell video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* `frame`: only part of the film shows; the film is enlarged and moved so that part fills the cell */
.cell video.framed { inset: auto; max-width: none; left: calc(-100% * var(--fx) / var(--fw)); top: calc(-100% * var(--fy) / var(--fh)); width: calc(100% / var(--fw)); height: calc(100% / var(--fh)); }
.cell.span4 { max-height: 88vh; }
.p-text { margin: 6px 0 0; font-size: 18px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.p-text.first { color: var(--ink); }
/* several paragraphs beside one picture */
.p-words .p-text + .p-text { margin-top: 1em; }
/* a GALLERY work: each section has its words in column 1 and its rows of pictures in columns 2–4;
   a row is one picture across the three columns, or three pictures one column each */
.p-sec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); padding-inline: var(--m); align-items: start; }
.p-sec .p-words { grid-column: 1; }
.p-sec .p-text { margin-top: 0; color: var(--ink); }
.p-stack { grid-column: 2 / -1; display: grid; row-gap: var(--g); }
.p-pics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--g); }
.p-pics > .cell { grid-column: span var(--span); }
.p-pics > .cell.fill { align-self: stretch; }
/* a row at one height, nothing cropped (data.js: [a, b, [c, d]], the inner list a stacked column) */
.p-pics.justified { display: flex; gap: var(--g); align-items: flex-start; }
.jr-item, .jr-stack { flex: none; min-width: 0; }
.jr-stack { display: grid; row-gap: var(--g); }
/* a caption under a big picture (`captions`, data.js), as wide as the picture */
.p-cap { grid-column: var(--cc, 1 / -1); margin: 10px 0 0; font-size: 16px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
/* a GALLERY work after Figma "GRID SYSTEM" (2026-11-09): rows of at most two pictures across the four
   columns, 8pt apart (across and down), and the words in a row of their own over columns 1–2: 40pt under the pictures
   above them, 96pt over the pictures below (main.js sectionsHtml) */
.p-flow { --pg: calc(8 * var(--u)); padding-inline: var(--m); }   /* --pg: the gap between pictures, across and down (8pt, 2026-11-09) */
.pf-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--pg); align-items: start; }
.pf-row > .cell { grid-column: var(--pc, 1 / -1); grid-row: 1; }
.pf-row.pf-pair > .cell { grid-column: span 2; }
.pf-row > .cell.span4 { max-height: none; }
.pf-row > .p-cap { grid-row: 2; }
.pf-row.pf-just { display: flex; gap: var(--pg); align-items: flex-start; }
.pf-row + .pf-row { margin-top: var(--pg); }
.pf-row:has(> .p-cap) + .pf-row, .pf-cap + .pf-row { margin-top: max(24px, calc(32 * var(--u))); }
.pf-words { width: calc((100% - var(--g)) / 2); margin-top: max(28px, calc(40 * var(--u))); }
.pf-words .p-text { margin: 0; font-size: 24px; line-height: 1.35; color: var(--ink); }   /* 24px (2026-11-09) */
.pf-words + .pf-row { margin-top: max(56px, calc(96 * var(--u))); }
/* one big frame where pictures take turns (sketch → line → render), and swaps inside a cell */
.cell.seq .wipe, .cell.swap .wipe { background: #fff; }
/* the sketch sequences (seq, swap): each picture fades in as a whole over the one before, which stays
   underneath meanwhile (so nothing flashes white). Like every other picture they fill their cell, so the
   corners line up with the cells beside them */
.cell.seq img, .cell.swap img { opacity: 0; }
.cell.seq img.is-under, .cell.swap img.is-under { opacity: 1; z-index: 1; }
.cell.seq img.is-on, .cell.swap img.is-on { z-index: 2; animation: seq-fade .8s ease-in-out forwards; }
@keyframes seq-fade { from { opacity: 0; } to { opacity: 1; } }
/* next work: a line across the four columns, the toy of the next work beside its name */
.p-next { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); align-items: center; margin: clamp(80px, 9vw, 140px) var(--m) 0; padding-top: 20px; border-top: 1px solid var(--line); }
.p-next .mono { grid-column: 1; }
.p-next a { grid-column: 2 / -1; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: clamp(24px, 3.17vw, 48px); transition: transform .5s var(--ease-out); }
.p-next a img { width: clamp(60px, calc(100 * var(--u)), 100px); transition: transform .6s var(--ease-spring); }
.p-next a:hover { transform: translateX(8px); }
.p-next a:hover img { transform: rotate(-10deg) scale(1.08); }
.p-next a:active { transform: translateX(8px) scale(.98); transition-duration: .1s; }
.p-missing { grid-column: 1 / -1; padding-top: 30vh; text-align: center; color: var(--muted); }
.p-missing a { color: var(--ink); text-decoration: underline; }

/* ============ About: split page (after alexandregellard.studio) ============
   Left, columns 1–2: everything, on one screen. Right, from column 3 to the edge of the screen: a
   full-height panel with the toys floating in it. */
.ab-split {
  /* --a: the about page's unit, the smaller of the width unit and a height unit, so on a short screen
     the left half shrinks instead of scrolling (everything sits on one screen, 2026-11-09) */
  --a: min(var(--u), calc(100svh / 960));
  --ab-foot: max(24px, calc(64 * var(--u)));   /* the foot line: 36pt, moved up another 36pt, then down 8pt (2026-10-19) */
  --ab-title: clamp(32px, calc(56 * var(--a)), 56px);   /* one line: the title is about 11.4 times its size wide */
  --ab-cap: calc(var(--ab-title) * .125);
  --ab-body: clamp(12px, calc(16 * var(--a)), 16px);
  --ab-cv: clamp(11.5px, calc(14 * var(--a)), 14px);
  min-height: 100vh; min-height: 100svh; align-items: stretch;   /* a very short screen grows the page rather than overlap */
}
/* the left half, on the grid's own columns 1 and 2, in four bands: the title, the statement, (room), the
   CV at the foot, the place and email on the foot line. The text keeps 36pt clear of the toys' panel */
.ab-text {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--top) - 28 * var(--u)) calc(36 * var(--u)) var(--ab-foot) 0;
}
.ab-title { grid-column: 1 / -1; grid-row: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--ab-title); line-height: 1.05; text-wrap: balance; }
/* the statement in two columns: the first paragraph in column 1, the other two in column 2, both
   starting on one line; all three share one size */
.ab-intro, .ab-more { grid-row: 2; margin: calc(28 * var(--a)) 0 0; }
.ab-intro { grid-column: 1; padding-right: calc(24 * var(--u)); }
.ab-more { grid-column: 2; display: grid; align-content: start; gap: calc(12 * var(--a)); }
.ab-intro, .ab-small, .ab-closing { margin-bottom: 0; font-size: var(--ab-body); line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.ab-small, .ab-closing { margin-top: 0; }
/* the CV at the foot, read like a spec sheet under one hairline: experience in column 1, education and
   software in column 2. Three levels only, by colour and face, never weight: grey monospace labels, the
   name in ink, the note in grey */
.ab-cv { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: subgrid; align-items: start; padding-top: calc(16 * var(--a)); border-top: 1px solid var(--line); }
.ab-cv > .ab-cv-group { grid-column: 1; padding-right: calc(24 * var(--u)); }
.ab-cv-side { grid-column: 2; display: grid; gap: calc(22 * var(--a)); }
.ab-cv-group { display: grid; gap: calc(12 * var(--a)); }
.ab-cv-head { margin: 0; font-size: 11px; font-weight: 400; line-height: 1.4; letter-spacing: .06em; color: var(--ink); }
.ab-cv-item { margin: 0; font-size: var(--ab-cv); line-height: 1.38; color: var(--ink); text-wrap: pretty; }
.ab-cv-when, .ab-cv-name, .ab-cv-note { display: block; }
.ab-cv-when { margin-bottom: 2px; font-size: 11px; line-height: 1.4; }
.ab-cv-note { color: var(--muted); }
.ab-contact { grid-column: 1 / -1; grid-row: 5; margin-top: calc(22 * var(--a)); color: var(--ink); }
.ab-mail { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out); }
.ab-mail:hover { background-size: 100% 1px; }
.ab-mail:active { opacity: .6; }
/* the toys' panel, on the grid: columns 3–4, from the 130px content line down to the same foot
   line as the text; it stays put while the text scrolls */
.ab-panel {
  grid-column: 3 / -1;
  position: sticky;
  /* like the text on the left: 28pt above the content line, its top level with the top of the
     title's capitals (Sticky's capitals start 0.125 of the font size below the line's top: --ab-cap),
     and 36pt narrower on its left side */
  top: calc(var(--top) - 28 * var(--u) + var(--ab-cap));
  align-self: start;
  margin-top: calc(var(--top) - 28 * var(--u) + var(--ab-cap));
  margin-left: calc(36 * var(--u));
  height: calc(100vh - var(--top) + 28 * var(--u) - var(--ab-cap) - var(--ab-foot));    /* still ends on the text's foot line */
  height: calc(100svh - var(--top) + 28 * var(--u) - var(--ab-cap) - var(--ab-foot));
  border-radius: var(--photo-radius);
  overflow: hidden;
  touch-action: pan-y;
  background: linear-gradient(to bottom, #0e0e0e 0%, #0e0e0e 22%, #4a4a32 48%, #c9b64a 74%, var(--accent) 100%);
}
/* my photo in the middle of the panel (3:4), under the toys: some toys cut into it, some don't */
.ab-portrait {
  position: absolute;
  left: 50%;
  top: 50%;   /* the photo always sits in the very centre of the panel */
  z-index: 1;
  width: min(calc((100% - var(--g)) / 2), calc((100svh - var(--top) - var(--ab-foot)) * .6));   /* about one grid column wide (3:4), smaller on short screens */
  height: auto;
  translate: -50% -50%;
  border-radius: var(--photo-radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.ab-toys { position: absolute; inset: 0; z-index: 2; }
.ab-toy { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; user-select: none; will-change: transform; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35)); }

/* ============ PLAY AREA: the claw machine in 3D ============
   One screen, white, the machine standing on the floor (three.js draws it, play.js). The only words
   are COIN ME, which pop up beside the machine when the mouse is on it; the page never leaves. */
body.is-play { height: 100vh; height: 100svh; overflow: hidden; }
body.is-over-machine { cursor: pointer; }
.play-3d { position: fixed; inset: 0; background: var(--bg); }
.stage { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.stage.is-ready { opacity: 1; }
.stage canvas { display: block; width: 100%; height: 100%; }
/* the height the camera shows the frame at (see fit in play.js): the frame's height, until the machine would get wider than the page */
.stage-poster { position: absolute; left: 50%; top: 50%; width: auto; height: min(100%, 179vw); max-width: none; translate: -50% -50%; pointer-events: none; }
/* while the model comes: a pixel smiley hops beside the words, in steps like the display face. Only
   after .4 s, so a fast line never sees it. Transform only: it keeps hopping while the scene is being built */
.play-load { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; display: flex; justify-content: center; align-items: center; gap: 10px; font-family: Sticky, 'Comic Sans MS', cursive; font-size: 20px; line-height: 1; pointer-events: none; animation: play-load-in 0s .4s both; }
.play-load[hidden] { display: none; }
.play-hop { flex: none; width: 26px; height: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd84d' d='M4 1h5v1H4zM2 2h9v2H2zM1 4h11v5H1zM2 9h9v2H2zM4 11h5v1H4z'/%3E%3Cpath d='M4 0h5v1H4zM2 1h2v1H2zM9 1h2v1H9zM1 2h1v2H1zM11 2h1v2h-1zM0 4h1v5H0zM12 4h1v5h-1zM1 9h1v2H1zM11 9h1v2h-1zM2 11h2v1H2zM9 11h2v1H9zM4 12h5v1H4zM4 4h1v2H4zM8 4h1v2H8zM3 7h1v1H3zM9 7h1v1H9zM4 8h5v1H4z'/%3E%3C/svg%3E") center / 100% no-repeat; transform-origin: 50% 100%; animation: play-hop .64s steps(1) infinite; }
@keyframes play-load-in { from { visibility: hidden; } to { visibility: visible; } }
@keyframes play-hop {
  0%, 100% { transform: scale(1.12, .84); }
  20%, 80% { transform: translateY(-6px); }
  40%, 60% { transform: translateY(-10px); }
}
/* after a round: the sheet of other work comes in from the right, over columns 2–4; the ball hangs in
   column 1 with the name of the picture under the mouse below it */
.sheet {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 20;
  left: calc(var(--m) + (100vw - 2 * var(--m) - 3 * var(--g)) / 4 + var(--g));
  padding: 92px var(--m) var(--m) 24px;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--photo-radius) 0 0 var(--photo-radius);
  box-shadow: 0 0 2px rgba(14, 14, 14, .06), -12px 0 40px rgba(14, 14, 14, .1);
  transform: translateX(104%); transition: transform .85s var(--ease-out);
}
.sheet.is-on { transform: none; }
.sheet-back { display: block; margin: 0 0 20px auto; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--g); align-items: start; }
.sheet-col { min-width: 0; }
.sheet-item { display: block; width: 100%; margin: 0 0 var(--g); padding: 0; border: 0; background: var(--block); cursor: pointer; border-radius: 4px; overflow: hidden; content-visibility: auto; }   /* off-screen pictures cost nothing, however long the sheet gets */
.sheet-item img { display: block; width: 100%; height: auto; transition: transform .6s var(--ease-out); }
.sheet-item:hover img, .sheet-item:focus-visible img { transform: scale(1.04); }
.ball-name {
  position: fixed; z-index: 15; margin: 0; width: min(26vw, 340px); translate: -50% 0;
  font-family: Sticky, 'Comic Sans MS', cursive; font-size: 24px; line-height: 1.15; text-align: center; text-wrap: balance;
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.ball-name.is-on { opacity: 1; }
/* one picture, the whole page */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(255, 255, 255, .42); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; transition: opacity .35s ease; }
.lightbox.is-on { opacity: 1; }
.lb-media { position: absolute; border-radius: var(--photo-radius); overflow: hidden; opacity: 0; transform: scale(.97); transition: opacity .4s ease .12s, transform .6s var(--ease-out) .12s; }
.lightbox.is-on .lb-media { opacity: 1; transform: none; }
.lb-media img, .lb-media video { display: block; width: 100%; height: 100%; object-fit: contain; }
.lb-back { position: absolute; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; }
.lb-name { position: absolute; height: 34px; margin: 0; padding: 0 14px 0 36px; background: #fff; border-radius: 4px; font-family: Sticky, 'Comic Sans MS', cursive; font-size: 20px; line-height: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; clip-path: inset(0 100% 0 0); transition: clip-path .25s ease; }
.lightbox.is-on .lb-name { clip-path: inset(0 0 0 0); transition: clip-path .5s var(--ease-out) .42s; }
/* what the picture shows (captions, data.js), as on a work's page: 16px grey, here on a white tag under the
   picture so it reads over the blurred sheet (2026-11-11) */
.lb-cap { position: absolute; margin: 0; padding: 6px 12px; background: #fff; border-radius: 4px; font-size: 16px; line-height: 1.45; color: var(--muted); text-wrap: pretty; opacity: 0; transition: opacity .4s ease .3s; }
.lb-cap[hidden] { display: none; }
.lightbox.is-on .lb-cap { opacity: 1; }
.is-lightbox .ball-name { opacity: 0; }
/* the ball's own canvas, above everything but the lid */
.ball-layer { position: fixed; inset: 0; z-index: 85; display: none; pointer-events: none; }
.ball-layer.is-on { display: block; }
/* COIN ME: a button in Sticky, popping up beside the head with a little bounce */
.see-work {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  left: 0;
  top: 0;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(28px, calc(46 * var(--u)), 46px);
  line-height: 1;
  white-space: nowrap;
  translate: 0 -50%;
  rotate: -4deg;
  scale: .4;
  opacity: 0;
  transform-origin: 0 50%;
  pointer-events: none;
  transition: scale .55s var(--ease-spring), opacity .2s, rotate .55s var(--ease-spring);
}
.see-work.is-on { scale: 1; opacity: 1; rotate: -2deg; pointer-events: auto; }
.see-work:hover { rotate: 0deg; }
/* on a narrow screen they sit under the machine, centred */
.see-work.is-narrow { translate: -50% 0; transform-origin: 50% 0; }
/* no 3D (no WebGL, or the model did not load): only the words, in the middle */
.see-work.is-flat { left: 50% !important; top: 50% !important; translate: -50% -50%; }

/* ============ Shared (D3): the lid between pages ============ */
.lid {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  transform: translateY(-101%);
  transition: transform .38s cubic-bezier(.7, 0, .2, 1);
  pointer-events: none;
}
.lid.is-shut { transform: none; }
/* until the lid arrives (main.js runs last): its colour over everything, set by the script in <head> */
html.lid-on { background: var(--lid-bg, var(--ink)); }
html.lid-on::after { content: ''; position: fixed; inset: 0; z-index: 71; background: var(--lid-bg, var(--ink)); }
.lid-word { font-family: var(--font-display); font-size: clamp(44px, 9vw, 130px); }
/* on the way to a work the lid shows the work's name: smaller, centred, wrapping onto balanced lines */
.lid-word.is-work { max-width: 86vw; font-size: clamp(30px, 6vw, 96px); line-height: 1.1; text-align: center; text-wrap: balance; }

/* ============ Appear on scroll ============
   (smooth pass, 2026-11-14) Everything that appears on scroll moves with opacity and transforms only,
   which the browser animates off the main thread, so scrolling stays smooth while they play: no
   clip-path wipe and no blur (both repaint the whole picture every frame). A block starts a little
   before it reaches the screen (main.js startReveals) and never waits for the blocks above it: --d is
   only the small stagger inside one row */
.wipe { height: 100%; overflow: hidden; }
/* 4px corners on every rectangular photo and film: the card pictures, the project cover, the gallery cells */
.card-media, .wipe { border-radius: var(--photo-radius); }
/* a picture: its frame fades in and rises a little while the picture inside settles from slightly large */
.work-in .card-media, .work-in > .wipe { opacity: 0; translate: 0 28px; transition: opacity .55s ease var(--d, 0s), translate .9s var(--ease-settle) var(--d, 0s); }
.work-in.is-in .card-media, .work-in.is-in > .wipe { opacity: 1; translate: none; }
.work-in :is(.card-media, .wipe) > :is(img, video) { scale: calc(var(--rest, 1) * 1.06); transition: scale 1.2s var(--ease-settle) var(--d, 0s), transform .9s var(--ease-out), filter .4s ease; }
.work-in.is-in :is(.card-media, .wipe) > :is(img, video) { scale: var(--rest, 1); }
.parallax { --rest: 1.1; }   /* the cards' pictures sit 1.1 large in their frames (their scroll drift is gone, main.js) */
.card.work-in .card-title, .card.work-in .tags { opacity: 0; translate: 0 10px; transition: opacity .5s ease, translate .7s var(--ease-settle); transition-delay: calc(var(--d, 0s) + .08s); }
.card.work-in .tags { transition-delay: calc(var(--d, 0s) + .14s); }
.card.work-in.is-in .card-title, .card.work-in.is-in .tags { opacity: 1; translate: none; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s ease, transform .8s var(--ease-settle); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
.headline .line > span.reveal { transform: translateY(105%); opacity: 1; }
.headline .line > span.reveal.is-in { transform: none; }

/* ============ Access ============ */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.card:focus-visible { outline-offset: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: var(--m); top: 12px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--bg); font-size: 14px; translate: 0 -200%; transition: translate .25s var(--ease-out); }
.skip-link:focus { translate: none; }

/* ============ Phones: two columns ============ */
@media (max-width: 720px) {
  :root { --u: calc(100vw / 700); }
  .g, .guides, .p-row, .p-next { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo { gap: 12px; height: 38px; padding: 0 12px; font-size: 14px; }
  .logo { --logo-h: 12px; --logo-roll: 22px; }
  .logo-title { font-size: 12px; }
  .nav ul { padding: 3px; }
  .nav ul a { height: 32px; padding: 0 9px; font-size: 12px; }
  .nav .no { display: none; }
  .nav .lang::before { margin: 0 2px; }
  .nav .lang button { height: 32px; padding: 0 9px; font-size: 11px; }
  .p-nav-title { font-size: 12px; }
  .p-back { height: 38px; padding: 0 12px; font-size: 12px; }
  .p-nav ul { margin-left: 8px; }
  .p-nav .p-nav-name { gap: 8px; padding: 0 8px 0 10px; }
  .p-nav-meta { font-size: 11px; }
  /* HOME: the hint makes room; SHAKE sits bottom right */
  .wordmark { padding-top: 26vh; }
  .box-hint { display: none; }
  /* WORK */
  .headline, .headline-sub { grid-column: 1 / -1; }
  .views { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin: 24px 0 0; }
  .gallery-view, .index-view { margin-top: 32px; }
  .card { grid-column: 1 / -1; }
  .card .card-media { aspect-ratio: 4 / 3; }
  .i-name { grid-column: 1 / -1; }
  .index-head > :nth-child(2) { display: none; }
  .i-tags { grid-column: 1; margin-top: 10px; }
  .index-head > .yr, .index-row .yr { grid-column: 2; align-self: end; }
  .index-head > :nth-child(1) { grid-column: 1; }
  /* PROJECT: every cell keeps its own proportions; wide ones take both columns */
  .p-title, .p-meta { grid-column: 1 / -1; }
  .p-row > * { grid-column: auto / span var(--mspan); grid-row: auto; }
  .p-row { row-gap: var(--row); }
  .cell, .cell.dom { aspect-ratio: var(--rn, var(--r)); }   /* on a phone every picture keeps its own shape */
  /* pictures side by side on a phone (one column each) share the row's shape too */
  .p-row.same .cell { height: auto; aspect-ratio: var(--rn); }
  .p-row.same .cell.m1 { aspect-ratio: var(--r); }
  /* a GALLERY work: the words above their pictures; of three small ones, two side by side, one below */
  .p-sec { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .p-sec .p-words, .p-stack { grid-column: 1; }
  .p-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--g); }
  .p-pics > .cell { grid-column: span 2; }
  /* a one-height row is too small on a phone: each picture across, a stacked column as two side by side */
  .p-pics.justified { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--g); }
  .jr-item { grid-column: 1 / -1; width: auto !important; }
  .jr-stack { grid-column: 1 / -1; width: auto !important; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); align-items: center; }
  .p-cap { grid-column: 1 / -1; }
  /* the GALLERY flow on a phone: one picture under another, each in its own shape; the words full width */
  .pf-row, .pf-row.pf-pair { grid-template-columns: minmax(0, 1fr); row-gap: var(--pg); }
  .pf-row > .cell, .pf-row.pf-pair > .cell { grid-column: 1; grid-row: auto; }
  .pf-row > .p-cap { grid-row: auto; grid-column: 1; }
  .pf-row.pf-just { flex-direction: column; }
  .pf-row.pf-just .jr-item { width: 100% !important; }
  .pf-words { width: auto; }
  .pf-words .p-text { font-size: 18px; line-height: 1.45; }   /* 24px is too big on a phone */
  :root:lang(zh) .pf-words .p-text { font-size: 17px; line-height: 1.8; }
  .p-pics > .cell.m1:not(:nth-child(3)) { grid-column: span 1; aspect-ratio: var(--r); }
  .p-pics > .cell.fill { grid-column: span 2; aspect-ratio: var(--rn); }
  /* PLAY AREA: the sheet comes up over the lower part of the page; the ball hangs above it */
  .sheet { left: 0; top: 40vh; padding: 16px var(--m) var(--m); border-radius: var(--photo-radius) var(--photo-radius) 0 0; transform: translateY(104%); }
  .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-back { margin-left: 0; }
  .ball-name { width: 70vw; font-size: 18px; }
  .p-next .mono, .p-next a { grid-column: 1 / -1; }
  .p-next a { margin-top: 10px; }
  /* ABOUT on a phone: one screen cannot hold it all, so the page scrolls again: the text in one column
     (the statement, then the CV, each group under the last), then the toys' panel at full width */
  .ab-split { --a: 1px; --ab-title: 40px; --ab-body: 14px; --ab-cv: 14px; }
  .ab-text { grid-column: 1 / -1; display: flex; flex-direction: column; min-height: 0; padding: var(--top) 0 40px; }
  .ab-intro, .ab-more { margin-top: 20px; padding-right: 0; }
  .ab-more { margin-top: 12px; }
  .ab-cv { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 36px; }
  .ab-cv > .ab-cv-group, .ab-cv-side { grid-column: 1; padding-right: 0; }
  .ab-panel { grid-column: 1 / -1; position: relative; top: auto; margin: 0; height: 70svh; }
  .ab-portrait { width: min(calc((100% - var(--g)) / 2), 46svh); }
}

/* narrow phones: the logo with its title and the page links do not fit one row, so the page links
   take a second row under the logo, and the content starts lower to make room (not on a project page,
   whose bar is one row) */
@media (max-width: 520px) {
  .nav { flex-wrap: wrap; row-gap: 8px; }
  .p-nav { flex-wrap: nowrap; }
  body:not([data-page="project"]) { --top: 124px; }
  .work { padding-top: calc(var(--top) + 8px); }
}

/* reduced motion: only the background drift stops (bobbing letters and toys);
   the intro, the falling toys and the hops still play */
@media (prefers-reduced-motion: reduce) {
  .wordmark .ch { animation: none; }
}
