/* ---------- Tokens (from Figma "fyu.wtf system") ---------- */
:root {
  --bg-page: #0e0f10;
  --text-primary: #e6e8e9;
  --text-muted: #777e83;
  --marker-active: #e6e8e9;
  --marker-inactive: #44484b;
  --border-hairline: #1a1b1d;
  --image-placeholder: #1a1b1d;
  --bg-elevated: #1a1b1d;

  /* Typography collection */
  --type-family: 'Instrument Sans', system-ui, sans-serif;
  --type-weight-regular: 400;
  --type-label-size: 10px;
  --type-label-line-height: 10px;
  --type-label-letter-spacing: 0.2px;
  --type-label-11-size: 11px; /* Label/Sentence 11: all site labels (sentence case) and the holding page */
  --type-label-11-line-height: 14px;
  --type-label-11-letter-spacing: -0.1px;
  --type-body-11-size: 11px;
  --type-body-11-line-height: 16px;
  --type-body-11-letter-spacing: 0.055px;
  --type-body-13-size: 13px;
  --type-body-13-line-height: 20px;
  --type-body-13-letter-spacing: 0;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;

  /* 12-col grid at desktop, 6-col at mobile */
  --margin: 16px;
  --gutter: 8px;
  --cols: 12;
  --col: calc((100vw - 2 * var(--margin) - (var(--cols) - 1) * var(--gutter)) / var(--cols));
  --rail: calc(var(--col) + var(--gutter));
}

/* Semantic collection, Light mode */
:root[data-theme="light"] {
  --bg-page: #f4f4f3;
  --text-primary: #0e0f10;
  --text-muted: #5d6367;
  --marker-active: #0e0f10;
  --marker-inactive: #c2c6c8;
  --border-hairline: #c2c6c8;
  --image-placeholder: #c2c6c8;
  --bg-elevated: #e6e8e9;
}

@media (max-width: 767px) {
  :root { --cols: 6; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--type-family);
  font-weight: var(--type-weight-regular);
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h2, p { margin: 0; font-weight: 400; }

/* Label/Sentence 11 (sentence case since 2026-11-12; was Label/Caps 10) */
.name, .nav-link, .clock, .label, .row, .lightbox-meta {
  font-size: var(--type-label-11-size);
  line-height: var(--type-label-11-line-height);
  letter-spacing: var(--type-label-11-letter-spacing);
}

.mobile-only { display: none !important; }
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 0;
  z-index: 10;
}
.header > * { position: absolute; top: var(--space-16); }

/* Fade (Desktop + Mobile Header): bg/page solid from the top to --fade-solid, then an eased
   fade to clear (--fade-len), ending just past the header's bottom edge, so content scrolling under the header dissolves.
   No blur: progressive backdrop blurs were tried twice on 2026-11-13 and removed.
   No band: an eased fade (100 / 97 / 90 / 76 / 54 / 26 / 0) starting at 100% right at the top edge, to clear by
   desktop Work y132, About y96; mobile Work y106, About y94. (2026-11-13; just before: a solid band to y46 / 44 / 48 / 42
   with the fade below it, ending at the same points.) (2026-11-13; tried just before: a 90% band, a 90% eased fade from the top edge, and a
   straight 100% → 0 fade from the top edge.) (Fade lengthened 2026-11-13 from 40 / 20 / 28 / 20 for a softer edge.) (Solid +8 desktop / +4 mobile on 2026-11-13, from y60 / 52 / 58 / 54.) (2026-11-13; earlier the same day the fade started at the top edge
   and ran 106 / 76 / 94 / 64, then 160 / 115 / 140 / 96, then solid to y36 / y38 + 80 / 40 / 56 / 40, then + 56 / 28 / 40 / 28.) Strength along the fade:
   80 / 78 / 72 / 61 / 43 / 21 / 0% (2026-11-13: was 100 / 92 / 74 / 50 / 26 / 8 / 0, raised to 100 / 97 / 90 / 76 / 54 / 26 / 0,
   then the whole fade taken to 80%, then 95 / 92 / 86 / 72 / 51 / 25 / 0 when the blur was removed, then 100 / 97 / 90 /
   76 / 54 / 26 / 0 after the solid band, now all ×0.9: 90 / 87 / 81 / 68 / 49 / 23 / 0, the band at 90%).
   (2026-11-13; earlier the same day: solid to y24, then to y50, before that solid to 75% of the header height.) */
body { --fade-solid: 0px; --fade-len: 132px; }
body[data-page="about"] { --fade-len: 96px; }
@media (max-width: 767px) {
  body { --fade-len: 106px; }
  body[data-page="about"] { --fade-len: 94px; }
}
.header::before, .lightbox-meta::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--fade-solid) + var(--fade-len));
  pointer-events: none;
}
.header::before, .lightbox-meta::before {
  z-index: -1;
  background: linear-gradient(to bottom,
    var(--bg-page) var(--fade-solid),
    color-mix(in srgb, var(--bg-page) 97%, transparent) calc(var(--fade-solid) + var(--fade-len) * .15),
    color-mix(in srgb, var(--bg-page) 90%, transparent) calc(var(--fade-solid) + var(--fade-len) * .32),
    color-mix(in srgb, var(--bg-page) 76%, transparent) calc(var(--fade-solid) + var(--fade-len) * .5),
    color-mix(in srgb, var(--bg-page) 54%, transparent) calc(var(--fade-solid) + var(--fade-len) * .68),
    color-mix(in srgb, var(--bg-page) 26%, transparent) calc(var(--fade-solid) + var(--fade-len) * .85),
    transparent calc(var(--fade-solid) + var(--fade-len)));
}
/* the three strongest layers also dim what they show (--dim; together about 40% at the very top): heavy blur
   spreads image colour into the dark gaps between images, which read as a pale streak along the top in dark mode */
