/* ==========================================================================
   45giristudio — stylesheet

   1  Tokens          7  Visuals (project tiles)
   7b Tools / Software
   2  Base            8  About
   3  Header          9  Manifesto
   4  Hero           10  Contact (reveal panel + “?” button)
   5  Section head   11  Footer
   6  Work grid      12  Project modal
                     13  Reduced motion

   Approach: small-screen styles first, then one `min-width: 801px` block per
   component for the desktop layout. 801px is the old 800px breakpoint, so the
   desktop view is unchanged. Big type is sized from its container (cqw units)
   so it can never overflow, whatever the screen.
   ========================================================================== */


/* 0 — Fonts ----------------------------------------------------------------- */
/* Self-hosted so no third-party connection stands between the page and its first text.
   Inter is a variable font: one file covers every weight from 400 to 900. */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/inter-var.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-mono-500.woff2") format("woff2");
}


/* 1 — Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --bg: #0a0a09;
  --fg: #f0eee8;
  --fg-soft: #c6c4bd;
  --muted: #85847e;
  --muted-dim: #7d7b75;           /* ≥ 4.5:1 on --bg, used for the quietest text */
  --line: #282824;
  --acid: #d7ff35;

  --font-sans: Inter, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  --gutter: clamp(1rem, 0.4rem + 2.5vw, 1.75rem);   /* 16px phones → 28px desktop */
  --card-radius: clamp(8px, 0.9vw, 14px);           /* softened corners on the work tiles */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* 2 — Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* The modal is a <dialog>; stop the page scrolling behind it. */
html:has(.modal[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  overflow-x: clip;               /* safety net only — nothing should overflow */
}

h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }

/* Buttons don't inherit type by default; make them behave like text. */
button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Film grain over the whole page (was an empty <div class="noise">). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* Small uppercase mono labels used across the site. */
.site-header__status,
.hero__meta,
.hero__scroll,
.section-head,
.project__info,
.site-footer,
.modal__kicker,
.modal__tech {
  font-family: var(--font-mono);
  text-transform: uppercase;
}


/* 3 — Header ---------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 74px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: difference;
  color: #fff;
  transition: transform 0.35s ease;
}

.site-header.is-hidden { transform: translateY(-100%); }
.site-header:focus-within { transform: none; }      /* never hide it from keyboard users */

.site-header a {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.site-header__logo-mark {
  width: 13px;
  height: 13px;
  border: 1px solid #fff;
  border-radius: 50%;
}

.site-header__nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.site-header__status {
  display: none;                  /* shown from 561px up — it doesn't fit next to the nav on phones */
  margin: 0 0 0 36px;
  font-size: 0.625rem;
}

.site-header__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #fff;
}

@media (min-width: 561px) {
  .site-header__status { display: block; }
}


/* 4 — Hero ------------------------------------------------------------------ */
/* Phones/tablets portrait: a simple vertical stack, so text can never overlap.
   Desktop (≥ 801px): the original free-floating composition. */

.hero {
  --hero-size: 38vw;              /* every size inside the title derives from this */

  /* Background photo and the dark wash over it. The wash is per image, because nebula2 is
     much brighter than nebula1 and the white type needs more cover on it. */
  --hero-bg: url("portfolio/nebula1.webp");
  /* The wash slider writes --hero-wash-user, which then wins over the per-photo default
     below; until it is touched each photograph keeps its own. */
  --hero-wash-base: 0.56;
  --hero-wash: var(--hero-wash-user, var(--hero-wash-base));

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(100vh, 700px);
  min-height: max(100svh, 700px);   /* grows if the content is taller (e.g. a phone held sideways) */
  padding: 100px var(--gutter) 32px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

/* The photograph and the wash over it are separate layers, because brightness and saturation
   have to reach the image alone — a filter on .hero itself would catch the type as well. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  background: var(--hero-bg) center / cover no-repeat;
  filter: brightness(var(--hero-brightness, 1)) saturate(var(--hero-saturation, 1));
}

.hero::after {
  background: linear-gradient(to bottom,
    rgb(10 10 9 / calc(var(--hero-wash) + 0.16)) 0%,
    rgb(10 10 9 / var(--hero-wash)) 24%,
    rgb(10 10 9 / calc(var(--hero-wash) + 0.05)) 52%,
    rgb(10 10 9 / 0.9) 88%,
    var(--bg) 100%);
}

/* the second image */
.hero:has(.hero__bg-toggle:checked) {
  --hero-bg: url("portfolio/nebula2.webp");
  --hero-wash-base: 0.72;         /* the brighter photograph needs more cover */
}

/* The switcher shows the image you'd get by pressing it, and sits inside the hero, so it
   scrolls away with the first screen. Where supported it also fades as it leaves. */
.hero__bg-switch {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 28px;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #fff;
  border-radius: 50%;
  /* a 160px thumbnail: the swatch is 44px, the full photo is only fetched if chosen */
  background: #15151a url("portfolio/nebula2-thumb.webp") center / cover no-repeat;
  box-shadow: 0 0 0 3px rgb(8 8 8 / 0.7);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.45s ease, scale 0.18s ease;
}

/* script.js adds .is-gone once the first screen has mostly scrolled past */
.hero__bg-switch.is-gone {
  opacity: 0;
  pointer-events: none;
}

.hero:has(.hero__bg-toggle:checked) .hero__bg-switch {
  background-image: url("portfolio/nebula1.webp");
}

@media (hover: hover) {
  .hero__bg-switch:hover { scale: 1.1; }
}

.hero__bg-toggle:focus-visible + .hero__bg-switch {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.hero__meta,
.hero__title,
.hero__copy,
.hero__scroll {
  position: relative;
  z-index: 1;                     /* above the background photo */
}

.hero__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--fg-soft);          /* was --muted: too dim once a photo sits behind it */
}

.hero__title {
  order: 2;
  margin: calc(var(--hero-size) * 0.5) 0 1.5rem;   /* top margin = room for the mark, which pokes upward */
  font-size: var(--hero-size);
  font-weight: 900;
  line-height: 0.76;
  letter-spacing: -0.105em;
  text-align: center;             /* phones: everything centred */
}

