/* ===========================================================================
   Eli Zapa — portfolio
   Figma: SGpuwkhxmSqgvHUQS8rHEj, node 116:2 (1920 × 1080 desktop frame).
   Carried over from the previous design: the Proto Mono faces, the
   typewriter reveal and the dark wipe-in button hover.
   =========================================================================== */

@font-face {
  font-family: 'Proto Mono';
  src: url('fonts/ProtoMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Proto Mono';
  src: url('fonts/ProtoMono-Medium.woff2') format('woff2'),
       url('fonts/ProtoMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e7edf0;
  --ink: #161616;
  --ink-faint: #989898;
  --button-ink: #171e24; /* the dark hover fill of every button */
  --mono: 'Proto Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Frosted panels (MENU, projects): Figma "glass" fills. */
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: 25px;

  --edge: 30px;   /* outer margin of the 1920 frame */
  /* The "© 2026 ELI ZAPA" footer: its 24px line sits this far from the
     bottom of the screen, and this far below whatever is right above it,
     on every page. */
  --footer-gap: 22px;
  --col: calc(50% + 23px); /* centre column: x = 983 on the 1920 frame */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro: 180ms;
  --dur-open: 560ms;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

/* Site cursor (Figma 116:54) — the same arrow everywhere, buttons included;
   hover feedback comes from the elements themselves. Hotspot = arrow tip. */
html,
html * {
  cursor: url('assets/cursor.svg') 2 2, auto;
}

body {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: -0.36px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

p, h2, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; }

/* ---------- backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* The background video holds two films stacked (regular on top, x-ray
   underneath), so the <video> is twice as tall as one film, 16:18. It's
   sized so its top half covers the window like object-fit: cover, centred
   (--bg-x moves it sideways: phones show the right-hand side; --bg-shift
   then nudges it by a fixed amount), and the
   bottom half falls outside and is clipped. setupXray reads the same
   framing, so the x-ray lines up. */
.backdrop--video {
  --bg-x: 0.5;
  --bg-shift: 0px;
  overflow: hidden;
  container-type: size;
}
/* Hidden until its entrance starts (class set in index.html's head). */
.bg-pending .backdrop--video { opacity: 0; }

.backdrop--video video {
  position: absolute;
  left: calc((100cqw - max(100cqw, 177.7778cqh)) * var(--bg-x) + var(--bg-shift));
  top: calc((100cqh - max(100cqw, 177.7778cqh) * 0.5625) * 0.5);
  width: max(100cqw, 177.7778cqh);
  height: auto;
  aspect-ratio: 16 / 18;
  pointer-events: none;
}

.xray-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- layout (desktop: everything pinned to the viewport) ---------- */

.page {
  /* Absolute, not fixed, and no z-index: so the page doesn't become a layer
     of its own, and the floating text can blend ("difference") with the
     video behind it. Its pieces still paint above the backdrop (they come
     later in the page), and with the body not scrolling here, absolute
     covers the window just as fixed did. */
  position: absolute;
  inset: 0;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}

/* ---------- top left: MENU + identity ---------- */

.top {
  position: absolute;
  top: var(--edge);
  left: var(--edge);
  display: flex;
  align-items: flex-start; /* Figma 123:159: button top level with the text's top */
  gap: 30px;
}

.ident {
  display: block;
  text-decoration: none;
  line-height: 18px;
  white-space: nowrap;
  text-transform: uppercase;
}
.ident h1 { margin: 0; font: inherit; } /* the name: the page's main heading, looking like the lines under it */

/* ---------- open menu (Figma 124:181) ----------
   A 119px frosted panel 26px under the identity block (top 110 in the
   1920 frame). Pages are rows like the project rows: grey text that turns
   black on hover; the current page has the white fill. */
.menu-panel {
  position: absolute;
  z-index: 2; /* over the project page */
  top: calc(var(--edge) + 80px);
  left: var(--edge);
  width: 119px;
  padding: 5px;
}
.menu-panel[hidden] { display: none; }
/* On Works it opens over the cards: a more solid fill keeps it readable. */
.is-works .menu-panel { background: rgba(255, 255, 255, 0.8); }

.menu-panel__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-panel__item {
  display: block;
  width: 100%;
  text-decoration: none; /* CONTACT is a mailto link */
  padding: 10px 15px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-faint);
  line-height: normal;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}
.menu-panel__item:hover,
.menu-panel__item:focus-visible { color: var(--ink); }
.menu-panel__item.is-current {
  background: #fff;
  color: var(--ink);
}

/* ---------- buttons ----------
   The previous site's button hover, kept: a dark fill wipes in behind the
   typewriter caret while the label retypes, and the label turns white.
   --pill-wipe is the fill's right inset, driven per frame by
   setupHoverRetypeButtons; it defaults to 0 (fully drawn) so a hover that
   isn't running the replay (reduced motion, touch) still shows the fill. */

.menu-btn {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px; /* Figma 120:89 */
  line-height: normal;
  color: var(--ink);
  transition: color var(--dur-micro) var(--ease-out);
}

.menu-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--button-ink);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease-out);
  clip-path: inset(0 var(--pill-wipe, 0px) 0 0 round 10px);
}

