/* Layout: one index drives the site. The lens in the hero filters the project index; rows open in place,
   and each case has its own page with a sticky contents rail. 12-col grid, 1280 max. Single light theme on pure white. */
:root {
  --bg: #ffffff;
  --ink: #0e0f12;
  --mute: #6b6e78;
  --line: #e6e7eb;
  --wash: #f5f6f8;
  --accent: #d81b7a;
  --on-accent: #ffffff;
  --dash: #c9cbd2;
  /* Schibsted Grotesk has no Cyrillic; Onest picks up only those letters (its Cyrillic file loads on Russian pages) */
  --display: "Schibsted Grotesk", "Onest", "Helvetica Neue", Arial, sans-serif;
  --body: "Schibsted Grotesk", "Onest", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1280px;
  --head: 56px;
  --radius-video: 16px; /* every video frame: Vimeo players and vertical clips */
  --video-bg: #000; /* behind every video in both themes; a theme colour here bleeds into the anti-aliased corners */
  --ease: cubic-bezier(.2,.7,.1,1);
  /* Type: the only four text styles on the site. Body bold is 600; nothing else sets a size or weight.
     The Bezier field (fx.js) shifts both heading styles together through --fx-wght and --fx-track. */
  --t-display: calc(600 + var(--fx-wght, 0)) clamp(44px, 7.4vw, 108px)/1 var(--display);
  --t-display-track: calc(-.04em + var(--fx-track, 0em));
  --t-heading: calc(500 + var(--fx-wght, 0)) clamp(26px, 3vw, 40px)/1.15 var(--display);
  --t-heading-track: calc(-.02em + var(--fx-track, 0em));
  --t-body: 400 16px/1.55 var(--body);
  --t-label: 400 11px/1.4 var(--mono);
  --t-label-track: .08em;
  /* Space: three steps of vertical air between groups; the inside of lists stays tight on purpose */
  --space-section: clamp(64px, 9vw, 144px); /* above and below every section */
  --space-head: clamp(40px, 4.5vw, 64px);   /* a section title to its list */
  --space-row: clamp(32px, 4vw, 48px);      /* between open project rows */
  /* A soft, feathered shadow that lifts light screenshots off the light page; the dark theme doesn't need it */
  --shot-shadow: 0 1px 2px rgba(16, 17, 20, .05), 0 6px 24px rgba(16, 17, 20, .08), 0 18px 48px rgba(16, 17, 20, .06);
  color-scheme: light;
}
/* Dark theme: set by the header switch, or by a case with "theme: dark" until the visitor picks one */
:root[data-theme="dark"] {
  --shot-shadow: none;
  --bg: #0c0d0f;
  --ink: #ecedf0;
  --mute: #8a8d97;
  --line: #24262b;
  --wash: #15161a;
  --accent: #ff5fa8;
  --on-accent: #0c0d0f;
  --dash: #3a3d45;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font: var(--t-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s, color .35s;
}
.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.mono { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; }
strong, b { font-weight: 600; }
.label { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--mute); }
h1, h2, h3 { margin: 0; font-family: var(--display); text-wrap: balance; }
p { margin: 0; }
.todo { color: var(--mute); }
.todo::before { content: "["; } .todo::after { content: "]"; }

/* Header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: var(--head); }
.logo { font-weight: 600; text-decoration: none; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%,100% { box-shadow: 0 0 0 8px transparent; } }
.nav { margin-left: auto; display: flex; gap: 20px; }
.nav a { text-decoration: none; color: var(--mute); white-space: nowrap; transition: color .2s; }
.nav a:hover { color: var(--ink); }
.annot-btn { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--mute); transition: all .2s; }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 7px; color: var(--mute); transition: color .2s, border-color .2s; }
.theme-btn:hover { color: var(--ink); border-color: var(--ink); }
/* Language switch: a link to the same page in the other language, styled like the header chips */
.lang-btn { text-decoration: none; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--mute); transition: color .2s, border-color .2s; }
.lang-btn:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 760px) { .lang-btn { margin-left: auto; } .lang-btn ~ .fx-panel, .lang-btn ~ .theme-btn { margin-left: 0 !important; } }
/* Half-filled disc: the filled side flips with the theme */
.theme-btn i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); transition: transform .5s var(--ease); }
:root[data-theme="dark"] .theme-btn i { transform: rotate(180deg); }
.annot-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; display: none; }
.is-case .read-progress { display: block; }
/* Two design links make the menu long: the status goes first, then the menu (Russian is the longest) */
@media (max-width: 1100px) { .status { display: none; } }
@media (max-width: 900px) { .nav { display: none; } .theme-btn { margin-left: auto; } }