.hero__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.08em;
  height: 0.78em;
  margin-inline: auto;
}

.hero__mark img {
  width: 1.02em;
  height: 1.02em;
  object-fit: contain;
  filter: invert(1);              /* black SVG artwork becomes white on the dark hero */
  translate: -0.014em -0.229em;   /* optical nudge, in em so it scales with the title */
}

.hero__giri {
  display: block;
  letter-spacing: -0.037em;
  font-kerning: none;
  white-space: nowrap;
}

.hero__giri-kern { margin-left: 0.018em; }    /* G–I optical spacing */

.hero__studio {
  display: block;
  margin: 0.22em 0 0;
  font-size: 0.31em;
  letter-spacing: -0.05em;
}

.hero__reg {
  margin-left: 0.14em;
  font-size: 0.32em;
  vertical-align: top;
}

.hero__copy {
  order: 1;
  max-width: 22rem;
  margin: auto auto 0;            /* auto top margin shares the free space with .hero__scroll */
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.55;
  color: var(--fg-soft);
}

.hero__scroll {
  order: 3;
  align-self: center;
  margin-top: auto;               /* with .hero__copy's auto margin, centres copy + title in the free space */
  font-size: 0.625rem;
  color: #fff;
}

.hero__scroll span {
  margin-right: 8px;
  font-size: 1rem;
}

@media (min-width: 801px) {
  /* Sized from the width AND the height: on a wide but short window the title would otherwise
     grow tall enough to run up under the “Independent visual studio” row. */
  .hero { --hero-size: clamp(6.25rem, min(20vw, 32vh), 19.375rem); }

  .hero__title {
    position: absolute;
    left: 2vw;
    bottom: 8vh;
    margin: 0;
    text-align: left;
  }

  /* One vertical signature: 45 centred over GIRI, with STUDIO® tucked in alongside GIRI
     on the same baseline. Phones keep the centred stack above.

     A two-column grid does the centring: the first column is sized by its widest item,
     which is GIRI, so `justify-self: center` puts the 45 exactly over the wordmark with
     no magic numbers — it stays centred if the type size or the artwork ever changes. */
  .hero__title {
    display: grid;
    grid-template-areas:
      "mark   ."
      "giri studio";
    grid-template-columns: max-content max-content;
    justify-content: start;
    align-items: baseline;
  }

  .hero__mark {
    grid-area: mark;
    justify-self: center;         /* centred on GIRI's column */
    margin-inline: 0;
  }

  .hero__giri { grid-area: giri; margin-left: 0; }

  .hero__studio {
    grid-area: studio;
    margin: 0 0 0 0.12em;
    font-size: 0.28em;
  }

  .hero__copy {
    position: absolute;
    right: 5vw;
    top: 50%;                     /* centred on the hero's height, beside the galaxy */
    bottom: auto;
    translate: 0 -50%;
    width: min(360px, 32vw);
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .hero__scroll {
    position: absolute;
    align-self: auto;
    left: var(--gutter);
    bottom: 31px;
  }

}


/* 4b — Hero image controls --------------------------------------------------- */

/* WASH fades the dark gradient over the photograph; BRIGHTNESS and SATURATION filter the
   photograph itself (see .hero::before / ::after above). All three write a custom property,
   so the JS stays three one-line formulas and the look lives entirely here.

   Phones first: the three rows collapse into a shallow panel behind the IMAGE trigger that
   sits in the metadata row. Desktop turns the same markup into a rail in normal flow,
   directly under the metadata — no magic offsets, so it follows the metadata wherever it
   goes. */
.img-ctl {
  position: absolute;
  z-index: 3;                     /* over the photo layers (0) and the hero content (1) */
  top: calc(100px + 1.5rem);      /* hero padding-top, clearing the metadata row */
  left: var(--gutter);
  right: var(--gutter);
  /* One grid for all three rows — the items below go `display: contents`, so every label,
     track and readout shares a column and the three tracks come out the same length.
     Sizing each row on its own would stagger them, because SATURATION is far wider
     than WASH. */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 3px;                   /* shallow on purpose: keep the photograph visible */
  padding: 8px 11px 9px;
  background: rgb(10 10 9 / 0.46);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 3px;
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;

  /* collapsed until the trigger is pressed. visibility, not display, so the transition runs
     and the sliders stay out of the tab order while hidden. */
  visibility: hidden;
  opacity: 0;
  translate: 0 -5px;
  transition: opacity 0.2s ease, translate 0.2s ease, visibility 0.2s;
}

.img-ctl.is-open {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
}

.img-ctl__item {
  display: contents;
  margin: 0;
}

/* Reset sits above WASH on phones as a row of its own, and at the far end of the rail on
   desktop, so the WASH label still lines up with the metadata above it. */
.img-ctl__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 3px;
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--fg-soft);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.img-ctl__reset:hover,
.img-ctl__reset:focus-visible { opacity: 1; }

/* the trigger's glyph is 16x12, this one is square — size it so it is not letterboxed */
.img-ctl__reset .img-ctl__icon { width: 11px; height: 11px; }

.img-ctl__name {
  white-space: nowrap;
  color: var(--fg-soft);
  opacity: 0.74;
}

.img-ctl__val {
  min-width: 2.9em;
  text-align: right;
  color: var(--fg-soft);
  opacity: 0.52;
  font-variant-numeric: tabular-nums;   /* so the row does not twitch while dragging */
}

/* The slider. Appearance is reset on both the track and the thumb, otherwise each engine
   draws its own chrome; WebKit and Firefox need separate pseudo-elements for each. */
.img-ctl__slider {
  appearance: none;
  width: 100%;
  height: 12px;                   /* a comfortable touch target around a hairline track */
  margin: 0;
  background: none;
  cursor: ew-resize;
}

/* The two track pseudo-elements must stay in separate rules: an engine throws away a whole
   rule whose selector list contains one it does not recognise, so grouping them means
   neither browser draws a track at all. The thumb rules below are split for the same reason. */
.img-ctl__slider::-webkit-slider-runnable-track {
  height: 1px;
  background: rgb(255 255 255 / 0.3);
}

.img-ctl__slider::-moz-range-track {
  height: 1px;
  background: rgb(255 255 255 / 0.3);
}

