/* Žans Sulojevs, portfolio: the Index. Every project keeps its own look here: its name is set in its own site's
   typeface and its pages wear its own site's colours, while the portfolio's own voice stays quiet (Geist for
   everything that isn't a project's name, the wordmark in Big Shoulders Display). Each page commits to its project's
   colours, so there is no light or dark theme: the body carries them as custom properties (tools/build.mjs), and on
   the Index js/site.js swaps them as a project is picked. They are registered as colours so the swap fades. */
@property --bg { syntax: '<color>'; inherits: true; initial-value: #161616; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #f2f2f2; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --btn { syntax: '<color>'; inherits: true; initial-value: #f2f2f2; }
@property --btn-ink { syntax: '<color>'; inherits: true; initial-value: #161616; }

:root {
  --bg: #161616; --ink: #f2f2f2; --accent: #ffffff; --btn: #f2f2f2; --btn-ink: #161616;
  --paper: #161616; --text: #e8e8e8; --mark: #f2f2f2;
  --ui: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --gut: clamp(16px, 4.4vw, 64px);
  --pad-l: max(var(--gut), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--gut), env(safe-area-inset-right, 0px));
  --max: 1440px;
  --fade: .7s ease;
}
/* shades worked out from each surface's own ink, wherever a surface sets its colours */
body, .read, .next-band, .ix-item, .g-item {
  --ink-2: color-mix(in srgb, var(--ink) 76%, var(--bg));
  --ink-3: color-mix(in srgb, var(--ink) 62%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 16%, transparent);
  --wall: color-mix(in srgb, var(--ink) 7%, var(--bg));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.is-home { transition: --bg var(--fade), --ink var(--fade), --accent var(--fade), --btn var(--fade), --btn-ink var(--fade); }
/* while Tenon's or Lumi's preview leads, the page's ground follows its film at once (js/site.js tint) */
/* and a canvas behind everything grows from the film's edge colours next to the film to its centre colour at the
   window's sides (js/site.js live, edgeTo) */
.pf-edge { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; opacity: 0; transition: opacity var(--fade); }
.pf-edge.is-on { opacity: 1; }
/* a pixel of those colours over the film's last row and column, which browsers draw darker between pixels */
.pv-lip { display: none; }
.pv-tile.has-lip .pv-lip { display: block; }
.pv-lip i { position: absolute; z-index: 1; pointer-events: none; }
/* narrow screens: it lies under the header and the first band, which then has no ground of its own (the page wears
   the band's colours, js/site.js), and scrolls with them */
@media (max-width: 960px) {
  .pf-edge { position: absolute; bottom: auto; }
  .ix-item:first-child { background: none; }
}
.is-home.edge-live { transition: --ink var(--fade), --accent var(--fade), --btn var(--fade), --btn-ink var(--fade); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img, video { max-width: 100%; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
.arr { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }

/* ---------- each project's name in its own site's typeface ----------
   --k evens out how big the faces look at one size; the place sets --size */
.pname { display: block; font-size: calc(var(--size, 64px) * var(--k, 1)); line-height: .95; white-space: nowrap; font-synthesis: none; }
.f-kinetic { --k: .94; font-family: 'Staatliches', 'Arial Narrow', sans-serif; font-weight: 400; text-transform: uppercase; }
.f-lumi { --k: .98; font-family: 'Jost', 'Futura', sans-serif; font-weight: 300; letter-spacing: -.01em; text-transform: lowercase; }
.f-sonar { --k: 1; font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.f-tenon { --k: 1; font-family: 'Cormorant', 'Garamond', serif; font-weight: 500; }
.f-halfmetre { --k: .86; font-family: 'Red Hat Display', var(--ui); font-weight: 900; letter-spacing: -.05em; }
.f-halfmetre i { font-style: normal; color: #e5573c; }
.f-type-shift { --k: .8; font-family: 'Anybody', var(--ui); text-transform: uppercase; }
/* SHIFT's wide cut makes the name the widest of all, so on a phone it is capped to fit the screen */
.f-type-shift { font-size: min(calc(var(--size, 64px) * var(--k)), 12vw); }
.f-type-shift .t { font-weight: 200; font-variation-settings: 'wdth' 100, 'wght' 200; }
.f-type-shift .s { font-weight: 900; font-variation-settings: 'wdth' 150, 'wght' 900; }
.f-type-shift b { font-weight: 900; color: #c6ff34; }
.f-in-the-loop { --k: 1; font-family: var(--display); font-weight: 900; text-transform: uppercase; }
.f-peek-grep { --k: .84; font-family: 'Inter', var(--ui); font-weight: 600; letter-spacing: -.035em; }
.f-peek-grep b { font-weight: 600; color: #7c9cff; }
/* the three groups' names are in the portfolio's own voice; on a phone the longest, Motion design, is capped to fit */
.f-group { --k: .8; font-family: var(--ui); font-weight: 500; letter-spacing: -.04em; font-size: min(calc(var(--size, 64px) * var(--k)), 11vw); }
/* Sonar's titles glow in its own magenta, as on its site, wherever it is on its own colours */
:is(.is-on, .hero, .next-band, .g-item) .f-sonar { text-shadow: 0 0 .32em color-mix(in srgb, #ff2f72 50%, transparent); }
/* while Sonar's preview leads, the titles take its kit colour as the film changes kit and glow softly in it, the
   same two shadows as Sonar's titles (js/site.js sets the colour) */
.is-on.is-lit .ix-name .nm, .is-lit .ix-pv h2, .g-item.is-lit .pname {
  text-shadow: 0 0 .05em color-mix(in srgb, var(--accent) 60%, transparent), 0 0 .3em color-mix(in srgb, var(--accent) 42%, transparent);
}
.is-lit .ix-pv h2 { color: var(--accent); }
/* Sonar's wave carried out of its preview over the page (js/site.js carry): a soft glowing ring in the new kit colour
   under the words and previews, moved only by transform and opacity. A band holding one clips it */
.pf-wave {
  position: fixed; left: 0; top: 0; z-index: -1; width: 1400px; height: 1400px; margin: -700px 0 0 -700px;
  border-radius: 50%; pointer-events: none; opacity: 0; will-change: transform, opacity;
  background: radial-gradient(closest-side, transparent 70%, color-mix(in srgb, var(--wave) 12%, transparent) 82%, color-mix(in srgb, var(--wave) 55%, transparent) 85.6%, transparent 86.2%);
}
.g-item.is-lit { isolation: isolate; contain: paint; }
/* what the wave is crossing: the new colour inside its front and the old outside, clipped to the letters (no glow
   while crossed: a text shadow would sit on top of letters clipped from the background); then the new colour */
.wv-x {
  color: transparent !important; text-shadow: none !important;
  background: radial-gradient(circle at var(--wx) var(--wy), var(--w-new) calc(var(--wr) - 14px), var(--w-old) calc(var(--wr) + 14px));
  -webkit-background-clip: text; background-clip: text;
}
.btn.wv-x { color: var(--btn-ink) !important; -webkit-background-clip: border-box; background-clip: border-box; }
.wv-n { color: var(--w-new) !important; text-shadow: 0 0 .05em color-mix(in srgb, var(--w-new) 60%, transparent), 0 0 .3em color-mix(in srgb, var(--w-new) 42%, transparent) !important; }
.btn.wv-n { color: var(--btn-ink) !important; background: var(--w-new); text-shadow: none !important; }

/* ---------- the frame: the wordmark, two links, the footer ---------- */
.top, .foot, .page { padding-left: var(--pad-l); padding-right: var(--pad-r); }
.top { width: 100%; max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px 18px; }
.logo { display: block; flex: none; color: var(--ink); text-decoration: none; font: 800 30px/1 var(--display); letter-spacing: .02em; white-space: nowrap; }
.nav { display: flex; gap: 6px 26px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { font-weight: 500; font-size: 15px; text-decoration: none; color: var(--ink-2); padding-block: 4px; }
.nav a:hover, .nav a[aria-current="page"], .nav a.is-in { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.foot { width: 100%; max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; padding-block: 22px 26px; font-size: 13px; color: var(--ink-3); }
.foot span:last-child { margin-left: auto; }

/* every page arrives with a slow fade */
main { animation: page-in .6s ease both; }
@keyframes page-in { from { opacity: 0; } }
/* inside the preview's frame the page empties while the next one loads (js/site.js) */
body.is-leaving main { visibility: hidden; }

/* the two ways in, everywhere: a filled button in the project's colour and an underlined link */
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 22px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font: 500 15px/1 var(--ui); text-decoration: none; white-space: nowrap; }
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn:focus-visible { outline-color: var(--ink); }
.line { border: 0; background: none; padding: 6px 0; font: 500 15px/1.3 var(--ui); color: inherit; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; white-space: nowrap; }
.line:hover { text-decoration-thickness: 2px; }

/* ---------- the Index ---------- */
/* the Index spans the screen (zan, 2026-10-23): the wordmark and the groups at the left edge, the previews as large
   as the screen's height allows at the right edge */
.is-home { display: grid; grid-template-rows: auto 1fr auto; }
.is-home :is(.top, .foot) { max-width: 2200px; }
.is-home main { display: grid; align-items: center; max-width: 2200px; width: 100%; margin: 0 auto; padding-left: var(--pad-l); padding-right: var(--pad-r); padding-block: 8px 24px; }
/* the groups' rows fill the screen's height (--n rows, set by tools/build.mjs); rows and names shrink on short screens */
.ix { --row: clamp(84px, calc((100svh - 200px) / var(--n, 3)), 176px); --size: min(clamp(56px, 6.6vw, 104px), calc(var(--row) * .66)); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: clamp(40px, 5vw, 96px); align-content: center; }
.ix-item { display: contents; }
.ix-name { grid-column: 1; grid-row: var(--r); height: var(--row); display: flex; align-items: center; min-width: 0; padding-right: 24px; border-bottom: 1px solid var(--line); text-decoration: none; outline-offset: -2px; }
.ix-item:first-child .ix-name { border-top: 1px solid var(--line); }
.ix-name .nm { flex: none; opacity: .34; transition: opacity .45s ease, text-shadow .45s ease; }
.ix-name:hover .nm { opacity: .7; }
.is-on .ix-name .nm { opacity: 1; color: var(--accent); }
/* one preview at a time, all in the same place on the right; the old one fades out before the new one fades in.
   Its width is what the rows' height leaves for the previews (Web design's shape, --ref) once the words under them
   (about 230px) fit */
.ix-pv { grid-column: 2; grid-row: 1 / span var(--n, 3); align-self: end; justify-self: end; width: min(100%, calc((var(--row) * var(--n, 3) - 230px) * var(--ref, 2))); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.is-on .ix-pv { opacity: 1; visibility: visible; transition: opacity .45s ease .3s, visibility 0s linear .3s; }
/* the words always take the room of a three line description, so the previews, names and buttons of every group
   sit in the same place whatever the text (zan: Software and A game had theirs elsewhere) */
.pv-say { display: grid; grid-template-rows: auto auto 1fr; gap: 18px; align-content: start; min-height: calc(1.25 * clamp(22px, 1.7vw, 30px) + 3 * 1.6 * 17px + 36px + 48px); }
/* the button sits at the bottom of that room, so its bottom edge is on A game's bottom line (zan, 2026-10-25: "align
   the ctas with the last section everywhere") */
.pv-say .acts { align-self: end; }
.ix-pv h2 { font: 600 clamp(22px, 1.7vw, 30px)/1.25 var(--ui); letter-spacing: -.01em; transition: text-shadow .45s ease; }
.ix-pv p { color: var(--ink-2); font-size: 17px; max-width: 62ch; }
.pv-media { position: relative; aspect-ratio: 16 / 10; width: 100%; max-width: 100%; overflow: hidden; border-radius: 6px; background: var(--wall); box-shadow: 0 0 0 1px var(--line); }
.pv-media video, .pv-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pv-media.is-contain { background: none; }
.pv-media.is-contain video { object-fit: contain; }
/* a group's previews (zan's sketch): the focused one large on the left, the next above on the right, the rest small
   in pairs below. Each sits in its place (left, top, width, height in %, set by tools/build.mjs and moved by
   js/site.js) with a 4px margin inside it, so the gaps stay 8px at every size; the box reaches 4px past the column
   on every side to make up for it. A group of one fills its preview's shape, as tall as the others and from the same
   left edge, so its words and button sit where every group's do (zan, 2026-10-23) */
.pv-media.is-group { aspect-ratio: var(--ar, 2); width: calc(100% + 8px); max-width: none; margin: -4px; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
/* on wide screens every group's previews are as tall as Web design's (--ref, its shape): a wider collage (the films)
   keeps the width and sits lower, a single preview keeps the height and is narrower, from the same left edge */
@media (min-width: 961px) {
  .pv-media.is-group { width: calc((100% + 8px) * min(1, var(--ar) / var(--ref))); margin-top: calc((100% + 8px) * max(0, 1 / var(--ref) - 1 / var(--ar)) - 4px); }
}
/* a group's previews rest while another group is picked (js/site.js): drawn as nothing, they cost the page nothing */
@media (min-width: 961px) { .ix-item.is-rest .pv-media { content-visibility: hidden; } }
.pv-tile { position: absolute; display: block; padding: 4px; text-decoration: none; outline-offset: -2px; }
.pv-tile[data-slot="0"] { z-index: 1; }
.pv-in { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: var(--tile-bg); transform-origin: 0 0; }
/* no frame lines (zan crossed them out, 2026-10-23): the large place has no ground of its own, so around its page
   the page's own colour shows, which is the large preview's */
.pv-tile[data-slot="0"] .pv-in { background: none; }
/* whole pages, never cropped: the large place is squarer than a screen, so it shows the page on its own colour */
.pv-tile video, .pv-tile img { object-fit: contain; }

/* ---------- a project's page: its opening band, the reading on its paper, the next project's band ---------- */
.hero, .read-in, .page { max-width: var(--max); margin: 0 auto; }
.hero { --size: clamp(64px, 12vw, 176px); display: grid; gap: 22px; padding: clamp(24px, 4vw, 56px) var(--pad-r) clamp(32px, 4vw, 56px) var(--pad-l); }
.hero-kind { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.hero .pname { color: var(--accent); margin-block: -.04em .06em; }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; }
.hero-text { display: grid; gap: 10px; min-width: 0; max-width: 40ch; }
.brief { font: 500 clamp(19px, 1.7vw, 24px)/1.4 var(--ui); letter-spacing: -.01em; text-wrap: balance; }
.facts { font-size: 14px; color: var(--ink-3); }
.hero-media { margin-top: 18px; }
.hero-media .shot { margin: 0; }
.hero-media video, .hero-media img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.is-study .hero { --size: clamp(56px, 8vw, 120px); }

/* the reading: the project's paper and text */
.read { --bg: var(--paper); --ink: var(--text); background: var(--bg); color: var(--ink); }
.read-in { display: grid; padding: clamp(40px, 5vw, 72px) var(--pad-r) clamp(56px, 6vw, 96px) var(--pad-l); }
.proj .read-in > * { width: 100%; min-width: 0; }
.proj .read-in > .points { max-width: 1100px; }
.intro.prose { max-width: 62ch; font-size: 20px; line-height: 1.6; color: var(--ink); }
.proj-end { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }

/* the next project, as a band in its own colours */
.next-band { --size: clamp(52px, 9vw, 132px); display: grid; gap: 10px; padding: clamp(40px, 6vw, 88px) var(--pad-r) clamp(44px, 6vw, 96px) var(--pad-l); background: var(--bg); color: var(--ink); text-decoration: none; }
.next-band > * { width: 100%; max-width: calc(var(--max) - 2 * var(--gut)); margin-inline: auto; }
.nb-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.next-band .pname { color: var(--accent); }
.nb-kind { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.next-band:hover .nb-kind { color: var(--ink); }
.next-band:hover .arr { transform: translateX(4px); }
.nb-kind .arr { transition: transform .25s ease; }
.next-band:focus-visible { outline-offset: -6px; }

/* pictures: full width of the column, phones two or three to a row, captions under them */
.shot { margin: 0; min-width: 0; display: grid; gap: 10px; }
.shot img, .shot video { display: block; width: 100%; height: auto; background: var(--wall); }
.shot figcaption { font-size: 14px; line-height: 1.5; color: var(--ink-3); max-width: 70ch; }
.proj .read-in > .shot, .proj .read-in > .shots { margin-top: 28px; }
.shots { display: grid; gap: 16px; align-items: start; }
.shots-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shots-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots.is-phones { max-width: 620px; }
.shot.is-tall img { box-shadow: 0 0 0 1px var(--line); }
.shot[style*="max-width"] { margin-inline: auto; }

/* the overview's points: three short reasons under the intro, each under a rule in the project's mark colour */
.points { list-style: none; margin: 48px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.points li { padding-top: 14px; border-top: 3px solid var(--mark); }
.points h2 { font: 600 17px/1.35 var(--ui); }
.points p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
/* the project's colours, named */
.swatches { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }
.swatches li { display: grid; gap: 2px; font-size: 14px; }
.swatches span { height: 64px; margin-bottom: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.swatches b { font-weight: 500; }
.swatches small { font-size: 13px; color: var(--ink-3); }

/* ---------- running text (the overview's words and the case study) ---------- */
.prose { color: var(--ink); font-size: 18px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 3.2em; font: 600 26px/1.25 var(--ui); letter-spacing: -.015em; scroll-margin-top: 24px; }
.prose h3 { margin-top: 2em; font: 600 19px/1.35 var(--ui); }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 600; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose code { font-size: .88em; padding: .1em .35em; background: var(--wall); }
.prose blockquote { margin: 1.8em 0; padding: 0 0 0 20px; border-left: 3px solid var(--mark); font-size: 22px; line-height: 1.45; }
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 3em; }

/* ---------- the case study: contents on the left on wide screens, the long read beside it ---------- */
.study-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; }
.study-body { width: 100%; max-width: 900px; }
:is(.study-body, .part) > :is(p, ul, ol, h2, h3, blockquote, hr, .kicker, .changes-wrap, .study-facts) { max-width: 680px; }
:is(.study-body, .part) > :is(.shot, .shots) { margin-block: 2.2em; }
:is(.study-body, .part) > :is(.shot, .shots) + :is(.shot, .shots) { margin-top: 0; }
.part > * + * { margin-top: 1.1em; }
.part > :last-child { margin-bottom: 0; }
.study-body .shot.is-tall { max-width: 300px; }
.study-body .shots.is-phones, .study-body .shots:has(.is-tall) { max-width: 620px; }
.lede { font: 500 23px/1.5 var(--ui); letter-spacing: -.01em; }
.study-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px 28px; margin-block: 2.4em 0; }
.study-facts > div { padding-top: 12px; border-top: 1px solid var(--line); }
.study-facts dt { font-weight: 500; font-size: 13px; color: var(--ink-3); }
.study-facts dd { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }
.part { margin-top: 4.4em; scroll-margin-top: 24px; }
.part h2 { margin-top: 0; }
.kicker { font-weight: 500; font-size: 14px; color: var(--ink-3); }
.part > .kicker + h2 { margin-top: .4em; }
.closing { padding-top: 3.2em; border-top: 1px solid var(--line); max-width: 680px; }
.study-hold { font-size: 20px; color: var(--ink-2); }

/* a batch of changes: what changed, how it was, how it is now */
.changes-wrap { margin-block: 1.8em; }
.changes { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.changes th, .changes td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.changes thead th { padding-block: 0 10px; border-top: 0; font-weight: 500; font-size: 13px; color: var(--ink-3); }
.changes tbody th { width: 26%; font-weight: 600; }
.changes td { width: 37%; color: var(--ink-2); }
.changes td + td { color: var(--ink); }

/* before and after: side by side, each labelled above its picture; phone shots stay a narrow pair */
.cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cmp-side { display: grid; gap: 8px; min-width: 0; }
.cmp-tag { font-weight: 500; font-size: 13px; color: var(--ink-3); }
.cmp-side + .cmp-side .cmp-tag { color: var(--ink); }
.cmp img, .cmp video { display: block; width: 100%; height: auto; background: var(--wall); }
.is-tall-pair { max-width: 620px; }
.is-tall-pair :is(.cmp, .gal) { gap: 24px; }
.is-tall-pair img { box-shadow: 0 0 0 1px var(--line); }
:is(.compare, .gallery) figcaption { max-width: 680px; }

/* a gallery: same-size pictures in a grid, a short label under each */
.gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; align-items: start; }
.gal-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gal-item { display: grid; gap: 8px; min-width: 0; }
.gal img, .gal video { display: block; width: 100%; height: auto; background: var(--wall); }
.gal-label { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.is-tall-pair .gal-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.is-tall-pair .gal-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery.is-tall-pair:has(.gal-4) { max-width: 860px; }

.toc { display: none; }
.toc p { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a { display: block; padding: 2px 0 2px 12px; border-left: 2px solid transparent; font-weight: 500; font-size: 14px; line-height: 1.4; text-decoration: none; color: var(--ink-3); }
.toc a:hover { color: var(--ink); }
.toc a.is-here { color: var(--ink); border-left-color: var(--mark); }
@media (min-width: 1240px) {
  .study-grid { grid-template-columns: 220px minmax(0, 900px); gap: 0 72px; justify-items: stretch; }
  .study-grid:not(:has(.toc)) { grid-template-columns: minmax(0, 900px); }
  .toc { display: block; position: sticky; top: 32px; align-self: start; padding-top: 6px; }
}

/* ---------- a group's page: each project as a band in its own colours, its words beside its preview ---------- */
.g-item { background: var(--bg); color: var(--ink); scroll-margin-top: 0; transition: --accent var(--fade), --btn var(--fade); }
.hero + .g-item { border-top: 1px solid var(--line); }
.g-in { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px clamp(32px, 5vw, 80px); align-items: center; padding: clamp(40px, 5vw, 80px) var(--pad-r) clamp(40px, 5vw, 80px) var(--pad-l); }
.g-text { --size: clamp(52px, 6.4vw, 104px); display: grid; gap: 14px; justify-items: start; min-width: 0; }
.g-text h2 { font: inherit; }
.g-text .pname { color: var(--accent); margin-block: -.04em .1em; }
.g-name { display: block; text-decoration: none; }
.g-name:hover .pname { opacity: .8; }
.g-more { max-width: 46ch; color: var(--ink-2); }
.g-text .acts { margin-top: 10px; }
.g-media { display: block; position: relative; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; border-radius: 6px; background: var(--wall); box-shadow: 0 0 0 1px var(--line); }
.g-media video, .g-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-media.is-contain { background: none; }
.g-media.is-contain video { object-fit: contain; }

/* ---------- the films ---------- */
.film-list { gap: clamp(48px, 6vw, 88px); }
.film { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 16px 40px; align-items: end; }
.film video { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--wall); box-shadow: 0 0 0 1px var(--line); }
.film figcaption { display: grid; gap: 10px; justify-items: start; padding-bottom: 4px; }
.film h2 { font: 600 26px/1.2 var(--ui); letter-spacing: -.015em; }

/* ---------- plain pages: info, contact, not found ---------- */
.page { display: grid; gap: 28px; justify-items: start; padding-block: clamp(32px, 6vw, 96px); }
.page h1 { font: 600 clamp(40px, 6vw, 72px)/1.05 var(--ui); letter-spacing: -.03em; }
.page .prose { max-width: 62ch; }
.addr { user-select: all; overflow-wrap: anywhere; font-size: 22px; }

@media (prefers-reduced-motion: reduce) {
  .is-home, .ix-item, .ix-name .nm, .ix-pv, .is-on .ix-pv, .pv-tile video, .pv-tile img { transition: none; }
  main { animation: none !important; }
  .btn .arr, .nb-kind .arr { transition: none; }
}

/* ---------- narrower screens ---------- */
/* tablets and phones: the Index becomes a stack of bands, each in its project's colours, every preview showing */
@media (max-width: 960px) {
  .is-home main { display: block; padding: 0; }
  .ix { display: block; --size: clamp(48px, 11vw, 80px); }
  .ix-item { display: grid; gap: 16px; padding: 26px var(--pad-r) 32px var(--pad-l);
    --bg: var(--p-bg); --ink: var(--p-ink); --accent: var(--p-accent); --btn: var(--p-btn); --btn-ink: var(--p-btn-ink);
    background: var(--bg); color: var(--ink); transition: --bg var(--fade), --ink var(--fade), --accent var(--fade), --btn var(--fade), --btn-ink var(--fade); }
  .ix-name, .ix-pv { grid-column: auto; grid-row: auto; }
  .ix-name { height: auto; display: grid; gap: 6px; border: 0; outline-offset: 4px; }
  .ix-item.is-lit { isolation: isolate; contain: paint; }
  .ix-item.is-lit .ix-name .nm { text-shadow: 0 0 .05em color-mix(in srgb, var(--accent) 60%, transparent), 0 0 .3em color-mix(in srgb, var(--accent) 42%, transparent); }
  .ix-item .f-sonar { text-shadow: 0 0 .32em color-mix(in srgb, #ff2f72 50%, transparent); }
  .ix-item:first-child .ix-name { border: 0; }
  .ix-name .nm { opacity: 1; color: var(--accent); }
  .ix-pv, .pv-say { gap: 14px; }
  .pv-say { min-height: 0; }
  /* the band's full width, whatever the length of the words under the previews (the films have none) */
  .ix-pv { width: auto; justify-self: stretch; opacity: 1; visibility: visible; transition: none; }
  .ix-item.edge-live { transition: --ink var(--fade), --accent var(--fade), --btn var(--fade), --btn-ink var(--fade); }
  .ix-pv h2 { font-size: 19px; }
  .ix-pv p { font-size: 15px; }
  .is-home .foot { background: var(--f-bg); color: color-mix(in srgb, var(--f-ink) 62%, var(--f-bg)); max-width: none; }
  .points { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .film { grid-template-columns: minmax(0, 1fr); }
  .g-in { grid-template-columns: minmax(0, 1fr); }
  .g-media { order: -1; }
}
@media (max-width: 860px) { .shots-3:not(.is-phones) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .top { padding-block: 18px 14px; flex-wrap: wrap; gap: 10px 24px; }
  .top .nav { width: 100%; justify-content: flex-start; }
  .logo { font-size: 26px; }
  .hero { gap: 16px; }
  .hero-row { flex-direction: column; align-items: stretch; }
  .intro.prose { font-size: 18px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 22px; margin-top: 2.6em; }
  .prose blockquote { font-size: 19px; }
  .lede { font-size: 20px; }
  .part { margin-top: 3.4em; }
  .study-body .shots-2:not(.is-phones):not(:has(.is-tall)) { grid-template-columns: minmax(0, 1fr); }
  .compare:not(.is-tall-pair) .cmp { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .is-tall-pair :is(.cmp, .gal) { gap: 12px; }
  .gal-3:not(.is-tall-pair .gal) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-tall-pair .gal-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .changes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .changes, .changes tbody, .changes tr, .changes th, .changes td, .changes tbody th { display: block; width: auto; }
  .changes tr { padding-block: 12px; border-top: 1px solid var(--line); }
  .changes th, .changes td { padding: 0; border: 0; }
  .changes td { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; margin-top: 6px; }
  .changes td::before { content: attr(data-k); padding-top: 2px; font-weight: 500; font-size: 12px; color: var(--ink-3); }
  .shots { gap: 10px; }
  .proj-end { margin-top: 44px; }
  .foot span:last-child { margin-left: 0; }
}
@media (max-width: 600px) {
  .pv-tile .len { display: none; }
}
@media (max-width: 420px) {
  .nav { gap: 4px 16px; }
  .nav a { font-size: 14px; }
  .acts .btn { flex: 1 1 100%; justify-content: center; }
}