/* Hero */
/* First screen fills the viewport under the header; the meta row sits on its bottom edge */
.hero {
  display: flex;
  min-height: calc(100vh - var(--head) - 1px - env(safe-area-inset-top, 0px));
  min-height: calc(100svh - var(--head) - 1px - env(safe-area-inset-top, 0px));
  padding-block: clamp(40px, 8vw, 96px) clamp(24px, 3vw, 40px);
}
.hero .wrap { width: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.hero-main { display: grid; gap: clamp(20px, 3vw, 36px); margin-block: auto; }
.hero h1 { font: var(--t-display); letter-spacing: var(--t-display-track); max-width: 15ch; }
.thesis { font: var(--t-heading); letter-spacing: var(--t-heading-track); max-width: 34ch; }
.hero-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.hero-meta div { display: grid; gap: 4px; }
.hero-meta b { font-weight: 600; }

/* Sections */
section { scroll-margin-top: calc(var(--head) + 16px); }
/* Section rhythm: major parts sit far apart, the three work lists (cases, reels, tools) a bit closer as one group */
.sec { padding-block: var(--space-section); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: var(--space-head); }
.h2 { font: var(--t-heading); letter-spacing: var(--t-heading-track); }
/* Section titles over an index speak in the hero's voice */
.sec-head .h2 { font: var(--t-display); letter-spacing: var(--t-display-track); }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--mute); transition: all .2s; display: inline-flex; gap: 6px; align-items: baseline; }
.chip sup { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Index */
.index { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); transition: opacity .35s; }
.row.dim { opacity: .18; }
.row.dim .row-head { pointer-events: none; }
.row-head {
  width: 100%; text-align: left;
  display: grid; align-items: baseline; gap: 16px;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr) 72px 28px;
  padding-block: 22px;
}
.row-name { font: var(--t-heading); letter-spacing: var(--t-heading-track); transition: transform .45s var(--ease); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.row-head:hover .row-name { transform: translateX(10px); }
/* Tools are small things, so their names drop to body bold: the list reads as a table, below cases and reels */
.row[data-kind="tool"] .row-name { font: var(--t-body); font-weight: 600; letter-spacing: 0; }
.row[data-kind="tool"] .row-head { padding-block: 16px; }
.tag { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--mute); transform: translateY(-4px); white-space: nowrap; }
.tag.era { border-color: var(--ink); color: var(--ink); }
/* Only in the preview build: marks what the public build leaves out */
.tag.draft { border-color: var(--accent); color: var(--accent); }
.sec-head > .tag.draft { transform: none; align-self: center; margin-right: auto; }
.row-type, .row-role { color: var(--mute); }
.row-year { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
.plus { width: 20px; height: 20px; position: relative; justify-self: end; align-self: center; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%); transition: transform .4s var(--ease); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.row.open .plus::after { transform: translate(-50%, -50%) rotate(0deg); }
@media (max-width: 760px) {
  .row-head { grid-template-columns: minmax(0, 1fr) 28px; gap: 6px 12px; }
  .row-type { grid-column: 1; grid-row: 2; }
  .row-role, .row-year { display: none; }
  .plus { grid-column: 2; grid-row: 1; }
}
.row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.row.open .row-body { grid-template-rows: 1fr; }
/* The body clips its content so it can slide open. The clip box reaches past the content, up into the head and out
   to the page gutters, so screenshot shadows show whole from the first frame. That extra room is see-through to
   clicks (the head under it stays clickable); the content inside takes clicks as usual. */
.row-body > .inner {
  --room-y: 40px; --room-x: 16px;
  overflow: hidden; min-height: 0;
  padding: var(--room-y) var(--room-x) 0; margin: calc(-1 * var(--room-y)) calc(-1 * var(--room-x)) 0;
  pointer-events: none;
}
@media (min-width: 720px) { .row-body > .inner { --room-x: 32px; } }
.row-body > .inner > * { pointer-events: auto; }
/* A closed row shows nothing, its shadows included (they would peek into the room above) */
.row:not(.open) .thumb, .row:not(.open) .media > img { box-shadow: none; }
.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding-block: 4px 36px; }
@media (max-width: 860px) { .case { grid-template-columns: minmax(0,1fr); gap: 24px; } }
/* The link to Vimeo or the tool sits at the bottom of the column, like "Read the case" */
.case-lede { display: flex; flex-direction: column; gap: 20px; }
.case-lede p { max-width: 52ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 20px; border-top: 1px solid var(--line); padding-top: 16px; }
/* align-content: start keeps short values on the first line when a neighbour wraps */
.facts div { display: grid; gap: 2px; align-content: start; }
/* Same look as a case row's "Read the case": plain text, the arrow moves its own way on hover */
.open-case { align-self: flex-start; margin-top: auto; display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.open-case span { line-height: 1; transition: transform .45s var(--ease); }
.open-case:hover span { transform: translate(4px, -4px); }
.outline { margin: 0; padding: 0; counter-reset: ch; }
.outline li { list-style: none; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; padding-block: 12px; border-bottom: 1px dashed var(--line); counter-increment: ch; }
.outline li::before { content: counter(ch, decimal-leading-zero); font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--mute); padding-top: 3px; }
.outline b { font-weight: 600; display: block; }
.outline span { color: var(--mute); }
.outline a { text-decoration: none; }
.outline a:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* Media placeholders */
.slot { margin: 0; border: 1px dashed var(--dash); border-radius: 6px; aspect-ratio: 16/10; max-width: 100%; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--mute); background: repeating-linear-gradient(135deg, transparent 0 9px, var(--wash) 9px 10px); }
.media { margin: 0; display: grid; gap: 10px; min-width: 0; }
.media img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: 6px; background: repeating-linear-gradient(135deg, var(--bg) 0 9px, var(--wash) 9px 10px); }
.video { aspect-ratio: 16/9; max-width: 100%; border-radius: var(--radius-video); overflow: hidden; isolation: isolate; background: var(--video-bg); }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-poster { position: relative; display: block; width: 100%; height: 100%; }
/* The poster is cropped closer than the frame so the reel's own picture fills it, not the player chrome around it */
.video-poster { --zoom: 1.35; }
.video-poster img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom)); transition: transform .8s var(--ease), opacity .3s; }
.video-poster:hover img { transform: scale(calc(var(--zoom) + .04)); opacity: .85; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 600; transition: transform .4s var(--ease); }
.play span { font-size: 10px; }
.video-poster:hover .play { transform: translate(-50%, -50%) scale(1.06); }
/* Screenshots carry the shadow: on the image itself, or on the thumb frame that clips its zoom */
.media > img { box-shadow: var(--shot-shadow); }
.thumb { margin-bottom: 20px; overflow: hidden; border-radius: 6px; box-shadow: var(--shot-shadow); }
.thumb > img, .row-cover .media > img { box-shadow: none; }
.thumb figcaption { display: none; }
.thumb img { transition: transform .8s var(--ease); }
.row.open .thumb img { transform: scale(1.0); }
.row:not(.open) .thumb img { transform: scale(1.06); }

/* Behind the work */
.behind { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; }
@media (max-width: 860px) { .behind { grid-template-columns: minmax(0,1fr); gap: 24px; } }
.behind-intro { display: grid; gap: 12px; align-content: start; }
.behind-intro p { color: var(--mute); max-width: 36ch; margin-top: 4px; }
.behind-title { font: var(--t-heading); letter-spacing: var(--t-heading-track); }
/* Process items are always open: a title, a line of text and the proof links */
.process { border-top: 1px solid var(--line); }
.process-item { display: grid; gap: 8px; padding-block: 18px 22px; border-bottom: 1px solid var(--line); }
.process-item h3 { font: var(--t-heading); letter-spacing: var(--t-heading-track); }
.process-item p { margin: 0; color: var(--mute); max-width: 58ch; }