.img-ctl__slider::-webkit-slider-thumb {
  appearance: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;               /* WebKit centres the thumb on the track by hand */
  border: 0;
  border-radius: 50%;
  background: var(--fg-soft);
  transition: scale 0.15s ease, background-color 0.15s ease;
}

.img-ctl__slider::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--fg-soft);
  transition: scale 0.15s ease, background-color 0.15s ease;
}

.img-ctl__slider:hover::-webkit-slider-thumb,
.img-ctl__slider:active::-webkit-slider-thumb { background: #fff; scale: 1.25; }
.img-ctl__slider:hover::-moz-range-thumb,
.img-ctl__slider:active::-moz-range-thumb { background: #fff; scale: 1.25; }

.img-ctl__slider:focus-visible { outline: none; }
.img-ctl__slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgb(255 255 255 / 0.3); }
.img-ctl__slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgb(255 255 255 / 0.3); }

/* The phone trigger, a third item in the metadata row. */
.img-ctl__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  color: inherit;
  cursor: pointer;
}

.img-ctl__toggle[aria-expanded="true"] { color: #fff; }
.img-ctl__icon { width: 14px; height: 11px; flex: none; }


@media (min-width: 801px) {
  /* The metadata row keeps the studio line at the left, then pushes the year and the trigger
     together against the right gutter — the auto margin eats the free space that
     space-between would otherwise put between them. */
  .hero__meta { gap: 20px; }
  .hero__meta > span + span { margin-left: auto; }

  /* Back into normal flow, so it sits under the metadata row without a measured offset.
     The metadata is the hero's only in-flow child on desktop — the title, copy and scroll
     cue are all absolutely positioned — so nothing else shifts. */
  /* The rail spans the hero gutter to gutter: three equal groups, with reset sized to its
     own content at the end so it never takes a quarter of the width. */
  .img-ctl {
    position: static;
    margin-top: 20px;
    grid-template-columns: repeat(3, 1fr) max-content;
    gap: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
  }

  /* One grid per group again, so the three sit side by side with a hairline between.
     first-of-type, not first-child: the reset button is the panel's first child now. */
  .img-ctl__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding-inline: clamp(16px, 2.2vw, 30px);
  }
  /* Both of these need an explicit row. The reset button is first in the markup and claims
     column 4; without a row on everything, auto-placement parks the cursor at column 4 and
     wraps the three sliders onto a second row below it. */
  .img-ctl__item { grid-row: 1; }
  .img-ctl__item:first-of-type { padding-left: 0; }
  .img-ctl__item + .img-ctl__item,
  .img-ctl__reset { border-left: 1px solid rgb(255 255 255 / 0.15); }

  .img-ctl__reset {
    grid-area: 1 / 4;              /* the three sliders then fill columns 1–3 of the same row */
    align-self: center;
    margin: 0;
    padding: 0 0 0 clamp(16px, 2.2vw, 30px);
    border-bottom: 0;
  }
}


/* 5 — Section head ---------------------------------------------------------- */

.section-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.section-head--centered {
  align-items: center;
  justify-content: center;
  min-height: 28px;
  text-align: center;
}


/* 5b — Motion / Case studies ------------------------------------------------
   The doorway to the case-study page, between the manifesto and the work grid.
   Phones centre the type and stack the stills: side by side they come out about
   170px wide, too small to read the pages they are advertising. */

.motion {
  display: block;
  padding: 0 var(--gutter);
  color: inherit;
  text-decoration: none;
}

/* Unlike the other section heads, this one has no section padding above it — the
   manifesto ends and the rule begins — so the label sat hard against the top of its own
   band with all 17px of air below it. Padding both sides instead centres it between the
   block above and its rule, and opens the band up a little. */
.motion__head {
  display: flex;
  justify-content: space-between;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.motion__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding: 28px 0 34px;
}

.motion__copy { display: flex; flex-direction: column; align-items: center; text-align: center; }

.motion__title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.motion__sub {
  margin: 14px 0 22px;
  max-width: 34ch;
  font-size: 0.95rem;
  color: var(--fg-soft);
}

.motion__enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--card-radius);
  background: #fff;
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.25s ease;
}

.motion__pair { display: grid; gap: 18px; }
.motion figure { margin: 0; }