.name { left: var(--margin); }
.nav-work { left: calc(var(--margin) + 3 * var(--rail)); display: flex; flex-direction: column; gap: 12px; }
.nav-about { left: calc(var(--margin) + 6 * var(--rail)); }
.header .clock { left: calc(var(--margin) + 9 * var(--rail)); padding-left: 12px; } /* indented like Work / About, over the list's 4th column */
.header .mode-toggle { position: absolute; right: var(--margin); }

/* Nav Link: marker + label */
.nav-link { display: inline-flex; align-items: center; color: var(--text-muted); white-space: nowrap; transition: color .15s; }
/* switching links, the old marker shrinks away (200ms, eases in) and the new one grows in just after
   (400ms expo-out, 120ms later), so the square reads as handing over from one link to the next */
.nav-link .marker {
  width: 4px; height: 4px; margin-right: var(--space-8); background: var(--marker-active);
  transform: scale(0); transition: transform 200ms cubic-bezier(.7, 0, .84, 0);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.is-active { color: var(--text-primary); }
.nav-link.is-active .marker { transform: none; transition: transform 400ms cubic-bezier(.16, 1, .3, 1) 120ms; }
@media (prefers-reduced-motion: reduce) { .nav-link .marker, .nav-link.is-active .marker { transition: none; } }

/* Filters and Views share one grid so their links line up in columns (All/Pile, Brand/Grid, Digital/List) */
.subnav {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  column-gap: var(--space-16);
  row-gap: 12px;
  padding-left: 12px;
}
.subnav-row { display: contents; }
body:not([data-page="work"]) .subnav { display: none; }

.clock { color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* "20:33 Vancouver ▪ Dusk": the time of day after a drawn 2px square (like the tile captions); on hover the name rolls
   up and out and "Probably designing" (etc.) rolls in, the header reveal's motion (app.js tick(), since 2026-11-29) */
.clock .caption-square { display: inline-block; width: 2px; height: 2px; margin: 0 6px; background: currentColor; vertical-align: middle; transform: translateY(-1px); }
.clock-moment { display: inline-grid; overflow: hidden; vertical-align: top; }
.clock-moment > span { grid-area: 1 / 1; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.clock-moment .cm-alt { transform: translateY(110%); }
@media (hover: hover) {
  .clock:hover .cm-now { transform: translateY(-110%); }
  .clock:hover .cm-alt { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .clock-moment > span { transition: none; } }
/* narrow desktops (768–1099): the header clock's column is too short for "Golden hour, thunder", so it shows the time
   only; phones keep the full line in the bottom bar, which has room */
@media (min-width: 768px) and (max-width: 1099px) {
  .header .clock .caption-square, .header .clock .clock-moment { display: none; }
}

/* Email ↔ Copied roll (app.js rollSwap, since 2026-11-29): both labels share one grid cell inside a mask; the mask has
   3px of room below so the link's underline isn't clipped, and passes the underline down to the labels */
.roll { display: inline-grid; overflow: hidden; vertical-align: top; padding-bottom: 3px; margin-bottom: -3px; text-decoration: inherit; }
.roll > span { grid-area: 1 / 1; text-decoration: inherit; white-space: nowrap; }

/* tiny checkmark after "Copied" (Email click; from the holding page, since 2026-11-29): a 6 × 3 corner turned 45°,
   0.75px like the FYU Mark's corner marks; it draws itself in, short stroke first, then the long one */
.check {
  display: inline-block;
  width: 6px; height: 3px;
  margin: 0 1px 0 5px;
  border-left: 0.75px solid currentColor;
  border-bottom: 0.75px solid currentColor;
  transform: translateY(-3px) rotate(-45deg);
  animation: check-draw .35s cubic-bezier(.16, 1, .3, 1) .05s backwards;
}
@keyframes check-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { .check { animation: none; } }

/* Mode Toggle: half-filled square, left = dark, right = light */
.mode-toggle { width: 10px; height: 10px; position: relative; }
.mode-toggle::before {
  content: ''; position: absolute; inset: -17px; /* 44 × 44 hit area */
}
.mode-glyph {
  position: absolute; inset: 0;
  /* 0.75px inside stroke as an inset shadow: borders snap to whole device pixels (0.75 → 0.5 on 2× screens) */
  box-shadow: inset 0 0 0 0.75px var(--text-muted);
  overflow: hidden;
}
/* the filled half slides across when the theme changes (since 2026-11-29; it used to jump) */
.mode-glyph::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 50%;
  background: var(--text-muted);
  transition: transform 200ms cubic-bezier(.16, 1, .3, 1);
}
[data-theme="light"] .mode-glyph::after { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) { .mode-glyph::after { transition: none; } }

/* ---------- Mobile header ---------- */
@media (max-width: 767px) {
  /* Top row reads left / centre / right: Work centred in cols 3–4, About right-aligned to the margin */
  .nav-work { left: calc(var(--margin) + 2 * var(--rail)); width: calc(2 * var(--col) + var(--gutter)); align-items: center; }
  .nav-about { left: auto; right: var(--margin); }
  /* Filter row drops to col 1 under the top line */
  .subnav { position: fixed; top: 46px; left: var(--margin); padding-left: 0; }
  .view-toggle { top: 48px; right: var(--margin); gap: var(--space-16); } /* 10px icons centred on the 14px filter line */
  body:not([data-page="work"]) .view-toggle { display: none !important; }
}

/* View Toggle icons, each with a 44x44 hit area */
.icon-btn { position: relative; width: 10px; height: 10px; }
.icon-btn::before { content: ''; position: absolute; inset: -17px; }
.icon-list, .icon-grid { position: absolute; inset: 0; }
.icon-list i { position: absolute; left: 0; width: 1px; height: 1px; background: var(--text-muted); }
.icon-list i::after { content: ''; position: absolute; left: 3px; width: 7px; height: 1px; background: inherit; }
.icon-list i:nth-child(1) { top: 0.5px; }
.icon-list i:nth-child(2) { top: 4.5px; }
.icon-list i:nth-child(3) { top: 8.5px; }
.icon-grid i { position: absolute; left: 0; top: 0; width: 4px; height: 4px; border: 1px solid var(--text-muted); }
.icon-grid i:nth-child(2) { left: 6px; }
.icon-grid i:nth-child(3) { top: 6px; }
.icon-grid i:nth-child(4) { left: 6px; top: 6px; }
/* Sphere (the view called Pile until 2026-11-23; its code key is still "pile"): eight squares round a circle,
   alternating big (4px) at top / right / bottom / left and small (3px) between, like near and far tiles on the ball;
   1px lines, filled bg/page so each overlaps the one before (option D, 2026-11-23). Drawn 11px wide (half a pixel
   past the 10px box each side, centred) so the round shape looks as big as the square Grid / List icons (since
   2026-11-23; 12px was live briefly and read a little gear-like: session scratchpad styles.icon-D12.css; 10px:
   styles.icon-D10.css). Half-pixel positions land on whole device pixels on 2× screens. */
.icon-sphere { position: absolute; inset: -0.5px; }
.icon-sphere i { position: absolute; width: 4px; height: 4px; border: 1px solid var(--text-muted); background: var(--bg-page); }
.icon-sphere i:nth-child(even) { width: 3px; height: 3px; }
.icon-sphere i:nth-child(1) { left: 3.5px; top: 0; }
.icon-sphere i:nth-child(2) { left: 6.5px; top: 1.5px; }
.icon-sphere i:nth-child(3) { left: 7px; top: 3.5px; }
.icon-sphere i:nth-child(4) { left: 6.5px; top: 6.5px; }
.icon-sphere i:nth-child(5) { left: 3.5px; top: 7px; }
.icon-sphere i:nth-child(6) { left: 1.5px; top: 6.5px; }
.icon-sphere i:nth-child(7) { left: 0; top: 3.5px; }
.icon-sphere i:nth-child(8) { left: 1.5px; top: 1.5px; }
.icon-btn.is-active .icon-sphere i { border-color: var(--text-primary); }
.icon-btn.is-active .icon-list i { background: var(--text-primary); }
.icon-btn.is-active .icon-grid i { border-color: var(--text-primary); }

/* ---------- Pages ---------- */
main { padding: 128px var(--margin) 64px; }
@media (max-width: 767px) {
  main { padding-top: 100px; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}
.page { display: none; }
body[data-page="work"] .page-work,
body[data-page="about"] .page-about { display: block; }

/* Tiles: desktop 12 per row, one tile per column (110px at 1440, since 2026-11-22; 6 per row, then 8, before);
   phones 4 per row (own 4-column grid) */
.tiles {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.tile {
  grid-column: span 1;
  aspect-ratio: var(--ar, 4 / 5); /* each image's own shape, set inline from its ratio */
  background: var(--image-placeholder);
  overflow: hidden;
  cursor: zoom-in;
  display: block;
  width: 100%;
}
@media (max-width: 767px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }   /* Grid on phones: 4 per row (since 2026-11-22; was 3) */
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile img, .tile video { transition: opacity 200ms ease-out; }
video { pointer-events: none; }   /* clicks go to the tile / lightbox item, as with images */
/* No hover dim in any view (removed 2026-11-13; it used to drop the hovered image to 85%). */

/* List Row: Index rail 1, Title rail 4, Industry rail 7, Tags rail 10 (2 cols), Year in the last column, right-aligned.
   Title, Industry and Tags indent 12px so they line up with the header's Work / About / clock labels. */
.row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gutter);
  padding: var(--space-12) 0;
  border-bottom: 0.5px solid transparent; /* keeps the 38.5px row; the visible hairline is ::after */
  color: var(--text-muted);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.row > span { grid-column: span 3; }
.row .tags { grid-column: span 2; }
.row .year { grid-column: span 1; text-align: right; }
@media (min-width: 768px) { .row .title, .row .industry, .row .tags { padding-left: 12px; } }

/* Row reveal (every list render): rows top-down by --row-delay (app.js); within a row the cells
   slide up out of their masks left to right, and the hairline draws in from the left. */
.cell-mask { display: block; overflow: hidden; }
.cell-line {
  display: block;
  animation: line-up 800ms cubic-bezier(.16, 1, .3, 1) calc(var(--row-delay, 0ms) + var(--cell-offset, 0ms)) backwards;
}
.row .title { --cell-offset: 30ms; }
.row .industry { --cell-offset: 60ms; }
.row .tags { --cell-offset: 90ms; }
.row .year { --cell-offset: 120ms; }
.row::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.5px; /* sits on the transparent border */
  border-bottom: 0.5px solid var(--border-hairline);
  transform-origin: left;
  animation: rule-in 800ms cubic-bezier(.16, 1, .3, 1) var(--row-delay, 0ms) backwards;
}
@keyframes rule-in { from { transform: scaleX(0); } }
/* rows below the fold wait, held at the start of their reveal, until they scroll in (app.js adds .is-in) */
.row:not(.is-in) .cell-line, .row:not(.is-in)::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .cell-line, .row::after { animation: none; } }

/* Travelling row highlight (List Row Hover in Figma): one bg/elevated band behind the rows that
   glides to the hovered/focused row, bleeding 8px past each end. Appears in place on entry. */
.page-work { position: relative; }
.list-highlight {
  position: absolute;
  top: 0;
  left: -8px;
  width: calc(100% + 16px);
  height: 0;
  background: var(--bg-elevated);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: transform 200ms cubic-bezier(.2, .7, .2, 1), height 200ms cubic-bezier(.2, .7, .2, 1), opacity 120ms;
}
.list-highlight.is-visible { opacity: 1; }
.list-highlight.no-travel { transition: opacity 120ms; }
body:not([data-view="list"]) .list-highlight { display: none; }
@media (hover: none) { .list-highlight { display: none; } }
@media (prefers-reduced-motion: reduce) { .list-highlight { transition: opacity 120ms; } }
.row .title { color: var(--text-primary); }
.row:hover { color: var(--text-primary); }
@media (max-width: 767px) {
  .row .index { grid-column: span 1; }
  .row .tags, .row .industry { display: none; }
  /* year ranges ("2022 – 2024") stay on one line (2026-11-21): the row becomes index (one column) | title (the rest) |
     year (as wide as its text), so the title keeps as much room as it can */
  .row { grid-template-columns: calc((100% - 5 * var(--gutter)) / 6) 1fr auto; }
  .row > span, .row .index, .row .title, .row .year { grid-column: auto; }
  .row .year { white-space: nowrap; }
}

/* Grid hover pop-up: the hovered tile shown 2× (box set in app.js), Tile Hover state with its
   caption tag. Above the header, below the lightbox; never catches the pointer. */
.grid-pop {
  position: fixed;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease-out, visibility 0s 180ms;   /* fades out when you leave */
}
.grid-pop.is-visible { opacity: 1; visibility: visible; transition: none; }   /* pops up at once (since 2026-11-13) */
body:not([data-view="grid"]) .grid-pop { display: none; }
.grid-pop-media {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  background: var(--image-placeholder);
  outline: 0.5px solid var(--text-primary);
}
.grid-pop-media img, .grid-pop-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-pop .pile-caption { display: flex; visibility: visible; }
@media (hover: none) { .grid-pop { display: none !important; } }

/* Filtered out: fades back and goes inactive (no click, hover, drag, pop-up or highlight).
   Filters toggle this instead of re-rendering, so nothing re-reveals. */
/* same 450ms both ways; ease-in-out is symmetrical, so fading back on doesn't feel quicker than fading out */
.pile .tile, .tiles .tile, .list .row > span { transition: opacity 450ms ease-in-out; }
.is-muted { opacity: .15; pointer-events: none; cursor: default; }
/* list rows: only the text fades; the hairline stays at full strength */
.pile .tile.is-muted { opacity: .06; }   /* Pile: fainter still, so the matching images stand out in the crowd (2026-11-21) */
.tiles .tile.is-muted { opacity: .12; }   /* Grid: 12% (since 2026-11-22; was 15%) */
/* projects with no images yet: List only, not clickable; "– more soon" muted after the name (2026-11-21) */
.row.is-soon { cursor: default; }
.soon { color: var(--text-muted); }
.list .row.is-muted { opacity: 1; }
.list .row.is-muted > span { opacity: .15; }

body:not([data-view="pile"]) .pile,
body:not([data-view="grid"]) .tiles,
body:not([data-view="list"]) .list { display: none; }

/* Pile: overlapping tiles scattered across the content area (Figma: 1408 × 756 from y124 at 1440 × 900) */
.pile {
  position: relative;
  width: 100%;
  height: calc(100vh - 124px - 20px);
  margin-top: -4px;
  container-type: size;
  isolation: isolate; /* tile z-indexes stay inside the pile, below the header and lightbox */
}
@media (max-width: 767px) {
  /* Phones: from the content start (y100) down to the Bottom Bar */
  .pile { height: calc(100dvh - 100px - 58px - env(safe-area-inset-bottom)); margin-top: 0; }
}
.pile .tile {
  position: absolute;
  aspect-ratio: var(--ar, 4 / 5); /* each image's own shape, set inline from its ratio */
  overflow: visible;
  z-index: var(--z, auto); /* dropped tiles stack in drop order */
  cursor: grab;
  touch-action: none; /* lets a finger drag the tile instead of panning the page */
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 0 0 0.5px var(--bg-page); /* keeps overlapping edges readable (0.5px since 2026-11-22; was 1px) */
}
.pile .tile.is-dragging { cursor: grabbing; }
.pile .tile img, .pile .tile video { position: absolute; inset: 0; }

/* Ambient drift: each tile sways on its own x and y periods (values set per tile in app.js),
   so the pile slowly breathes. Holds still under the pointer; off for reduced motion. */
@property --drift-x { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --drift-y { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes drift-x { from { --drift-x: calc(var(--dx) * -1); } to { --drift-x: var(--dx); } }
@keyframes drift-y { from { --drift-y: calc(var(--dy) * -1); } to { --drift-y: var(--dy); } }
/* Blur reveal: tiles sharpen and fade in on every render, staggered by --reveal-delay
   (random in the pile, reading order in the grid; set in app.js). Fill backwards only, so no
   filter is left on the tile afterwards. */
/* no opacity in `to`: tiles reveal into their own opacity (1, or .15 when filtered out) */
@keyframes reveal {
  from { opacity: 0; filter: blur(8px); }
  to { filter: blur(0); }
}
.tiles .tile {
  animation: reveal 700ms cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms) backwards;
}
/* grid tiles wait, held invisible at the start of the reveal, until they scroll in (app.js adds .is-in) */
.tiles .tile:not(.is-in) { animation-play-state: paused; }
/* switching views: the old view fades out in place (app.js), then the new view renders at
   the top. The transition lives on the leaving state only, so coming back is instant. */
.page-work.is-leaving,
.page-about.is-leaving { opacity: 0; transition: opacity 300ms ease-in-out; pointer-events: none; }   /* view switches and Work / About */
.pile .tile {
  translate: var(--drift-x) var(--drift-y);
  animation:
    drift-x var(--tx, 13s) ease-in-out var(--delay-x, 0s) infinite alternate,
    drift-y var(--ty, 13s) ease-in-out var(--delay-y, 0s) infinite alternate,
    reveal 700ms cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms) backwards;
}
/* Hold still while dragged, focused, or under a real pointer (touch screens skip :hover so a
   tapped or dropped tile doesn't stay "hovered" and frozen). Only the drift pauses; the reveal
   keeps going. */
.pile .tile.is-dragging,
.pile .tile:focus-visible { animation-play-state: paused, paused, running; }
@media (hover: hover) {
  .pile .tile:hover { animation-play-state: paused, paused, running; }
}
@media (prefers-reduced-motion: reduce) {
  .pile .tile, .tiles .tile { animation: none; }
}
/* Sphere pile (local exploration, ?pile=sphere): app.js places every tile with a transform each frame, so the
   drift is off (the blur reveal stays) and left / top go to the pile's corner; back tiles dim via --depth-fade. */
.pile.is-sphere { touch-action: none; cursor: grab; }
.pile.is-sphere.is-spinning, .pile.is-sphere.is-spinning .tile { cursor: grabbing; }
.pile.is-sphere .tile {
  left: 0 !important; top: 0 !important;
  translate: none;
  transform-origin: 50% 50%;
  will-change: transform;
  animation: reveal 700ms cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms) backwards;
}
.pile.is-sphere .tile > img, .pile.is-sphere .tile > video { opacity: var(--depth-fade, 1); }   /* --depth-fade is set on the img / video itself (app.js), so nothing else restyles */
@media (hover: hover) {
  .pile.is-sphere .tile:hover > img, .pile.is-sphere .tile:hover > video { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pile.is-sphere .tile { animation: none; }
}
/* Hover state sits above everything, including dropped tiles (their z-index counts up from 1) */
/* 0.5px outline (one device pixel on retina) in text/primary at full strength (since 2026-11-22; 40% from 2026-11-13). */
.pile .tile.is-dragging,
.pile .tile:focus-visible {
  z-index: 10000;
  outline: 0.5px solid var(--text-primary);
  outline-offset: 0;
}
@media (hover: hover) {
  .pile .tile:hover {
    z-index: 10000;
    outline: 0.5px solid var(--text-primary);
    outline-offset: 0;
  }
}
/* Caption tag sits 4px above the hovered tile */
.pile-caption {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: var(--space-4);
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  background: var(--bg-page);
  color: var(--text-primary);
  white-space: nowrap;
  font-size: var(--type-label-11-size);
  line-height: var(--type-label-11-line-height);
  letter-spacing: var(--type-label-11-letter-spacing);
  visibility: hidden; /* hidden captions near the edge must not widen the page */
  display: none;
  pointer-events: none;
}
.pile-caption .muted { color: var(--text-muted); }
/* divider between title and year: a 2px square in the muted colour, centred on the text */
.pile-caption .caption-square { align-self: center; width: 2px; height: 2px; background: var(--text-muted); }
.pile .tile.is-dragging .pile-caption,
.pile .tile:focus-visible .pile-caption { display: flex; visibility: visible; }
@media (hover: hover) {
  .pile .tile:hover .pile-caption { display: flex; visibility: visible; }
}

/* About: Text Blocks at rail 7, 3 cols wide */
.page-about {
  margin-left: calc(6 * var(--rail));
  width: calc(3 * var(--col) + 2 * var(--gutter));
}
.text-block { display: flex; flex-direction: column; gap: var(--space-16); }
.text-block + .text-block { margin-top: 40px; }
/* Masked line reveal (app.js splits each block into rendered lines): each line slides up out of
   its own mask, staggered by --line-delay. Hidden until split; .is-static = re-split on resize. */
.page-about:not(.is-split) .label,
.page-about:not(.is-split) .body { visibility: hidden; }
.line-mask { display: block; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.line { display: block; animation: line-up 800ms cubic-bezier(.16, 1, .3, 1) var(--line-delay, 0ms) backwards; } /* expo-out */
@keyframes line-up { from { transform: translateY(110%); } } /* 110% keeps descenders inside the mask */
.page-about.is-static .line { animation: none; }

/* Header reveal: each header item's content slides up out of its own mask (same motion as the
   text lines), staggered in reading order once on load (app.js). Icons fill their button. */
.hdr-mask { display: inline-flex; overflow: hidden; vertical-align: top; }
.hdr-line {
  display: inline-flex;
  align-items: center;
  animation: line-up 800ms cubic-bezier(.16, 1, .3, 1) var(--line-delay, 0ms) backwards;
}
.mode-toggle .hdr-mask, .icon-btn .hdr-mask { position: absolute; inset: 0; }
.mode-toggle .hdr-line, .icon-btn .hdr-line { position: relative; width: 100%; height: 100%; }
/* the view icons' masks get 2px of room each side, so the Sphere icon (drawn half a pixel past its 10px box) isn't
   cropped; the line inside sits back on the 10px box (since 2026-11-23) */
.icon-btn .hdr-mask { inset: -2px; }
.icon-btn .hdr-line { position: absolute; inset: 2px; width: auto; height: auto; }
@media (prefers-reduced-motion: reduce) { .line, .hdr-line { animation: none; } }

/* Body/11 */
.body {
  font-size: var(--type-body-11-size);
  line-height: var(--type-body-11-line-height);
  letter-spacing: var(--type-body-11-letter-spacing);
}
.body > p + p { margin-top: var(--type-body-11-line-height); } /* one blank line between paragraphs */
.contact > p + p { margin-top: 0; } /* Contact: one link per line, no blank line between (since 2026-11-29; was "Email / LinkedIn") */
.body a { transition: color .15s; }
.body a:hover { color: var(--text-muted); }
/* every About link (Third + Grove, Email, LinkedIn) gets the holding page's underline: 0.5px, 2px below */
.body a { text-decoration: underline; text-decoration-thickness: .5px; text-underline-offset: 2px; }
@media (max-width: 767px) {
  .page-about { margin-left: 0; width: auto; }
}

/* ---------- Bottom Bar (mobile) ---------- */
.bottom-bar {
  position: fixed;
  inset: auto 0 0 0;
  height: calc(58px + env(safe-area-inset-bottom));
  padding: 0 var(--margin) calc(16px + env(safe-area-inset-bottom));
  align-items: flex-end;
  justify-content: space-between;
  /* the header's eased fade, flipped: bg/page at 100% only at the bottom edge, easing to clear at the top
     (since 2026-11-23; was clear → solid from 60% down) */
  background: linear-gradient(to top,
    var(--bg-page) 0%,
    color-mix(in srgb, var(--bg-page) 97%, transparent) 15%,
    color-mix(in srgb, var(--bg-page) 90%, transparent) 32%,
    color-mix(in srgb, var(--bg-page) 76%, transparent) 50%,
    color-mix(in srgb, var(--bg-page) 54%, transparent) 68%,
    color-mix(in srgb, var(--bg-page) 26%, transparent) 85%,
    transparent 100%);
  z-index: 10;
}

/* ---------- Lightbox (stacked cascade, since 2026-11-12; Figma Desktop / Lightbox / Stack 185:1452) ----------
   The meta row stays fixed at the top; the project's images sit in one centred column, 8px apart, and scroll
   underneath it. app.js sizes each image every scroll frame on a soft bell: full size at the
   middle of the stage (a 50vw column on desktop, never taller than the stage), easing to 80% away from it, so images swell
   evenly as they pass the centre (after obys.agency/work/source-unknown). No thumbnails, no counter, no snapping. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg-page);
}
.lightbox[hidden] { display: none; }
/* Entering / leaving: a copy of the image that flies between its page tile and its place in the lightbox
   (app.js flyImage), above the lightbox and under the grain. */
.lb-ghost {
  position: fixed;
  z-index: 21;
  pointer-events: none;
  background: var(--image-placeholder);
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
}
.lb-ghost img, .lb-ghost video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-meta {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  padding: var(--space-16) var(--margin);
  /* no solid strip (since 2026-11-24): the header's eased fade (::before, shared with .header), shorter than the
     header's: 64px, just past the one row of text (96 / 94 like the About header was live briefly), so the images dissolve under it */
  --fade-solid: 0px; --fade-len: 64px;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gutter);
  color: var(--text-muted);
}
.lightbox-meta > * { grid-column: span 3; }
.lightbox-meta [data-lb-title] { color: var(--text-primary); }
/* desktop: same columns as the List Row (Index, Title, Industry, then Tags in the last quarter); Title, Industry
   and Tags indent 12px (marker + gap) so they line up with the header's Work / About / clock labels */
@media (min-width: 768px) {
  .lightbox-meta [data-lb-title], .lightbox-meta [data-lb-industry], .lightbox-meta [data-lb-tags] { padding-left: 12px; }
}
/* last quarter: Tags (rail 10), then Year right-aligned 16px before Close at the right edge */
.lightbox-end { display: flex; gap: var(--space-16); }
.lightbox-end [data-lb-tags] { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-actions { display: flex; gap: var(--space-16); margin-left: auto; }
.lightbox-close { color: var(--text-muted); }
/* Image counter "02 / 04": desktop on rail 1, level with the middle of the stage (where the centred image sits);
   phones in the meta row before Close. Each digit rolls through its own mask when an image reaches the middle. */
.lightbox-count { display: inline-flex; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: pre; opacity: var(--rest, 1); }
.lbc-cur { color: var(--text-primary); }
.lbc-cur, .lbc-total { display: inline-flex; }
.lbc-digit { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.lbc-digit > span { display: block; }
.lbc-digit > span + span { position: absolute; left: 0; top: 0; }
@media (min-width: 768px) {
  .lightbox-count { position: fixed; left: var(--margin); top: calc(46px + (100vh - 62px) / 2); top: calc(46px + (100dvh - 62px) / 2); transform: translateY(-50%); }
}
.lightbox-close:focus-visible { outline: 0.5px solid var(--text-primary); outline-offset: 4px; color: var(--text-primary); }
.lightbox-close:hover { color: var(--text-primary); }
/* the scroller: a tall track (one STEP of scroll per image, app.js) with a sticky full-screen stage inside */
.lightbox-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lightbox-scroll::-webkit-scrollbar { display: none; }
.lightbox-track { position: relative; }
.lightbox-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.lightbox-item {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--image-placeholder);
  overflow: hidden;
  cursor: pointer;
  /* no will-change: the swell is a scale() (app.js layout), and a promoted layer would keep the raster of its
     first, smaller scale and look soft at full size */
}
.lightbox-item img, .lightbox-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-item.is-centre { cursor: default; }
/* empty space around the images: a thin-line × (6px, 1px) inside a full square outline (0.75px), 16 × 16, text/primary, says "click to close" (app.js closes on a click there; mouse / trackpad only).
   The 2x copy keeps it crisp on retina. */
@media (hover: hover) and (pointer: fine) {
  .lightbox-stage {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 8 8, pointer;
    cursor: -webkit-image-set(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 1x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 2x) 8 8, pointer;
  }
}
.lightbox-next { cursor: pointer; }   /* Previous / Next boxes: click glides to that project (app.js fillBox) */
/* the same 16 × 16 square cursor with an arrow inside: up over Previous, down over Next (since 2026-11-22); each arrow
   sits 0.5px towards its tail so the heavier head doesn't make it look off-centre */
@media (hover: hover) and (pointer: fine) {
  .lightbox-next[data-dir="-1"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 12V5M5 8l3-3 3 3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 8 8, pointer;
    cursor: -webkit-image-set(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 12V5M5 8l3-3 3 3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 1x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 12V5M5 8l3-3 3 3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 2x) 8 8, pointer;
  }
  .lightbox-next[data-dir="1"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4v7M5 8l3 3 3-3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 8 8, pointer;
    cursor: -webkit-image-set(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4v7M5 8l3 3 3-3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 1x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4v7M5 8l3 3 3-3' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 2x) 8 8, pointer;
  }
}
/* Grid tiles: the same 16 × 16 square cursor with a plus inside ("open"), 7px arms, 1px (since 2026-11-22). This
   image cursor is only the fallback: with JS, .ui-cursor draws it in difference blend and the system cursor hides. */
@media (hover: hover) and (pointer: fine) {
  .tiles .tile {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4.5v7M4.5 8h7' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 8 8, zoom-in;
    cursor: -webkit-image-set(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4.5v7M4.5 8h7' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 1x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16' fill='none' stroke='%23e6e8e9'%3E%3Cpath d='M8 4.5v7M4.5 8h7' stroke-width='1'/%3E%3Cpath d='M0.375 0.375H15.625V15.625H0.375Z' stroke-width='0.75'/%3E%3C/svg%3E") 2x) 8 8, zoom-in;
  }
}
/* drawn cursor (app.js): the system cursor hides where it shows; lightbox images keep theirs */
html.has-ui-cursor .tiles .tile,
html.has-ui-cursor .lightbox-stage,
html.has-ui-cursor .lightbox-next { cursor: none; }
html.has-ui-cursor .list .row:not(.is-soon) { cursor: none; }   /* List: plus over rows that open a project */
html.has-ui-cursor .pile:not(.is-spinning) .tile:not(.is-dragging) { cursor: none; }   /* Pile: plus over tiles; grab hand in the gaps, grabbing while dragging */
.ui-cursor {
  position: fixed; left: 0; top: 0; z-index: 70;   /* above the grain (50) and the lightbox */
  width: 16px; height: 16px;
  pointer-events: none;
  mix-blend-mode: difference;   /* white drawn in difference inverts what's under it */
  opacity: 0;
}
/* it grows out of the 6px bracket square (since 2026-11-23): off, it's a 6px solid square (scale .375, filled);
   on, it opens to the 16px outline with its mark. Turning off it shrinks back, then hands over to the brackets. */
.ui-cursor { transition: opacity 0s linear 220ms; }
.ui-cursor.is-on { opacity: 1; transition-delay: 0s; }
.ui-cursor svg { display: block; transform: scale(.375); transition: transform 220ms cubic-bezier(.33,1,.68,1); }
.ui-cursor.is-on svg { transform: none; }
.ui-cursor .uc-fill { transition: opacity 160ms ease-out; }
.ui-cursor.is-on .uc-fill { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ui-cursor, .ui-cursor svg, .ui-cursor .uc-fill { transition: none; } }

/* Bracket cursor (app.js, since 2026-11-23; from the holding page): the pointer everywhere the drawn cursor isn't.
   A 6px solid square in open space that glides open into the FYU Mark's corner marks to frame a hovered link or
   button. White in difference blend like .ui-cursor. Pile gaps show the drawn move / grab chevrons (app.js). */
html.has-brackets, html.has-brackets * { cursor: none !important; }
.brackets {
  position: fixed; left: 0; top: 0; z-index: 70;
  width: 6px; height: 6px;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0; transition: opacity .2s;
}
.brackets.is-on { opacity: 1; }
.brackets::before, .brackets::after { content: ''; position: absolute; transition: opacity .2s; }
/* the square never grows: it stays 6px in the centre and fades while the corners open out */
.brackets::before { left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.brackets::after {
  inset: 0; opacity: 0;
  --c: #fff; --a: 4px; --w: var(--hairline, 0.75px);   /* app.js rounds 0.75px to whole screen pixels */
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--a) var(--w),
    linear-gradient(var(--c), var(--c)) left top / var(--w) var(--a),
    linear-gradient(var(--c), var(--c)) right top / var(--a) var(--w),
    linear-gradient(var(--c), var(--c)) right top / var(--w) var(--a),
    linear-gradient(var(--c), var(--c)) left bottom / var(--a) var(--w),
    linear-gradient(var(--c), var(--c)) left bottom / var(--w) var(--a),
    linear-gradient(var(--c), var(--c)) right bottom / var(--a) var(--w),
    linear-gradient(var(--c), var(--c)) right bottom / var(--w) var(--a);
  background-repeat: no-repeat;
}
.brackets.is-framing::before { opacity: 0; transition-duration: .1s; }
.brackets.is-framing::after { opacity: 1; }
/* fades with the scroll while a Previous / Next box fills (--rest set by layout() in app.js) */
.lightbox-item, .lightbox-next:not(.is-filling) { opacity: var(--rest, 1); }
/* after the last image: a dashed box shaped like the next project's first image, "Next: <project>" (Label/Sentence 11)
   centred inside; it swells into the middle like an image and fills from the bottom (--fill 0 → 1) as you scroll on,
   then becomes the next project's first image (app.js). Clicking it loads that project too. */
.lightbox-next {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text-primary);
  font-size: var(--type-label-11-size);
  line-height: var(--type-label-11-line-height);
  letter-spacing: var(--type-label-11-letter-spacing);
  /* no will-change: the swell is a scale() (app.js layout), and a promoted layer would keep the raster of its
     first, smaller scale and look soft at full size */
}
/* the fill is the image the box stands for, uncovered (not stretched) from the bottom as you scroll on;
   Previous from the top (you're scrolling up) */
.lightbox-next-fill {
  position: absolute;
  inset: 0;
  background: var(--image-placeholder);
  clip-path: inset(calc((1 - var(--fill, 0)) * 100%) 0 0 0);
}
.lightbox-next[data-dir="-1"] .lightbox-next-fill { clip-path: inset(0 0 calc((1 - var(--fill, 0)) * 100%) 0); }
.lightbox-next-fill img, .lightbox-next-fill video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-next-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lightbox-next-line rect {
  fill: none;
  stroke: var(--marker-inactive);   /* faded back: quieter than the label (was text/muted) */
  stroke-width: 0.75;   /* since 2026-11-22; was 0.5 */
  stroke-dasharray: 2 3;   /* fine dashes: 2px on, 3px off (like the holding page crosshair was) */
}
.lightbox-next-text { position: relative; white-space: nowrap; opacity: clamp(0, (.6 - var(--fill, 0)) * 5, 1); }   /* fades out as the reveal reaches it (fill .4 → .6), so it never sits on the image */
.lightbox-next-label { color: var(--text-muted); }
/* moving to another project: everything fades out in place first, like a view switch (app.js changeProject) */
.lightbox.is-leaving .lightbox-meta .hdr-line,
.lightbox.is-leaving .lightbox-count,
.lightbox.is-leaving .lightbox-item,
.lightbox.is-leaving .lightbox-next,
.lightbox.is-leaving .lightbox-next.is-full .lightbox-next-text,
.lightbox.is-leaving .lightbox-next.is-full .lightbox-next-line { opacity: 0; transition: opacity 300ms ease-in-out; }
.lightbox.is-leaving .lightbox-next.is-full { opacity: 1; }   /* the full box stays: it becomes that project's image */
.lightbox.is-leaving { pointer-events: none; }
.lightbox-next:focus-visible { outline: 0.5px solid var(--text-primary); outline-offset: 4px; }
@media (max-width: 767px) {
  .lightbox-meta > * { grid-column: span 2; }
  .lightbox-meta [data-lb-industry], .lightbox-meta [data-lb-tags], .lightbox-meta [data-lb-year] { display: none; }
}

/* Image load fade (app.js, since 2026-11-29): tile and lightbox images wait invisible over their grey box until they've
   loaded, then fade in (tiles keep their 200ms opacity transition, shared with the Sphere's depth fade; lightbox 300ms).
   Already-loaded images get .no-fade and show at once. Only with JS (html.img-fade), so no-JS pages still show images. */
.img-fade :is(.tile, .lightbox-item, .lightbox-next-fill) > img:not(.is-loaded) { opacity: 0; }
.lightbox-item > img, .lightbox-next-fill > img { transition: opacity 300ms ease-out; }
img.no-fade { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tile > img, .lightbox-item > img, .lightbox-next-fill > img { transition-duration: 150ms; }
}

/* Theme switch (app.js, since 2026-11-29): the two themes crossfade through a view transition instead of flipping in
   one frame. Colour only, so reduced motion keeps a shorter fade. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; animation-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 150ms; }
}

/* ---------- Grain (the holding page's digital noise, since 2026-11-13) ----------
   A fixed layer over everything (header, work, lightbox), never catching the pointer. app.js draws 8 noise frames
   into canvases at the screen's real pixel density (256 CSS px tile, one speck per device pixel: light specks up to
   8%, dark specks up to 25%) and swaps them 12 times a second (--grain), like TV static; it fades in over .8s once
   the first frame is ready. Light theme: 20% strength, as the holding page runs by day (dark specks show more on
   light grey). Reduced motion: one still frame. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain, none);
  background-size: var(--grain-size, 256px);
  opacity: 0;
  transition: opacity .8s ease-out;
}
.grain.is-on { opacity: .56; }   /* 30% lighter than the holding page, then 20% lighter again (2026-11-13) */
:root[data-theme="light"] .grain.is-on { opacity: .11; }

/* Local sphere tuning panel (app.js adds it on localhost only) */
.tune {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 240px;
  background: var(--bg-elevated); color: var(--text-primary);
  font-size: var(--type-label-11-size); line-height: var(--type-label-11-line-height); letter-spacing: var(--type-label-11-letter-spacing);
  border: 0.5px solid var(--border-hairline);
}
.tune button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tune-head { display: block; width: 100%; text-align: left; padding: 8px 10px; }
.tune.is-closed .tune-body { display: none; }
.tune-body { padding: 0 10px 10px; display: grid; gap: 6px; }
.tune label { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 8px; color: var(--text-muted); }
.tune input[type="range"] { width: 100%; accent-color: var(--text-primary); }
.tune output { text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tune-actions { display: flex; gap: 16px; padding-top: 4px; }
.tune-actions button { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 2px; }
@media (max-width: 767px) { .tune { bottom: 66px; left: 16px; right: 16px; width: auto; } }
body:has(.lightbox:not([hidden])) .tune, body:not([data-view="pile"]) .tune, body:not([data-page="work"]) .tune { display: none; }   /* Pile only */