/* Capabilities */
.caps { display: flex; flex-wrap: wrap; gap: 8px; }
.cap { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; transition: background .25s, color .25s, border-color .25s; cursor: default; }
.cap:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0,1fr); } }
/* About: the story in body text like every other description, what I do as chips under it, the timeline beside */
.about-main { display: flex; flex-direction: column; gap: 40px; }
.about-text { margin: 0; max-width: 52ch; }
.about-caps { display: grid; gap: 14px; }
.about-text em { font-style: normal; color: var(--mute); }
.timeline { display: grid; align-content: start; }
.timeline div { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.timeline .mono { color: var(--mute); padding-top: 3px; }
/* A project with a live site: the name links out, the arrow says it leaves the page */
.timeline-link { color: inherit; text-decoration: none; transition: color .2s; }
.timeline-link span { color: var(--mute); transition: color .2s; }
.timeline-link:hover, .timeline-link:hover span { color: var(--accent); }

/* Contact */
/* Contact sits centred: the label, the address with its copy button, then the socials */
.contact { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.mail { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 18px; }
.mail-addr { font: var(--t-heading); letter-spacing: var(--t-heading-track); overflow-wrap: anywhere; user-select: all; }
.copy { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; border: 1px solid var(--ink); border-radius: 999px; padding: 8px 14px; transition: all .2s; }
.copy:hover, .copy.done { background: var(--ink); color: var(--bg); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 36px; }
.socials a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.socials a:hover { border-color: var(--ink); }
footer { padding-block: 40px; color: var(--mute); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Case page */
.back { display: inline-flex; gap: 8px; margin-top: 32px; text-decoration: none; transition: gap .3s var(--ease), color .2s; }
.back:hover { gap: 12px; color: var(--ink); }
.case-hero { display: grid; gap: 28px; padding-block: clamp(32px, 6vw, 80px) 32px; }
.case-hero h1 { font: var(--t-display); letter-spacing: var(--t-display-track); display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 20px; }
.case-hero h1 .tag { transform: translateY(-.6em); }
.case-hero .lede { font: var(--t-heading); letter-spacing: var(--t-heading-track); max-width: 34ch; }
.case-hero .facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* The product's own site (site: in the front matter), right under the lede, as a pill like the other buttons */
.case-site { justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: -8px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; transition: border-color .2s, background .2s; }
.case-site:hover, .case-site:focus-visible { border-color: var(--ink); }
.cover { margin-bottom: clamp(48px, 7vw, 96px); }
.case-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 48px; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--head) + 32px); align-self: start; display: grid; gap: 14px; }
.toc ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; border-left: 1px solid var(--line); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--mute); transition: color .2s, border-color .2s; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; padding-top: 2px; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--ink); }
@media (max-width: 860px) {
  .case-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .toc { top: calc(env(safe-area-inset-top, 0px) + var(--head)); z-index: 10; background: var(--bg); margin-inline: -16px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
  .toc > .label { display: none; }
  .toc ol { display: flex; overflow-x: auto; border-left: 0; gap: 4px; scrollbar-width: none; }
  .toc a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; padding: 6px 8px 10px; margin: 0; }
  .toc a.active { border-bottom-color: var(--ink); }
}
.prose { display: grid; gap: clamp(48px, 6vw, 80px); min-width: 0; }
.prose section { display: grid; gap: 18px; scroll-margin-top: calc(var(--head) + 64px); }
.prose h2 { font: var(--t-heading); letter-spacing: var(--t-heading-track); }
.prose p, .prose li { max-width: 62ch; }
/* Each h3 opens a block of its own (a key decision, say): a rule and room above it, so a long section doesn't read
   as one sheet. The first one right under the section title needs neither. */