.motion img {
  display: block;
  width: 100%;
  /* height:auto is load-bearing. The width/height attributes on the <img> exist to reserve
     space before the file arrives, but they also set a presentational height — and a box
     with a definite width AND height ignores aspect-ratio entirely, so without this the
     stills render 383x450 and object-fit crops the middle out of them. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--card-radius);
  transition: opacity 0.4s ease;
}

.motion figcaption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 801px) {
  .motion__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
    padding: 38px 0 46px;
  }
  .motion__copy { align-items: flex-start; text-align: left; justify-content: center; }
  .motion__enter { justify-content: space-between; }
  .motion__pair { grid-template-columns: 1fr 1fr; gap: 14px; }
  .motion figcaption { text-align: left; }
}

/* The whole block is the link, so a hover anywhere in it is a hover on the link — which is
   why lighting the button up in acid read as a glitch from across the page. Both the button
   and the stills just dim slightly instead, so the block responds as one quiet unit. */
@media (hover: hover) {
  .motion:hover .motion__enter { background: #e2e2de; }
  .motion:hover img { opacity: 0.86; }
}


/* 5c — Case studies page (/motion) -------------------------------------------
   Shares this stylesheet with the homepage so both pages come from one cached file.
   The mockup this follows was white; it is inverted here to the studio palette, and
   it uses Inter and DM Mono rather than adding webfonts to a site that currently
   makes no third-party requests at all. */

.case {
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px var(--gutter) 90px;
}

.case__kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.case__title {
  margin: 22px 0 0;
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.case__lead {
  margin: 26px 0 0;
  max-width: 54ch;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  color: var(--fg-soft);
}

/* Each study: media on the left, the Premise/Process/Result table on the right. */
.case__item {
  display: grid;
  gap: 30px;
  margin-top: 96px;
  padding-top: 38px;
  border-top: 1px solid var(--fg);
}

.case__media figure { position: relative; margin: 0; }

.case__media img {
  display: block;
  width: 100%;
  height: auto;              /* see the note on .motion img — the width/height attributes
                                would otherwise defeat aspect-ratio */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--card-radius);
  background: #111;
}

/* The reel itself. Poster and video are stacked in a 16:9 box; the video stays transparent
   until it is actually playing, so a reel that never starts shows the still rather than a
   black rectangle — the same lesson as the homepage tiles. Native controls appear on first
   play rather than up front, so they do not sit over the still. */
.case__player {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #111;
}

.case__player img,
.case__player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case__player video { opacity: 0; transition: opacity 0.45s ease; }
.case__player.is-live video { opacity: 1; }

.case__play {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s ease, background-color 0.25s ease;
}

.case__play svg { width: 12px; height: 12px; fill: currentColor; }
.case__player.is-live .case__play { opacity: 0; pointer-events: none; }

@media (hover: hover) {
  .case__play:hover { background: #e2e2de; }
}

.case__caption,
.case__credit {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.case__num {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.case__name {
  margin: 10px 0 0;
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.case__tagline { margin: 10px 0 0; font-size: 1.05rem; color: var(--fg-soft); }

/* A description list rather than an ordered list: these really are term/definition pairs,
   which also means a screen reader announces "Premise" as the label for its sentence. */
.case__steps { margin: 30px 0 0; }

.case__steps dt {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.case__steps dd {
  margin: 0 0 18px;
  padding-top: 6px;
  font-size: 1rem;
  line-height: 1.45;
}

.case__steps dd:last-of-type { border-bottom: 1px solid var(--line); padding-bottom: 18px; }

.case__credit { margin-top: 22px; }

/* 03 — the rig. A raised panel so it reads as a chapter rather than a third case study. */
.rig {
  margin-top: 96px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: var(--card-radius);
  background: #121211;
}

.rig__head { display: grid; gap: 24px; }

.rig__title {
  margin: 14px 0 0;
  font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.rig__lead { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--fg-soft); }

.rig figure { margin: 0; }

.rig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--card-radius) / 1.5);
  background: #1d1d1d;
}

.rig figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.rig__pair,
.rig__split { display: grid; gap: 24px; margin-top: 40px; }
.rig__wide { margin-top: 40px; }

.rig__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 26px; }

.rig__list li { border-top: 1px solid var(--fg); padding-top: 14px; display: grid; gap: 6px; }
.rig__list b { font-size: 1.15rem; }
.rig__list span { font-size: 0.95rem; line-height: 1.5; color: var(--fg-soft); }

.case__back {
  display: inline-block;
  margin-top: 72px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

@media (hover: hover) {
  .case__back:hover { color: #fff; }
}

@media (min-width: 801px) {
  .case { padding-top: 160px; }
  .case__item { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: start; }
  .rig__head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: end; }
  .rig__pair { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; }
  .rig__split { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
}


/* 6 — Work grid ------------------------------------------------------------- */

.work { padding: 25px var(--gutter) 0; }   /* the Tools board follows and nearly touches it */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 22px;
}

.project { cursor: pointer; }

.project__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 13px 0 28px;
  font-size: 0.625rem;
  color: var(--muted);
}

.project__info h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg);
  text-align: right;
}

.project__info > :last-child { display: none; }     /* tech line is on the modal for phones */

/* The Tools board follows the last tile, so its caption keeps only a small gap. */
.project:last-child .project__info { padding-bottom: 8px; }

.project__open {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

@media (min-width: 801px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .project--feature,
  .project--wide { grid-column: 1 / -1; }

  .project__info {
    grid-template-columns: 1fr 1.3fr 1fr;
    padding-bottom: 38px;
  }

  .project__info h2 { text-align: center; }

  .project__info > :last-child {
    display: block;
    text-align: right;
  }
}


/* 7 — Visuals (project tiles) ------------------------------------------------ */
/* Each tile is a size container: type and shapes inside use cqw/cqh so they
   scale with the tile itself, not with the window. */

.visual {
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: #111;
  container-type: size;
  aspect-ratio: 1;                /* square on phones */
  transition: transform 0.7s var(--ease-out);
}

/* Every autoplay tile carries a still underneath its video. If playback never starts — a
   phone with Reduce Motion switched on, a slow connection, a decode that fails — the tile
   shows this frame instead of an empty black box. Without it there is nothing to paint:
   the video sits at readyState 0 with no frame in existence, and you see the tile's own
   background colour. The video stays transparent until it is genuinely running. */
.visual__media[data-autoplay] {
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}

.visual.is-playing .visual__media[data-autoplay] { opacity: 1; }

.visual__media {                  /* video + photos fill the tile */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 801px) {
  .visual {
    aspect-ratio: auto;
    height: clamp(430px, 45vw, 560px);
  }
  .project--feature .visual { height: clamp(430px, 58vw, 720px); }
  .project--wide .visual    { height: clamp(430px, 50vw, 620px); }
}

/* 07 · For the Hungry — the tile takes the shape of its media instead of the grid's.
   Both slides are 1920x1080 artwork whose composition runs to the edges: the crate label
   loses its wordmark to a square phone crop (44% of the width) and its top and bottom to
   the wide desktop frame (20% of the height). A 16:9 frame fits both exactly, so nothing
   is cropped and no letterbox appears. height:auto is needed to beat the fixed height the
   wide tiles take on desktop. */
[data-project="ads"] .visual {
  aspect-ratio: 16 / 9;
  height: auto;
}

/* Its row-mate has to follow it. A 16:9 tile beside a 1.22 one leaves the shorter card's
   caption floating a third of the way up the row with a hole beneath it, which reads as a
   fault rather than a choice. Euphoria's own frame is 16:9 too, so matching it crops
   nothing — it uncovers the rig at the edges that the taller tile was cutting off. Phones
   stack in one column, where nothing has to line up, so the square tile stays there. */
@media (min-width: 801px) {
  [data-project="euphoria"] .visual {
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

/* 06 · Interiors — same reasoning, and here it is not optional. Both slides are 16:9
   artwork, and the first is a composed advert: a square phone crop or the taller desktop
   tile would cut the headline off its own layout. The frame takes the shape of the work. */
[data-project="interiors"] .visual {
  aspect-ratio: 16 / 9;
  height: auto;
}

/* The headline, set in the site's own face rather than baked into the render. Every number
   below is measured from the approved composition and expressed as a share of the frame, so
   the layout holds at any width: cqw for the type (the tile is a size container) and per-cent
   for the positions. The three left values differ by a few tenths because the glyphs do —
   a round S overhangs its box further than a flat-sided P — and matching the ink edges is
   what makes the left margin read as straight. */
.adline {
  position: absolute;
  inset: 0;
  margin: 0;
  color: var(--bg);
  font-family: var(--font-sans);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.adline span {
  position: absolute;
  display: block;
  white-space: nowrap;
}

.adline__kicker  { left: 3.70%; top:  4.86%; font-size:  3.987cqw; letter-spacing: 0.014em; }
.adline__word--a { left: 3.34%; top: 11.52%; font-size: 13.721cqw; letter-spacing: 0.004em; }
.adline__word--b { left: 3.03%; top: 35.44%; font-size: 11.332cqw; letter-spacing: 0.018em; }

@media (hover: hover) {
  .project:hover .visual { transform: scale(0.985); }
}

/* 01 · Liquid Caustics */
.visual--liquid { background: #07100f; }

.visual__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0002, #0005);
  pointer-events: none;
}

/* Draggable image strip + scrubber. Keyed on [data-slider] rather than on a single project,
   because more than one tile uses it now — add data-slider to a .visual and it behaves the
   same way, in the grid and in the modal, with no JS or CSS to change. */
[data-slider] {
  cursor: grab;
  touch-action: pan-y;            /* vertical page scroll still works; horizontal drags go to the slider */
}

[data-slider].is-dragging { cursor: grabbing; }

.slider__track {
  display: flex;
  align-items: center;            /* a slide shorter than the frame letterboxes evenly (the modal) */
  height: 100%;
  transform: translate3d(calc(var(--index, 0) * -100% + var(--drag, 0px)), 0, 0);
  transition: transform 0.55s var(--ease-out);
  will-change: transform;
}

[data-slider].is-dragging .slider__track { transition: none; }

.slider__track > * {
  flex: 0 0 100%;                 /* one slide per frame, whatever element it is */
}

.slider__track img {
  position: static;               /* undo .visual__media — a bare image slide IS the slide */
  user-select: none;
  -webkit-user-drag: none;
}

/* A slide that carries more than the photograph — type laid over it — needs a box of its
   own to position against. Pinning it to the artwork's 16:9 rather than to the frame is
   what keeps the words where they were composed: in the modal the frame is 16:10, and an
   overlay measured against that frame would drift by a thirtieth of the width and scale
   wrong. The slide letterboxes instead, and the type travels with the picture. */
.slide {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
}

.slide .visual__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;              /* aspect matches the file, so nothing is actually cropped */
  user-select: none;
  -webkit-user-drag: none;
}

.slider__scrubber {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 1;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0 22px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: ew-resize;
  touch-action: pan-y;
}

.slider__scrubber::-webkit-slider-runnable-track { height: 1px; background: rgb(255 255 255 / 0.72); }
.slider__scrubber::-moz-range-track              { height: 1px; background: rgb(255 255 255 / 0.72); }

.slider__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -4.5px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--bg);
}

.slider__scrubber::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--bg);
}

