/* 99 PRODUCTIONS: white on black, monospace HUD around full-bleed video. */
:root {
  --bg: #000;
  --panel: #1f2124;
  --fg: #f4f5f6;
  --dim: #8a8f96;
  --faint: #3a3d42;
  --line: rgba(244, 245, 246, 0.14);
  --mono: "Share Tech Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --gutter: 24px;
  --hud: 13px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}
@media (max-width: 720px) {
  :root { --gutter: 16px; --hud: 12px; }
  .hud-top { gap: 14px; }
  .hud-top nav { gap: 14px; }
}

@view-transition { navigation: auto; }
::view-transition-group(film), ::view-transition-group(rule-t), ::view-transition-group(rule-b),
::view-transition-group(rule-l), ::view-transition-group(rule-r) { animation-duration: 0.7s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--hud) / 1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Colour / mono mode: every image and video goes black and white. */
html.mono video, html.mono img.media { filter: grayscale(1) contrast(1.05); }

/* ---------------------------------------------------------------- top HUD */
.hud-top {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; gap: 40px;
  height: 64px; padding: 0 var(--gutter);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-top .brand { margin-right: auto; }
.hud-top nav { display: flex; gap: clamp(20px, 5vw, 80px); }
.hud-link { position: relative; color: var(--fg); }
.hud-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease);
}
.hud-link:hover::after, .hud-link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.lang { color: var(--dim); }
.lang b { color: var(--fg); font-weight: 400; }