.prose h3 { font: 600 20px/1.3 var(--display); letter-spacing: -.01em; margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.prose h2 + h3 { margin-top: 8px; padding-top: 0; border-top: 0; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.prose blockquote { margin: 0; padding-left: 20px; border-left: 2px solid var(--ink); }
.prose blockquote p { font: var(--t-heading); letter-spacing: var(--t-heading-track); }
/* A gallery of phone screenshots (::phones in a case): three across the text column, the rest scroll in sideways,
   by the arrows under it (main.js), a swipe or a trackpad. On phones two and a bit are in view. */
.phones { margin: 0; display: grid; gap: 12px; min-width: 0; }
.phones-row { --gap: 12px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * var(--gap)) / 3); gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; }
.phones-row::-webkit-scrollbar { display: none; }
.phones-row img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--wash); scroll-snap-align: start; }
.phones-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.phones-nav { display: flex; gap: 8px; margin-left: auto; }
.phones-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; transition: border-color .2s, opacity .2s; }
.phones-btn:hover { border-color: var(--ink); }
/* Forward is the main move: a filled circle (black on the light theme, light on the dark one) */
.phones-btn[data-dir="1"] { background: var(--ink); border-color: var(--ink); color: var(--bg); transition: opacity .2s, transform .3s var(--ease); }
.phones-btn[data-dir="1"]:hover:not(:disabled) { transform: scale(1.06); }
.phones-btn:disabled { opacity: .3; cursor: default; border-color: var(--line); }
.phones-btn[data-dir="1"]:disabled { opacity: .2; border-color: var(--ink); }
/* How many are in view out of all: "1–3 / 5" */
.phones-count { align-self: center; margin-right: 8px; font: var(--t-label); letter-spacing: var(--t-label-track); color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.phones.fits .phones-nav { display: none; }
@media (max-width: 760px) {
  .phones-row { grid-auto-columns: 42%; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
}
/* The content pipeline (::pipeline in a case): boxes on a grid whose fr tracks match the SVG viewBox units, so the
   stretched lines (non-scaling stroke) always meet the box edges. Narrow screens scroll it sideways. */
.pipeline { margin: 0; display: grid; gap: 10px; min-width: 0; }
.pipe-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.pipe-scroll::-webkit-scrollbar { display: none; }
.pipe { position: relative; min-width: 720px; }
.pipe-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pipe-lines path { fill: none; stroke: var(--dash); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.pipe ol { margin: 0; padding: 0; gap: 0; list-style: none; display: grid; grid-template-columns: minmax(0,10fr) minmax(0,2fr) minmax(0,10fr) minmax(0,2fr) minmax(0,10fr) minmax(0,2fr) minmax(0,10fr) minmax(0,2fr) minmax(0,10fr); grid-template-rows: 10fr 2fr 10fr 2fr 10fr; }
.pipe-step { position: relative; display: grid; align-content: start; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); }
.pipe-step b { font: 600 15px/1.25 var(--display); letter-spacing: -.01em; }
.pipe-step span { font-size: 13px; line-height: 1.4; color: var(--mute); }
.pipe-step.in::before { content: ""; position: absolute; right: 100%; top: 50%; translate: 0 -50%; border-block: 4.5px solid transparent; border-left: 7px solid var(--mute); }
.pipe-step.end { border-color: var(--ink); background: var(--bg); }
/* What the app offers (::tiers in a case): the rule on top forks into a column per tier. The live tier is a filled
   panel, a tier that is a design for now is dashed. Under 560px the columns stack and the fork goes. */
.tiers { --gap: 16px; --fork: 28px; margin: 0; display: grid; gap: 10px; min-width: 0; container: tiers / inline-size; }
.tiers-core, .tier li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.tiers-core { justify-self: center; text-align: center; max-width: 380px; padding: 14px 20px; border-color: var(--ink); }
.tiers b { font: 600 15px/1.25 var(--display); letter-spacing: -.01em; }
.tiers span { font-size: 13px; line-height: 1.4; color: var(--mute); }
.tiers-cols { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); padding-top: var(--fork); }
.tiers-cols::before, .tiers-cols::after { content: ""; position: absolute; top: 0; border: 0 solid var(--dash); }
.tiers-cols::before { top: -10px; left: 50%; height: calc(var(--fork) / 2 + 10px); border-left-width: 1.5px; } /* from the core box, across the figure gap */
.tiers-cols::after { top: calc(var(--fork) / 2); height: calc(var(--fork) / 2); left: calc((100% - var(--gap)) / 4); right: calc((100% - var(--gap)) / 4); border-width: 1.5px 1.5px 0; border-radius: 8px 8px 0 0; }
.tier { display: grid; align-content: start; gap: 12px; padding: 16px; border-radius: 12px; background: var(--wash); border: 1px solid transparent; }
.tier header { display: grid; gap: 2px; padding: 2px 2px 4px; }
.tier header b { font-size: 17px; }
.tier ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tier li { max-width: none; }
.tier-plan { background: none; border: 1.5px dashed var(--dash); }
@container tiers (max-width: 559px) {
  .tiers-core { justify-self: stretch; max-width: none; }
  .tiers-cols { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .tiers-cols::before, .tiers-cols::after { display: none; }
}

/* Sticky notes (::stickers in a case): paper squares written in Shantell Sans (a marker hand), each stuck on at its
   own angle and height. Four across, two by two on narrow screens. A hover presses the note flat. */
.stickers, .answers { --paper: #fff1b8; --paper-ink: #2b2614; --paper-mute: #6b5f37; }
:root[data-theme="dark"] :is(.stickers, .answers) { --paper: #e3cf82; --paper-mute: #5f5430; } /* still paper on a dark desk, just dimmer */
.stickers { margin: 0; display: grid; gap: 22px; min-width: 0; container: stickers / inline-size; }
/* No gaps, and each note a little wider than its column, so neighbours overlap; the padding keeps the outer ones in */
.stickers ul { --overlap: 24px; margin: 0; padding: 16px 14px 24px; list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; } /* one column per note (--n from the template) */
.stickers li { position: relative; justify-self: center; width: calc(100% + var(--overlap)); max-width: none; aspect-ratio: 1; display: grid; align-content: center; gap: 6px; padding: 16px calc(12px + var(--overlap)) 16px 14px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 10px 18px -8px rgba(0,0,0,.28); rotate: var(--tilt); translate: 0 var(--drop); transition: rotate .4s var(--ease), translate .4s var(--ease); }
.stickers li:hover { z-index: 1; }
/* Paper: a fine grain (SVG noise, tiled), a soft sheen at the top where the glue holds it flat, and a shade along the
   foot where it lifts off. Layered over --paper, so both themes keep their colour. The answers reuse the same paper. */
.stickers li, .answers .note { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .26 0 0 0 0 .12 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E"),
  linear-gradient(to bottom, rgba(255,255,255,.28), rgba(255,255,255,0) 22%, rgba(0,0,0,0) 78%, rgba(90,70,20,.10)),
  var(--paper); }
.stickers li:last-child { padding-right: 14px; } /* the last note has nothing on top of it */
.stickers li:nth-child(4n+1) { --tilt: -3deg; --drop: 6px; }
.stickers li:nth-child(4n+2) { --tilt: 2.2deg; --drop: -8px; }
.stickers li:nth-child(4n+3) { --tilt: -1.4deg; --drop: 12px; }
.stickers li:nth-child(4n+4) { --tilt: 3.2deg; --drop: -2px; }
.stickers li:nth-child(5) { --tilt: -2deg; --drop: 10px; }
.stickers li:hover { rotate: 0deg; translate: 0 calc(var(--drop) - 4px); }
.stickers b { font: 500 clamp(16px, 1.45vw, 18px)/1.15 "Shantell Sans", cursive; }
.stickers span { font: 400 clamp(13px, 1.2vw, 14.5px)/1.2 "Shantell Sans", cursive; color: var(--paper-mute); }
@container stickers (max-width: 599px) {
  .stickers ul { --overlap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stickers b { font-size: 17px; }
  .stickers span { font-size: 13px; }
  /* An odd last note gets the row to itself, centred and the same size as the others */
  .stickers li:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% + var(--overlap) / 2); }
}
@media (prefers-reduced-motion: reduce) { .stickers li { transition: none; } }

/* Pains and answers (::answers in a case): the problem's sticky notes come back, one row each: the note, an arrow, and
   what the product does about it with whether that is live or only designed (dashed, like Chef in the tiers).
   On phones the arrow goes and the note shrinks. */
.answers { margin: 0; display: grid; gap: 22px; min-width: 0; container: answers / inline-size; }
.answers ol { margin: 0; padding: 10px 0 0; list-style: none; display: grid; gap: 34px; }
.answers li { max-width: none; display: grid; grid-template-columns: 160px 28px minmax(0, 62ch); align-items: center; gap: 22px; }
.answers .note { aspect-ratio: 1; display: grid; align-content: center; padding: 16px 18px; color: var(--paper-ink); font: 500 18px/1.15 "Shantell Sans", cursive; box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 10px 18px -8px rgba(0,0,0,.28); rotate: var(--tilt); }
.answers li:nth-child(4n+1) { --tilt: -2.4deg; }
.answers li:nth-child(4n+2) { --tilt: 1.8deg; }
.answers li:nth-child(4n+3) { --tilt: -1.2deg; }
.answers li:nth-child(4n+4) { --tilt: 2.6deg; }
.answers .to { color: var(--mute); font-size: 20px; text-align: center; }
.answers p { margin: 0; max-width: none; }
.answers .state { justify-self: start; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--ink); padding: 3px 8px; border: 1px solid var(--ink); border-radius: 999px; }
.answers .state.plan { color: var(--mute); border: 1px dashed var(--dash); }
.answers .say { display: grid; gap: 10px; align-content: center; }
@container answers (max-width: 559px) {
  .answers ol { gap: 30px; }
  .answers li { grid-template-columns: 84px minmax(0, 1fr); align-items: start; gap: 16px; }
  .answers .note { padding: 8px 9px; font-size: 13px; }
  .answers .to { display: none; }
  .answers p { font-size: 14px; line-height: 1.5; }
}

/* A positioning map (::positioning in a case): the plot with its two axes and thin middles; the axis names run
   under it and up its left side. Labels sit right of their dot, or left of it near the right edge (.flip). */
.positioning { margin: 0; display: grid; gap: 22px; min-width: 0; container: pos / inline-size; } /* the caption clear of the axis names, set in the same face */
.pos-map { position: relative; padding: 0 0 36px 32px; }
.pos-plot { position: relative; aspect-ratio: 16 / 10; border-left: 1.5px solid var(--dash); border-bottom: 1.5px solid var(--dash); background:
  linear-gradient(to right, transparent calc(50% - .5px), var(--line) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
  linear-gradient(to top, transparent calc(50% - .5px), var(--line) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)); }
.pos-pt { position: absolute; display: flex; align-items: center; gap: 8px; translate: -5px 50%; font-size: 13px; line-height: 1.2; color: var(--mute); white-space: nowrap; }
.pos-pt i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--dash); }
.pos-pt.flip { flex-direction: row-reverse; translate: calc(-100% + 5px) 50%; }
.pos-pt.own { font: 600 15px/1.2 var(--display); color: var(--ink); translate: -8px 50%; }
.pos-pt.own.flip { translate: calc(-100% + 8px) 50%; }
.pos-pt.own i { width: 16px; height: 16px; background: var(--ink); box-shadow: 0 0 0 6px var(--wash); }
.pos-axis { position: absolute; display: flex; justify-content: space-between; gap: 16px; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--mute); }
.pos-x { left: 32px; right: 0; bottom: 0; }
/* Runs bottom to top along the plot: vertical text turned half a turn, so its start lands at the bottom */
.pos-y { left: 0; top: 0; bottom: 36px; writing-mode: vertical-rl; rotate: 180deg; }
/* Phones: a taller plot so the dots have room, axis names on two lines, and our label above its dot */
@container pos (max-width: 559px) {
  .pos-map { padding: 0 0 52px 40px; }
  .pos-plot { aspect-ratio: 4 / 5; }
  .pos-x { left: 40px; }
  .pos-y { bottom: 52px; }
  .pos-axis { font-size: 10px; }
  .pos-pt.own, .pos-pt.own.flip { flex-direction: column-reverse; gap: 6px; translate: -50% 8px; }
}