.slider__scrubber:focus-visible { outline: none; }
.slider__scrubber:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--acid); outline-offset: 2px; }
.slider__scrubber:focus-visible::-moz-range-thumb     { outline: 2px solid var(--acid); outline-offset: 2px; }

/* 03 · 45 T-Shirt — a vertical clip of the garment in motion. Black, like the footage,
   so there is no flash of another colour before the video has loaded. */
.visual--shirt { background: #000; }

/* 04 · Cycles Temporal Engine */
.visual--temporal {
  display: grid;
  place-items: center;
  background: #050505;
}

.temporal__title {
  position: relative;
  z-index: 1;
  font-size: 14cqw;
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.08em;
}

.frame {
  position: absolute;
  width: 35%;
  height: 62%;
  border: 1px solid #fff4;
  opacity: 0.25;
  transform: skew(-8deg) rotate(-7deg);
}

.frame--1 { left: 10%; top: 18%; }
.frame--2 { left: 33%; top: 15%; }
.frame--3 { left: 56%; top: 12%; }

.scan {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--acid);
  box-shadow: 0 0 20px var(--acid);
  animation: scan 2s ease-in-out infinite;
}

@keyframes scan {                 /* moves with transform (cheap) instead of animating `top` */
  0%, 100% { transform: translateY(15cqh); }
  50%      { transform: translateY(85cqh); }
}

@media (min-width: 801px) {
  .temporal__title { font-size: clamp(2.2rem, 7.2cqw, 6.25rem); }
}

/* 05 · Euphoria */
/* 05 · Euphoria — a clip of the form turning. Black, like the footage, so nothing of
   another colour shows before the video has loaded. */
