/* ==========================================================================
   OneClick Advertising Agency — oneclicklb.com
   One stylesheet. No framework.

   The work is loud, colourful and bilingual. So the site is the quiet dark
   wall it hangs on: #101010 everywhere, olive as the only interface colour,
   and every other bit of chroma comes from the client work itself.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Font — Archivo variable (self-hosted, wdth 62–125 / wght 100–900).
   One family, two voices: expanded+heavy for display (cut-vinyl signage),
   normal width for text.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback so the swap barely shifts. */
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Helvetica Neue'), local('Arial');
  size-adjust: 101%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colour — neutrals tinted 0.006–0.012 chroma toward the brand hue (119.2).
     Contrast on --ground verified: ink 14.2:1 · muted 5.7:1 · brand 7.4:1 */
  --ground: #101010;
  --surface: #1b1c18;
  --surface-2: #252721;
  --line: #32342d;
  --muted: #8b8d84;
  --ink: #dddfda;
  --ink-hi: #f6f7f4;
  --brand: #96ab3b;
  --brand-hi: #b0c84d;
  --brand-dim: #6d7d29;
  --danger: #ff8a7a;
  --success: var(--brand-hi);

  /* Type */
  --font-text: 'Archivo', 'Archivo Fallback', system-ui, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2vw + 1.1rem, 2rem);
  --text-2xl: clamp(2rem, 2.6vw + 1.2rem, 3rem);
  --text-3xl: clamp(2.25rem, 4.2vw + 1rem, 4.25rem);
  --text-display: clamp(2.5rem, 8vw + 0.5rem, 5.5rem);

  /* Space — 4pt scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section: clamp(4rem, 9vw, 8.5rem);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 62ch;

  /* Structure */
  --container: 1360px;
  --radius: 4px;
  --radius-lg: 10px;
  --header-h: 68px;

  /* Motion */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  /* Depth — semantic, never arbitrary */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-header: 200;
  --z-actionbar: 300;
  --z-menu: 400;
  --z-skip: 500;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-5));
  /* `hidden` still makes a scroll container — one the page cannot show a bar
     for but a touch device will happily pan, which is how a few stray pixels
     of full-bleed turn into a page that slides sideways under the thumb.
     `clip` makes no scroll container at all, so there is nothing to pan.
     The `hidden` above it is the fallback for browsers without `clip`. */
  overflow-x: hidden;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 400;
  font-variation-settings: 'wdth' 100;
  line-height: 1.65;
  letter-spacing: 0.005em; /* light-on-dark compensation */
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Any `display` declaration outranks the UA's [hidden] rule, so state that
   the attribute always wins. Without this, hiding the form on success fails. */
[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* The surface fill is a loading placeholder for photos. Logos are cut out
   on transparent backgrounds, so on them it would paint a visible box. */
img {
  height: auto;
  background-color: var(--surface);
}

.brand-mark img,
.footer-mark img,
.client img {
  background-color: transparent;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--brand);
  color: var(--ground);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--ground);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 6px;
  border: 3px solid var(--ground);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-dim);
}

/* --------------------------------------------------------------------------
   4. Typography roles
   -------------------------------------------------------------------------- */
.display,
h1,
h2 {
  font-variation-settings: 'wdth' 112;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink-hi);
  text-wrap: balance;
}

/* Every section title carries the brand colour; the h1 stays ink with its
   one olive word. --brand on --ground measures 7.4:1, well past the 3:1
   large-text floor. */
h2 {
  color: var(--brand);
}

h3,
h4 {
  font-variation-settings: 'wdth' 100;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-hi);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-xl);
}
h4 {
  font-size: var(--text-lg);
}

p {
  text-wrap: pretty;
}

.lede {
  font-size: var(--text-lg);
  color: var(--ink);
  max-width: var(--measure);
  line-height: 1.55;
}

.prose {
  max-width: var(--measure);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
  position: relative;
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
}