.pipeline { container: pipe / inline-size; }
.pipe-lines-v { display: none; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pipe-lines-v path { fill: none; stroke: var(--dash); stroke-width: 1.25; }
.pipe-lines-v marker path { fill: var(--mute); stroke: none; }
/* Too narrow for the flow left to right (phones, tablets): the steps stack, the branches sit between two rails,
   and main.js draws the lines. The order of the list is already the reading order. */
@container pipe (max-width: 759px) {
  .pipe { min-width: 0; max-width: 520px; }
  .pipe-lines, .pipe-step.in::before { display: none; }
  .pipe-lines-v { display: block; }
  .pipe ol { grid-template-columns: 28px minmax(0, 1fr) 28px; grid-template-rows: none; row-gap: 22px; }
  .pipe-step { grid-area: auto / 2 / auto / 3 !important; } /* over the desktop place in the inline style */
  .pipe-step:nth-child(-n+2), .pipe-step.end { grid-column: 1 / -1 !important; }
}
.prose .case-note { font: var(--t-body); letter-spacing: 0; text-transform: none; max-width: 62ch; padding-top: 20px; border-top: 1px solid var(--line); }
.comment { margin: 0; max-width: 62ch; display: grid; gap: 14px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); }
.comment blockquote { margin: 0; }
.comment figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.comment-handle { font-weight: 600; }
.comment a { text-decoration: none; margin-left: auto; transition: color .2s; }
.comment a:hover { color: var(--ink); }
.next-case { display: grid; gap: 8px; margin-top: clamp(64px, 9vw, 128px); padding-block: 28px 8px; border-top: 1px solid var(--line); text-decoration: none; }
.next-case .name { font: var(--t-display); letter-spacing: var(--t-display-track); transition: transform .5s var(--ease); }
.next-case:hover .name { transform: translateX(16px); }

/* 404 */
.lost { padding-block: clamp(80px, 14vw, 180px); display: grid; gap: 24px; justify-items: start; }
.lost h1 { font: var(--t-display); letter-spacing: var(--t-display-track); }

/* Cursor chip */
.cursor { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: 6px 10px; border-radius: 999px; opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; }
.cursor.on { opacity: 1; transform: translate(14px, 14px) scale(1); }
@media (hover: none) { .cursor { display: none; } }

/* Layout notes (Framer-style grid overlay) */
.grid-overlay { position: fixed; inset: 0; z-index: 15; pointer-events: none; display: none; }
.grid-overlay .wrap { height: 100%; display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid-overlay .wrap { grid-template-columns: repeat(4, 1fr); } .grid-overlay .wrap i:nth-child(n+5) { display: none; } }
.grid-overlay i { background: color-mix(in srgb, var(--accent) 6%, transparent); border-inline: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
body.annot .grid-overlay { display: block; }
/* :where keeps this at zero specificity so it never overrides sticky or absolute positioning */
:where([data-c]) { position: relative; }
body.annot [data-c] { outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -1px; }
body.annot [data-c]::after { content: attr(data-c); position: absolute; top: 0; right: 0; z-index: 16; font: 500 10px/1 var(--mono); letter-spacing: .04em; background: var(--accent); color: var(--on-accent); padding: 4px 6px; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Effects playground (temporary, see fx.js). Remove with the FX menu once the choice is made. */
.fx-panel { position: relative; }
.fx-btn { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--mute); transition: color .2s, border-color .2s; }
.fx-btn:hover, .fx-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink); }
.fx-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 25; min-width: 200px; display: grid; gap: 10px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 12%, transparent); }
.fx-menu label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fx-menu input { accent-color: var(--accent); margin: 0; }
.fx-menu input:disabled + * , .fx-menu label:has(input:disabled) { color: var(--mute); }
.fx-note { color: var(--mute); max-width: 24ch; }