.visual--euphoria { background: #000; }


/* 7b — Tools / Software ------------------------------------------------------ */
/* A compact monochrome strip. The board is drawn entirely in CSS — a ruled head and four
   corner brackets — so there is no artwork file to keep in step with the layout.
   Each name stays hidden until its mark is hovered or focused; the space for it is always
   reserved, so revealing a name never shifts the row.

   ---- HOW TO CUSTOMISE -------------------------------------------------------
   On .tools:
     --ink         line, type and disc colour
     --tool-size   diameter of each disc
     --bracket     arm length of the corner brackets
   Per mark, in the "Optical balance" block below: --logo-size, the mark's share of its disc.
   Adding or removing a tool: edit the <li> list in index.html, add a --logo-size line, and
   update the count in .tools__head. The row is a 7-column grid here and 2 columns on phones,
   so change grid-template-columns in both places if the count changes. */

.tools {
  --ink: #0a0a09;
  --tool-size: clamp(2.5rem, 4.2vw, 3.4rem);
  --bracket: clamp(10px, 1.1vw, 16px);
  --orbit-spill: 27%;          /* how far the rings orbit outside the disc */

  padding: 38px var(--gutter) 42px;
  background: #fff;
  color: var(--ink);
}

/* head: label — ruled line with a + at its centre — count */
.tools__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(20px, 2.4vw, 30px);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tools__rule {
  position: relative;
  height: 1px;
  background: rgb(10 10 9 / 0.3);
}

.tools__rule::after {
  content: "+";
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding-inline: 8px;
  background: #fff;               /* punches a gap in the rule behind the + */
  font: 400 0.8rem/1 var(--font-mono);
  color: var(--ink);
}

/* Four corner brackets, each an L drawn from two gradients. No extra markup. */
.tools__frame {
  --b: 1px;

  position: relative;
  padding: clamp(18px, 2.2vw, 28px) clamp(12px, 1.8vw, 24px) clamp(26px, 2.6vw, 34px);
  background:
    linear-gradient(var(--ink), var(--ink)) 0    0    / var(--bracket) var(--b) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0    0    / var(--b) var(--bracket) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0    / var(--bracket) var(--b) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0    / var(--b) var(--bracket) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0    100% / var(--bracket) var(--b) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0    100% / var(--b) var(--bracket) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / var(--bracket) var(--b) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / var(--b) var(--bracket) no-repeat;
}

.tools__list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools__item {
  position: relative;
  display: flex;
  justify-content: center;
}

/* short tick between marks */
.tools__item + .tools__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--tool-size) / 2);
  width: 1px;
  height: 1.4em;
  translate: 0 -50%;
  background: rgb(10 10 9 / 0.18);
}

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 1.6rem;         /* room the revealed name drops into — always reserved */
  -webkit-tap-highlight-color: transparent;
}

.tool:focus-visible { outline: none; }   /* the ring goes on the disc instead */

.tool__button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tool-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: scale 0.25s var(--ease-out);
}

/* the disc is small by design, so the touch target is padded out invisibly to 44px */
.tool__button::after {
  content: "";
  position: absolute;
  inset: 50% 50%;
  width: max(2.75rem, 100%);
  height: max(2.75rem, 100%);
  translate: -50% -50%;
  border-radius: 50%;
}

.tool__logo {
  width: var(--logo-size, 58%);
  height: var(--logo-size, 58%);
  object-fit: contain;
  /* turns any mark — coloured or white — into a clean white silhouette */
  filter: brightness(0) invert(1);
}

.tool__label {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 4px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, translate 0.25s var(--ease-out);
}

/* The orbit sits behind the mark and spills outside the disc. Idle it is part-drawn;
   revealing a tool closes the rings and fades the nodes in. */
.tools__defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.tool__orbit {
  position: absolute;
  inset: calc(var(--orbit-spill) * -1);
  width: calc(100% + 2 * var(--orbit-spill));
  height: calc(100% + 2 * var(--orbit-spill));
  max-width: none;                /* the global `svg { max-width: 100% }` would shrink it off-centre */
  overflow: visible;
  pointer-events: none;

  color: var(--ink);
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;

  stroke-dashoffset: 0.72;        /* idle: only a loose arc of each ring is drawn */
  stroke-opacity: 0.3;
  fill-opacity: 0;

  transition:
    stroke-dashoffset 0.8s var(--ease-out),
    stroke-opacity 0.4s ease,
    fill-opacity 0.45s ease 0.18s,
    rotate 1s var(--ease-out);
}

/* One reveal state for pointer, keyboard and touch. script.js adds .is-open on tap. */
.tool:hover .tool__label,
.tool:focus-visible .tool__label,
.tool.is-open .tool__label { opacity: 1; translate: -50% 0; }

.tool:hover .tool__orbit,
.tool:focus-visible .tool__orbit,
.tool.is-open .tool__orbit {
  stroke-dashoffset: 0;
  stroke-opacity: 1;
  fill-opacity: 0.95;
  rotate: 7deg;
}

.tool:hover .tool__button,
.tool.is-open .tool__button { scale: 1.06; }

.tool:focus-visible .tool__button {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

/* Optical balance: each mark's share of its disc. Wide wordmarks sit larger,
   dense round marks smaller. */
.tool--blender   { --logo-size: 72%; }
.tool--davinci   { --logo-size: 54%; }
.tool--adobe     { --logo-size: 56%; }
.tool--jwildfire { --logo-size: 76%; }
.tool--openai    { --logo-size: 54%; }
.tool--claude    { --logo-size: 52%; }
.tool--fspy      { --logo-size: 54%; }

/* Narrow screens: Blender alone on the first row, then three rows of two. Below about
   660px seven across leaves the orbits overlapping their neighbours. This breakpoint is
   only here now — there is no artwork <source> left to keep it in step with. */
@media (max-width: 660px) {
  .tools { --tool-size: clamp(2.6rem, 11vw, 3.4rem); }

  .tools__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: clamp(14px, 3.6vw, 22px);
    max-width: 22rem;             /* keeps the pairs together on a wide-ish phone or tablet */
    margin-inline: auto;
  }

  .tools__item--blender { grid-column: 1 / -1; }

  /* the tick belongs between the pairs, not before the first of each row */
  .tools__item + .tools__item::before { display: none; }
  .tools__item:nth-child(odd):not(.tools__item--blender)::before { display: block; left: 0; }

}


/* 7c — Showreel -------------------------------------------------------------- */
/* Full-bleed, no autoplay and no sound until asked.

   The still is an <img> layered under the video rather than the video's poster attribute:
   object-fit is reliably honoured on an <img> in every engine, whereas WebKit renders a
   video poster without cropping it, leaving the image's baked-in letterbox bars visible as
   a black band under the white section above. The thumbnail is 16:10 holding a 16:9 frame,
   so a 16:9 box with object-fit: cover trims those bars exactly. */