/* :not(.eyebrow) — without it this rule outranks .eyebrow and the label
   above a stacked title came out larger and in a different colour from the
   same label anywhere else on the page. */
.section-head p:not(.eyebrow) {
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* fixed, not absolute — the header is fixed, so an absolute skip link
   scrolls out of reach. */
.skip-link {
  position: fixed;
  left: var(--s-4);
  top: var(--s-4);
  z-index: var(--z-skip);
  background: var(--brand);
  color: var(--ground);
  font-weight: 700;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out-quart);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--ground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-5);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart),
    color var(--dur-fast) var(--ease-out-quart),
    transform var(--dur-fast) var(--ease-out-quart);
}

.btn:hover {
  --btn-bg: var(--brand-hi);
}

.btn:active {
  transform: translateY(1px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-hi);
  border-color: var(--line);
}

.btn--ghost:hover {
  --btn-bg: transparent;
  --btn-fg: var(--brand-hi);
  border-color: var(--brand-dim);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Text link with an underline that grows from the left */
.link {
  color: var(--brand-hi);
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(var(--brand-dim), var(--brand-dim));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur) var(--ease-out-quart), color var(--dur-fast) linear;
}

.link:hover {
  color: var(--ink-hi);
  background-size: 100% 2px;
  background-image: linear-gradient(var(--brand-hi), var(--brand-hi));
}

/* --------------------------------------------------------------------------
   7. Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--ground);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) linear;
}

.header[data-scrolled='true'] {
  border-bottom-color: var(--line);
}

.header .container {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.brand-mark {
  display: flex;
  align-items: center;
  flex: none;
  margin-inline-end: auto;
  text-decoration: none;
  border-radius: var(--radius);
}

.brand-mark img {
  width: 132px;
  height: 45px;
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--dur-fast) linear;
}

.nav a:hover {
  color: var(--ink-hi);
}

.nav a[aria-current='true'] {
  color: var(--ink-hi);
}

.nav a[aria-current='true']::after {
  content: '';
  position: absolute;
  left: var(--s-3);
  right: var(--s-3);
  bottom: 6px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.header .btn {
  min-height: 42px;
  padding-inline: var(--s-4);
}

/* Menu toggle — hidden on desktop */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.menu-toggle span {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink-hi);
  transition: transform var(--dur) var(--ease-out-quart),
    background-color var(--dur-fast) linear;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink-hi);
  transition: transform var(--dur) var(--ease-out-quart), top var(--dur) var(--ease-out-quart);
}

.menu-toggle span::before {
  top: -6px;
}
.menu-toggle span::after {
  top: 6px;
}

.menu-toggle[aria-expanded='true'] span {
  background: transparent;
}

