/* ==========================================================================
   Clara Kulmurzina — portfolio
   One typeface (Geist Mono), centred composition, light and dark themes.
   ========================================================================== */

:root {
  --fg: #0b0b0b;
  --fg-2: rgba(11, 11, 11, 0.42);
  --bg: #ececec;                                  /* grey page; the white band moves over it */
  --band: 255, 255, 255;
  --band-a: 1;
  --hero-fg: #494949;                             /* first-screen text */
  --glass: rgba(236, 236, 236, 0.62);
  --glass-strong: rgba(236, 236, 236, 0.74);
  --line: rgba(11, 11, 11, 0.12);
  --ph: #e0e0e0;

  --font: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Xanh Mono", "Geist Mono", ui-monospace, monospace;   /* serif mono for big type */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;   /* running text */
  --small: 11px;                                  /* UI, labels, captions */
  --text: 13px;                                   /* running text */
  --big: clamp(22px, min(4.4vw, 5.6vh), 68px);    /* display: fits the hero in ~3/4 of the screen */
  --track: 0.62em;                                /* letter-spacing of a selected item */
  --filters-h: 40px;

  --pad: 16px;          /* page side margin */
  --gap: 12px;          /* grid gutter */
  --img-gap: 4px;       /* between images */
  --header-h: 46px;     /* phones: one row — name + Menu */

  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --dur: 0.8s;

  /* image heights: row / open / small (category view) — mobile */
  --h-s: calc((var(--vw, 100vw) - 2 * var(--pad) - var(--img-gap)) / 2.3 * 1.25);
  --h-l: min(calc(var(--vw, 100vw) * 0.78 * 1.25), calc(100svh - var(--header-h) - 260px));
  --h-xs: calc(var(--vw, 100vw) * 0.5 * 1.25);
}

@media (min-width: 760px) {
  :root {
    --pad: 24px;
    --gap: 20px;
    --img-gap: 5px;
    --header-h: 46px;     /* one row: name · work · about · playground */
    /* row: four 4:5 images per screen; open: two per screen */
    --h-s: calc((var(--vw, 100vw) - 2 * var(--pad) - 3 * var(--img-gap)) / 4 * 1.25);
    --panel: clamp(280px, 28vw, 440px);
    --h-l: min(
      calc((var(--vw, 100vw) - 2 * var(--pad) - var(--panel) - var(--img-gap)) / 2 * 1.25),
      calc(100svh - var(--header-h) - var(--filters-h) - 120px)
    );
    --h-xs: calc(var(--h-s) * 0.78);
  }
}