.showreel__frame {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.showreel__poster,
.showreel__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the video is transparent until it has actually started, so the still shows through */
.showreel__video { opacity: 0; }

.showreel__poster,
.showreel__video { transition: opacity 0.3s ease; }

.showreel__frame.has-started .showreel__video { opacity: 1; }
.showreel__frame.has-started .showreel__poster { opacity: 0; }

.showreel__play {
  position: absolute;
  /* sits just below the poster's “45 GIRI” lettering rather than on top of it */
  top: 62%;
  left: 0;
  right: 0;
  translate: 0 -50%;
  margin-inline: auto;
  width: clamp(54px, 5.8vw, 78px);
  height: clamp(54px, 5.8vw, 78px);
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  /* the poster has bright areas, so the glyph carries its own shadow as well as a scrim */
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / 0.55));
  transition: opacity 0.3s ease, scale 0.2s var(--ease-out);
}

.showreel__play svg { width: 100%; height: 100%; }

@media (hover: hover) {
  .showreel__play:hover { scale: 1.08; }
}

.showreel__frame.is-playing .showreel__play {
  opacity: 0;
  pointer-events: none;
}

.showreel__bar {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px calc(var(--gutter) - 4px) 10px var(--gutter);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.35) 45%, rgb(0 0 0 / 0.82));
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.showreel__sep { opacity: 0.6; }
.showreel__time { margin-right: auto; font-variant-numeric: tabular-nums; }

.showreel__ctl {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}

.showreel__ctl svg { width: 19px; height: 19px; fill: currentColor; }

/* the mute glyph shows a cross when muted and an arc when not */
.showreel__loud { display: none; }
[data-showreel-mute][aria-pressed="false"] .showreel__muted { display: none; }
[data-showreel-mute][aria-pressed="false"] .showreel__loud { display: block; }

.showreel__play:focus-visible,
.showreel__ctl:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}


/* 8 — About ----------------------------------------------------------------- */

.about {
  padding: 34px var(--gutter) 56px;
  /* no border-top: About now follows the hero, which already draws its own bottom edge */
  background: #fff;               /* the only light section on the site */
  color: #000;
}

.about .section-head {
  color: #555;
  border-bottom-color: rgb(0 0 0 / 0.15);
}

.about__grid {
  display: grid;
  gap: 0;                         /* the three children carry their own spacing instead */
  padding-top: 55px;
  text-align: center;             /* phones: the 45 and the copy share one centre line */
}

.about__number {
  font-size: 55vw;
  font-weight: 900;
  line-height: 0.7;
  letter-spacing: 0;              /* was -0.075em, which made the 4 and 5 touch */
}

.about__lead {
  max-width: 680px;
  margin: 95px auto 55px;
  font-size: 11vw;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.about__text,
.about__note {
  max-width: 560px;
  margin-inline: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #000;
}

.about__note {
  margin-top: 28px;
  color: rgb(0 0 0 / 0.55);       /* keeps the quieter look of the closing note */
}

@media (min-width: 801px) {
  .about { padding-bottom: 90px; }

  /* The body copy sits under the 45 rather than under the lead, so the left column reads
     as one block — the numeral and the prose it belongs to — and the lead keeps the whole
     right column to itself. Phones are untouched: there it stays a single centred stack. */
  /* Two columns up top, then the page lets go of them. The numeral and the lead face
     each other across the grid; underneath, both paragraphs run the full measure and
     centre on the same axis, so the section closes on the middle rather than drifting
     back to one side. */
  .about__grid {
    grid-template-columns: 5fr 7fr;
    grid-template-areas:
      "num   lead"
      "text  text"
      "note  note";
    column-gap: 5vw;
    text-align: left;
    align-items: start;
  }

  .about__number { grid-area: num; font-size: clamp(11.25rem, 27vw, 26.25rem); }

  .about__lead {
    grid-area: lead;
    max-width: none;
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 3.625rem);
  }

  .about__text {
    grid-area: text;
    max-width: none;
    margin: 48px 0 0;
    text-align: center;
    /* At this measure the sentence runs to one line and a tail, which leaves a single word
       stranded under 1300px of text. Balancing splits it into two even lines instead; where
       the property is unsupported the line simply falls as before. */
    text-wrap: balance;
  }

  .about__note {
    grid-area: note;
    max-width: none;
    margin: 34px 0 0;
    text-align: center;
    text-wrap: balance;
  }
}


/* 9 — Manifesto ------------------------------------------------------------- */
/* Each line is sized from the section width so “UNEXPECTED” always fits.
   6.3 is the line's width in em (6.12) plus a little safety margin. */

.manifesto {
  container-type: inline-size;
  padding: 34px 0;                /* phones: sits close to the sections above and below */
  border-block: 1px solid var(--line);
  border-top: 0;                  /* the showreel above ends on its own hard edge */
}

.manifesto__line {
  padding-inline: var(--gutter);
  /* 6.6 is the width of “UNEXPECTED” in em at the phone tracking below (6.93 - 0.04 x 9 = 6.57), plus slack */
  font-size: min(13.75rem, 15cqw, (100cqw - 2 * var(--gutter)) / 6.6);
  font-weight: 900;
  line-height: 0.92;              /* phones: the lines no longer touch */
  letter-spacing: -0.04em;        /* phones: looser, so the big type stays legible */
}

.manifesto__line:nth-child(2) { text-align: center; }
.manifesto__line:nth-child(3) { text-align: right; }
.manifesto__edge { letter-spacing: -0.055em; }       /* pulls the last “D” flush with the gutter */

@media (min-width: 801px) {
  .manifesto { padding-block: 100px; }

  /* desktop keeps the original tight setting */
  .manifesto__line {
    font-size: min(13.75rem, 15cqw, (100cqw - 2 * var(--gutter)) / 6.3);
    line-height: 0.78;
    letter-spacing: -0.09em;
  }
}


/* 10 — Contact -------------------------------------------------------------- */

.contact { padding: 30px var(--gutter) 90px; }

/* The panel is a before/after reveal. Two image layers sit under the text:
     ::before  the dim image (always visible)
     ::after   the bright image, clipped to the left of --reveal
   .idea-panel__content (the headline + email) is clipped to the same edge.
   --reveal is set by script.js while dragging; --selected-bg when the “?” is clicked. */
.idea-panel {
  --reveal: 78%;
  --selected-bg: url("portfolio/clouds2.webp");

  position: relative;
  isolation: isolate;
  margin-block: 22px;
  overflow: hidden;
  background: #151513;
  container-type: inline-size;    /* the headline sizes itself from the panel width */
  cursor: ew-resize;
  touch-action: pan-y;            /* vertical scroll still works on touch */
  user-select: none;
  -webkit-user-select: none;
}