.menu-toggle[aria-expanded='true'] span::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded='true'] span::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .nav,
  .header > .container > .btn {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Mobile menu panel */
.menu-panel {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: var(--z-menu);
  display: grid;
  align-content: start;
  gap: var(--s-1);
  padding: var(--s-6) var(--gutter) var(--s-8);
  background: var(--ground);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel a {
  padding: var(--s-4) 0;
  font-size: var(--text-2xl);
  font-variation-settings: 'wdth' 112;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--ink-hi);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.menu-panel a:last-of-type {
  border-bottom: 0;
}

.menu-panel .menu-contact {
  margin-top: var(--s-6);
  display: grid;
  gap: var(--s-3);
}

@media (prefers-reduced-motion: no-preference) {
  .menu-panel:not([hidden]) a {
    animation: menu-in var(--dur-slow) var(--ease-out-quint) both;
    animation-delay: calc(var(--i, 0) * 40ms);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* --------------------------------------------------------------------------
   8. Hero — statement left, a wall of real work on the right
   -------------------------------------------------------------------------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 6rem));
  padding-bottom: clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

.hero .container {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 1000px) {
  .hero .container {
    grid-template-columns: minmax(0, 32rem) minmax(0, 1fr);
    align-items: center;
    /* let the rail bleed to the viewport edge */
    padding-inline-end: 0;
    max-width: none;
    padding-inline-start: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  }
}

.hero h1 {
  margin-bottom: var(--s-5);
  /* Line breaks are authored in the markup, so balancing would fight them. */
  text-wrap: initial;
}

.hero h1 .brand-word {
  color: var(--brand);
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 34ch;
  line-height: 1.5;
  margin-bottom: var(--s-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.hero-meta {
  margin-top: var(--s-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.hero-meta strong {
  color: var(--ink-hi);
  font-weight: 600;
}

/* The rail: decorative (aria-hidden) — the real, semantic work lives in #work.
   overflow + min-width are load-bearing: without them the max-content track
   inflates the grid column and the headline stops wrapping.

   `clip`, not `hidden`: the track inside is ~2000px wide in a 350px box, and
   `hidden` would make that a scroll container — invisible on a desktop, but a
   panel that slides sideways under a thumb on iOS, which reads as the whole
   page coming loose. `clip` clips at the same edge and scrolls at none. */
.hero-rail {
  position: relative;
  min-width: 0;
  overflow: hidden;
  overflow: clip;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 90%, transparent);
}

.hero-copy {
  min-width: 0;
}

.rail-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .rail-track {
    animation: rail 64s linear infinite;
  }
}

@keyframes rail {
  to {
    transform: translateX(-50%);
  }
}

.rail-track img {
  width: clamp(150px, 21vw, 268px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin-inline-end: var(--s-4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .hero-rail {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .rail-track img {
    scroll-snap-align: start;
  }
}

/* --------------------------------------------------------------------------
   9. Work

   Two views of one list. The grid is the canonical one: it is what the markup
   says, what a crawler indexes and what a screen reader reads. The carousel is
   a WebGL rendering of the same eleven pieces that replaces it visually when
   the browser can afford it. Neither view invents content the other lacks.
   -------------------------------------------------------------------------- */
/* Quiet on purpose: the olive title right under it carries the colour. */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The page's default head is a two-column baseline-aligned row; with an
   eyebrow above the h2 it has to stack instead. */
.section-head--stack {
  display: block;
}

.section-head--stack .eyebrow {
  margin-bottom: var(--s-2);
}

.section-head--stack p:not(.eyebrow) {
  margin-top: var(--s-4);
}

/* --- filter chips ------------------------------------------------------- */
.gal-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: clamp(var(--s-5), 3vw, var(--s-7));
}

.gal-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 var(--s-4);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart),
    color var(--dur-fast) var(--ease-out-quart);
}

.chip:hover {
  color: var(--ink-hi);
  border-color: var(--brand-dim);
}

.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ground);
}

/* The view switch is not a filter, so it sits apart from the group. */
.chip--alt {
  margin-inline-start: auto;
  color: var(--muted);
}

.chip svg {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (max-width: 720px) {
  .chip--alt {
    margin-inline-start: 0;
  }
}

/* --- the carousel ------------------------------------------------------- */
/* The stage is the one thing on the page laid out wider than its container,
   so it is also the one thing that can push the document past the viewport:
   100vw counts a classic scrollbar that 100% of the document does not. Clip
   it at the section, which is already exactly the width the stage wants to
   fill, and the overflow never reaches the page. */
#work {
  overflow-x: clip;
}

/* Full-bleed: the pieces running off both edges are the whole point of the
   arc. */
.gal-stage {
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  height: clamp(400px, 62vh, 660px);
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

/* On a phone the focused piece is limited by the stage's width, not its
   height — it has to leave room for the pieces either side of it. A stage
   sized off viewport height alone would then be mostly empty above and below
   the card, so tie it to the width here instead. */
@media (max-width: 720px) {
  .gal-stage {
    height: min(62vh, 104vw);
  }
}

.gal-stage[data-grabbing='true'] {
  cursor: grabbing;
}

.gal-stage:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -4px;
}

.gal-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Painted from plain <img> so the section is never an empty box while
   three.js and the textures are still in flight. */
.gal-poster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  perspective: 1400px;
  transition: opacity var(--dur-slow) var(--ease-out-quart);
}

.gal-poster[data-fading='true'] {
  opacity: 0;
}

.gal-poster-img {
  flex: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

.gal-poster-img--c {
  height: 82%;
}

.gal-poster-img--l,
.gal-poster-img--r {
  height: 55%;
  opacity: 0.55;
}

/* On a convex arc the outer edge of a side piece is the one that recedes. */
.gal-poster-img--l {
  transform: rotateY(-16deg);
}

.gal-poster-img--r {
  transform: rotateY(16deg);
}

/* --- caption and controls ----------------------------------------------- */
.gal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-5);
  min-height: 48px;
}