/* Icon-only MENU (Figma 120:138): 15 px padding around a 2 × 2 grid of
   4 px squares with 2 px gaps — a 42 × 42 px button. */
.menu-btn--icon { padding: 15px; }

.menu-btn__grid {
  display: grid;
  grid-template-columns: repeat(2, 4px);
  grid-template-rows: repeat(2, 4px);
  gap: 2px;
}

.menu-btn__grid i {
  display: block;
  border-radius: 1px;
  background: currentColor;
}

/* Pressed MENU while the menu is open (Figma 124:172): the blue-grey
   frosted fill of the cursor label, white squares. */
.menu-btn.glass[aria-expanded="true"] {
  background: rgba(90, 113, 129, .5);
  color: #fff;
}

/* Hover only where there's a real pointer: on touch screens a tapped button
   keeps :hover until the next tap elsewhere, so MENU would stay dark after
   closing the menu. */
@media (hover: hover) {
  .menu-btn:hover { color: #fff; }
  .menu-btn:hover::before { opacity: 1; }
}
.menu-btn.is-wiping::before { transition: none; }

.menu-btn:focus-visible,
.menu-panel__item:focus-visible,
.projects__row:focus-visible,
.ident:focus-visible {
  outline: 2px solid var(--button-ink);
  outline-offset: 2px;
}

/* Sound toggle (Figma 126:242 / 126:245): icon-only, like MENU — 15px
   padding around a 12 × 10 speaker, a 44 × 42 button — pinned to the top
   right, level with MENU. Waves while sound is on, a cross while it's off. */
.sound-btn {
  position: absolute;
  top: var(--edge);
  right: var(--edge);
  padding: 15px;
}
.sound-btn[hidden] { display: none; }
.sound-btn__icon { display: block; overflow: visible; }
.sound-btn__on { display: none; }
.sound-btn[aria-pressed="true"] .sound-btn__on { display: inline; }
.sound-btn[aria-pressed="true"] .sound-btn__off { display: none; }

/* ---------- centre column: expertise ---------- */

.info {
  position: absolute;
  top: var(--edge);
  left: var(--col);
  width: 313px;
  line-height: 18px;
  white-space: nowrap;
}

.info__label {
  font: inherit;
  color: var(--ink-faint);
}

.info__cols {
  display: grid;
  grid-template-columns: 210px auto;
  margin-top: 20px;
}

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

.footer {
  position: absolute;
  left: var(--col);
  bottom: var(--footer-gap);
  line-height: 24px;
  color: var(--ink-faint);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- text floating on the video ----------
   The identity block and the centre column sit straight on the gecko film:
   white, blended "difference", so they read dark over the pale background
   and turn light where a dark lizard passes underneath. (The text inside
   the frosted panels keeps its own colours. The footer stays plain grey,
   #989898, like the Works and Laboratory footers.)
   The white is drawn black and inverted: Chrome on Windows draws white
   letters heavier than dark ones, so white text blended back to dark
   looked bolder than the rest of the site. Black letters keep its weight. */
.ident,
.info {
  color: #000;
  filter: invert(1);
  mix-blend-mode: difference;
}
.info__label,
.info__value { color: inherit; }

/* ---------- bottom left: projects ---------- */

/* Nothing in the panel is ever cropped or scrolled: its width follows the
   window instead. The panel is the rows plus a square image as wide as the
   panel's inside (border + padding = 12px each way), so its height is
   width + rows, and the width that just fills the space under the header
   (30 + 56 + 30 above, 30 below = 146px) is 100vh − 146px − rows.
   It is also capped at 500px (Figma) and kept clear of the centre column,
   and never narrower than the rows' text needs. setupProjects measures the
   rows into --projects-rows / --projects-min. On smaller windows the image
   shrinks and the space between the row texts tightens. */
.projects {
  --projects-rows: 147px; /* all rows + the gaps between them */
  --projects-min: 280px;  /* rows' text at its tightest spacing */
  position: absolute;
  left: var(--edge);
  bottom: var(--edge);
  width: clamp(var(--projects-min),
               min(100vh - 146px - var(--projects-rows), 50vw - 37px),
               500px);
  padding: 5px;
}

.projects__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.projects__row {
  display: flex;
  justify-content: space-between;
  gap: 10px; /* the tightest the texts get; wider panels spread them out */
  width: 100%;
  padding: 10px 15px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: var(--ink-faint);
  line-height: normal;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  /* Closing: the bottom corners round off again only once the image under
     the row has (almost) folded away. */
  transition: color var(--dur-micro) var(--ease-out),
              border-radius 160ms var(--ease-out) 400ms;
}

/* Hover turns the row's text black. Only where there is a real pointer:
   on a phone a tap would leave the row "hovered", black after its card
   has closed. */
@media (hover: hover) {
  .projects__row:hover { color: var(--ink); }
}
.projects__row:focus-visible {
  color: var(--ink);
}

/* Open card (Figma 119:61): the row and its image form one card — black
   text, square bottom corners on the row, no gap before the image. */
.projects__item.is-open .projects__row {
  color: var(--ink);
  border-radius: 5px 5px 0 0;
  transition: color var(--dur-micro) var(--ease-out), border-radius 0s;
}

/* The image opens under its row. Animated through grid-template-rows so the
   panel grows to the image's real height without measuring it. */
.projects__media {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-open) var(--ease-out);
}

.projects__item.is-open .projects__media {
  grid-template-rows: 1fr;
}

.projects__media-inner {
  min-height: 0;
  overflow: hidden;
  border-radius: 0 0 5px 5px;
}

.projects__media img,
.projects__media video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0 0 5px 5px;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 400ms var(--ease-out), transform var(--dur-open) var(--ease-out);
}

.projects__item.is-open .projects__media img.is-loaded,
.projects__item.is-open .projects__media video.is-loaded {
  opacity: 1;
  transform: none;
}

/* The card that opens on load appears already open, without the unfold. */
.projects.is-instant .projects__row,
.projects.is-instant .projects__media { transition: none; }

/* ---------- info page: about panel (Figma 130:294) ----------
   In the projects panel's place (same frosted panel, 5px padding, 5px gap,
   500px wide, 30px off the bottom-left), shown instead of it on #info
   (html.is-info, set by setupProjectView). The spin video sits on top, the
   bio under it with 30px padding. On shorter windows the panel never grows
   past the space under the header: the video gives up height, cropped
   evenly top and bottom so the face stays in view. */
.about {
  position: absolute;
  left: var(--edge);
  bottom: var(--edge);
  width: min(500px, calc(50vw - 37px)); /* clear of the centre column */
  max-height: calc(100% - 146px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}
html:not(.is-info) .about,
.is-info .projects { display: none; }

/* The title bar (Figma 140:10): white, flush on top of the video — the
   two read as one block, rounded at its outer corners only. */
.about__bar {
  flex: none;
  margin: 0 0 -5px; /* cancels the panel's gap: no space under it */
  padding: 10px 15px;
  border-radius: 5px 5px 0 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
}

.about__portrait {
  position: relative;
  flex: 0 1 auto;
  min-height: 80px;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-radius: 0 0 5px 5px; /* square on top, under the title bar */
  /* "difference" needs a solid colour to blend against: the panel itself is
     only 50% white, and blending over a half-transparent backdrop flattens
     everything to grey. This is what the frosted panel looks like (50%
     white over the page). */
  background: color-mix(in srgb, #fff 50%, var(--bg));
}
.about__video,
.about__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%; /* a shorter video keeps the face in view */
  border-radius: 0 0 5px 5px; /* square on top, under the title bar */
  filter: grayscale(1);       /* saturation 0 */
  mix-blend-mode: difference;
}
/* The video's dither is made of 2 × 2-pixel dots. Scaled down smoothly, the
   browser averages them into grey mush, so the frames are redrawn on the
   canvas at the screen's real pixel size taking whole dots, never blending
   them (setupDitherVideo). The video plays underneath as the source; it
   only shows if the canvas can't be used. */
.about__canvas { visibility: hidden; }
.dither-live .about__canvas { visibility: visible; }
/* Only one of the two may blend, or the canvas would blend with the video
   under it: once the canvas draws, the video stays as its unseen source. */
.dither-live .about__video { opacity: 0; }

/* A 20% #5a7181 tint over the video, as on the Works thumbnails. */
.about__portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0 0 5px 5px; /* square on top, under the title bar */
  background: rgba(90, 113, 129, 0.2);
  pointer-events: none; /* clicks reach the contact link */
}

/* The video is the contact link (mailto). */
.about__contact {
  position: absolute;
  inset: 0;
  border-radius: 0 0 5px 5px; /* square on top, under the title bar */
}
.about__contact:focus-visible { outline: 2px solid var(--button-ink); outline-offset: -2px; }

/* While the menu is open the bio text folds away and the video shrinks to
   half size in the bottom-left corner (setupAboutPanel animates and sizes
   it; this keeps the text hidden). */
.about.is-collapsed .about__text {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -5px; /* cancel the panel's gap */
  opacity: 0;
}

.about__text {
  flex: none;
  overflow: hidden; /* while it folds */
  padding: 30px;
  color: var(--ink-faint);
  line-height: 18px;
  text-transform: uppercase;
}
.about__text p + p { margin-top: 18px; }
.about__text > * + * { margin-top: 20px; } /* Figma 140:4: 20px between the bio and the contacts */
/* The contacts: label over value, two columns 50px apart. */
.about__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 50px;
  margin-bottom: 0;
  white-space: nowrap;
}
.about__contacts dd { margin: 0; }
.about__contacts a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-out);
}
.about__contacts a:hover,
.about__contacts a:focus-visible { color: var(--ink); }