.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
/* The dots fade out over the lower part of the first screen, so the grid melts into the page instead of ending on a line */
.fx-grid, .fx-layer {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  /* Eased stops: the fade starts at a quarter of the screen and is gone well before the bottom edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 25%, rgba(0, 0, 0, .55) 50%, rgba(0, 0, 0, .18) 68%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 25%, rgba(0, 0, 0, .55) 50%, rgba(0, 0, 0, .18) 68%, transparent 85%);
}
.hero h1 .w, .sec-head .h2 .w { display: inline-block; white-space: nowrap; }
.hero h1 .ch, .sec-head .h2 .ch { display: inline-block; }

.fx-tl { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; user-select: none; -webkit-user-select: none; }
.fx-tl-labels, .fx-tl-area { display: grid; grid-template-rows: 20px repeat(3, 18px); }
.fx-tl-labels .label { align-self: center; }
.fx-tl-area { position: relative; cursor: ew-resize; touch-action: pan-y; }
.fx-tl-ruler { border-bottom: 1px solid var(--line); background: repeating-linear-gradient(90deg, var(--mute) 0 1px, transparent 1px calc(100% / 24)) left bottom / 100% 5px no-repeat; opacity: .7; }
.fx-tl-track { position: relative; border-bottom: 1px dashed var(--line); }
.fx-tl-track .bar { position: absolute; top: 50%; height: 2px; transform: translateY(-50%); background: color-mix(in srgb, var(--accent) 35%, transparent); }
.fx-tl-track .kf { position: absolute; top: 50%; width: 7px; height: 7px; background: var(--bg); border: 1.5px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.fx-tl-head { position: absolute; top: 0; bottom: 0; left: 100%; border-left: 1.5px solid var(--accent); pointer-events: none; }
.fx-tl-head::before { content: ""; position: absolute; top: 0; left: -5px; border: 4px solid transparent; border-top: 6px solid var(--accent); border-bottom: 0; }
.fx-tl-time { position: absolute; top: 2px; left: 6px; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; line-height: 1; color: var(--accent); background: var(--bg); padding: 2px 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.fx-ease { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--ink); color: var(--bg); font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; line-height: 1; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.fx-ease.on { opacity: 1; }
.fx-ease svg { width: 48px; height: 32px; display: block; }
.fx-ease path { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .55; }
.fx-ease circle { fill: currentColor; }
body.fx-ease-on .cursor { display: none; }
@media (hover: none) { .fx-ease { display: none; } }
/* Near the end of the strip the timecode sits left of the playhead so it stays inside the screen */
.fx-tl-head.end .fx-tl-time { left: auto; right: 6px; }
/* Phones: keep the name on one line and drop the layout notes button to make room */
.logo { white-space: nowrap; }
@media (max-width: 760px) { .annot-btn { display: none; } }
@media (max-width: 760px) { .fx-panel { margin-left: auto; } .fx-panel + .theme-btn { margin-left: 0; } }

/* Spring ring cursor (fx.js) */
.fx-ring { position: fixed; left: 0; top: 0; z-index: 29; pointer-events: none; width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 999px; display: grid; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), background-color .3s, border-color .3s, opacity .2s; }
.fx-ring span { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; line-height: 1; color: var(--on-accent); white-space: nowrap; opacity: 0; transition: opacity .2s; }
.fx-ring[data-mode="link"] { width: 48px; height: 48px; background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); }
.fx-ring[data-mode="row"] { width: 72px; height: 72px; background: var(--accent); border-color: var(--accent); }
.fx-ring[data-mode="row"] span { opacity: 1; }
.fx-ring.press { width: 20px; height: 20px; }
.fx-ring[data-mode="link"].press { width: 38px; height: 38px; }
.fx-ring.away { opacity: 0; }
body.fx-ring-on .cursor { display: none; }

/* Film grain overlay (fx.js): oversized so the jitter never shows an edge */
.fx-grain { position: fixed; inset: -120px; z-index: 40; pointer-events: none; opacity: .07; background-size: 160px; animation: fx-grain .7s steps(5) infinite; }
:root[data-theme="dark"] .fx-grain { opacity: .09; }
@keyframes fx-grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-37px, 22px); } 40% { transform: translate(18px, -41px); }
  60% { transform: translate(-12px, 33px); } 80% { transform: translate(41px, 9px); } 100% { transform: translate(0, 0); }
}

/* Headline lines are fixed: each is its own row, and on wide screens it never wraps */
.hero h1 .line { display: block; }
@media (min-width: 720px) { .hero h1 .line { white-space: nowrap; } }

/* Bezier field type controls (fx.js): font readout with Reset next to the handle, and the first-visit hint */
.fx-readout { position: absolute; left: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--accent); font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-reset { padding: 5px 8px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font: inherit; letter-spacing: inherit; transition: transform .3s var(--ease); }
.fx-reset:hover { transform: scale(1.05); }
.fx-hint { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; color: var(--accent); white-space: nowrap; animation: fx-hint 1.4s ease-in-out infinite alternate; }
@keyframes fx-hint { from { opacity: .5; } to { opacity: 1; } }
.fx-copy { padding: 5px 8px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); font: inherit; letter-spacing: inherit; transition: background-color .2s; }
.fx-copy:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Work sections: case studies are links, tools and reels expand in place */
.work-sec { padding-block: var(--space-section); }
.sec-note { color: var(--mute); max-width: 40ch; }
.row-link { display: block; position: relative; color: inherit; }
.row-link .row-head { cursor: pointer; }
/* "Read the case" is the row's link: its ::after covers the whole row, so a click anywhere opens the case.
   The site link sits above that layer and stays its own link. */