.gal-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gal-caption b {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-hi);
  letter-spacing: -0.005em;
}

.gal-caption span {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.4;
}

.gal-nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-inline-start: auto;
}

.gal-arrow {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out-quart),
    border-color var(--dur-fast) var(--ease-out-quart);
}

.gal-arrow:hover:not([disabled]) {
  color: var(--brand-hi);
  border-color: var(--brand-dim);
}

.gal-arrow[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.gal-arrow svg {
  width: 20px;
  height: 20px;
}

.gal-count {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 5ch;
  text-align: center;
}

/* --- swapping the two views --------------------------------------------- */
/* With the carousel up, the grid keeps its place in the document — it is the
   only version a screen reader or a crawler can read — but stops taking up
   space. Nothing inside .work-item is focusable, so this cannot strand a tab
   stop off-screen. */
[data-gal='on'] .work-list {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-gal='on'] .work-list * {
  animation: none !important;
}

[data-gal='off'] .gal {
  display: none;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(var(--s-4), 2.2vw, var(--s-6)) clamp(var(--s-3), 1.8vw, var(--s-5));
}

@media (min-width: 720px) {
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .work-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.work-item figure,
.work-item .shot {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.work-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  transition: transform var(--dur-slow) var(--ease-out-quart),
    filter var(--dur-slow) var(--ease-out-quart);
}

.work-item--top img {
  object-position: center top;
}

/* A logo sheet is designed for white stock — present it that way. */
.work-item--sheet .shot {
  background: var(--ink-hi);
}

.work-item--sheet img {
  object-fit: contain;
  padding: 9%;
}

.work-item:hover img {
  transform: scale(1.035);
}

.work-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-cap b {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-hi);
  letter-spacing: -0.005em;
}

.work-cap span {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.4;
}

/* Web work — landscape captures, first one runs full width */
.web-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(var(--s-5), 3vw, var(--s-7)) clamp(var(--s-4), 2vw, var(--s-6));
  margin-top: var(--s-8);
}

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

  .web-grid .work-item--wide {
    grid-column: 1 / -1;
  }
}

.web-grid img {
  aspect-ratio: 2 / 1;
  object-position: center top;
}

/* The captures are ~2.01:1 — matching that keeps the site's own headline
   from being sliced in half. */
.web-grid .work-item--wide img {
  aspect-ratio: 2 / 1;
}

/* --------------------------------------------------------------------------
   10. Numbers
   -------------------------------------------------------------------------- */
.numbers {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: var(--s-5);
  padding-block: var(--s-7);
}

/* Rules as elements, not borders, so they can draw themselves in on scroll. */
.numbers::before,
.numbers::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
}

.numbers::before { top: 0; }
.numbers::after { bottom: 0; }

.number b {
  display: block;
  font-variation-settings: 'wdth' 112;
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.number span {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--text-sm);
  color: var(--ink);
}

.number small {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   11. Clients
   Most of these marks ship with their own dark background baked into the
   artwork, so a light chip would frame every one in a white border. A dark
   chip lets them sit flush; the few light-background marks read as inset
   cards, which is honest to how they were drawn.
   -------------------------------------------------------------------------- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(148px, 46%), 1fr));
  gap: var(--s-3);
}