/* dark theme: chosen with the toggle, or the system setting before JS runs */
:root[data-theme="dark"] {
  --fg: #f3f3f1;
  --fg-2: rgba(243, 243, 241, 0.45);
  --bg: #141414;
  --band: 255, 255, 255;
  --band-a: 0.07;
  --hero-fg: #bdbdbd;
  --glass: rgba(20, 20, 20, 0.62);
  --glass-strong: rgba(20, 20, 20, 0.74);
  --line: rgba(243, 243, 241, 0.16);
  --ph: #1b1b1a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --fg: #f3f3f1;
    --fg-2: rgba(243, 243, 241, 0.45);
    --bg: #141414;
    --band: 255, 255, 255;
    --band-a: 0.07;
    --hero-fg: #bdbdbd;
    --glass: rgba(20, 20, 20, 0.62);
  --glass-strong: rgba(20, 20, 20, 0.74);
    --line: rgba(243, 243, 241, 0.16);
    --ph: #1b1b1a;
    color-scheme: dark;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0s; }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--text)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease;
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; text-align: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* small uppercase UI type */
.mono {
  font-size: var(--small);
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.muted { color: var(--fg-2); }
.link { transition: color 0.2s ease; }
.link:hover { color: var(--fg-2); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* soft reveal on scroll (only when JS is running) */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s ease, transform 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* frosted glass for everything that stays on top */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

/* ---------- print marks: crop marks in the corners, fold marks mid-edge ---------- */

.print-marks { position: fixed; inset: 0; z-index: 30; pointer-events: none; --mk-o: 10px; --mk-l: 8px; }
@media (min-width: 760px) { .print-marks { --mk-o: 14px; --mk-l: 10px; } }
.pm { position: absolute; display: block; background: var(--fg); opacity: 0.55; }
/* crop marks: lines that stop short of the (imaginary) trim corner */
.pm-tl-h, .pm-tr-h, .pm-bl-h, .pm-br-h { width: var(--mk-l); height: 1px; }
.pm-tl-v, .pm-tr-v, .pm-bl-v, .pm-br-v { width: 1px; height: var(--mk-l); }
.pm-tl-h { top: var(--mk-o); left: 0; }
.pm-tl-v { left: var(--mk-o); top: 0; }
.pm-tr-h { top: var(--mk-o); right: 0; }
.pm-tr-v { right: var(--mk-o); top: 0; }
.pm-bl-h { bottom: var(--mk-o); left: 0; }
.pm-bl-v { left: var(--mk-o); bottom: 0; }
.pm-br-h { bottom: var(--mk-o); right: 0; }
.pm-br-v { right: var(--mk-o); bottom: 0; }
/* fold marks: the middle of each edge */
.pm-fold-t, .pm-fold-b { left: 50%; width: 1px; height: var(--mk-l); }
.pm-fold-t { top: 0; }
.pm-fold-b { bottom: 0; }
.pm-fold-l, .pm-fold-r { top: 50%; height: 1px; width: var(--mk-l); }
.pm-fold-l { left: 0; }
.pm-fold-r { right: 0; }

/* ---------- white band: a wide soft stripe of light across the grey page, follows the cursor up and down ---------- */

.glow-band {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 44vh;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  /* full width, no ends; brightest in the middle, eased fall-off to the grey page */
  background: linear-gradient(to bottom,
    rgba(var(--band), 0) 0%,
    rgba(var(--band), calc(var(--band-a) * 0.18)) 18%,
    rgba(var(--band), calc(var(--band-a) * 0.55)) 32%,
    rgba(var(--band), calc(var(--band-a) * 0.88)) 43%,
    rgba(var(--band), var(--band-a)) 50%,
    rgba(var(--band), calc(var(--band-a) * 0.88)) 57%,
    rgba(var(--band), calc(var(--band-a) * 0.55)) 68%,
    rgba(var(--band), calc(var(--band-a) * 0.18)) 82%,
    rgba(var(--band), 0) 100%);
}
/* page content sits above the band (and the Playground dots) */
body > main, body > .site-footer { position: relative; z-index: 1; }

/* ---------- layout ---------- */

.wrap { padding-inline: var(--pad); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

/* ---------- header: name over the menu, both on the centre axis ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  font-size: var(--small);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background-color 0.4s ease;
}
/* nothing under the header yet (top of the page): no glass plate, the white band passes behind the text */
.site-header.is-clear {
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.hdr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  row-gap: 8px;
  min-height: var(--header-h);
  padding-block: 10px;
}
.hdr .brand { justify-self: start; }
.hdr-center { grid-column: 1 / -1; grid-row: 2; }
@media (min-width: 760px) {
  .hdr { grid-template-columns: 1fr auto 1fr; padding-block: 0; }
  .hdr .brand { grid-column: 1; grid-row: 1; }
  .hdr-center { grid-column: 2; grid-row: 1; }
  .clock { grid-column: 3; }
}
.hdr-center { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.hdr-center { transition: transform 0.6s var(--ease); will-change: transform; }
.hdr-center.no-slide { transition: none; }
/* invisible copy used to measure the final position of the selected item */
.hdr-center.is-measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; transition: none; }
.hdr-center.is-measure * { transition: none !important; animation: none !important; }
@media (min-width: 760px) {
  .hdr-center { flex-direction: row; align-items: baseline; gap: 40px; }
}
.brand { transition: color 0.2s ease; }
.brand:hover { color: var(--fg-2); }

.nav { display: flex; justify-content: center; gap: 14px; }
.nav a {
  color: var(--fg-2);
  transition: color 0.3s ease, letter-spacing 0.6s var(--ease), margin-right 0.6s var(--ease);
}
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] {
  color: var(--fg);
  letter-spacing: var(--track);
  margin-right: calc(-1 * var(--track));   /* keep the word optically centred */
}
@media (min-width: 760px) { .nav { gap: 32px; } }


.clock { justify-self: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-city { display: none; }
@media (min-width: 760px) { .clock-city { display: inline; } }

/* ---------- phones: one-row header (name · ⌄ · time); the arrow drops a menu panel down from the top ---------- */

.menu-btn, .mnav { display: none; }
.menu-btn svg, .mnav-close svg { display: block; width: 18px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.2; }
@media (max-width: 759px) {
  .hdr { grid-template-columns: 1fr auto 1fr; padding-block: 0; }
  .hdr .brand { grid-column: 1; grid-row: 1; }
  .hdr .hdr-center, .site-header .hdr-filters { display: none; }   /* phones: no docked category row — it stays at the start of the list */
  .menu-btn { display: block; grid-column: 2; grid-row: 1; padding: 12px 14px; margin: -12px 0; color: var(--fg); }
  .hdr .clock { grid-column: 3; grid-row: 1; }

  /* no opacity on the wrapper: a fading parent switches the frosted blur off until it finishes */
  .mnav {
    display: block;
    position: fixed; inset: 0; z-index: 40;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    transition: background-color 0.7s ease, visibility 0s linear 0.8s;
    font-size: var(--small);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  .mnav.is-open {
    background: rgba(0, 0, 0, 0.06);         /* the page underneath dims a touch; tap it to close */
    visibility: visible;
    transition: background-color 0.6s ease;
  }
  /* frosted glass: lighter tint, stronger blur — the page shows through, softened */
  .mnav-sheet {
    background: var(--glass);
    -webkit-backdrop-filter: blur(30px) saturate(1.7);
    backdrop-filter: blur(30px) saturate(1.7);
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-101%);
    transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);    /* going up: eases in and out */
    will-change: transform;
    max-height: 100svh; overflow-y: auto;
  }
  .mnav.is-open .mnav-sheet {
    transform: none;
    transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);     /* coming down: long, soft landing */
  }
  .mnav-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--header-h); }
  .mnav-top .clock { justify-self: end; }
  .mnav-close { padding: 12px 14px; margin: -12px 0; color: var(--fg); }
  .mnav-close svg { transform: rotate(180deg); }   /* the same arrow, pointing up */

  /* the pages in mono, one per line; the current one in black */
  .mnav-main { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
  .mnav-big {
    font-family: var(--font);
    font-size: clamp(18px, 5.6vw, 26px); line-height: 1.1;
    letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--fg-2);
    opacity: 0; transform: translateY(-6px);
    transition: color 0.25s ease, opacity 0.5s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .mnav.is-open .mnav-big { opacity: 1; transform: none; }
  .mnav.is-open .mnav-big:nth-of-type(1) { transition-delay: 0.15s; }
  .mnav.is-open .mnav-big:nth-of-type(2) { transition-delay: 0.22s; }
  .mnav.is-open .mnav-big:nth-of-type(3) { transition-delay: 0.29s; }
  .mnav-big[aria-current="page"], .mnav-big:active { color: var(--fg); }

  .mnav-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; color: var(--fg-2); }
  .mnav-foot a { color: var(--fg-2); }
  html.menu-open, html.menu-open body { overflow: hidden; }

  /* the category row on the page wraps instead of scrolling sideways */
  .filters.filters--flow { flex-wrap: wrap; justify-content: center; white-space: normal; overflow: visible; column-gap: 16px; row-gap: 10px; }
  .filters.filters--flow .fsep { display: none; }
  .filters.filters--flow .fbreak { display: block; flex-basis: 100%; height: 0; }
  .filters.filters--flow button { white-space: nowrap; }
  .filters.filters--flow button[aria-pressed="true"] { letter-spacing: 0.3em; margin-right: -0.3em; }
}