.row-hit { color: inherit; text-decoration: none; }
.row-hit::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.row-hit:focus-visible { outline: none; }
.row-link:has(.row-hit:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.row-site { position: relative; z-index: 2; color: var(--mute); text-decoration: none; transition: color .2s; }
.row-site:hover, .row-site:focus-visible { color: var(--ink); }
.row-link:hover .row-name { transform: translateX(10px); }
/* Case row: name, meta, lede and the link stack in the name column; the cover takes the type column to the end */
.row-link .row-head { grid-template-rows: auto auto auto 1fr; align-items: start; row-gap: 0; padding-block: var(--space-row); }
.row-link .row-name, .row-meta, .row-lede, .row-actions { grid-column: 1; padding-right: clamp(24px, 4vw, 64px); }
.row-meta { grid-row: 2; margin-top: 10px; font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; color: var(--mute); }
.row-lede { grid-row: 3; margin: 16px 0 0; color: var(--mute); max-width: 52ch; }
.row-actions { grid-row: 4; align-self: end; margin-top: 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; }
.row-open { display: inline-flex; align-items: baseline; gap: 8px; }
.row-link .arrow { line-height: 1; transition: transform .45s var(--ease); }
.row-link:hover .arrow { transform: translateX(6px); }
.row-cover { grid-column: 2 / -1; grid-row: 1 / -1; overflow: hidden; border-radius: 6px; }
.row-cover .media > img { border-radius: 0; transition: transform .7s var(--ease); }
.row-cover figcaption { display: none; }
.row-link:hover .row-cover .media > img { transform: scale(1.03); }

/* Layered cover (templates.mjs): the field, each layer placed in %, the cover file on top */
.layered-frame { position: relative; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 6px; }
.layered-frame img { position: absolute; display: block; height: auto; border-radius: 0; background: none; }
.layered-frame .layer-top { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row-cover .layered-frame { border-radius: 0; }
/* Hand-written notes over a layered cover (notes: in the front matter), on the cover's 2000x1000 grid. Caveat is
   part of the picture, not one of the site's text styles. */
.layered-frame .notes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.notes text { font: 400 48px Caveat, cursive; fill: #fff; }
.notes text.small { font-size: 40px; }
.notes path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* In a home page row the layers wait just outside the frame, each past its own edge, and slide in one after
   another while the row is hovered. Touch screens and reduced motion get the finished picture. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .row-cover .layer { transform: translate(calc(var(--dx) * 90%), calc(var(--dy) * 90%)); transition: transform .8s var(--ease) calc((6 - var(--i)) * 25ms); }
  .row-link:hover .row-cover .layer, .row-link:has(.row-hit:focus-visible) .row-cover .layer { transform: none; transition-delay: calc(var(--i) * 45ms); }
  /* Meanwhile the camera eases in on the wordmark: the whole picture grows a little inside the row's clipped cover */
  .row-cover .layered-frame { transform-origin: 52% 46%; transition: transform 1.4s var(--ease); }
  .row-link:hover .row-cover .layered-frame, .row-link:has(.row-hit:focus-visible) .row-cover .layered-frame { transform: scale(1.06); }
  /* The notes write themselves while the bowls slide in, each with its own bowl: the word uncovers left to right
     as its arrow draws, the head last. Leaving the row wipes them quickly, before the bowls slide away. */
  .row-cover .note text { clip-path: inset(-20% 100% -20% 0); transition: clip-path .2s; }
  .row-cover .note path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .15s; }
  .row-link:hover .row-cover .note text, .row-link:has(.row-hit:focus-visible) .row-cover .note text {
    clip-path: inset(-20% -5% -20% 0); transition: clip-path .45s cubic-bezier(.3,.1,.3,1) calc(.25s + var(--n) * .06s);
  }
  .row-link:hover .row-cover .note path, .row-link:has(.row-hit:focus-visible) .row-cover .note path {
    stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease-out calc(.2s + var(--n) * .06s);
  }
  .row-link:hover .row-cover .note path + path, .row-link:has(.row-hit:focus-visible) .row-cover .note path + path { transition-delay: calc(.55s + var(--n) * .06s); }
}
@media (max-width: 760px) {
  .row-link .row-head { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .row-cover { grid-column: 1; grid-row: 1; margin-bottom: 18px; }
  .row-link .row-name, .row-meta, .row-lede, .row-actions { grid-column: 1; grid-row: auto; padding-right: 0; }
}

/* Demoreel rows are always open: the head is a plain title, not a control */
.row-static .row-head:hover .row-name { transform: none; }
.row-static { padding-block: var(--space-row); }
.row-static .row-head { padding-block: 0 16px; }
.row-static .case { padding-block: 0; }
/* Their facts read as one column: the label on the left, the value beside it */
.row-static .facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.row-static .facts div { grid-template-columns: 88px minmax(0, 1fr); align-items: baseline; gap: 12px; }
/* Once the row stacks, the reel or clips come first, like a case study's cover */
@media (max-width: 860px) { .row-static .case-side { order: -1; } }
/* Side by side, the media starts level with the name, like a case study's cover: the name and the text share
   the first column, the media takes the type column to the end over both rows */
@media (min-width: 861px) {
  .row-static { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr) 72px 28px; grid-template-rows: auto 1fr; column-gap: 16px; }
  .row-static .case { display: contents; }
  .row-static .row-head { grid-column: 1; grid-row: 1; display: block; padding: 0 clamp(24px, 4vw, 64px) 16px 0; }
  .row-static .case-lede { grid-row: 2; }
  .row-static .case-side { grid-column: 2 / -1; grid-row: 1 / -1; }
}

/* A tool's expanded row tells the whole story */
.mini-case { display: grid; margin-top: 4px; }
.mini-case section { display: grid; gap: 6px; padding-block: 14px; border-bottom: 1px dashed var(--line); }
.mini-case h3 { font: var(--t-body); font-weight: 600; }
.mini-case p { max-width: 60ch; }
.mini-case .slot { margin-top: 6px; }

/* Vertical clips (UA ads): each rests on its last frame with a play mark until it is clicked (main.js) */
.clips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.clips.wide { grid-template-columns: minmax(0, 1fr); }
/* More than three: the same sideways row as the phone screenshots, three in view, the arrows under it */
.clips-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 10px) / 3); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; }
.clips-row::-webkit-scrollbar { display: none; }
.clips-row .clip { scroll-snap-align: start; }
@media (max-width: 760px) { .clips-row { grid-auto-columns: 42%; } }
.clips.wide .clip-frame { aspect-ratio: 16 / 9; }
.clip-viewer.wide video { width: min(92vw, calc(88vh * 16 / 9)); aspect-ratio: 16 / 9; }
.clip { margin: 0; display: grid; gap: 8px; min-width: 0; cursor: pointer; }
/* The frame clips and rounds; the video is scaled 2% past it, so a fractional width never leaves a light hairline at the edge */
.clip-frame { position: relative; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden; border-radius: var(--radius-video); background: var(--video-bg); isolation: isolate; }
.clip video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform .8s var(--ease), opacity .3s; }
/* The same hover as a Vimeo poster: the frame eases in a little and dims. Only while it waits to be played */
.clip:not(.playing):hover video { transform: scale(1.06); opacity: .85; }
.clip-play { z-index: 1; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; display: grid; place-items: center; padding-left: 3px; border-radius: 50%; background: color-mix(in srgb, #fff 88%, transparent); color: #0e0f12; font-size: 14px; transform: translate(-50%, -50%); transition: opacity .25s, transform .4s var(--ease); pointer-events: none; }
.clip:hover .clip-play { transform: translate(-50%, -50%) scale(1.08); }
.clip.playing .clip-play { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
.clip-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Expand sits on the video, bottom right, like a player's fullscreen button: quiet at rest, full on hover */
.clip-expand { z-index: 1; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(14, 15, 18, .55); color: #fff; opacity: .75; transition: opacity .2s, background .2s, transform .3s var(--ease); }
.clip-expand svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.clip:hover .clip-expand, .clip-expand:focus-visible { opacity: 1; }
.clip-expand:hover { background: rgba(14, 15, 18, .8); transform: scale(1.08); }
.clip-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Expanded clip: a modal viewer, the video as tall as the screen allows, the browser's own controls */
.clip-viewer { padding: 0; border: 0; background: none; max-width: none; max-height: none; overflow: visible; }
.clip-viewer::backdrop { background: rgba(8, 8, 10, .88); }
.clip-viewer video { display: block; width: min(92vw, calc(min(88vh, 960px) * 9 / 16)); height: auto; aspect-ratio: 9 / 16; object-fit: contain; border-radius: var(--radius-video); background: var(--video-bg); }
.clip-close { position: fixed; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; color: #fff; transition: border-color .2s; }
.clip-close:hover { border-color: #fff; }
/* Screenshots open large on click (main.js), in the same dark viewer as the clips */
img.expandable { cursor: zoom-in; }
img.expandable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shot-viewer { cursor: zoom-out; }
.shot-viewer img { display: block; max-width: 94vw; max-height: 90vh; width: auto; height: auto; border-radius: 10px; background: var(--video-bg); }

/* Expanded rows share the row's own columns: the description sits in the name column, exactly as a case study's lede,
   and the media starts where the type column does */
@media (min-width: 861px) {
  .row .case { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr) 72px 28px; column-gap: 16px; }
  .row .case-lede { grid-column: 1; padding-right: clamp(24px, 4vw, 64px); }
  .row .case-side { grid-column: 2 / -1; }
}

/* Over a clip the spring ring becomes a pill that says what a click does: Play, Pause or Expand */
.fx-ring[data-mode="clip"] { width: 128px; height: 30px; background: var(--accent); border-color: var(--accent); }
.fx-ring[data-mode="clip"] span { opacity: 1; }
/* Over a case row the pill grows to fit "Open" and the case name (fx.js measures it into --pill) */
.fx-ring[data-mode="case"] { width: var(--pill, 160px); height: 30px; background: var(--accent); border-color: var(--accent); }
.fx-ring[data-mode="case"] span { opacity: 1; }

/* Sound on the clip, bottom left, like a player: a speaker button that opens into a slider on hover or focus.
   It never reaches the Expand button on the right. Without hover (touch) the slider stays open. */
.clip-sound { z-index: 1; position: absolute; left: 10px; bottom: 10px; height: 32px; max-width: calc(100% - 62px); display: flex; align-items: center; border-radius: 999px; background: rgba(14, 15, 18, .55); color: #fff; opacity: .75; transition: opacity .2s, background .2s; }
.clip:hover .clip-sound, .clip-sound:focus-within { opacity: 1; }
.clip-sound:hover { background: rgba(14, 15, 18, .8); }
.clip-mute { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.clip-mute svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.clip-mute .cross, .clip-sound.off .wave { display: none; }
.clip-sound.off .cross { display: inline; }
.clip-mute:focus-visible, .clip-sound .volume:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clip-sound .volume { -webkit-appearance: none; appearance: none; min-width: 0; width: 0; margin: 0; opacity: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--fill, 70%), rgba(255, 255, 255, .3) var(--fill, 70%)); cursor: pointer; transition: width .3s var(--ease), margin .3s var(--ease), opacity .2s; }
.clip-sound:hover .volume, .clip-sound:focus-within .volume { width: 64px; margin-right: 12px; opacity: 1; }
@media (hover: none) { .clip-sound .volume { width: 56px; margin-right: 12px; opacity: 1; } }
/* While a clip plays, its controls step aside and come back on hover or keyboard focus, like a player's overlay.
   Touch screens have no hover, so there they stay. */
@media (hover: hover) {
  .clip.playing .clip-sound, .clip.playing .clip-expand { opacity: 0; }
  .clip.playing:hover .clip-sound, .clip.playing:hover .clip-expand,
  .clip.playing .clip-sound:focus-within, .clip.playing .clip-expand:focus-visible { opacity: 1; }
}
.clip-sound .volume::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.clip-sound .volume::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; }
.clip-sound .volume:hover::-webkit-slider-thumb { transform: scale(1.25); }

/* Contact chips under the hero thesis: click copies the value */
.hero-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-chip { display: inline-flex; align-items: baseline; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); transition: border-color .2s, background-color .2s; }
.contact-chip:hover { border-color: var(--ink); }
.contact-val { font-weight: 600; }
.contact-state { font: var(--t-label); letter-spacing: var(--t-label-track); text-transform: uppercase; line-height: 1; color: var(--accent); min-width: 7ch; }
.contact-chip.done { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }

/* Pixel-art avatar above the name: crisp pixels, a rounded square like the video frames, a little hop on hover */
.avatar { display: block; width: clamp(72px, 7vw, 96px); height: auto; aspect-ratio: 1; border-radius: var(--radius-video); image-rendering: pixelated; transition: transform .5s var(--ease); }
.avatar:hover { transform: translateY(-4px) rotate(-4deg); }

/* Proof links under each process item, and room for the sticky header when a row is reached by its anchor */
.process-item .proof { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 4px; }
.process-item .proof a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: border-color .2s; }
.process-item .proof a:hover { border-color: var(--ink); }
article.row { scroll-margin-top: calc(var(--head) + 16px); }

/* About: two timeline groups, each with its own small heading above the rule */
.timelines { display: grid; gap: 36px; align-content: start; }
.timeline-group { display: block; padding-bottom: 10px; }
.timeline > .timeline-group + div { border-top: 1px solid var(--line); }
a.contact-chip { color: inherit; text-decoration: none; }

/* Seamless case transitions (View Transitions between pages; main.js names the pieces just before each switch).
   From the home page the clicked case's cover grows into the case page's cover while everything above that row
   slides up and everything below slides down, fading; the case title, lede and facts then rise in. Going back to the
   home page is a plain switch (main.js skips it). The sticky header stays put. Browsers without it, and reduced motion, just load the page. */
@view-transition { navigation: auto; }
header.top { view-transition-name: site-top; }
::view-transition-group(*) { animation-duration: .65s; animation-timing-function: var(--ease); }
/* The cover keeps its crop while it changes shape: both snapshots fill the box and the box clips them */
::view-transition-group(case-cover) { overflow: clip; border-radius: 6px; }
::view-transition-old(case-cover), ::view-transition-new(case-cover) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(root) { animation: vt-fade .3s ease both; }
::view-transition-new(root) { animation: vt-fade .45s ease .2s reverse both; }
::view-transition-old(*.above) { animation: vt-up .5s var(--ease) both; }
::view-transition-old(*.below) { animation: vt-down .5s var(--ease) both; }
::view-transition-new(*.rise) { animation: vt-rise .6s var(--ease) var(--vt-delay, .2s) both; }
@keyframes vt-fade { to { opacity: 0; } }
@keyframes vt-up { to { transform: translateY(-56px); opacity: 0; } }
@keyframes vt-down { to { transform: translateY(56px); opacity: 0; } }
@keyframes vt-rise { from { transform: translateY(28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