/* ---------- project page (Figma 125:221) ----------
   Left: the project's details, vertically centred and lined up with the
   identity text (x = 102 = 30 + 42 + 30). Right: a frosted panel the full
   height of the window (30px margins), width 972 at 1920 (half + 12px),
   holding the project's images in a scrolling column, 5px apart.
   html.is-project (setupProjectView) hides the home page's pieces. */
.project-view {
  position: absolute;
  inset: 0;
  pointer-events: none; /* let clicks through to the header around it */
}
.project-view[hidden] { display: none; }
.project-view > * { pointer-events: auto; }
.project-view__footer { display: none; } /* phones only (the page's own footer elsewhere) */

.project-view__info {
  position: absolute;
  top: 50%;
  left: calc(var(--edge) + 72px);
  /* 487 in Figma; narrower windows keep 40px clear of the image panel. */
  width: min(487px, calc(50% - 42px - var(--edge) - 72px - 40px));
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 71px;
}

.project-view__meta {
  display: flex;
  flex-direction: column;
  gap: 30px;
  line-height: normal;
  color: var(--ink-faint);
  text-transform: uppercase;
  white-space: nowrap;
}
.project-view__title {
  margin: 0;
  font: inherit;
  color: var(--ink);
}
.project-view__fields p { display: block; width: max-content; }
.project-view__meta > p,
.project-view__title { width: max-content; }