/* RGB dot: colour / mono switch (bottom left). */
.mode-dot {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 40;
  width: 22px; height: 14px; display: block;
}
.mode-dot span { position: absolute; top: 0; width: 14px; height: 14px; border-radius: 50%; mix-blend-mode: screen; transition: transform 0.4s var(--ease), background 0.3s; }
.mode-dot span:nth-child(1) { left: 0; background: #ff2a2a; }
.mode-dot span:nth-child(2) { left: 4px; background: #2aff5a; }
.mode-dot span:nth-child(3) { left: 8px; background: #2a6bff; }
html.mono .mode-dot span { background: var(--fg); }
html.mono .mode-dot span:nth-child(1) { transform: translateX(4px); }
html.mono .mode-dot span:nth-child(3) { transform: translateX(-4px); }

/* ---------------------------------------------------------------- viewfinder brackets */
.frame { position: absolute; inset: -22px; pointer-events: none; }
.frame i { position: absolute; width: 24px; height: 24px; border: 0 solid var(--fg); transition: transform 0.5s var(--ease), opacity 0.4s; }
.frame i:nth-child(1) { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.frame i:nth-child(2) { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }

/* ---------------------------------------------------------------- cursor */
.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; mix-blend-mode: difference; transition: opacity 0.4s; }
.cursor.is-out { opacity: 0; }
/* A thin ring that trails the normal cursor; it fills in over links and turns into an X over video. */
.cursor-dot { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 1px solid #fff; transition: transform 0.5s var(--ease), background 0.4s, opacity 0.2s; }
.cursor-x { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; opacity: 0; transform: scale(0.4) rotate(-45deg); transition: transform 0.35s var(--ease), opacity 0.25s; }
.cursor-x::before, .cursor-x::after { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: #fff; }
.cursor-x::before { transform: rotate(45deg); }
.cursor-x::after { transform: rotate(-45deg); }
.cursor-label { position: absolute; left: 28px; top: 10px; color: #fff; white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.cursor.is-media .cursor-x { opacity: 1; transform: none; }
.cursor.is-media .cursor-dot { transform: scale(0.36); background: #fff; }
.cursor.is-media .cursor-label { opacity: 1; }
.cursor.is-link .cursor-dot { transform: scale(0.65); background: #fff; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------------------------------------------------------------- scramble text */
.scramble { display: inline-block; white-space: nowrap; }

/* ---------------------------------------------------------------- loader */
.loader {
  position: fixed; inset: 0; z-index: 90; background: var(--bg); overflow: hidden;
  display: grid; place-items: center; transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
/* The showreel plays full screen behind the counter. */
.loader-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 1.2s, transform 3.5s var(--ease); }
.loader-video.is-on { opacity: 0.6; transform: none; }
.loader-mid { position: relative; display: grid; justify-items: center; gap: 12px; }
.loader-mid img { width: 34px; height: auto; }
#loader-count { font-variant-numeric: tabular-nums; }
.loader-c { position: absolute; z-index: 1; }
.loader-c i { font-style: normal; color: var(--dim); letter-spacing: 0.2em; }
.loader-c.tl { left: var(--gutter); top: 22px; }
.loader-c.tc { left: 50%; top: 22px; transform: translateX(-50%); color: var(--dim); }
.loader-c.tr { right: var(--gutter); top: 22px; }
.loader-c.bl { left: var(--gutter); bottom: 20px; }
.loader-c.br { right: var(--gutter); bottom: 20px; color: var(--dim); }
.loader-bar { position: absolute; left: 0; bottom: 0; height: 1px; background: var(--fg); width: 0; }
@media (max-width: 720px) { .loader-c.tc { display: none; } .loader-c.bl { right: 120px; } }

/* ---------------------------------------------------------------- HOME */
/* The hero is short so the first clip already sits in the viewfinder under the logo. */
.hero { position: relative; scroll-snap-align: start; height: 50svh; min-height: 340px; display: grid; place-items: center; align-content: center; gap: 22px; padding-top: 56px; }
.hero-logo { width: min(19vw, 230px); }
.hero-logo img { width: 100%; height: auto; }
.hero-word { letter-spacing: 0.9em; margin-right: -0.9em; font-size: 14px; }
/* Scroll hint with the dripping line from 99MGMT. */
.hero-hint { position: absolute; top: calc(50svh - 18px); left: 50%; transform: translateX(-50%); z-index: 2; color: var(--dim); font-size: 11px; letter-spacing: 0.3em; margin-right: -0.3em; transition: opacity 0.4s; pointer-events: none; }
.hero-hint::after {
  content: ""; position: absolute; left: 50%; top: 20px; width: 1px; height: 22px;
  background: linear-gradient(var(--dim), transparent); animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.reel { display: grid; justify-items: center; gap: 26px; padding: 56px var(--gutter) 42vh; }
.reel-item { position: relative; display: block; scroll-margin: 0; transition: transform 0.7s var(--ease), opacity 0.35s; }
.reel-box { position: relative; }
/* Away from the viewfinder a clip keeps its height but is cropped narrower (--cut, set per item). */
.reel-media {
  position: relative; width: min(28vw, calc(38svh * var(--ar, 1.7778))); min-width: 280px; aspect-ratio: var(--ar, 1.7778);
  background: #0c0c0d; opacity: 0.32; filter: brightness(0.7); clip-path: inset(0 var(--cut, 0%));
  transition: clip-path 0.7s var(--ease), opacity 0.6s var(--ease), filter 0.6s;
}
.reel-cap { display: none; }
.reel-media video, .reel-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-media img { transition: opacity 0.4s; }
.reel-media.is-playing img { opacity: 0; }
.reel-item .frame i { opacity: 0; }
.reel-item .frame i:nth-child(1) { transform: translate(-14px, -14px); }
.reel-item .frame i:nth-child(2) { transform: translate(14px, -14px); }
.reel-item .frame i:nth-child(3) { transform: translate(-14px, 14px); }
.reel-item .frame i:nth-child(4) { transform: translate(14px, 14px); }
.reel-item.is-focus .reel-media { opacity: 1; filter: none; }
.reel-item.is-focus .frame i { opacity: 1; transform: none; }
/* The clip in the viewfinder leans in when you point at it. */
@media (hover: hover) and (pointer: fine) {
  .reel-item.is-focus:hover { transform: scale(1.14); }
}
html { scroll-snap-type: y proximity; }
.reel-item { scroll-snap-align: center; }
.reel-empty { padding: 10vh 0 30vh; text-align: center; color: var(--dim); }
.hero { transition: opacity 0.2s linear; }

/* Opening a clip: everything else clears and guide lines shoot out from the clip's edges. */
body.is-leaving .hero, body.is-leaving .hero-hint, body.is-leaving .reel-item:not(.is-focus), body.is-leaving .hud-bottom,
body.is-leaving .gauge, body.is-leaving .pips, body.is-leaving .site-foot, body.is-leaving .reel-item .frame { opacity: 0 !important; transition: opacity 0.3s; }
body.is-leaving .reel-item.is-focus { transform: none; }
.xhair { position: fixed; inset: 0; z-index: 35; pointer-events: none; }
.xhair i { position: absolute; background: var(--line); transition: transform 0.5s var(--ease); }
.xhair i:nth-child(1), .xhair i:nth-child(2) { left: 0; right: 0; height: 1px; transform: scaleX(0); transform-origin: var(--cx) 0; }
.xhair i:nth-child(3), .xhair i:nth-child(4) { top: 0; bottom: 0; width: 1px; transform: scaleY(0); transform-origin: 0 var(--cy); }
.xhair i:nth-child(1) { top: var(--t); view-transition-name: rule-t; }
.xhair i:nth-child(2) { top: calc(var(--b) - 1px); view-transition-name: rule-b; }
.xhair i:nth-child(3) { left: var(--l); view-transition-name: rule-l; }
.xhair i:nth-child(4) { left: calc(var(--r) - 1px); view-transition-name: rule-r; }
.xhair.is-on i { transform: none; }

.hud-bottom {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: 60px; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center; gap: 16px; pointer-events: none;
}
.hud-bottom > :nth-child(2) { justify-self: center; }
.hud-bottom > :nth-child(3) { justify-self: center; }
.hud-bottom .idx { color: var(--fg); font-variant-numeric: tabular-nums; }
.hud-bottom .cat { padding-left: 34px; }
@media (max-width: 720px) {
  .hud-bottom { grid-template-columns: 1fr 1fr auto; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); }
  .hud-bottom .cat { display: none; }
  .hud-bottom > :nth-child(2) { justify-self: start; }
  .reel-media { width: calc(100vw - 2 * var(--gutter)); min-width: 0; opacity: 0.7; filter: none; clip-path: none; }
  .reel-item .frame { display: none; }
  .reel-cap { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; }
  .reel-cap span:last-child { color: var(--dim); text-align: right; }
  .reel { gap: 36px; padding-top: 24px; padding-bottom: 80px; }
  .hero { height: auto; min-height: 0; padding: 110px 0 40px; }
  .hero-hint { display: none; }
  .hud-bottom { display: none; }
  .mode-dot { display: none; }
}

/* Left gauge: tick marks that show where you are in the reel. */
.gauge { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 3px; padding: 6px 0; }
.gauge i { display: block; width: 14px; height: 1px; background: var(--faint); transition: width 0.3s var(--ease), background 0.3s; }
.gauge i.on { background: var(--fg); }
.gauge i.at { width: 26px; background: var(--fg); }
@media (max-width: 900px) { .gauge { display: none; } }

/* Right pips: previous / current / next clip. */
.pips { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 9px; }
.pips button { width: 11px; height: 11px; background: var(--dim); transition: background 0.25s, transform 0.25s var(--ease); }
.pips button[data-d="0"] { background: var(--fg); cursor: default; }
.pips button:not([data-d="0"]):hover { background: var(--fg); transform: scale(1.25); }
.pips button:disabled { background: var(--faint); transform: none; }
@media (max-width: 720px) { .pips { display: none; } }

.site-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 36px var(--gutter) 96px; border-top: 1px solid var(--line); color: var(--dim);
}
.site-foot .start { display: flex; align-items: center; gap: 14px; }
.site-foot .start img { width: 30px; height: auto; }
.site-foot .fam { display: flex; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.site-foot .fam a:hover, .site-foot a:hover { color: var(--fg); }
.site-foot .mid { text-align: center; color: var(--fg); }
@media (max-width: 720px) { .site-foot { grid-template-columns: 1fr; justify-items: start; } .site-foot .fam { justify-content: flex-start; } }

/* ---------------------------------------------------------------- PLAYER */
/* Thin rules box the video in: one under the top HUD, one above the titles, one down each side. */
.player { --pt: 64px; --ps: 80px; --pb: 150px; position: relative; height: 100svh; min-height: 520px; overflow: hidden; }
.rules i { position: absolute; background: var(--line); pointer-events: none; }
.rules i:nth-child(1) { left: 0; right: 0; top: var(--pt); height: 1px; view-transition-name: rule-t; }
.rules i:nth-child(2) { left: 0; right: 0; bottom: var(--pb); height: 1px; view-transition-name: rule-b; }
.rules i:nth-child(3) { top: 0; bottom: 0; left: var(--ps); width: 1px; view-transition-name: rule-l; }
.rules i:nth-child(4) { top: 0; bottom: 0; right: var(--ps); width: 1px; view-transition-name: rule-r; }
.stage { position: absolute; inset: var(--pt) var(--ps) var(--pb); }
.stage-video { position: absolute; inset: 0; background: #000; view-transition-name: film; }
.stage-video video { width: 100%; height: 100%; object-fit: contain; }
.stage .frame { inset: 0; }
.stage .frame i { width: 46px; height: 46px; }
.stage .big-play, .stage .loading {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font: 400 clamp(56px, 10vw, 170px) / 1 var(--display); letter-spacing: 0.01em;
  color: transparent; -webkit-text-stroke: 1.5px var(--fg); opacity: 0; transition: opacity 0.3s;
}
.stage .loading { color: rgba(0, 0, 0, 0.25); }
.player.is-loading .loading { opacity: 1; animation: blink 1.2s steps(2) infinite; }
.player.is-paused:not(.is-loading) .big-play { opacity: 1; }
@keyframes blink { 50% { opacity: 0.55; } }
.side { position: absolute; top: 50%; z-index: 2; display: flex; gap: 36px; white-space: nowrap; transform-origin: center; }
.side-l { left: calc(var(--ps) / 2); transform: translate(-50%, -50%) rotate(-90deg); }
.side-r { right: calc(var(--ps) / 2); transform: translate(50%, -50%) rotate(90deg); }
.side button { color: var(--fg); }
.side button[aria-pressed="false"] { color: var(--dim); }
.scrub-row { position: absolute; left: calc(var(--ps) + 70px); right: calc(var(--ps) + 70px); bottom: calc(var(--pb) - 52px); }
.scrub { position: relative; height: 26px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; touch-action: none; }
.scrub i { width: 1px; height: 12px; background: var(--faint); transition: height 0.15s; }
.scrub i.on { background: var(--fg); }
.scrub i.head { height: 24px; background: var(--fg); }
.scrub-tip { position: absolute; bottom: 30px; transform: translateX(-50%); color: var(--fg); pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.scrub:hover .scrub-tip { opacity: 1; }
.time { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.titles { position: absolute; left: calc(var(--ps) + 70px); right: calc(var(--ps) + 70px); bottom: 6px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px; }
.titles .time { padding-bottom: 12px; }
.titles h1, .titles p {
  margin: 0; font: 400 clamp(36px, 4.6vw, 92px) / 1 var(--display); letter-spacing: 0.005em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.titles p { text-align: right; }
.reveal-up { display: inline-block; transform: translateY(105%); animation: up 0.9s var(--ease) 0.15s forwards; }
@keyframes up { to { transform: none; } }

/* Fullscreen: the video edge to edge with one small bar at the bottom. */
.fs-bar { display: none; }
.stage:fullscreen { background: #000; }
.stage:fullscreen .frame, .stage:fullscreen .big-play { display: none; }
.stage:fullscreen .fs-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: center; align-items: center; gap: 56px;
  padding: 26px var(--gutter) calc(26px + env(safe-area-inset-bottom, 0px)); transition: opacity 0.4s;
}
.stage:fullscreen .fs-bar .time { color: var(--fg); }
.stage:fullscreen .fs-bar button[aria-pressed="false"] { color: var(--dim); }
.stage.is-idle:fullscreen .fs-bar { opacity: 0; }
.stage.is-idle:fullscreen, .stage.is-idle:fullscreen * { cursor: none; }

.details { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; padding: 90px 80px; border-top: 1px solid var(--line); }
.details h2 { margin: 0; font: inherit; color: var(--dim); }
.credits { display: grid; grid-template-columns: max-content 1fr; gap: 10px 48px; margin: 0; }
.credits dt { color: var(--dim); }
.credits dd { margin: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pager a { position: relative; display: grid; gap: 14px; padding: 36px 80px 44px; overflow: hidden; }
.pager a + a { border-left: 1px solid var(--line); text-align: right; }
.pager .lbl { color: var(--dim); }
.pager .nm { font: 400 clamp(32px, 4.4vw, 64px) / 0.9 var(--display); }
.pager img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 0.5s, transform 1.2s var(--ease); z-index: -1; filter: brightness(0.45); }
.pager a:hover img { opacity: 1; transform: none; }
.notfound { height: 100svh; display: grid; place-items: center; align-content: center; gap: 24px; text-align: center; }
.notfound h1 { margin: 0; font: 400 clamp(64px, 14vw, 200px) / 0.85 var(--display); }

@media (max-width: 720px) {
  .player { height: auto; min-height: 0; padding: 64px 0 20px; }
  .rules { display: none; }
  .stage { position: relative; inset: auto; width: 100%; aspect-ratio: var(--ar, 1.7778); max-height: 72svh; }
  .stage .frame { display: none; }
  .stage .big-play, .stage .loading { font-size: 15vw; }
  .side { display: none; }
  .player-mobile-controls { display: flex !important; }
  .scrub-row { position: relative; left: auto; right: auto; bottom: auto; margin: 22px var(--gutter) 0; }
  .titles { position: relative; left: auto; right: auto; bottom: auto; grid-template-columns: 1fr; gap: 6px; margin: 24px var(--gutter) 0; }
  .titles .time { order: 3; padding: 8px 0 0; }
  .titles h1, .titles p { white-space: normal; text-align: left; font-size: clamp(44px, 14vw, 80px); }
  .titles p { color: var(--dim); }
  .details { grid-template-columns: 1fr; padding: 48px var(--gutter); gap: 20px; }
  .pager a { padding: 28px var(--gutter); }
}
.player-mobile-controls { display: none; gap: 28px; margin: 16px var(--gutter) 0; }

/* ---------------------------------------------------------------- ARCHIVE */
.archive { position: relative; padding: 96px 0 140px; }
.lens { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.lens path { fill: none; stroke: rgba(244, 245, 246, 0.22); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rows { position: relative; z-index: 2; list-style: none; margin: 0; padding: 0; }
.row a {
  display: grid; grid-template-columns: 19% 26% 1fr auto; align-items: center; gap: 12px;
  height: 35px; padding: 0 var(--gutter); white-space: nowrap;
}
.row span { overflow: hidden; text-overflow: ellipsis; }
.row .n, .row .d { padding: 1px 6px; margin: 0 -6px; justify-self: start; transition: background 0.15s, color 0.15s; font-variant-numeric: tabular-nums; }
.row .d { justify-self: end; }
.row a:hover .n, .row a:focus-visible .n, .row a:hover .d, .row a:focus-visible .d { background: var(--fg); color: var(--bg); }
.row { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.row.is-out { opacity: 0; transform: translateY(6px); }
.rows:hover .row a:not(:hover) { color: var(--dim); }
.archive-empty { padding: 30vh var(--gutter); text-align: center; color: var(--dim); }
/* Only shown on phones; on desktop the list fills the screen on its own. */
.archive-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

.preview {
  position: fixed; left: 50%; top: 50%; z-index: 1; width: min(37vw, 760px); max-height: 62svh; aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%) scale(0.96); opacity: 0; transition: opacity 0.35s, transform 0.5s var(--ease); pointer-events: none;
}
.preview.is-on { opacity: 1; transform: translate(-50%, -50%); }
.preview .crt {
  /* Rounded, bulging corners like an old TV tube. */
  position: absolute; inset: 0; overflow: hidden; filter: url(#crt); border-radius: 6% / 10%;
  -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 70%, transparent 100%);
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.preview .scan {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.35) 2px 3px);
}
.preview .frame { inset: -12px; }
.preview.is-glitch .crt { animation: glitch 0.32s steps(4) 1; }
@keyframes glitch {
  0% { transform: translateX(-10px) skewX(6deg); }
  33% { transform: translateX(8px) skewX(-4deg); }
  66% { transform: translateX(-3px); }
  100% { transform: none; }
}

.filters { position: fixed; right: var(--gutter); bottom: 20px; z-index: 30; display: flex; gap: clamp(18px, 4vw, 64px); flex-wrap: wrap; justify-content: flex-end; }
.filters button { color: var(--dim); }
.filters button[aria-pressed="true"] { color: var(--fg); }
.filters small { font-size: inherit; margin-left: 10px; }

@media (max-width: 900px) {
  .preview, .lens { display: none; }
  .row a { grid-template-columns: 44px 1fr auto; height: auto; padding: 12px var(--gutter); row-gap: 2px; }
  .row .a { grid-column: 2; grid-row: 2; color: var(--dim); }
  .row .d { grid-row: 1; grid-column: 3; }
  .rows:hover .row a:not(:hover) { color: inherit; }
  .archive { padding-top: 76px; }
  .archive-title {
    position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
    margin: 0 var(--gutter); font: 400 clamp(56px, 17vw, 96px) / 0.9 var(--display); letter-spacing: 0.005em;
  }
  .archive-title sup { font: 400 13px / 1 var(--mono); letter-spacing: 0.04em; vertical-align: top; }
  .filters { position: absolute; top: calc(76px + clamp(56px, 17vw, 96px) * 0.9 + 18px); left: var(--gutter); right: var(--gutter); bottom: auto; justify-content: flex-start; gap: 8px 18px; }
  .rows { margin-top: 64px; }
}

/* ---------------------------------------------------------------- CONTACT */
body.contact { background: var(--panel); }
.cgrid {
  min-height: 100svh; display: grid; grid-template-columns: 4fr 1fr; grid-template-rows: auto 1fr auto;
}
.cgrid > * { border-color: var(--faint); border-style: solid; border-width: 0; }
.c-top { position: relative; grid-column: 1; min-height: clamp(260px, 36svh, 400px); border-bottom-width: 1px; overflow: hidden; }
/* The showreel tile drifts around the top panel and bounces off its edges. */
.c-reel {
  position: absolute; left: 0; top: 0; z-index: 1; width: clamp(200px, 20vw, 340px); aspect-ratio: 16 / 10.5; background: #000; overflow: hidden; display: block;
  will-change: transform; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.c-reel video, .c-reel img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; transition: opacity 0.4s; }
.c-reel:hover video { opacity: 1; }
.c-reel span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font: 400 clamp(18px, 1.7vw, 26px) / 1 var(--display); letter-spacing: 0.06em; }
.c-where { position: absolute; right: var(--gutter); top: 76px; line-height: 1.5; }
.c-where .clock { color: var(--dim); font-variant-numeric: tabular-nums; }
.c-what { position: absolute; left: var(--gutter); bottom: 20px; color: var(--dim); }
.c-side { grid-column: 2; grid-row: 1 / 3; border-left-width: 1px; display: grid; grid-template-rows: 1fr auto; padding-top: 64px; }
.c-stills { position: relative; overflow: hidden; border-bottom: 1px solid var(--faint); min-height: 240px; }
/* Each new photo tips in from a slight angle, like a print dropped on the pile. */
.c-stills img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: rotate(-5deg) scale(1.12); transition: opacity 0.5s, transform 0.9s var(--ease);
}
.c-stills img.on { opacity: 1; transform: none; z-index: 1; }
.c-stills img.was { opacity: 1; transform: none; transition: none; }
.c-stills-bar { display: flex; justify-content: space-between; padding: 22px var(--gutter); }
.c-stills-bar button:hover { color: var(--dim); }
.c-main { grid-column: 1; padding: 40px var(--gutter) 30px; display: grid; align-content: center; gap: 30px; }
.c-main h1 { margin: 0; font: 400 clamp(64px, 11.2vw, 210px) / 0.84 var(--display); letter-spacing: 0.005em; }
.c-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.c-links a:hover { color: var(--dim); }
.c-bottom { grid-column: 1 / -1; display: grid; grid-template-columns: 4fr 1fr; border-top-width: 1px; }
.wall { position: relative; height: 260px; overflow: hidden; background: var(--fg); color: var(--panel); }
.wall-inner { position: absolute; left: -10%; top: -40%; width: 130%; transform: rotate(-6deg); display: grid; gap: 0; }
.wall-line { display: flex; white-space: nowrap; font: 400 54px / 1 var(--display); letter-spacing: 0.01em; animation: wall 40s linear infinite; }
.wall-line:nth-child(even) { animation-direction: reverse; animation-duration: 52s; }
.wall-line span { padding-right: 0.35em; }
.wall-line span:nth-child(odd) { color: transparent; -webkit-text-stroke: 1.5px var(--panel); }
@keyframes wall { to { transform: translateX(-50%); } }
.c-meta { border-left: 1px solid var(--faint); display: grid; grid-template-rows: auto 1fr auto auto; padding: 22px var(--gutter); gap: 16px; }
.c-meta .fam-row { display: flex; gap: 18px; color: var(--dim); }
.c-meta .fam-row a:hover { color: var(--fg); }
.c-meta .spaced { align-self: center; justify-self: center; letter-spacing: 0.7em; margin-right: -0.7em; }
.c-meta .row2 { display: flex; justify-content: space-between; align-items: center; color: var(--dim); }
/* 🔥 / 👎: pick one, pick it again to take it back. */
.reacts { display: flex; gap: 14px; }
.reacts button { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.reacts .emo { display: inline-block; font-size: 22px; line-height: 1; filter: grayscale(0.6) brightness(0.8); transition: transform 0.3s var(--ease), filter 0.3s; }
.reacts button:hover .emo { transform: scale(1.15) rotate(-6deg); filter: none; }
.reacts button[aria-pressed="true"] { color: var(--fg); }
.reacts button[aria-pressed="true"] .emo { filter: none; }
.reacts button.pop .emo { animation: pop 0.45s var(--ease); }
.reacts small { font-size: inherit; font-variant-numeric: tabular-nums; }
html.mono .reacts .emo { filter: grayscale(1); }
@keyframes pop { 40% { transform: scale(1.5) rotate(-10deg); } }
.c-meta .row2 a:hover { color: var(--fg); }
.mode-btn b { font-weight: 400; color: var(--fg); margin-left: 12px; }
.mode-btn { color: var(--dim); text-align: left; }
@media (max-width: 900px) {
  .cgrid, .c-bottom { grid-template-columns: 1fr; }
  .c-side { grid-column: 1; grid-row: auto; border-left-width: 0; border-top-width: 1px; padding-top: 0; }
  /* Phone order like a business card: where, how to reach us, then pictures. */
  .c-top { order: 1; min-height: 340px; }
  .c-main { order: 2; padding-top: 48px; }
  .c-side { order: 3; }
  .c-bottom { order: 4; }
  .c-links { display: grid; grid-template-columns: 1fr 1fr; }
  .c-where { top: auto; bottom: 48px; right: auto; left: var(--gutter); }
  .c-what { bottom: 20px; }
  .c-meta { border-left: 0; border-top: 1px solid var(--faint); min-height: 180px; }
  .wall { height: 200px; }
  .wall-line { font-size: 40px; }
}

/* ---------------------------------------------------------------- EASTER EGGS */
.egg-toast {
  position: fixed; left: 50%; bottom: 76px; z-index: 120; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; background: var(--fg); color: var(--bg); white-space: nowrap; transition: opacity 0.3s, transform 0.4s var(--ease);
}
.egg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .egg-toast { white-space: normal; width: calc(100vw - 32px); text-align: center; } }

/* 99 Luftballons */
.balloons { position: fixed; inset: 0; z-index: 110; pointer-events: none; overflow: hidden; }
.balloons i {
  position: absolute; bottom: -80px; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 28%, #ff7a7a, #e01818 55%, #8f0000);
  animation: float linear forwards, sway ease-in-out infinite alternate;
}
.balloons i::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 46px; background: rgba(244, 245, 246, 0.35); }
@keyframes float { to { transform: translateY(calc(-100vh - 160px)); } }
@keyframes sway { from { margin-left: -14px; } to { margin-left: 14px; } }

/* VHS tape */
/* On the root element: a filter on body would pin every fixed element to the page instead of the screen. */
html.vhs { filter: contrast(1.12) saturate(1.5) blur(0.35px); }
html.vhs main { animation: vhs-jitter 0.2s steps(2) infinite; }
@keyframes vhs-jitter { 50% { transform: translate(0.6px, -0.4px); } }
.vhs-osd {
  position: fixed; inset: 0; z-index: 115; pointer-events: none; font: 400 clamp(18px, 2.4vw, 30px) / 1 var(--mono);
  color: #fff; text-shadow: 2px 0 rgba(255, 0, 60, 0.7), -2px 0 rgba(0, 200, 255, 0.7);
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
}
.vhs-osd span { position: absolute; top: 34px; left: 40px; }
.vhs-osd .vhs-sp { left: auto; right: 40px; }
.vhs-osd b { font-weight: 400; }
.vhs-band { position: absolute; left: 0; right: 0; height: 26px; background: linear-gradient(transparent, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.3), transparent); animation: band 2.6s linear infinite; }
@keyframes band { from { top: -30px; } to { top: 100%; } }

/* Archive: the hidden ninety-ninth track. */
.row-99 a { color: var(--fg); animation: glitch 0.4s steps(4) 1; }
.row-99 .n, .row-99 .d { background: var(--fg); color: var(--bg); }

.notfound .coin { color: var(--faint); font-size: 11px; }

/* 99 ARCADE */
html.arcade-open { overflow: hidden; }
.arcade {
  position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, 0.96); display: grid; place-items: center; align-content: center; gap: 18px;
  padding: 24px var(--gutter); animation: arcade-in 0.45s var(--ease);
}
@keyframes arcade-in { from { opacity: 0; transform: scale(1.04); filter: brightness(3); } }
.arcade-screen { position: relative; width: min(100%, calc((100svh - 120px) * 4 / 3), 960px); aspect-ratio: 4 / 3; }
.arcade canvas { display: block; width: 100%; height: 100%; touch-action: none; border-radius: 3% / 4%; }
.arcade-scan {
  position: absolute; inset: 0; pointer-events: none; border-radius: 3% / 4%;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.28) 2px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.55));
}
.arcade .frame { inset: -14px; }
.arcade-bar { width: min(100%, calc((100svh - 120px) * 4 / 3), 960px); display: flex; justify-content: space-between; color: var(--dim); }
.arcade-bar button:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-snap-type: none; }
}