.client {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: var(--s-2);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform var(--dur) var(--ease-out-quart),
    border-color var(--dur) linear;
}

.client img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client:hover {
  transform: translateY(-3px);
  border-color: var(--brand-dim);
}

/* --------------------------------------------------------------------------
   12. Services — a list, not a grid of icon cards
   -------------------------------------------------------------------------- */
.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

@media (min-width: 860px) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(var(--s-6), 5vw, var(--s-9));
  }
}

.service {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) linear;
}

.service:hover {
  border-top-color: var(--brand-dim);
}

/* Close the list off — without this the final row reads as unfinished. */
.service:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .service:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

.service h3 {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  color: var(--ink-hi);
  transition: color var(--dur-fast) linear;
}

.service:hover h3 {
  color: var(--brand-hi);
}

/* Reserve the space, then scale in — animating width would relayout the row
   on every hover. */
.service h3::after {
  content: '';
  width: clamp(20px, 6vw, 56px);
  height: 1px;
  margin-inline-start: auto;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur) var(--ease-out-quart);
}

.service:hover h3::after {
  transform: scaleX(1);
}

.service p {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 44ch;
}

/* --------------------------------------------------------------------------
   13. CEO — one portrait, one voice
   -------------------------------------------------------------------------- */
.ceo {
  display: grid;
  gap: clamp(var(--s-6), 5vw, var(--s-9));
  align-items: center;
}

@media (min-width: 700px) {
  .ceo {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  }
}

.ceo-portrait {
  width: min(100%, 380px);
  aspect-ratio: 455 / 572;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.ceo-copy .eyebrow {
  margin-bottom: var(--s-2);
}

.ceo-role {
  margin-top: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}

.ceo-copy .lede {
  margin-top: var(--s-5);
}

.ceo-copy .btn {
  margin-top: var(--s-6);
}

/* --------------------------------------------------------------------------
   14. FAQ
   -------------------------------------------------------------------------- */
.faq {
  display: grid;
  gap: clamp(var(--s-6), 5vw, var(--s-8));
}

/* "FREQUENTLY" is a 10-character word set in expanded 800 — it has to be
   sized against the column, not the page, or it runs into the questions. */
.faq > h2 {
  font-size: clamp(2rem, 3vw + 0.6rem, 3.5rem);
  overflow-wrap: break-word;
}

@media (min-width: 1000px) {
  .faq {
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    align-items: start;
  }
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  min-height: 56px;
  padding: var(--s-4) 0;
  background: none;
  border: 0;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink-hi);
  cursor: pointer;
  transition: color var(--dur-fast) linear;
}

.faq-q:hover {
  color: var(--brand-hi);
}

.faq-q svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--brand);
  transition: transform var(--dur) var(--ease-out-quart);
}

.faq-q[aria-expanded='true'] svg {
  transform: rotate(45deg);
}

/* 0fr → 1fr avoids animating height directly */
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease-out-quart);
}

.faq-item[data-open='true'] .faq-a {
  grid-template-rows: 1fr;
}

.faq-a > div {
  overflow: hidden;
}

.faq-a p {
  padding-bottom: var(--s-5);
  max-width: 60ch;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   15. Contact
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  gap: clamp(var(--s-6), 5vw, var(--s-8));
}

@media (min-width: 940px) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
    align-items: start;
  }
}

.form {
  display: grid;
  gap: var(--s-5);
}

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

  .field--full,
  .form-foot {
    grid-column: 1 / -1;
  }
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.field label .opt {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-hi);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast) linear, background-color var(--dur-fast) linear;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--surface-2);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--ground);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 1px;
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: var(--danger);
}

.error {
  min-height: 0;
  font-size: var(--text-xs);
  color: var(--danger);
}

.error:empty {
  display: none;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
}

.form-note {
  font-size: var(--text-xs);
  color: var(--muted);
  max-width: 34ch;
}

/* Submit states */
.btn[data-state='sending'] .btn-label::after {
  content: '';
  display: inline-block;
  width: 0.75em;
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
}