.project-view__desc {
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-faint);
  text-transform: uppercase;
  white-space: pre-line; /* line breaks typed in the admin show */
}

/* Credits (set in the admin): two columns 50px apart, each credit its role
   (faint) over its names (ink), 20px apart. */
.project-view__credits {
  display: flex;
  gap: 50px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 16px;
  text-transform: uppercase;
}
.project-view__credits[hidden] { display: none; }
.project-view__credits-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.project-view__credit { margin: 0; }
.project-view__credit > * { display: block; overflow-wrap: anywhere; }
.project-view__credit-role { color: var(--ink-faint); }
.project-view__credit-name { color: var(--ink); }
a.project-view__credit-name { text-decoration: none; text-underline-offset: 3px; }
@media (hover: hover) {
  a.project-view__credit-name:hover { text-decoration: underline; }
}
a.project-view__credit-name:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.project-view__gallery {
  position: absolute;
  top: var(--edge);
  right: var(--edge);
  bottom: var(--edge);
  width: calc(50% + 12px);
  display: flex;
  padding: 5px;
}
.project-view__scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 5px;
  scrollbar-width: none;
}
.project-view__scroll::-webkit-scrollbar { display: none; }
.project-view__scroll:focus-visible { outline: 2px solid var(--button-ink); outline-offset: 2px; }

.project-view__scroll img,
.project-view__scroll canvas {
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1; /* placeholder size until the image arrives */
  object-fit: cover;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.project-view__scroll img.is-loaded,
.project-view__scroll canvas.is-loaded {
  aspect-ratio: auto;
  opacity: 1;
}
/* Each image's frame: it settles inside it (setupProjectView, like the
   Works cards) — easing down from slightly zoomed and coming into focus out
   of a blur while it waits to arrive (.is-arriving). */
.project-view__shot {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 5px;
}
/* A film (a project video set to "play only when enlarged" in the admin)
   holds still; a click watches it enlarged. A play button sits on it, still
   (no cursor tag over it), on every screen. It shows at once, before its
   still has loaded: the frame shows as a pale panel (16:9 until the
   film's own shape is known) and the still fills it when it arrives. */
.project-view__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(90, 113, 129, 0.5);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  color: #fff;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity var(--dur-micro) var(--ease-out);
}
.project-view__play::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}
.project-view__shot.is-film .project-view__play { display: flex; }
.project-view__shot.is-film .project-view__play { opacity: 1; }
.project-view__scroll .is-film canvas { opacity: 1; aspect-ratio: 16 / 9; }
.project-view__shot.is-arriving :is(img, canvas) { filter: blur(var(--intro-blur, 0px)); }

/* While a project shows, the home page's own pieces step aside. */
.is-project .backdrop,
.is-project .xray-canvas,
.is-project .info,
.is-project .projects,
.is-project .sound-btn,
.is-project .about { display: none; }
/* The footer stays on a project page, at the same height as on the home
   page, but in line with the menu button. */
.is-project .footer { left: var(--edge); }

/* ---------- works page (Figma 132:2) ----------
   Every project, at #works. A frosted panel 30px from the sides, starting
   under the header level with the open menu (y = 110), holding the cards in two columns 5px apart;
   each card is its row (title, category, year) over its image at the
   image's own proportions. Images are tinted slightly until hovered. The
   page scrolls under the header; the footer follows the panel, centred
   like the Laboratory's. html.is-works (setupProjectView) hides the home
   page's pieces; the sound button stays. */
.works-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--edge) + 80px) var(--edge) 0; /* level with the open menu (.menu-panel) */
  scrollbar-width: none;
}
.works-view::-webkit-scrollbar { display: none; }
.works-view[hidden] { display: none; }

.works-view__panel {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 5px;
}
.works-view__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.work-card {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  border-radius: 5px;
}
.work-card:focus-visible { outline: 2px solid var(--button-ink); outline-offset: 2px; }
.work-card__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 5px 5px 0 0;
  background: #fff;
  color: var(--ink-faint); /* #989898; dark on hover */
  transition: color var(--dur-micro) var(--ease-out);
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
}
.work-card__row > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.work-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0 0 5px 5px;
  background: rgba(255, 255, 255, 0.6); /* until the image arrives */
}
.work-card__media img,
.work-card__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1); /* in colour only on hover */
  transition: opacity 400ms var(--ease-out), filter var(--dur-open) var(--ease-out);
}
.work-card__media :is(img, video).is-loaded { opacity: 1; }
/* As a card arrives — on the first screen when the page opens, further down
   as it scrolls into view (setupWorksView) — its picture comes into focus
   out of a blur; the colour change on hover waits until it's done. */