/* ---------- footer ---------- */

.site-footer { padding-top: 120px; padding-bottom: 20px; font-size: var(--small); letter-spacing: 0.02em; text-transform: uppercase; }
.site-footer .mono { font-size: inherit; }
.site-footer .grid { row-gap: 10px; align-items: end; }
.site-footer .copy { grid-column: 1 / 7; }
.site-footer .social { grid-column: 1 / 13; display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer .top { grid-column: 7 / 13; grid-row: 1; justify-self: end; }
.site-footer .link { color: var(--fg-2); }
.site-footer .link:hover { color: var(--fg); }
/* CV: hovering shows a small preview of the first page above the link; click opens the PDF */
.cv-link { position: relative; }
.cv-peek {
  position: absolute; left: 50%; bottom: calc(100% + 14px);
  width: 150px; height: auto; max-width: none;
  border: 1px solid var(--line); background: #fff;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
}
@media (hover: hover) and (min-width: 760px) {
  .cv-link:hover .cv-peek, .cv-link a:focus-visible .cv-peek { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 759px), (hover: none) { .cv-peek { display: none; } }

@media (min-width: 760px) {
  .site-footer .copy { grid-column: 1 / 5; }
  .site-footer .social { grid-column: 5 / 9; grid-row: 1; justify-content: center; gap: 28px; }
  .site-footer .top { grid-column: 9 / 13; }
}

/* ---------- display type ---------- */

.statement {
  font-family: var(--display);
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
  font-size: var(--big);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.lead {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 44em;
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- home: hero — one grid of mono lines, all the same size:
   name top-left, the five lines in the centre, "now based in Toronto" bottom-right ---------- */

.hero {
  position: relative;
  min-height: calc(78svh - var(--header-h));
  display: grid;
  place-items: center;
  overflow-x: clip;
}
.hero-frame {
  --hf-fs: clamp(13px, 1.9vw, 34px);
  width: 100%;
  padding-inline: max(0px, 3vw - var(--pad));     /* frame edges ≈ 3% in from the screen edges */
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--hf-fs);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--hero-fg);
}
.hero-frame p { margin: 0; white-space: nowrap; }
.hf-row { display: flex; justify-content: space-between; align-items: center; line-height: 0.86; }
.hf-row:first-child { margin-bottom: 0.1em; }
.hf-row--bottom { margin-top: 0.06em; justify-content: flex-end; }
.hero .intro-block { align-self: center; width: 35ch; max-width: 100%; }

/* phones: the same frame, sized so the five lines fill the width; the band rests in the middle behind it */
@media (max-width: 759px) {
  /* only the top half of the screen: the categories and the first project peek in below */
  /* sized so the category block sits exactly on the middle of the screen (the side fold marks hit its centre);
     --fh = the category block's height, measured in main.js */
  .hero { height: calc(50svh - var(--header-h) - var(--fh, 64px) / 2); min-height: 0; }
  .hero-frame { --hf-fs: calc((100vw - 2 * var(--pad)) / 21.2); padding-inline: 0; }
  .hf-row, .hf-row--bottom { justify-content: center; }   /* name and "now based in Toronto" centred */
  .glow-band { height: 34vh; }
}

.h-stack {
  font-family: var(--display);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-size: var(--big);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* the greeting: a small mono block, lines set on the character grid (30 characters wide) */
.intro-block {
  width: 30ch;
  max-width: 100%;
  font-family: var(--font);
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: left;
}
.intro-block .ib-j { text-align: justify; text-align-last: justify; }   /* BRAND  &  VISUAL  DESIGNER */
.intro-block .ib-c { text-align: center; }                               /* ART DIRECTION, centred */
.intro-block .ib-r { text-align: right; }
.intro-block p { white-space: nowrap; }   /* each line stays one line, even with letters as separate boxes */
.intro-block .ch, .hero-frame .ch { display: inline-block; will-change: transform; }

/* (HH : MM : SS) stretched edge to edge */
.h-time {
  font-family: var(--display);
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: var(--big);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- home: filters ---------- */

.filters {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
  padding-bottom: 12px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
/* thin vertical bars between the category buttons */
.fbreak { display: none; }
.fsep { flex: none; align-self: center; width: 1px; height: 10px; background: var(--fg-2); opacity: 0.7; }
.filters--flow { margin-bottom: clamp(28px, 5vh, 56px); }

/* the docked copy lives inside the header, so header + filters are one glass block */
.hdr-filters {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.hdr-filters > div { min-height: 0; overflow: hidden; }
.site-header.show-filters .hdr-filters { grid-template-rows: 1fr; }
.filters--hdr { padding-top: 4px; padding-bottom: 12px; opacity: 0; transition: opacity 0.3s ease; }
.site-header.show-filters .filters--hdr { opacity: 1; transition: opacity 0.5s ease 0.1s; }

.filters button {
  color: var(--fg-2);
  transition: color 0.3s ease, letter-spacing 0.6s var(--ease), margin-right 0.6s var(--ease);
}
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] {
  color: var(--fg);
  letter-spacing: var(--track);
  margin-right: calc(-1 * var(--track));
}

/* ---------- home: feed ---------- */

.feed > div { transition: opacity 0.35s ease; }
.feed.is-switching > div { opacity: 0; }

/* ---------- project rows (centred) ---------- */

.project { position: relative; }
.project + .project { margin-top: clamp(80px, 13vh, 144px); }   /* air between projects (doubled 2026-11-23) */

/* project head on the grid of the open project: number in the text column,
   title from the line where the first image starts, then scope + toggle, arrows at the far right */
.project-head {
  position: relative;
  cursor: pointer;                       /* the whole line opens / closes the project */
  display: grid;
  grid-template-columns: var(--panel) minmax(0, 1fr) auto;
  column-gap: 0;
  align-items: center;
  min-height: 34px;
  margin-bottom: 6px;
  max-height: 60px;
  transition: max-height var(--dur) var(--ease), opacity 0.4s ease, margin var(--dur) var(--ease);
}
/* the title button fills the space up to the arrows; scope + toggle sit exactly halfway
   between the end of the name and the arrows */
.title { grid-column: 2; justify-self: stretch; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.t-meta { justify-self: center; display: flex; align-items: center; gap: 10px; }
.ph-idx { grid-column: 1; justify-self: start; font-variant-numeric: tabular-nums; }
@media (max-width: 759px) {
  .project-head { grid-template-columns: minmax(0, 1fr); }
  .title { grid-column: 1; justify-self: center; display: flex; gap: 1.6em; }
  .ph-idx { display: none; }
}
.t-name { transition: color 0.2s ease; }
.title:hover .t-name { color: var(--fg-2); }

/* "+" turns into "×" when the project is open */
.plus {
  position: relative;
  width: 9px; height: 9px;
  flex: none;
  transition: transform var(--dur) var(--ease);
}
.plus::before, .plus::after {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 9px; height: 1px;
  background: currentColor;
}
.plus::after { transform: rotate(90deg); }
.is-open .plus { transform: rotate(45deg); }

.ctrl { grid-column: 3; justify-self: end; display: none; gap: 2px; margin-right: -8px; }
/* plain grey triangles; darker on hover */
.ctrl .arrow { position: relative; width: 26px; height: 26px; padding: 0; color: var(--fg-2); transition: color 0.2s ease; }
.ctrl .arrow::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
}
.ctrl .arrow[data-dir="-1"]::before { border-width: 5px 7px 5px 0; border-color: transparent currentColor transparent transparent; }
.ctrl .arrow[data-dir="1"]::before  { border-width: 5px 0 5px 7px; border-color: transparent transparent transparent currentColor; }
.ctrl .arrow:hover { color: var(--fg); }
@media (hover: hover) and (min-width: 760px) { .ctrl { display: flex; } }

/* body = [text panel, opening from the left | images] */
.project-body {
  display: grid;
  grid-template-columns: 0px minmax(0, 1fr);
  transition: grid-template-columns var(--dur) var(--ease);
}
.project.is-open .project-body { grid-template-columns: calc(var(--pad) + var(--panel)) minmax(0, 1fr); }

.panel { overflow: clip; min-width: 0; min-height: 0; }   /* min-height 0: the closed (0fr) row really collapses on phones */
/* a closed project's hidden text must not add height to the row */
@media (min-width: 760px) { .project:not(.is-open) .panel { max-height: 0; } }
.panel-inner {
  width: calc(var(--pad) + var(--panel));
  padding: 0 calc(var(--gap) * 1.5) 0 var(--pad);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.project.is-open .panel-inner { opacity: 1; transition: opacity 0.6s ease calc(var(--dur) * 0.45); }
.panel-inner p { max-width: 36em; }

/* project text: a short paragraph, then ruled rows — Scope of Work, My Role, credits */
.p-desc { font-family: var(--sans); font-size: 14px; line-height: 1.5; letter-spacing: -0.005em; }
.p-rows { margin-top: 22px; border-top: 1px solid var(--line); }
.p-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  column-gap: 14px;
  padding: 9px 0 10px;
  border-bottom: 1px solid var(--line);
}
.p-rows dt { padding-top: 2px; }
.p-rows dd { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.4; }
.panel-close { margin-top: 18px; color: var(--fg-2); }
.panel-close:hover { color: var(--fg); }

.strip {
  position: relative;
  display: flex;
  justify-content: safe center;   /* centred while it fits, starts at the margin when it scrolls */
  align-items: flex-start;
  gap: var(--img-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-inline: var(--pad);
  scroll-padding-left: var(--pad);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
  /* images disappear at the page margin on the left, bleed off the edge on the right */
  clip-path: inset(0 0 0 var(--pad));
  transition: padding-left var(--dur) var(--ease), clip-path var(--dur) var(--ease);
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging .frame button { pointer-events: none; }
.strip.is-animating { scroll-snap-type: none; }
.project.is-open .strip { padding-left: 0; scroll-padding-left: 0; clip-path: inset(0 0 0 0); }

/* phones: the panel slides down above the images */
@media (max-width: 759px) {
  .project-body,
  .project.is-open .project-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 0fr auto;
    transition: grid-template-rows var(--dur) var(--ease);
  }
  .project.is-open .project-body { grid-template-rows: 1fr auto; }
  .panel-inner { width: 100%; padding: 0 var(--pad) 20px; }
  .project.is-open .strip { padding-left: var(--pad); scroll-padding-left: var(--pad); clip-path: inset(0 0 0 var(--pad)); }
  .strip { cursor: auto; }
}

.frame { flex: none; scroll-snap-align: start; position: relative; }

/* hover (category view only): the image leans in a little — it can be opened */
@media (hover: hover) {
  .project.is-solo:not(.is-open) .frame:hover { z-index: 2; }
  .project.is-solo:not(.is-open) .frame:hover img,
  .project.is-solo:not(.is-open) .frame:hover .video { transform: scale(1.03); }
}

/* rows: images rise in one after another when the project comes into view */
.js .feed-all .project .frame {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease calc(150ms + var(--i, 0) * 70ms), transform 1.1s var(--ease) calc(150ms + var(--i, 0) * 70ms);
}
.js .feed-all .project.is-in .frame { opacity: 1; transform: none; }
.frame button { display: block; cursor: zoom-in; }
.project.is-open .frame button { cursor: inherit; }
.frame img {
  height: var(--h-s);
  width: auto;
  max-width: none;
  background: var(--ph);
  user-select: none;
  -webkit-user-drag: none;
  transition: height var(--dur) var(--ease), background-color 0.5s ease, transform 0.6s var(--ease);
}
.project.is-open .frame img { height: var(--h-l); }

/* YouTube videos: same row, 16:9, muted until clicked */
.frame--video .video {
  position: relative;
  height: var(--h-s);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  transition: height var(--dur) var(--ease), transform 0.6s var(--ease);
}
.project.is-open .frame--video .video { height: var(--h-l); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.video-sound { position: absolute; inset: 0; cursor: pointer; }
.video-sound::after {
  content: "Sound off";
  position: absolute; right: 10px; bottom: 10px;
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; mix-blend-mode: difference;
}
.video-sound[aria-pressed="true"]::after { content: "Sound on"; }
/* captions wrap to the image's width instead of widening the frame */
.frame figcaption { margin-top: 8px; text-align: center; width: 0; min-width: 100%; }
/* technical captions: code, number, ratio — tiny */
.cap { font-size: 9px; letter-spacing: 0.06em; line-height: 1.3; }
.cap-meta { opacity: 0.6; }

/* ---------- category view ----------
   Closed: one small image, centred (left padding --cpad is measured in JS).
   Open: the very same row as in All works — text on the left, the chosen
   image first, the rest of the project fading in to its right. */

/* a tight centred column: images almost touch */
.feed-cat .project + .project { margin-top: var(--img-gap); }
.feed-cat .project.is-open { margin-top: clamp(28px, 5vh, 48px); margin-bottom: clamp(28px, 5vh, 48px); }
.js .feed-cat .project.reveal { transform: translateY(24px) scale(0.97); }
.js .feed-cat .project.reveal.is-in { transform: none; }
/* captions sit beside the image, alternating: odd → bottom-left, even → top-right */
.project.is-solo:not(.is-open) .frame figcaption {
  position: absolute;
  margin: 0;
  width: auto;
  min-width: 0;
  white-space: nowrap;
  line-height: 1;
}
.feed-cat > .project:nth-child(odd):not(.is-open) .frame figcaption { right: calc(100% + 10px); bottom: 0; }
.feed-cat > .project:nth-child(even):not(.is-open) .frame figcaption { left: calc(100% + 10px); top: 0; }
@media (max-width: 759px) {
  .feed-cat > .project:nth-child(n):not(.is-open) .frame figcaption { position: static; margin-top: 6px; text-align: center; }
}

/* hover in the column: project name on the left, what it is on the right */
.solo-label {
  position: absolute;
  top: calc(var(--h-xs) / 2);
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}
.solo-label--l {
  left: var(--pad);
  max-width: min(22em, calc(var(--cpad, 0px) - var(--pad) - 80px));
  text-align: left;
  transform: translate(-8px, -50%);
}
.solo-label--r {
  right: var(--pad);
  max-width: min(22em, calc(100% - var(--cpad, 0px) - var(--cw, 0px) - var(--pad) - 80px));
  text-align: right;
  transform: translate(8px, -50%);
}
.project.is-solo:not(.is-open):has(.frame:first-child:hover) .solo-label { opacity: 1; transform: translateY(-50%); }
.project.is-open .solo-label { display: none; }
/* phones / touch: no hover — project name and what it is sit right under the image */
@media (max-width: 759px), (hover: none) {
  .solo-label, .solo-label--l, .solo-label--r {
    position: static; display: block; opacity: 1; transform: none;
    max-width: 34em; margin: 0 auto; padding: 0 var(--pad);
    text-align: center; pointer-events: none;
  }
  .solo-label--l { margin-top: 8px; }
  .solo-label--r { margin-top: 2px; margin-bottom: 20px; }
  .project.is-open .solo-label { display: none; }
}

.is-solo:not(.is-open) .project-head { max-height: 0; min-height: 0; margin-bottom: 0; opacity: 0; overflow: hidden; }

.project.is-solo:not(.is-open) .strip {
  padding-left: var(--cpad, var(--pad));
  overflow-x: hidden;
  scroll-snap-type: none;
  cursor: default;
  clip-path: inset(0 0 0 0);
}
.project.is-solo:not(.is-open) .frame img { height: var(--h-xs); }
.project.is-solo:not(.is-open) .frame--video .video { height: var(--h-xs); }
.project.is-solo:not(.is-open) .frame button { cursor: zoom-in; }

.is-solo .frame:not(:first-child) {
  transition: opacity 0.6s ease calc(var(--dur) * 0.5 + var(--i, 0) * 70ms), visibility 0s;
}
.is-solo:not(.is-open) .frame:not(:first-child) {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}

.fc-proj { display: none; }
.is-solo:not(.is-open) .fc-proj { display: none; }   /* the hover labels name the project */

@media (max-width: 759px) {
  .project.is-solo.is-open .strip { padding-left: var(--pad); }
}

/* ---------- About: frosted glass over the current page ---------- */

.about {
  position: fixed;
  inset: 0;
  z-index: 18;                         /* under the header, so the menu still works */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: calc(var(--header-h) + clamp(24px, 6vh, 64px));
  padding-bottom: 48px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.about.is-open { opacity: 1; visibility: visible; transition: opacity 0.5s ease, visibility 0s; }
body.about-open { overflow: hidden; }

/* About layout: identity · about · experience · education/exhibitions, then a ruled project table */
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px 32px;
  align-items: start;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  transform: translateY(16px);
  transition: transform 0.7s var(--ease);
}
.about.is-open .about-inner { transform: none; }
@media (min-width: 760px)  { .about-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1100px) {
  .about-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr); }
}

.about-inner .mono { font-family: var(--font); }
.ab-name { font: 500 14px/1.45 var(--sans); letter-spacing: inherit; }
.ab-contact { margin: 18px 0; }
.ab-contact .link:hover { color: var(--fg-2); }

.ab-h { font-weight: 400; color: var(--fg-2); margin-bottom: 10px; }
.ab-h:not(:first-child) { margin-top: 28px; }
.ab-text { max-width: 34em; }
.ab-skills li { padding-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one column, one line each */
.ab-list li { margin-bottom: 12px; }
.ab-list li .muted { display: block; }
.ab-year { display: block; color: var(--fg-2); font-variant-numeric: tabular-nums; }

.ab-projects { grid-column: 1 / -1; margin-top: clamp(40px, 9vh, 110px); }
.ab-tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  row-gap: 2px;
  column-gap: 32px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease;
}
/* phones / tablets: project · client on one line, scope underneath */
.ab-tr > span:nth-child(3) { grid-column: 1 / -1; color: var(--fg-2); }
@media (min-width: 1100px) {
  /* project · client · scope — client under Experience, scope under Education */
  .ab-tr { grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr) minmax(0, 1.2fr); }
  .ab-tr > span:nth-child(3) { grid-column: auto; color: inherit; }
}
.ab-th { border-bottom-color: var(--fg-2); padding-bottom: 7px; }
a.ab-tr:hover { color: var(--fg-2); }
a.ab-tr span:first-child::after { content: " →"; opacity: 0; transition: opacity 0.2s ease; }
a.ab-tr:hover span:first-child::after { opacity: 1; }
.ab-tr.is-static { color: var(--fg-2); cursor: default; }

.about-close { grid-column: 1 / -1; justify-self: center; margin-top: 8px; font-family: var(--font); color: var(--fg-2); transition: color 0.2s ease; }
.about-close:hover { color: var(--fg); }

/* ---- About on a baseline grid: every line is --lh tall, every gap a whole number of lines,
        so text in neighbouring columns sits on the same lines ---- */
.about { --lh: 20px; }
.about-inner { line-height: var(--lh); row-gap: calc(var(--lh) * 2); }
.about-inner p, .about-inner li, .about-inner span, .about-inner h2, .about-inner h3, .about-inner a { line-height: var(--lh); }
.about-inner .mono { line-height: var(--lh); position: relative; top: 1px; }   /* 11px mono → same baseline as 14px text */
.ab-name { line-height: var(--lh); }
.ab-contact { margin: var(--lh) 0; }
.ab-cv { margin-top: var(--lh); }
.ab-cv a { margin-left: 0.7em; }
.ab-cv a:hover { color: var(--fg-2); }
.ab-h { margin: 0 0 var(--lh); }
.ab-h:not(:first-child) { margin-top: calc(var(--lh) * 2); }
.ab-list li { margin: 0 0 var(--lh); }
.ab-list li:last-child { margin-bottom: 0; }
.ab-skills li { padding: 0; }
.ab-projects { margin-top: calc(var(--lh) * 3); }
.ab-tr { padding: calc(var(--lh) / 2 - 1px) 0 calc(var(--lh) / 2); row-gap: 0; }   /* line + padding + 1px rule = 2 lines */
.ab-th { padding-bottom: calc(var(--lh) / 2); }
.about-close { margin-top: var(--lh); line-height: var(--lh); }

/* no category bar while About is open */
body.about-open .hdr-filters { display: none; }

/* ---------- lightbox (playground) ---------- */

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  border: 0; padding: 0;
  background: transparent;
  color: var(--fg);
}
/* full-screen view over frosted glass: the page stays faintly visible behind, blurred */
.lightbox::backdrop {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
/* Playground: title and what the piece is, right under the image */
.lb-info { flex: none; max-width: 40em; margin-top: 12px; text-align: center; text-transform: uppercase; letter-spacing: 0.02em; font-size: var(--small); line-height: 1.45; }
.lb-info p { margin: 0; }
.lb-info .lb-note { margin-top: 2px; }
.lb-info[hidden] { display: none; }

.lb-top, .lb-bottom { padding: 16px var(--pad); display: flex; justify-content: space-between; align-items: center; }
.lb-top button { font-size: var(--small); text-transform: uppercase; letter-spacing: 0.02em; }
.lb-stage { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 var(--pad); cursor: zoom-out; }
.lb-nav { display: flex; gap: 18px; }
.lb-nav button { padding: 4px 2px; }
.lb-stage img { max-width: 100%; max-height: calc(100% - var(--lb-info-h, 0px)); width: auto; height: auto; object-fit: contain; min-height: 0; }
/* swiping: the next image slides in from the side it came from */
.lb-stage img.lb-in-next { animation: lb-in-next 0.35s var(--ease); }
.lb-stage img.lb-in-prev { animation: lb-in-prev 0.35s var(--ease); }
@keyframes lb-in-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes lb-in-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* ---------- about ---------- */

.info-bio { padding-top: clamp(64px, 16vh, 180px); padding-bottom: clamp(64px, 12vh, 140px); }
.info-bio .lead + .lead { margin-top: 1.2em; }

.info-lists { row-gap: 56px; }
.info-lists section { grid-column: span 12; }
.info-lists h2 { margin-bottom: 14px; font-weight: 400; }
.info-lists li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.info-lists li:last-child { border-bottom: 1px solid var(--line); }
.info-lists li .muted { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }

@media (min-width: 760px) { .info-lists section { grid-column: span 6; } }
@media (min-width: 1100px) { .info-lists section { grid-column: span 3; } }

/* ---------- playground ---------- */

/* PLAY / GROUND in dots: a fixed layer in the middle of the screen; the page scrolls over it */
.pg-dots { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; --dot: #dcdcda; }
:root[data-theme="dark"] .pg-dots { --dot: #2a2a29; }
@media (max-width: 759px) { :root:not([data-theme="dark"]) .pg-dots { --dot: #e0e0e0; } :root[data-theme="dark"] .pg-dots { --dot: #1e1e1e; } }
body:has(.pg-dots) main, body:has(.pg-dots) .site-footer { position: relative; z-index: 1; }
/* the coloured dots that fly over the images are drawn on a second layer above the page */
.pg-dots--front { z-index: 3; }

/* first screen: one line right under the bottom of GROUND, the first image peeks in below it */
.pg-intro {
  padding-top: calc(var(--dots-bottom, 72svh) + 18px - var(--header-h));
  padding-bottom: 0;
  text-align: center;
}
.pg-intro-text { font-size: clamp(12px, 1.5vw, 22px); line-height: 1.2; letter-spacing: 0.01em; }

/* free layout: every image has its own place across the width (--x), size (--s) and space above (--gy),
   set per image in build.py; while scrolling it drifts outward (--dx, main.js) */
.pg-col { --h-pg: calc(var(--vw, 100vw) * 0.42 * 1.25); --mw-base: 60vw; display: flex; flex-direction: column; }
@media (min-width: 760px) { .pg-col { --h-pg: min(32svh, 280px); --mw-base: 17vw; } }
.pg-item { position: relative; display: block; margin-top: calc(10px + var(--gy, 0.5) * 4vh); }
/* computer: packed — each image keeps its place across the width but rises as high as it can
   without touching the others, so several works are on screen at once (pgPack in main.js) */
.pg-col.is-packed { display: block; position: relative; }
.pg-col.is-packed .pg-item { position: absolute; left: 0; top: 0; margin: 0; }
.pg-col.is-packed .pg-media { margin-left: 0; }
.pg-col.is-packed .pg-media img { max-width: none; max-height: none; }
.pg-item:first-child { margin-top: 0; }
.pg-media {
  --mw: min(var(--mw-base) * var(--s, 1), 100vw - 2 * var(--pad));   /* absolute: a % here would point at itself */
  position: relative;
  display: inline-block;
  vertical-align: top;
  margin-left: calc(var(--x, 0.5) * (100% - var(--mw)));
  translate: var(--dx, 0px) 0;
}
.pg-media img {
  width: auto; height: auto;
  max-height: calc(var(--h-pg) * var(--s, 1));
  max-width: var(--mw);
  transition: transform 0.6s var(--ease);
}
.pg-media .cap { display: block; margin: 6px 0 0; white-space: nowrap; line-height: 1; }   /* code name under every image: PG_01 … */
/* computer: title and description beside the image, on the freer side, on hover */
.pg-info {
  position: absolute; top: 50%;
  width: 22em; max-width: 26vw;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}
.pg-item[data-side="r"] .pg-info { left: calc(100% + 28px); transform: translate(-8px, -50%); text-align: left; }
.pg-item[data-side="l"] .pg-info { right: calc(100% + 28px); transform: translate(8px, -50%); text-align: right; }
.pg-info p { margin: 0; }
.pg-info .pg-label--r { margin-top: 2px; }
/* computer: no title / description on hover (the code is under each image; the rest is in full-screen view) */
@media (min-width: 760px) and (hover: hover) { .pg-info { display: none; } }
@media (hover: hover) and (min-width: 760px) {
  .pg-item:has(.pg-media:hover) { z-index: 2; }
  .pg-media:hover img { transform: scale(1.03); }
}
/* phones / touch: title and note right under the image, as wide as the image */
@media (max-width: 759px), (hover: none) {
  .pg-info, .pg-item[data-side] .pg-info {
    position: static; opacity: 1; transform: none; text-align: left;
    width: 0; min-width: 100%; max-width: none; margin-top: 6px;
  }
}
.js .pg-item.reveal { transform: translateY(24px) scale(0.97); }
.js .pg-item.reveal.is-in { transform: none; }
.shot button { display: block; cursor: zoom-in; }
.shot img { background: var(--ph); }
.shot figcaption { margin-top: 8px; }
.shot.is-missing button { cursor: default; }

/* ---------- contact ---------- */

.contact-hero { padding-top: clamp(64px, 16vh, 180px); padding-bottom: clamp(64px, 12vh, 140px); }

.contact-rows .row { border-top: 1px solid var(--line); min-height: 40px; align-items: center; padding: 9px 0; }
.contact-rows .row:last-child { border-bottom: 1px solid var(--line); }
.contact-rows .label { grid-column: 1 / 5; }
.contact-rows .value { grid-column: 5 / 13; display: flex; gap: 20px; flex-wrap: wrap; }
@media (min-width: 760px) {
  .contact-rows .label { grid-column: 1 / 4; }
  .contact-rows .value { grid-column: 7 / 13; }
}

.project-head .ctrl { cursor: default; }
/* computer: a click on the open row closes it */
@media (hover: hover) and (min-width: 760px) { .project.is-open:not(.is-solo) .frame button { cursor: zoom-out; } }