.form-status {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-status[hidden] {
  display: none;
}

.form-status h3 {
  color: var(--brand-hi);
}

.form-status--error h3 {
  color: var(--danger);
}

.form-status p {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Contact details column */
.contact-details {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.detail {
  display: grid;
  gap: var(--s-1);
}

.detail dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail dd {
  margin: 0;
  font-size: var(--text-base);
  color: var(--ink-hi);
}

/* Phone, WhatsApp and email are the conversion actions — give them a full
   44px target even though they read as inline text. */
.detail dd > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color var(--dur-fast) linear, color var(--dur-fast) linear;
}

.detail dd > a:hover {
  color: var(--brand-hi);
  border-bottom-color: var(--brand-dim);
}

.socials {
  display: flex;
  gap: var(--s-2);
}

.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: color var(--dur-fast) linear, border-color var(--dur-fast) linear,
    background-color var(--dur-fast) linear;
}

.socials a:hover {
  color: var(--brand-hi);
  border-color: var(--brand-dim);
  background: var(--surface-2);
}

.socials svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  /* Deep enough at the bottom that the floating back-to-top button (48px,
     24px off the edge) parks below the last line instead of over it. */
  padding-block: var(--s-8) calc(var(--s-9) + env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.footer h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-3);
}

.footer p,
.footer li {
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.footer li {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur-fast) linear;
}

.footer a:hover {
  color: var(--ink-hi);
}

.footer-mark img {
  width: 150px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: var(--s-4);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   17. Floating controls
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--s-5) + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  color: var(--ink-hi);
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease-out-quart),
    transform var(--dur) var(--ease-out-quart), visibility var(--dur) linear,
    background-color var(--dur-fast) linear;
}

.to-top[data-visible='true'] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--brand);
  color: var(--ground);
  border-color: var(--brand);
}

.to-top svg {
  width: 20px;
  height: 20px;
}

/* Mobile action bar — the fastest path to a conversation */
.action-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-actionbar);
  display: none;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: var(--ground);
  border-top: 1px solid var(--line);
}

.action-bar .btn {
  flex: 1;
}