.work-card.is-arriving .work-card__media :is(img, video) {
  filter: grayscale(1) blur(var(--intro-blur, 0px));
  transition: opacity 400ms var(--ease-out);
}
.work-card:hover .work-card__media :is(img, video),
.work-card:focus-visible .work-card__media :is(img, video) { filter: grayscale(0); }
/* The slight blue-grey tint (Figma: 20% #5a7181), lifted on hover. */
.work-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(90, 113, 129, 0.2);
  transition: opacity var(--dur-open) var(--ease-out);
  pointer-events: none;
}
.work-card:hover .work-card__row,
.work-card:focus-visible .work-card__row { color: var(--ink); }
.work-card:hover .work-card__media::after,
.work-card:focus-visible .work-card__media::after { opacity: 0; }

.works-view__footer {
  margin: var(--footer-gap) 0 0; /* below the panel */
  padding-bottom: var(--footer-gap);
  text-align: center; /* centred, like the Laboratory footer */
  line-height: 24px;
  color: var(--ink-faint);
  text-transform: uppercase;
  white-space: nowrap;
}

/* The cards soften as they pass under the header: a light blur across the
   top of the Works page, washed with the page's own background colour so
   it melts into it, and fading out gradually well below the header so
   there is no edge. It appears once the page has scrolled and slides away
   with the header (setupWorksView). */
.header-veil {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--edge) * 3 + 54px);
  background: linear-gradient(to bottom, rgba(231, 237, 240, 0.6), rgba(231, 237, 240, 0)); /* --bg */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, rgba(0, 0, 0, 0.6) 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 30%, rgba(0, 0, 0, 0.6) 60%, transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  display: none;
}
.is-works .header-veil { display: block; }
.header-veil.is-on { opacity: 1; }

/* ---------- laboratory page (Figma 134:54) ----------
   At #lab: personal and experimental single shots. One frosted panel from
   level with the open menu to 64px off the bottom (the footer centred under
   it); inside, a white caption bar, the huge LABORATORY title fading from
   blue-grey into the panel, and over its lower half a strip of portrait
   shots standing on the panel's bottom edge — tall, short, mid, short,
   tallest, short, … — which slides sideways and loops (setupLabView). The
   shots are greyscale and tinted until hovered. html.is-lab hides the home
   page's pieces; the sound button stays. */
.lab-view {
  position: absolute;
  inset: 0;
}
.lab-view[hidden] { display: none; }

.lab-view__panel {
  position: absolute;
  top: calc(var(--edge) + 80px); /* level with the open menu */
  left: var(--edge);
  right: var(--edge);
  bottom: calc(var(--footer-gap) * 2 + 24px); /* the footer's line, a gap either side */
  display: flex;
  padding: 5px;
}
.lab-view__inner {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 5px;
}
.lab-view__bar {
  position: relative;
  z-index: 1;
  padding: 10px 15px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  line-height: normal;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
/* 292px on the 1920 frame, centred in the space above the strip's
   reference height (476 of 857: --lab-strip is set by setupLabView). */
.lab-view__title {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  bottom: calc(var(--lab-strip, 857px) * 0.555);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Figma 139:2: 42px on the 1920 frame, three set lines, centred. */
  font-size: clamp(14px, 2.1875vw, 56px);
  line-height: 1.19; /* the face's own ("normal"): 50px at 42px */
  letter-spacing: -0.04em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}
/* The fade runs over the whole block: solid down to its middle, then
   paling to almost white by the foot of the last line. */
.lab-view__title-text {
  display: block;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(180deg, rgba(90, 113, 129, 0.5) 50.333%, #f3f6f7 100.33%);
  -webkit-background-clip: text;
  background-clip: text;
}
.lab-view__title-text > span { display: block; }
/* The strip: the shots stand on the bottom edge, placed by setupLabView. */
.lab-view__track {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  touch-action: pan-y; /* a sideways swipe drives the strip */
  user-select: none;
  -webkit-user-select: none;
}
.lab-view__track:focus-visible { outline: 2px solid var(--button-ink); outline-offset: -2px; border-radius: 5px; }
.lab-view__track.is-dragging,
.lab-view__track.is-dragging * { cursor: grabbing; }

.lab-shot {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.6); /* until the image arrives */
  will-change: transform;
}
.lab-shot img,
.lab-shot video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1);
  transition: opacity 400ms var(--ease-out), filter var(--dur-open) var(--ease-out);
  -webkit-user-drag: none;
  pointer-events: none;
}
.lab-shot :is(img, video).is-loaded { opacity: 1; }
.lab-shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(90, 113, 129, 0.2);
  transition: opacity var(--dur-open) var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .lab-view__track:not(.is-dragging) .lab-shot:hover :is(img, video) { filter: grayscale(0); }
  .lab-view__track:not(.is-dragging) .lab-shot:hover::after { opacity: 0; }
}
/* Feed view (desktop, setupLabView): the strip and the line about the page
   give way to every shot in a masonry grid, scrolling under the caption
   bar. The tiles are .lab-shot too (same look), placed by setupLabView. */
