:root {
  --paper: #f3f0e8;
  --ink: #141414;
  --mute: #77736c;
  --line: #e4e1db;
  --hover: #ff6500;                 /* hover colour: the ribbon orange from the BKK renders */
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gut: clamp(16px, 3vw, 40px);
}
* { box-sizing: border-box; font-style: normal !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); }
a { color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }

/* ---------- landing: blank, everything sits on the bottom edge ---------- */
.home .landing { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; padding: var(--gut); }
.home .foot { width: 100%; border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 28px; }
.tagline { margin: 0; max-width: 46ch; font: 400 clamp(20px, 2.1vw, 28px)/1.25 var(--sans); letter-spacing: -0.01em; }
@media (min-width: 761px) { .tagline { max-width: none; } }   /* desktop: the tagline runs on one line */
.cats { display: flex; flex-wrap: wrap; gap: 4px 0; }
.cats a { flex: 1 1 0; min-width: max-content; padding-right: 28px; text-decoration: none;
  font: 500 clamp(22px, 3.4vw, 52px)/1 var(--sans); letter-spacing: -0.03em; }
.cats a:hover { color: var(--hover); }
@media (max-width: 700px) { .cats { flex-direction: column; gap: 10px; } }

/* ---------- header ---------- */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding: 18px var(--gut); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 5; }
.mark { font: 500 20px/1 var(--sans); letter-spacing: -0.02em; text-decoration: none; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.nav a { text-decoration: none; color: var(--mute); }
.nav a[aria-current] { color: var(--ink); }
.nav a:hover { color: var(--hover); }

/* ---------- gallery ---------- */
.gallery { padding: var(--gut); }
h1 { font: 500 clamp(34px, 6vw, 88px)/0.95 var(--sans); letter-spacing: -0.04em; margin: 24px 0 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 40px 24px; }
.card { text-decoration: none; display: grid; gap: 10px; }
.thumb { aspect-ratio: 202 / 158; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .thumb img { transform: scale(1.03); }
.card span { font-size: 15px; }
.card:hover span { color: var(--hover); }

/* ---------- project ---------- */
.project { padding: 0 var(--gut) 60px; max-width: 1400px; margin: 0 auto; }
.phead { padding: 24px 0 8px; }
.phead h1 { margin: 4px 0 24px; }
.eyebrow { margin: 0; font-size: 14px; color: var(--mute); }
.b { margin: 0 auto 32px; }
.text { max-width: 680px; margin-left: 0; font-size: 17px; }
.text p { margin: 0 0 .9em; }
.text a { text-underline-offset: 3px; }
.media { width: min(100%, max(var(--w, 100%), 560px)); }
.media img + img { margin-top: 16px; }
.frame { position: relative; height: 0; background: #000; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid video { width: 100%; background: #000; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; align-items: start; margin-bottom: 32px; }
.row .b { width: 100%; margin: 0; }
.grid { columns: 3 260px; column-gap: 12px; }
.grid img { width: 100%; margin: 0 0 12px; break-inside: avoid; }
.grid img + img { margin-top: 0; }
[data-zoom] { cursor: zoom-in; }
/* buttons: no outline, just three small squares tucked into the top left corner and three into the bottom right, each a
   different size, framing the label. On hover the squares fill orange; the label itself stays put. */
.btn { position: relative; display: inline-block; padding: 16px 26px; text-decoration: none; font-size: 14px; color: var(--ink); }
.btn-sq { position: absolute; width: 16px; height: 16px; pointer-events: none; }
.btn-sq.tl { top: 0; left: 0; }
.btn-sq.br { bottom: 0; right: 0; transform: rotate(180deg); }
.btn-sq i { position: absolute; box-sizing: border-box; border: 1px solid var(--ink); background: transparent; transition: background-color .15s, border-color .15s; }
.btn-sq i:nth-child(1) { top: 0; left: 0; width: 7px; height: 7px; }      /* the corner */
.btn-sq i:nth-child(2) { top: 0; left: 9px; width: 5px; height: 5px; }    /* along the top edge */
.btn-sq i:nth-child(3) { top: 9px; left: 0; width: 4px; height: 4px; }    /* down the side */
.btn:hover { color: var(--ink); }
.btn:hover .btn-sq i { background: var(--hover); border-color: var(--hover); }
.pager { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; margin-top: 56px; font-size: 14px; }
.pager a { text-decoration: none; color: var(--mute); }
.pager a:hover { color: var(--hover); }
.text a:hover, .mark:hover { color: var(--hover); }
a:hover { text-decoration: none; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; background: rgba(243,240,232,.97); display: flex; align-items: center; justify-content: center;
  padding: 56px 72px; z-index: 20; cursor: zoom-out; }
.lb img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; cursor: default; user-select: none; }
:where(.lb) button { all: unset; cursor: pointer; color: var(--ink); font: 400 15px/1 var(--sans); }
.lb button:hover { color: var(--hover); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 34px; padding: 24px 22px; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }
.lb-close { position: absolute; top: 18px; right: 24px; }
.lb-count { position: absolute; top: 18px; left: 24px; font-size: 15px; color: var(--mute); }
@media (max-width: 560px) { .lb { padding: 56px 12px; } .lb-nav { top: auto; bottom: 8px; transform: none; } }

@media (max-width: 700px) {
  .top { position: static; }
  .nav { gap: 6px 16px; }
}

/* ---------- landing scene ---------- */
.stage3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.home .landing { position: relative; z-index: 1; }
/* the landing page never scrolls or bounces (phones especially): the menu stays pinned to the bottom of the screen.
   touch-action stops the page panning under a finger; taps on the links and the touch warp in scene.js still work. */
html:has(body.home), body.home { height: 100%; overflow: hidden; overscroll-behavior: none; }
.home .landing { position: fixed; inset: 0; min-height: 0; touch-action: none; }
.home .foot { background: var(--ink); color: var(--paper); }      /* the menu block at the bottom, inverted: dark with light words */
/* the rule above the words runs the full width of the page; the words keep their margin */
.home .landing { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.home .foot { padding-left: var(--gut); padding-right: var(--gut); padding-bottom: var(--gut); }

/* ---------- video player: nothing ever darkens the picture ---------- */
.player { position: relative; line-height: 0; }
.player video { width: 100%; cursor: pointer; }
:where(.player) button { all: unset; cursor: pointer; display: grid; place-items: center; }   /* :where keeps this reset weak */
.player svg { width: 14px; height: 14px; fill: currentColor; }
.pl-big { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper); color: var(--ink); box-shadow: 0 2px 14px rgba(0, 0, 0, .12); transition: opacity .2s, scale .2s; }
.pl-big svg { width: 20px; height: 20px; margin-left: 3px; }
.pl-big:hover { color: var(--hover); scale: 1.06; }
.player.playing .pl-big { opacity: 0; pointer-events: none; }
.pl-bar { position: absolute; left: 10px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 999px;
  background: var(--paper); color: var(--ink); font: 500 12px/1 var(--sans); transition: opacity .35s; }
.pl-bar button:hover { color: var(--hover); }
.pl-time { font-variant-numeric: tabular-nums; min-width: 72px; }
.pl-track { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; cursor: pointer; background: rgba(243, 240, 232, .35); transition: opacity .35s; }
.pl-track i { display: block; height: 100%; width: 0; background: var(--paper); }
/* the bar and progress line show while paused; once playing they fade away after a few seconds without a move, a tap
   or a key (.idle, site.js), and so does the cursor. A move over the video or a tap brings them back. */
.player.idle .pl-bar, .player.idle .pl-track { opacity: 0; pointer-events: none; }
.player.idle, .player.idle video { cursor: none; }
.player:fullscreen { display: grid; place-items: center; background: #000; }
.player:fullscreen video { height: 100%; object-fit: contain; }

/* ---------- top bar on the inner pages: inverted, like the menu block on the landing page ---------- */
.top { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.nav a { color: #a8a49c; }
.nav a[aria-current] { color: var(--paper); }
.nav a:hover, .mark:hover { color: var(--hover); }

/* side-by-side media (e.g. the portrait videos): three to a row, two on a tablet, one on a phone */
.row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
/* NFThing and The Room Studios on desktop: the portrait reels one at a time down the middle, with space between them.
   Each is at most 420px wide, and narrower on a short screen so a whole 9:16 reel fits in the window. */
@media (min-width: 761px) {
  .p-nfthing .row, .p-the-room-studios .row {
    grid-template-columns: minmax(0, min(420px, calc((100vh - 140px) * 9 / 16))); justify-content: center; row-gap: 72px; margin: 72px 0; }
}

/* ---------- click-to-load embeds: poster + play button until pressed ---------- */
.embed { cursor: pointer; }
.embed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
:where(.embed) button { all: unset; cursor: pointer; display: grid; place-items: center; }
.embed svg { fill: currentColor; }
.embed:hover .pl-big { color: var(--hover); scale: 1.06; }
.embed .pl-big, .player .pl-big { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper); color: var(--ink); box-shadow: 0 2px 14px rgba(0, 0, 0, .12); transition: opacity .2s, scale .2s; }
.embed .pl-big svg { width: 20px; height: 20px; margin-left: 3px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--hover); }
/* the room studios: the four reels at the bottom in a 2 x 2 grid, all one size, centred on the page */
/* category pages on a phone: projects two across, titles small enough to fit under the narrower thumbnails */
@media (max-width: 760px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .card { gap: 6px; align-content: start; }
  .card span { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
}

/* loading screen: "loading" spread corner to corner, top left to bottom right, each letter lit in turn */
/* the loader covers the page from the very first paint, so nothing half-loaded shows; the letters only appear if loading
   takes a moment (.show, site.js). .gone fades it away. The 12 s animation is a safety net if the script never runs. */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--paper); transition: opacity .35s, visibility 0s .35s;
  animation: loader-safety 0s 12s forwards; }
.loader.gone { opacity: 0; visibility: hidden; }
.loader:not(.show) span { visibility: hidden; }
@keyframes loader-safety { to { opacity: 0; visibility: hidden; } }
.loader span { position: absolute; --pad: 24px; font-size: 28px; line-height: 1; color: var(--ink);
  left: calc(var(--pad) + (100vw - 2 * var(--pad) - 0.6em) * var(--i) / 6);
  top: calc(var(--pad) + (100dvh - 2 * var(--pad) - 1em) * var(--i) / 6);
  opacity: .12; animation: loader-blink 1.4s linear infinite; animation-delay: calc(var(--i) * 0.2s); }
/* each letter lights up in a primary colour as it blinks (red, yellow, blue in turn), then fades back to ink */
.loader span:nth-child(3n+1) { --blink: #e8261c; } .loader span:nth-child(3n+2) { --blink: #ffc400; } .loader span:nth-child(3n) { --blink: #1f3bff; }
@keyframes loader-blink { 0% { opacity: 1; color: var(--blink); } 22% { opacity: .12; color: var(--ink); } 100% { opacity: .12; color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .loader span { animation: none; opacity: .6; } }

/* landing: the 3D scene shot like a 2000s film. A grade on the scene itself (a little more contrast, colour a touch
   softer and warmer), then two layers over it, under the words: towards the edges of the frame a slight softening and a
   gentle vignette, as a lens of the time would give, and fine moving grain on top. Each layer sits directly over the
   canvas (not inside a shared box), so the grain really multiplies into the picture. Grain tile from scene.js. */
.stage3d { filter: contrast(1.06) saturate(.9) sepia(.08); }
.film-edge, .film-grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.film-edge {
  -webkit-backdrop-filter: blur(1.6px); backdrop-filter: blur(1.6px);
  background: radial-gradient(ellipse 78% 72% at 50% 45%, rgba(60,45,30,0) 50%, rgba(60,45,30,.12) 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 45%, transparent 52%, #000 100%);
          mask-image: radial-gradient(ellipse 78% 72% at 50% 45%, transparent 52%, #000 100%); }
.film-grain { background-image: var(--grain); background-size: 160px 160px; mix-blend-mode: multiply; opacity: .17;
  animation: film-grain .5s steps(1) infinite; }
@keyframes film-grain {
  0% { background-position: 0 0; } 12% { background-position: -37px 21px; } 25% { background-position: 52px -48px; }
  37% { background-position: -61px -13px; } 50% { background-position: 18px 64px; } 62% { background-position: -24px -70px; }
  75% { background-position: 71px 33px; } 87% { background-position: -8px -29px; } }
@media (prefers-reduced-motion: reduce) { .film-grain { animation: none; } }
@media (max-width: 760px) { .film-grain { opacity: .09; } }   /* phones: about half the grain, it reads stronger on a small screen */

/* the gallery pages' cubes (cubes-strip.js): a see-through strip along the bottom of the screen, over the cards but
   never in the way of a click */
.cube-strip { position: fixed; left: 0; bottom: 0; width: 100%; z-index: 5; pointer-events: none; display: block; }