@media (max-width: 720px) {
  .action-bar {
    display: flex;
  }

  body {
    padding-bottom: 82px;
  }

  .to-top {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

/* --------------------------------------------------------------------------
   18. Motion — reveals enhance an already-visible default.
   Nothing is hidden unless JS is running and can un-hide it.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-slow) var(--ease-out-quart),
      transform var(--dur-slow) var(--ease-out-quart);
    transition-delay: calc(var(--i, 0) * 45ms);
  }

  .js [data-reveal][data-shown='true'] {
    opacity: 1;
    transform: none;
  }

  .hero-copy > * {
    animation: hero-in 700ms var(--ease-out-expo) both;
    animation-delay: calc(var(--i, 0) * 70ms);
  }

  .hero-rail {
    animation: hero-fade 900ms var(--ease-out-quart) both;
    animation-delay: 180ms;
  }
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes hero-fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   19. Utility
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media print {
  .header,
  .action-bar,
  .to-top,
  .hero-rail {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ==========================================================================
   20. Client marquee
   A paged carousel would hide logos behind a control nobody presses. Logos
   have no reading time, so a continuous two-row drift shows every client at
   once and never gates content. It never pauses on hover — nothing in the row
   is clickable, so stopping it only makes the page feel stuck. Under reduced
   motion it becomes an ordinary scrollable rail.
   ========================================================================== */
.marquee {
  display: grid;
  gap: var(--s-3);
  /* fade the ends rather than cutting logos off mid-stroke */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

/* Same reasoning as .hero-rail: a 3000px track in a 350px box must clip, not
   scroll, or a finger can drag the client strip off its own row. */
.marquee-row {
  min-width: 0;
  overflow: hidden;
  overflow: clip;
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-set {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marquee-set .client {
  width: clamp(104px, 12vw, 138px);
  flex: none;
  margin-inline-end: var(--s-3);
}

@media (prefers-reduced-motion: no-preference) {
  .marquee-track {
    animation: marquee 46s linear infinite;
    will-change: transform;
  }

  .marquee-row--reverse .marquee-track {
    animation-duration: 58s;
    animation-direction: reverse;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-row {
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .marquee-set .client {
    scroll-snap-align: start;
  }
}

/* ==========================================================================
   21. Reels
   A row of phone-shaped frames that runs off the right edge, so it reads as
   a feed to swipe rather than a grid to scan. Every frame shares one height;
   its width follows the video's own ratio (9:16 or 4:5), the same rule the
   work carousel uses for posters.
   ========================================================================== */
/* The work section above already ends on a full section gap. */
.reels-section {
  padding-top: 0;
}

.reels-track {
  /* Line the first frame up with the container's left edge, then let the
     row run past the right one. */
  --reels-inset: max(var(--gutter), (100% - var(--container)) / 2 + var(--gutter));
  --reel-h: clamp(360px, 64vh, 600px);
  display: flex;
  gap: clamp(var(--s-3), 1.6vw, var(--s-5));
  padding: 0 var(--reels-inset) var(--s-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--reels-inset);
  list-style: none;
}

@supports (height: 1svh) {
  .reels-track {
    --reel-h: clamp(360px, 64svh, 600px);
  }
}

/* The arrows stand in for the scrollbar, and they only exist with JS. */
.js .reels-track {
  scrollbar-width: none;
}

.js .reels-track::-webkit-scrollbar {
  display: none;
}

.reel {
  flex: none;
  width: calc(var(--reel-h) * var(--ar));
  scroll-snap-align: start;
}

.reel figure {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: 0;
}

.reel-frame {
  position: relative;
  aspect-ratio: var(--ar);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.reel-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--dur-slow) var(--ease-out-quart);
}

/* With autoplay running, the reel that is playing is the lit one. */
[data-auto='on'] .reel:not([data-playing='true']) video {
  filter: brightness(0.62) saturate(0.8);
}

.reel-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  background: none;
  border: 0;
  color: var(--ink-hi);
  cursor: pointer;
}

.reel-play:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

.reel-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgb(16 16 16 / 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity var(--dur) var(--ease-out-quart),
    transform var(--dur) var(--ease-out-quart);
}

.reel-icon svg {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
}

.reel .i-pause,
.reel[data-playing='true'] .i-play {
  display: none;
}

.reel[data-playing='true'] .i-pause {
  display: block;
}

/* While playing, the control steps out of the way until it is wanted. */
.reel[data-playing='true'] .reel-icon {
  opacity: 0;
  transform: scale(0.9);
}

.reel[data-playing='true'] .reel-play:hover .reel-icon,
.reel[data-playing='true'] .reel-play:focus-visible .reel-icon {
  opacity: 1;
  transform: none;
}

.reel-sound {
  position: absolute;
  right: var(--s-3);
  bottom: var(--s-3);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(246 247 244 / 0.16);
  border-radius: 999px;
  background: rgb(16 16 16 / 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink-hi);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out-quart),
    color var(--dur-fast) var(--ease-out-quart);
}

.reel-sound svg {
  width: 20px;
  height: 20px;
}

.reel-sound[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ground);
}

.reel-sound .i-on,
.reel-sound[aria-pressed='true'] .i-off {
  display: none;
}

.reel-sound[aria-pressed='true'] .i-on {
  display: inline;
}

.reel-sound:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* The arrows sit on the heading's baseline, right above the row they move,
   so they are on screen whenever the reels are. */
.reels-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
}

.reels-head .section-head {
  margin-bottom: 0;
}

.reels-nav {
  display: flex;
  gap: var(--s-3);
  margin-inline-start: auto;
}

/* On touch screens the row is swiped, and the peeking next frame already
   says there is more. */
@media (pointer: coarse) {
  .reels-nav {
    display: none;
  }
}

/* Without JS the native controls are the controls; these never show. */
.reel-play[hidden],
.reel-sound[hidden],
.reels-nav[hidden] {
  display: none;
}

/* ==========================================================================
   22. The gallery room (3D)
   ========================================================================== */
.room-stage {
  position: relative;
  width: min(100% - (2 * var(--gutter)), var(--container));
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ground);
  --stage-bg: #101010;
}

@media (max-width: 720px) {
  .room-stage {
    aspect-ratio: 4 / 3;
  }
}

three-d-stage {
  display: block;
  width: 100%;
  height: 100%;
}

/* Until the custom element is defined the tag is inert — keep it out of view
   so the poster owns the frame. */
three-d-stage:not(:defined) {
  display: none;
}

.room-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.room-poster[hidden] {
  display: none;
}

.room-poster > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(0.7);
}