.lab-view__grid {
  position: absolute;
  top: var(--lab-bar, 34px);
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lab-view__grid::-webkit-scrollbar { display: none; }
.lab-view__grid[hidden] { display: none; }
.lab-view__grid-inner { position: relative; }
.lab-view__grid .lab-shot {
  top: 0;
  bottom: auto;
  margin: 0;
  will-change: auto;
  cursor: pointer; /* (also tells phones it's tappable, so a touch "hovers" it) */
  -webkit-touch-callout: none; /* no save-image menu for a held finger */
  -webkit-user-select: none;
  user-select: none;
}
.lab-view.is-feed .lab-view__title,
.lab-view.is-feed .lab-view__track { visibility: hidden; }
/* In colour on hover — and on touch screens when a finger is on it, just
   as the Works cards do (a plain :hover, which phones apply to a touch). */
.lab-view__grid .lab-shot:hover :is(img, video) { filter: grayscale(0); }
.lab-view__grid .lab-shot:hover::after { opacity: 0; }
/* Phones: the shot nearest the middle of the strip in colour (setupLabView). */
@media (max-width: 820px) {
  .lab-shot.is-centre :is(img, video) { filter: grayscale(0); }
  .lab-shot.is-centre::after { opacity: 0; }
}
/* While a shot arrives (setupLabView, like the Works cards) its picture
   comes into focus out of a blur. */
.lab-shot.is-arriving :is(img, video) {
  filter: grayscale(1) blur(var(--intro-blur, 0px));
  transition: opacity 400ms var(--ease-out);
}
@media (max-width: 820px) {
  .lab-shot.is-arriving.is-centre :is(img, video) { filter: grayscale(0) blur(var(--intro-blur, 0px)); }
}

/* A picture enlarged (a tap or click on a Journal shot or a project image,
   createMediaViewer): large and in colour over a frosted veil, under the
   cursor tag ("Close"). */
.lab-viewer {
  position: fixed;
  inset: 0;
  z-index: 9;
}
.lab-viewer[hidden] { display: none; }
.lab-viewer__bg {
  position: absolute;
  inset: 0;
  background: rgba(231, 237, 240, 0.6); /* --bg */
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.lab-viewer__media {
  position: fixed;
  display: block;
  object-fit: cover;
  border-radius: 5px;
  -webkit-user-drag: none;
}

/* An enlarged film's controls (createMediaViewer): along its foot, a
   frosted pill — play / pause, the scrub bar, the time. They fade away
   after a moment of stillness while it plays (.is-idle). */
.film-bar {
  position: fixed;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  height: 34px;
  padding: 0 12px 0 0;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(90, 113, 129, 0.5);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  color: #fff;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 400ms var(--ease-out);
}
.film-bar[hidden] { display: none; }
.film-bar.is-idle { opacity: 0 !important; }
.lab-viewer.is-idle,
.lab-viewer.is-idle * { cursor: none; }
.film-bar__toggle {
  flex: none;
  width: 64px;
  height: 100%;
  padding: 0 0 0 12px;
  border: 0;
  background: none;
  text-align: left;
  text-transform: inherit;
}
.film-bar__track {
  position: relative;
  flex: 1;
  height: 100%;
  touch-action: none;
}
.film-bar__track::before,
.film-bar__fill {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
}
.film-bar__track::before { background: rgba(255, 255, 255, 0.35); }
.film-bar__fill {
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}
.film-bar__track:hover::before,
.film-bar__track:hover .film-bar__fill,
.film-bar__track.is-dragging::before,
.film-bar__track.is-dragging .film-bar__fill { height: 4px; margin-top: -2px; border-radius: 2px; }
.film-bar__track:focus-visible { outline: none; }
.film-bar__track:focus-visible::before { box-shadow: 0 0 0 1px #fff; }
.film-bar__time {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.film-bar__full {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 100%;
  margin-right: -12px; /* to the bar's edge: the bar's own end padding becomes its */
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}
.film-bar__full[hidden] { display: none; }
.film-bar__full svg { display: block; }
.film-bar__exit,
.lab-viewer.is-full .film-bar__enter { display: none; }
.lab-viewer.is-full .film-bar__exit { display: inline; }
.film-bar__full:focus-visible { outline: 1px solid #fff; outline-offset: -4px; border-radius: 8px; }
/* Full screen: the film edge to edge on black. */
.lab-viewer.is-full .lab-viewer__bg {
  background: #000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.lab-viewer.is-full .lab-viewer__media { border-radius: 0; }
@media (max-width: 820px) {
  .film-bar { gap: 10px; padding-right: 10px; }
  .film-bar__toggle { width: 56px; padding-left: 10px; }
  .film-bar__full { margin-right: -10px; }
}

.lab-view__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--footer-gap);
  line-height: 24px;
  color: var(--ink-faint);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.is-lab .backdrop,
.is-lab .xray-canvas,
.is-lab .info,
.is-lab .projects,
.is-lab .footer,
.is-lab .about { display: none; }

.is-works .backdrop,
.is-works .xray-canvas,
.is-works .info,
.is-works .projects,
.is-works .footer,
.is-works .about { display: none; }

/* ---------- pointer label over an open image (Figma 116:38) ---------- */

.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(90, 113, 129, 0.5);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  color: #fff;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease-out);
}

.cursor-label.is-visible { opacity: 1; }

/* ---------- typewriter reveal ----------
   Armed by the inline script in index.html before first paint, cleared by
   setupTypewriter once it has taken over. No JS → text stays visible. */

.type-armed .menu-btn__label,
.type-armed .ident > *,
.type-armed .info,
.type-armed .footer {
  visibility: hidden;
}

.type {
  position: relative;
  visibility: visible;
}

/* The footer is typed directly and must stay pinned to the frame. */
.footer.type { position: absolute; }

/* The text is all present from the start and clipped, so nothing reflows as
   it "types". --type-reveal is the width shown, stepped per character. */
.type__text {
  display: inline-block;
  clip-path: inset(0 calc(100% - var(--type-reveal, 100%)) 0 0);
}

/* Outside .type__text, or the clip would hide it too. */
.type__marker {
  position: absolute;
  top: 0.1em;
  bottom: 0.1em;
  left: 0;
  width: 0.55em;
  background: currentColor;
  transform: translate3d(var(--type-caret, 0px), 0, 0);
  opacity: 0;
  pointer-events: none;
}

/* ---------- smaller screens: the same pieces, stacked ---------- */

@media (max-width: 820px), (max-height: 600px) {
  body { overflow: auto; }
  .page {
    position: relative;
    inset: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 16px;
  }
  .top, .info, .projects, .about, .footer, .footer.type { position: static; }
  .is-works .top,
  .is-lab .top { position: relative; } /* painted over the page under it */
  .about { width: 100%; max-width: 500px; max-height: none; margin-top: auto; }
  .sound-btn { position: relative; top: auto; right: auto; transform: none; align-self: flex-start; }
  .top { gap: 20px; }
  .menu-panel { top: calc(16px + 80px); left: 16px; z-index: 2; }
  .works-view { padding-top: calc(16px + 80px); } /* level with the open menu */
  .project-view { position: static; display: flex; flex-direction: column; gap: 28px; pointer-events: auto; }
  .project-view[hidden] { display: none; }
  .project-view__info { position: static; width: auto; transform: none; gap: 40px; margin-bottom: 12px; } /* 40px to the images (28 + 12) */
  .project-view__meta { white-space: normal; }
  .project-view__gallery { position: static; width: 100%; }
  .project-view__scroll { overflow: visible; }
  .info { width: auto; }
  .info__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .projects {
    width: 100%;
    max-width: 500px;
    margin-top: auto;
  }
  .projects__row { gap: 10px; padding: 10px 12px; }
  .footer { white-space: normal; }
  .is-project .top { order: -1; } /* the project comes before it in the page (for phones) */
  .is-project .footer { order: 1; margin-top: calc(var(--footer-gap) - 28px); } /* after the images, one footer gap below them (the page's gap is 28) */
  .is-project .page { padding-bottom: var(--footer-gap); }
}

/* ---------- phones (Figma 128:255, 402 × 874) ----------
   One screen, no scrolling: the header 20px from the top and left, the still
   life shifted so the dice and lizard show, and the projects as a
   full-width panel 10px off the bottom and sides — rows only, no
   thumbnail; the current project's row is black. A tap on a row opens its
   project page (setupProjectView). The centre column and the footer are
   left out. The project page keeps the stacked layout above, with the same
   20px header and 10px panel margins. */
@media (max-width: 820px) {
  /* Phones: the header (and the sound button) 20px from the edges, and
     everything placed under the header (the open menu, the Works and
     Laboratory panels) follows from it. */
  :root { --edge: 20px; --footer-gap: 15px; }
  .backdrop--video { --bg-x: 0.825; --bg-shift: 50px; } /* the film 50px further right */

  body { overflow: hidden; } /* nothing scrolls the document: the project and Works pages scroll their own layers */
  /* A drag on the background moves the x-ray (setupXray), so the browser
     shouldn't treat it as a pan / pull-to-refresh; pinch-zoom still works. */
  html:not(.is-project) .page { touch-action: pinch-zoom; }
  html:not(.is-project) .page {
    position: absolute; /* not fixed: see .page */
    inset: 0;
    display: block;
    min-height: 0;
    padding: 0;
  }
  html:not(.is-project) .top {
    position: absolute;
    top: var(--edge);
    left: var(--edge);
    gap: 20px;
  }
  html:not(.is-project) .sound-btn { position: absolute; top: var(--edge); right: var(--edge); }
  html:not(.is-project) .info,
  html:not(.is-project) .footer { display: none; }
  .is-project .footer { margin-left: 10px; } /* in line with the menu button (10 + 10) */
  html:not(.is-project) .projects {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    margin: 0;
  }
  html:not(.is-project) .about {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100% - var(--edge) - 90px); /* from 100px, level with the Journal panel, to 10px off the bottom */
    margin: 0;
  }
  /* The video's height is set so the panel starts exactly there
     (setupAboutPanel: fit). */
  .about.is-fitted .about__portrait { aspect-ratio: auto; height: var(--about-video-h); }
  .about__text { padding: 20px; }
  .projects__row { gap: 10px; padding: 10px 15px; }
  /* Rows first (Figma 128:255): nothing open on load, every row grey
     (#989898) until its card is open. A tap opens a row's thumbnail like
     on desktop: square (1:1) and as wide as its row, like the desktop card. */

  .menu-panel { top: calc(var(--edge) + 70px); left: var(--edge); } /* 28px under the menu button (20 + 42 + 28) */
  /* On the Works, Journal and project pages the menu can open over a
     picture: a see-through panel turns as grey as its grey text over a dark
     one, so there it's nearly solid, as light as on the homepage. */
  .is-works .menu-panel,
  .is-lab .menu-panel,
  .is-project .menu-panel { background: rgba(255, 255, 255, 0.9); }

  /* Works page: one column, the panel 10px from the sides like the
     projects panel, under the header (20 + 54 + 26). */
  .works-view { padding: calc(var(--edge) + 80px) 10px 0; } /* level with the open menu */
  /* …and each card's line is just the title and the year (no categories). */
  .work-card__field { display: none; }
  .lab-view__panel { left: 10px; right: 10px; }
  /* Phones: no line about the page, just the shots. */
  .lab-view__title { display: none; }
  .lab-view__bar { text-align: left; }
  /* …and they sit centred in the strip's height, not standing on its foot. */
  .lab-shot { top: 0; bottom: 0; margin: auto 0; }
  .lab-view__footer { white-space: normal; padding: 0 20px; }
  .works-view__footer { padding: 0 20px var(--footer-gap); white-space: normal; }

  /* Project page: header at 20px, details in line with it, images 10px
     from the edges like the projects panel. As on the Works page, the
     page itself stays put and the project scrolls in a layer under the
     header — so Safari's bars stay as on the homepage (full size, never
     shrinking on a scroll), and the header can slide away and back
     (headerBar) while its text still blends with what's behind it. */
  .is-project .page {
    position: absolute;
    inset: 0;
    display: block;
    min-height: 0;
    padding: 0;
  }
  .is-project .top { position: absolute; top: var(--edge); left: var(--edge); gap: 20px; }
  .is-project .footer { display: none; } /* the project's own, under its images */
  .is-project .header-veil { display: block; }
  .is-project .project-view {
    position: absolute;
    inset: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: calc(var(--edge) + 54px + 40px) 10px 0; /* 40px under the header */
  }
  .is-project .project-view::-webkit-scrollbar { display: none; }
  .is-project .project-view > * { flex-shrink: 0; }
  .is-project .project-view__footer {
    display: block;
    margin: calc(var(--footer-gap) - 28px) 0 0; /* one footer gap under the images */
    padding: 0 20px var(--footer-gap); /* centred, like the Works page's footer */
    text-align: center;
    line-height: 24px;
    color: var(--ink-faint);
    text-transform: uppercase;
  }
  .is-project .project-view__info { padding: 0 10px; }
  /* Phones: the year on the title's line, at its right; the categories
     under them. 5px apart (30px on desktop). */
  .project-view__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 20px;
    align-items: baseline;
  }
  .project-view__title { grid-column: 1; grid-row: 1; max-width: 100%; } /* a long title wraps before the year */
  .project-view__year { grid-column: 2; grid-row: 1; justify-self: end; }
  .project-view__fields { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- film grain ----------
   A faint, moving grain over the whole site. One tile of monochrome
   noise (assets/grain-*.png, centred on mid-grey), blended "overlay": it adds texture without darkening or
   tinting anything — gentle on the pale background, a little more on the
   darker subjects, like film. The layer is a tile larger than the window
   and jumps to a new offset ten times a second; moving it redraws nothing.
   It never takes the pointer. Still for visitors who asked for reduced
   motion. */
:root { --grain-opacity: 0.35; } /* raise for more grain, lower for less */

body::after {
  content: '';
  position: fixed;
  top: -180px;
  left: -180px;
  width: calc(100% + 360px);
  height: calc(100% + 360px);
  z-index: 100;
  pointer-events: none;
  /* The grain tile as images (captured from Chrome's render of the original
     SVG noise filter, which Safari draws differently): identical in every
     browser, one size per screen density. */
  background-image: url('assets/grain-2x.png');
  background-image: -webkit-image-set(url('assets/grain-1x.png') 1x, url('assets/grain-2x.png') 2x, url('assets/grain-3x.png') 3x);
  background-image: image-set(url('assets/grain-1x.png') 1x, url('assets/grain-2x.png') 2x, url('assets/grain-3x.png') 3x);
  background-size: 120px 120px; /* the tile's size on screen */
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  animation: grain 1s steps(1) infinite;
  will-change: transform;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-63px, 41px); }
  20%  { transform: translate(118px, -77px); }
  30%  { transform: translate(-151px, -132px); }
  40%  { transform: translate(32px, 164px); }
  50%  { transform: translate(-97px, -18px); }
  60%  { transform: translate(141px, 96px); }
  70%  { transform: translate(-22px, -159px); }
  80%  { transform: translate(76px, 23px); }
  90%  { transform: translate(-128px, 117px); }
  100% { transform: translate(0, 0); }
}

/* ---------- reduced motion: nothing types, nothing slides ---------- */

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .type-armed .menu-btn__label,
  .type-armed .ident > *,
  .type-armed .info,
  .type-armed .footer {
    visibility: visible;
  }
  .type__text { clip-path: none; }
  .type__marker { display: none; }
  .menu-btn::before { clip-path: inset(0 round 10px); }
  .projects__row,
  .projects__media,
  .projects__media img, .projects__media video { transition: none; }
}