.idea-panel::before,
.idea-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--selected-bg) center / cover no-repeat;
}

.idea-panel::before { opacity: 0.75; }
.idea-panel::after  { clip-path: inset(0 calc(100% - var(--reveal)) 0 0); }

.idea-panel__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60svh;
  padding: 6vw 4vw;
  clip-path: inset(0 calc(100% - var(--reveal)) 0 0);
}

.idea-panel__title {
  /* Where the dot of the “?” is, measured on Inter Bold: 0.2563em from the glyph's
     left edge, and the button sits 0.03em above the baseline (just under the stem). */
  --dot-x: 0.2563em;
  --dot-y: 0.03em;

  margin-bottom: max(0.4em, 2rem);
  font-size: min(11.25rem, 14.5cqw);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.1em;
  white-space: nowrap;
}

/* The “?” button.
   .dot-anchor is a zero-size box that sits on the text baseline, right where the “?” starts.
   The button is positioned from it in em, so it follows the glyph at any font size or layout. */
.dot-anchor {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0;
}

.cloud-picker {
  --size: 0.35em;
  --ring: max(1.5px, 0.012em);

  position: absolute;
  left: var(--dot-x);
  bottom: var(--dot-y);
  width: var(--size);
  height: var(--size);
  translate: -50% 50%;            /* centre the button on that point */
  padding: 0;
  border: var(--ring) solid #fff;
  border-radius: 50%;
  background: #d9d6cb var(--selected-bg) center / cover no-repeat;
  box-shadow: 0 0 0 var(--ring) rgb(8 8 8 / 0.82);
  cursor: pointer;
  touch-action: manipulation;
  transition: scale 0.18s ease;
}

/* Visual size stays proportional to the type; the tap target grows to at least 44px. */
.cloud-picker::before {
  content: "";
  position: absolute;
  inset: min(0px, calc((var(--size) - 2.75rem) / 2));
  border-radius: 50%;
}

.cloud-picker:focus-visible {
  scale: 1.15;
  outline-offset: 0.06em;
}

@media (hover: hover) {
  .cloud-picker:hover { scale: 1.15; }
}

.email {
  width: max-content;
  max-width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid #fff;
  font: 0.875rem var(--font-mono);
  color: #fff;
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
}

.email span {
  margin-left: 20px;
  color: var(--acid);
}

.reveal__handle {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  left: var(--reveal);
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #0a0a09e8;
  box-shadow: 0 0 0 2px #0006;
  font: 11px/1 var(--font-mono);
  color: #fff;
  pointer-events: none;
}

.reveal__input:focus-visible + .reveal__handle {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

@media (min-width: 801px) {
  .idea-panel__content {
    min-height: 55svh;
    padding: 4vw;
  }
  .idea-panel__title { font-size: min(11.25rem, 12.5cqw); }
}

/* Phones: break the headline into 4 lines so it can be much bigger. The widest line,
   “making?”, is 3.56em wide, so font-size = available width ÷ 3.7 (a little slack).
   The “?” button is positioned in em, so it scales with the type automatically. */
.br-narrow { display: none; }

@media (max-width: 560px) {
  .br-narrow { display: inline; }
  .idea-panel__title { font-size: min(11.25rem, calc((100cqw - 8vw) / 3.7)); }
}


/* 11 — Footer --------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 16px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 0.5625rem;
  color: var(--muted-dim);
}

@media (min-width: 801px) {
  .site-footer { padding-block: 18px; }
}


/* 12 — Project modal -------------------------------------------------------- */
/* script.js copies the tile's .visual into .modal__visual, so the modal shows
   the real work (video, images, slider) instead of an empty box. */

.modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 70px var(--gutter) 30px;
  border: 0;
  overflow: auto;
  background: #0a0a09f8;
  color: var(--fg);
}

.modal[open] {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 35px;
}

.modal::backdrop { background: transparent; }

.modal__close {
  position: fixed;
  top: 12px;
  right: calc(var(--gutter) - 8px);
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 40px;
  font-weight: 200;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}

.modal__visual {
  height: 52dvh;
  overflow: hidden;
  background: #111;
}

.modal__visual .visual {
  aspect-ratio: auto;
  height: 100%;
}

.modal__kicker,
.modal__tech {
  font-size: 0.625rem;
  color: #888;
}

.modal__title {
  margin: 20px 0;
  font-size: clamp(2.8rem, 7vw, 6.25rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.08em;
}

.modal__text {
  max-width: 440px;
  margin-bottom: 20px;
  line-height: 1.6;
  color: #aaa;
}

/* The media is shown whole (contain) in a 16:10 frame, and the title is sized from its own
   column so a long word like “Mediterranean” can no longer squeeze the image. The shirt clip
   is vertical, but it is black to its edges, so it letterboxes invisibly here. */
.modal .modal__visual {
  height: auto;
  max-height: 75dvh;
  aspect-ratio: 16 / 10;
}

.modal .modal__visual .visual__media { object-fit: contain; }

.modal .modal__copy { container-type: inline-size; }

.modal .modal__title {
  font-size: min(6.25rem, 13.5cqw);   /* longest word is ~7.2em wide: 100 ÷ 7.2 ≈ 13.9 */
  overflow-wrap: break-word;
}

@media (min-width: 801px) {
  .modal { padding: 7vh 7vw; }

  .modal[open] {
    grid-template-columns: 1.35fr 0.65fr;
    align-content: normal;
    align-items: center;
    gap: 5vw;
  }

  .modal__close { top: 20px; right: 28px; }
  .modal__visual { height: 75dvh; }

  /* minmax(0, …) lets the image column keep its 1.35 : 0.65 share whatever the title says */
  .modal[open] { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); }
}


/* 13 — Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ring,
  .scan { animation: none; }

  .site-header,
  .visual,
  .slider__track,
  .cloud-picker,
  .tool__button,
  .tool__orbit,
  .tool__label,
  .showreel__play,
  .showreel__poster,
  .showreel__video { transition: none; }
}