.room-poster-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--gutter);
  text-align: center;
}

.room-poster-inner p {
  max-width: 34ch;
  font-size: var(--text-xs);
  color: var(--muted);
}

.room-stage[data-state='loading'] .room-poster-inner .btn {
  opacity: 0.6;
  pointer-events: none;
}

/* ==========================================================================
   23. Scroll-driven motion
   Native scroll timelines where the browser has them: composited, no JS, and
   they scrub with the scroll rather than firing once. The IntersectionObserver
   reveals in section 18 stay as the fallback for everything else.
   ========================================================================== */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Hand over from the JS reveals so the two never fight. */
    .js [data-reveal] {
      opacity: 1;
      transform: none;
      transition: none;
    }

    /* --- section headings wipe up from behind their own baseline --- */
    .section-head h2,
    .faq > h2 {
      animation: wipe-up linear both;
      animation-timeline: view();
      animation-range: entry 8% entry 46%;
    }

    /* --- posters unroll top-to-bottom, staggered across the grid --- */
    .work-grid .work-item {
      animation: unroll linear both;
      animation-timeline: view();
      animation-range: entry calc(4% + var(--i, 0) * 2%) entry calc(52% + var(--i, 0) * 2%);
    }

    /* --- screen captures drift inside their frame --- */
    .web-grid .shot {
      overflow: hidden;
    }

    .web-grid .shot img {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    /* --- the numbers rules draw themselves in --- */
    .numbers::before,
    .numbers::after {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    /* --- service rows arrive from the left --- */
    .service {
      animation: slide-in linear both;
      animation-timeline: view();
      animation-range: entry calc(2% + var(--i, 0) * 3%) entry calc(46% + var(--i, 0) * 3%);
    }

    /* --- the portrait opens from the bottom edge --- */
    .ceo-portrait {
      animation: open-up linear both;
      animation-timeline: view();
      animation-range: entry 6% entry 54%;
    }

    /* --- the room settles into place --- */
    .room-stage {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 4% entry 60%;
    }

    /* --- hero copy lifts away as you leave it --- */
    .hero-copy {
      animation: hero-exit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 92%;
    }
  }
}

@keyframes wipe-up {
  from {
    opacity: 0;
    transform: translateY(30px);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 -20% 0);
  }
}

@keyframes unroll {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.97);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes drift {
  from {
    transform: translateY(-5%) scale(1.11);
  }
  to {
    transform: translateY(5%) scale(1.11);
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes open-up {
  from {
    opacity: 0;
    transform: scale(0.94);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-exit {
  to {
    opacity: 0.18;
    transform: translateY(-56px);
  }
}

/* --- hero headline: each line rises out from behind its own edge --- */
.hline {
  display: block;
  overflow: hidden;
  /* room for descenders and the full stop */
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.hline > span {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .hline > span {
    animation: line-up 900ms var(--ease-out-expo) both;
    animation-delay: calc(var(--l, 0) * 110ms);
  }

  .hline:nth-child(2) > span {
    --l: 1;
  }
  .hline:nth-child(3) > span {
    --l: 2;
  }
}

@keyframes line-up {
  from {
    transform: translateY(105%);
  }
}
