/* ============================================================
   FONTS: self-hosted (Open Font License), latin + latin-ext subsets.
   DM Sans is a variable font, so one file covers weights 300 to 500.
   ============================================================ */

/* Outfit, latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/outfit-v15-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Outfit, latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/outfit-v15-latin.woff2') format('woff2');
  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;
}
/* DM Sans, latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/fonts/dm-sans-v17-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* DM Sans, latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/fonts/dm-sans-v17-latin.woff2') format('woff2');
  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;
}

/* ============================================================
   Riverr — site stylesheet
   Brand: Midnight Electric (assets/riverr-brand-context.md)
   Structure: v8 (light-first, restrained, pill controls)
   ============================================================ */

:root {
  /* Primary blues — Midnight Electric */
  --midnight: #000028;       /* principal dark canvas */
  --deep-navy: #071B5A;
  --royal-blue: #123EAE;
  --riverr-blue: #1769E8;    /* the branded accent */
  --electric-blue: #159AF5;
  --bright-cyan: #20D4F5;    /* selected / active states only, sparingly */

  /* Neutrals */
  --white: #FFFFFF;
  --soft-white: #F8FAFC;
  --light-grey: #E7EBF2;
  --slate-grey: #6C7B91;
  --ice-blue: #E1F4FE;

  /* Secondary accents — reserved for charts and categorisation; unused in UI */
  --deep-teal: #459B97;
  --mid-teal: #7AC4BF;
  --light-teal: #AFE0DC;
  --burnt-orange: #C66113;
  --warm-orange: #DE8F2E;
  --soft-gold: #EAB861;

  /* Derived steps (same hue family) so small text passes WCAG AA.
     Slate Grey itself is 4.3:1 on white, so it is kept for large text,
     logos, and the Midnight footer, where it passes. */
  --text: #34405A;           /* body copy: Midnight softened toward Slate */
  --text-muted: #5B6A80;     /* metadata and captions: 5.5:1 on white */
  --rule: #E7EBF2;           /* = Light Grey */
  --rule-strong: #D3DAE5;
  --section-grey: #F5F7FA;   /* Light Grey tint: alternate section ground on the home page */

  /* Type */
  --font-display: "Outfit", sans-serif;   /* Outfit Medium */
  --font-body: "DM Sans", sans-serif;     /* DM Sans Light */

  --shell-max: 72rem;
  --shell-pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--rule-strong) var(--soft-white); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--soft-white);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: lining-nums;
}

::selection { background: var(--midnight); color: var(--white); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--midnight); }
p { margin: 0; }
a { color: var(--riverr-blue); text-decoration: none; }
:focus-visible { outline: 2px solid var(--riverr-blue); outline-offset: 3px; border-radius: 6px; }
img, video { max-width: 100%; display: block; }
img { height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
button { font: inherit; }

.shell { max-width: var(--shell-max); margin-inline: auto; padding-inline: var(--shell-pad); }

/* The hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

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

.skip-link {
  position: absolute; top: -3rem; left: 1rem; z-index: 99;
  background: var(--midnight); color: var(--white);
  padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.85rem;
  transition: top 180ms var(--ease);
}
.skip-link:focus { top: 0.5rem; }

/* Small sentence-case metadata — the brand's "technical label", set in DM Sans */
.meta {
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.005em;
  color: var(--text-muted);
}

/* ---------- Motion: one quiet reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 680ms var(--ease), transform 680ms var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Aura: a restrained Primary Blue gradient ---------- */

.has-aura { position: relative; overflow: hidden; }
.aura {
  position: absolute;
  pointer-events: none;
  filter: blur(52px);
  z-index: 0;
}
/* Grain lives only inside gradient sections — never over project imagery */
.has-aura::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.045'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.has-aura > .shell { position: relative; z-index: 1; }

.aura-hero {
  top: -24%;
  right: -12%;
  width: min(80vw, 74rem);
  aspect-ratio: 1 / 0.9;
  background:
    radial-gradient(closest-side at 62% 22%, rgba(18, 62, 174, 0.34), transparent 64%),
    radial-gradient(closest-side at 54% 42%, rgba(23, 105, 232, 0.36), transparent 72%),
    radial-gradient(closest-side at 36% 60%, rgba(21, 154, 245, 0.26), transparent 74%),
    radial-gradient(closest-side at 72% 72%, rgba(32, 212, 245, 0.18), transparent 72%);
}
/* A much fainter counterweight low on the left, so that side isn't bare. */
.aura-hero-left {
  left: -14%;
  bottom: -18%;
  width: min(46vw, 40rem);
  aspect-ratio: 1.25 / 1;
  background:
    radial-gradient(closest-side at 50% 55%, rgba(21, 154, 245, 0.12), transparent 72%),
    radial-gradient(closest-side at 62% 40%, rgba(32, 212, 245, 0.08), transparent 70%);
}
/* Sized to its section and faded out at the bottom, so it never ends in a
   hard edge where the section clips it */
.aura-page {
  top: -30%;
  right: -14%;
  width: min(58vw, 50rem);
  height: 130%;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  background:
    radial-gradient(closest-side at 62% 24%, rgba(18, 62, 174, 0.24), transparent 62%),
    radial-gradient(closest-side at 56% 40%, rgba(23, 105, 232, 0.26), transparent 70%),
    radial-gradient(closest-side at 40% 62%, rgba(21, 154, 245, 0.20), transparent 72%),
    radial-gradient(closest-side at 74% 74%, rgba(32, 212, 245, 0.13), transparent 70%);
}
/* Interior page heads: the right aura reaches further in, and a faint wash
   on the left balances it. */
.aura-page-wide { width: min(74vw, 66rem); right: -10%; top: -12%; height: 125%; }
.aura-page-left {
  left: -12%;
  top: 0;
  width: min(48vw, 42rem);
  height: 120%;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  background:
    radial-gradient(closest-side at 48% 50%, rgba(21, 154, 245, 0.13), transparent 72%),
    radial-gradient(closest-side at 60% 36%, rgba(32, 212, 245, 0.09), transparent 70%);
}
.aura-close {
  bottom: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vw, 58rem);
  aspect-ratio: 2.2 / 1;
  background:
    radial-gradient(closest-side at 50% 56%, rgba(23, 105, 232, 0.22), transparent 70%),
    radial-gradient(closest-side at 62% 34%, rgba(18, 62, 174, 0.18), transparent 66%);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: blur(12px);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 4.25rem;
}
.brand { display: flex; align-items: center; }
.brand img { width: 108px; height: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }
.site-nav a {
  color: var(--text);
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  transition: color 180ms var(--ease);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--midnight); }
.site-nav a[aria-current="page"]:not(.nav-cta) {
  box-shadow: inset 0 -2px 0 var(--riverr-blue);
}
.site-nav .nav-cta {
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  background: var(--white);
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}
.site-nav .nav-cta:hover { background: var(--midnight); border-color: var(--midnight); color: var(--white); }

/* Menu button: hidden until the nav no longer fits beside the logo */
.nav-toggle {
  display: none;
  position: relative;
  width: 2.75rem; height: 2.75rem;
  margin-right: -0.6rem;
  border: 0;
  background: none;
  color: var(--midnight);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before {
  position: absolute;
  left: 50%;
  width: 1.35rem; height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 260ms var(--ease);
}
.nav-toggle-bars { top: 50%; transform: translate(-50%, -4px); }
.nav-toggle-bars::before { content: ""; top: 0; transform: translate(-50%, 8px); }
.nav-open .nav-toggle-bars { transform: translate(-50%, 0) rotate(45deg); }
.nav-open .nav-toggle-bars::before { transform: translate(-50%, 0) rotate(-90deg); }
.nav-toggle:focus-visible { outline: 2px solid var(--riverr-blue); outline-offset: 2px; border-radius: 999px; }

@media (max-width: 560px) {
  .js .nav-toggle { display: grid; }
  .nav-open.site-header { background: var(--white); }
  /* The header's backdrop-filter makes it the containing block, so the
     panel is absolutely positioned to fill the screen below it. */
  .js .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: calc(100vh - 4.25rem);
    height: calc(100dvh - 4.25rem);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--shell-pad) 2rem;
    background: var(--white);
    border-top: 1px solid var(--rule);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 0s linear 220ms;
  }
  .js .nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 0s;
  }
  .js .site-nav a:not(.nav-cta) {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.6rem;
    letter-spacing: -0.015em;
    color: var(--midnight);
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rule-strong);
  }
  .js .site-nav a[aria-current="page"]:not(.nav-cta) { box-shadow: none; color: var(--riverr-blue); }
  .js .site-nav .nav-cta {
    margin-top: 1.75rem;
    min-height: 3.1rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--riverr-blue);
    border-color: var(--riverr-blue);
    color: var(--white);
    font-size: 1rem;
  }
  .js .site-nav .nav-cta:hover { background: var(--royal-blue); border-color: var(--royal-blue); }
  .menu-open, .menu-open body { overflow: hidden; }
}
@media (max-width: 560px) and (prefers-reduced-motion: reduce) {
  .js .site-nav, .js .nav-open .site-nav, .nav-toggle-bars, .nav-toggle-bars::before { transition: none; }
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 400;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease),
              border-color 200ms var(--ease), transform 200ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--riverr-blue); color: var(--white); }
.btn-primary:hover { background: var(--royal-blue); }
.btn-quiet { background: var(--white); color: var(--midnight); border-color: var(--rule-strong); }
.btn-quiet:hover { border-color: var(--midnight); }
.btn-lg { min-height: 3.5rem; padding: 0.95rem 2.3rem; font-size: 1.05rem; }

.text-link {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--riverr-blue);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--ease);
}
.text-link:hover { border-bottom-color: var(--riverr-blue); }

/* ---------- Home: hero ---------- */

/* The hero fills the screen below the sticky header: the copy sits in the
   middle of the free space and the client logos rest on the bottom edge.
   svh keeps the logos above mobile browser toolbars. */
.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4.25rem);
  min-height: calc(100svh - 4.25rem);
}
.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero-heading {
  font-size: clamp(2.7rem, 6.2vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.hero-lede {
  margin-top: clamp(1.4rem, 2.8vw, 2rem);
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.5vw, 1.17rem);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  margin-top: clamp(1.9rem, 3.4vw, 2.6rem);
}

/* ---------- Home: client logos (rolodex) ---------- */

/* Sits inside the hero, on its gradient: no strip of its own. */
.clients {
  position: relative;
  z-index: 1;
}
.clients-row {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.4rem, 2.8vw, 2rem);
}
/* The rule sits on the rail, not the shell, so it lines up with the
   service-row rules inside the content column. */
.logo-rail {
  flex: 1;
  border-top: 1px solid var(--rule-strong);
  padding-top: clamp(1.4rem, 2.8vw, 2rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
}
.logo-rail.is-static { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.logo-slot {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Single muted tone: the logo is used as a mask, so every mark renders in
   exactly Slate Grey whatever colours the source file carries. */
.logo {
  display: block;
  width: calc(var(--w, 150px) * var(--logo-scale, 1));
  height: calc(var(--h, 36px) * var(--logo-scale, 1));
  max-width: 100%;
  background: var(--slate-grey);
  -webkit-mask: var(--u) center / contain no-repeat;
          mask: var(--u) center / contain no-repeat;
  transition: transform 460ms var(--ease), opacity 460ms var(--ease);
}
.logo.is-leaving { transform: translateY(-65%); opacity: 0; }
.logo.is-entering { transform: translateY(65%); opacity: 0; transition: none; }
/* ---------- Home: why ---------- */

.why { background: var(--white); padding-block: clamp(5rem, 11vw, 9rem); }
.why-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.75rem, 3.5vw, 2.5rem);
}
.why-statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--midnight);
  max-width: 20ch;
}
.why-copy { max-width: 52ch; }
.why-copy p { font-size: clamp(1.02rem, 1.5vw, 1.15rem); color: var(--text-muted); }
.why-copy p + p { margin-top: 1.2rem; }

/* ---------- Section heading ---------- */

.section-heading {
  font-size: clamp(1.55rem, 2.7vw, 2.1rem);
  letter-spacing: -0.015em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* ---------- Home: what we do ---------- */

.services { background: var(--section-grey); padding-block: clamp(4.5rem, 9vw, 7rem); }
.services-rows { border-top: 1px solid var(--rule-strong); }
.service-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto;
  gap: 0.75rem 2rem;
  align-items: center;
  padding-block: clamp(1.75rem, 3.4vw, 2.6rem);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--text);
}
/* A blue rule draws across the top edge on hover. */
.service-row::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -1px;
  height: 1px;
  background: var(--riverr-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 520ms var(--ease);
}
.service-row:hover::before { transform: scaleX(1); }
.service-row h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--midnight);
  transition: transform 320ms var(--ease);
}
.service-row:hover h3 { transform: translateX(0.35rem); }
.service-row p { color: var(--text-muted); font-size: 1.05rem; max-width: 36ch; }
.service-go {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--midnight);
  font-size: 1.2rem;
  line-height: 1;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), color 220ms var(--ease);
}
.service-row:hover .service-go { background: var(--riverr-blue); border-color: var(--riverr-blue); color: var(--white); }
.service-row:focus-visible .service-go { background: var(--riverr-blue); border-color: var(--riverr-blue); color: var(--white); }
@media (prefers-reduced-motion: reduce) {
  .service-row::before, .service-row h3 { transition: none; }
  .service-row:hover h3 { transform: none; }
}

.services-note {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---------- Project cards (home frames + work index) ---------- */

.work { background: var(--white); padding-block: clamp(4.5rem, 9vw, 7rem); }
.work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.work-stack { display: flex; flex-direction: column; gap: clamp(2.5rem, 5vw, 3.75rem); }
.work-frame { display: block; color: inherit; }
.frame-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light-grey);
}
.frame-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}
a.work-frame:hover .frame-media img,
a.index-item:hover .index-media img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) {
  a.work-frame:hover .frame-media img,
  a.index-item:hover .index-media img { transform: none; }
}
.frame-caption {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0.35rem 2rem;
  align-items: baseline;
  padding-top: 1.1rem;
}
.frame-caption h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); letter-spacing: -0.01em; }
.frame-caption .frame-sub { color: var(--text); font-size: 1rem; margin-top: 0.15rem; }
.frame-caption .meta { justify-self: end; text-align: right; }

/* ---------- Home: how we work ---------- */

.process { background: var(--section-grey); padding-block: clamp(4.5rem, 9vw, 7rem); }
.flow {
  --marker: 12px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: 2.4rem;
}
.flow::before {
  content: "";
  position: absolute;
  top: calc(var(--marker) / 2);
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--riverr-blue), var(--rule-strong) 60%);
}
.flow-step { position: relative; }
.flow-marker {
  position: absolute;
  top: -2.4rem; left: 0;
  width: var(--marker); height: var(--marker);
  border-radius: 50%;
  background: var(--section-grey);
  border: 2px solid var(--riverr-blue);
}
.flow-marker.is-active { background: var(--bright-cyan); border-color: var(--bright-cyan); }
.flow-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.flow-step h3 { margin-top: 0.35rem; font-size: 1.16rem; }
.flow-step p { margin-top: 0.5rem; font-size: 0.95rem; color: var(--text-muted); max-width: 26ch; }

/* ---------- Home: closing ---------- */

.closing { background: var(--white); }
.closing-grey { background: var(--section-grey); }
.closing-inner {
  padding-block: clamp(5.5rem, 12vw, 10rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.closing h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
.closing-sub { margin-top: 0.9rem; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--text-muted); }
.closing .btn { margin-top: 2.1rem; }
.closing-base { margin-top: 2.3rem; }

/* ============================================================
   INTERIOR PAGES
   ============================================================ */

.page-head-inner {
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.page-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.page-lede {
  margin-top: clamp(1.2rem, 2.4vw, 1.75rem);
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
}

/* ---------- Work: filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.filter-btn {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  min-height: 2.5rem;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.filter-btn:hover { border-color: var(--midnight); color: var(--midnight); }
/* Selected state: Riverr Blue, matching the primary buttons */
.filter-btn[aria-pressed="true"] {
  background: var(--riverr-blue);
  border-color: var(--riverr-blue);
  color: var(--white);
}

/* ---------- Work: index ---------- */

.index-list {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
}
.index-item {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  color: inherit;
}
.index-item[hidden] { display: none; }
.index-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light-grey);
}
.index-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.index-meta h2 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); letter-spacing: -0.015em; }
.index-sub { margin-top: 0.2rem; font-size: 1.02rem; color: var(--text); }
.index-desc { margin-top: 0.8rem; color: var(--text-muted); font-size: 1rem; max-width: 36ch; }
.index-meta .meta { margin-top: 0.8rem; }
.index-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.93rem;
  font-weight: 400;
  color: var(--riverr-blue);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--ease);
}
a.index-item:hover .index-more { border-bottom-color: var(--riverr-blue); }
.index-empty { padding-block: clamp(2.5rem, 5vw, 4rem); color: var(--text-muted); }

/* ============================================================
   CASE STUDY
   ============================================================ */

.case-head-inner {
  padding-top: clamp(3.5rem, 8vw, 6rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.case-back { display: inline-block; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); font-size: 0.92rem; font-weight: 400; }
.case-title {
  font-size: clamp(2.2rem, 4.8vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  max-width: 20ch;
}
.case-lede {
  margin-top: clamp(1.1rem, 2.2vw, 1.5rem);
  max-width: 52ch;
  font-size: clamp(1.08rem, 1.6vw, 1.25rem);
}
.case-head-inner .meta { margin-top: 1.1rem; }

.case-hero {
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background: var(--light-grey);
}
.case-hero img { width: 100%; height: 100%; object-fit: cover; }

.case-body {
  display: flex;
  flex-direction: column;
  gap: clamp(3.25rem, 7vw, 5.5rem);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}
.case-intro {
  max-width: 44rem;
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.55;
  color: var(--midnight);
}
.case-section {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
}
.case-section > h2 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); letter-spacing: -0.015em; }
.case-copy { display: flex; flex-direction: column; gap: 1.1rem; }
.case-copy p { font-size: clamp(1.03rem, 1.5vw, 1.16rem); max-width: 58ch; }

/* Figures */
.figure-row { display: grid; gap: clamp(0.85rem, 2vw, 1.5rem); }
.figure-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figure-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fig .fig-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light-grey);
}
.fig.ratio-43 .fig-media { aspect-ratio: 4 / 3; }
.fig.is-screen .fig-media { border: 1px solid var(--rule-strong); }
.fig .fig-media img { width: 100%; height: 100%; object-fit: cover; }
.fig figcaption { margin-top: 0.7rem; }
.fig figcaption strong { font-weight: 500; color: var(--midnight); }

/* Scope / deliverables list */
.scope-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
  border-top: 1px solid var(--rule-strong);
}
.scope-list li {
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: baseline;
}
.scope-list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--riverr-blue);
  transform: translateY(-0.15em);
}

/* Pull statement */
.pull {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--midnight);
  max-width: 26ch;
}
.pull-block { display: flex; flex-direction: column; gap: 1.1rem; max-width: 46rem; }
.pull-block p:not(.pull) { font-size: clamp(1.03rem, 1.5vw, 1.16rem); max-width: 56ch; }

/* Onus: platform user groups */
.groups { display: flex; flex-direction: column; gap: clamp(2.5rem, 5vw, 3.75rem); }
.group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
}
.group h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.group-copy p { font-size: 1.04rem; max-width: 52ch; }
.group-copy .figure-row { margin-top: 1.4rem; }

/* Video player + playlist */
.player {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: start;
}
.player.is-single { grid-template-columns: 1fr; }
.player-frame {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--midnight);
}
/* contain, never cover: the short films are square and carry burned-in subtitles */
.player-frame video { width: 100%; height: 100%; object-fit: contain; background: var(--midnight); }
.now-playing { margin-top: 0.8rem; }
.playlist { border-top: 1px solid var(--rule-strong); }
.playlist-heading { font-size: 1.05rem; margin-bottom: 0.9rem; }
.playlist button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  text-align: left;
  padding: 0.85rem 0.25rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.playlist button:hover { color: var(--midnight); background: var(--white); }
.playlist .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}
.playlist button[aria-current="true"] { color: var(--midnight); }
.playlist button[aria-current="true"] .dot { background: var(--bright-cyan); border-color: var(--bright-cyan); }
.playlist .kind { font-size: 0.8rem; color: var(--text-muted); }

/* Project facts */
.facts h2 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
/* Image viewer: thumbnails become buttons, the overlay shows the large file */
.zoom-btn {
  display: block;
  width: 100%; height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.zoom-btn:focus-visible { outline: 2px solid var(--riverr-blue); outline-offset: 3px; }
.lb-open, .lb-open body { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.9);
}
.lightbox[hidden] { display: none; }
.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 100%;
}
.lb-figure img {
  max-width: min(92vw, 1600px);
  max-height: 80vh;
  width: auto; height: auto;
  border-radius: var(--radius);
}
.lb-caption { color: var(--light-grey); font-size: 0.92rem; text-align: center; max-width: 60ch; }
.lb-close, .lb-nav {
  position: absolute;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(231, 235, 242, 0.28);
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}
.lb-close:hover, .lb-nav:hover { background: var(--riverr-blue); border-color: var(--riverr-blue); }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 2px solid var(--bright-cyan); outline-offset: 2px; }
.lb-close { top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.lb-next { right: clamp(0.5rem, 2vw, 1.5rem); }
@media (max-width: 640px) {
  .lb-nav { top: auto; bottom: clamp(0.75rem, 3vw, 1.5rem); transform: none; }
}

/* Case study: full gallery band */
.gallery-intro { margin-bottom: clamp(2rem, 4vw, 3rem); }
.gallery-more { display: none; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
}

.facts-table {
  width: 100%;
  max-width: 50rem;
  border-collapse: collapse;
  border-top: 1px solid var(--rule-strong);
}
.facts-table th,
.facts-table td {
  text-align: left;
  vertical-align: top;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}
.facts-table th { width: 9.5rem; padding-right: 1.5rem; font-size: 0.88rem; color: var(--text-muted); }
.facts-table td { font-size: 1rem; color: var(--text); }

/* Next project */
.next-project { border-top: 1px solid var(--rule); }
.next-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: clamp(2rem, 4vw, 2.75rem);
  color: inherit;
}
.next-link .meta { display: block; }
.next-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 2.4vw, 1.9rem); color: var(--midnight); }
.next-arrow { font-size: 1.4rem; color: var(--riverr-blue); transition: transform 220ms var(--ease); }
.next-link:hover .next-arrow { transform: translateX(4px); }

/* ---------- Page CTA ---------- */

.page-cta { border-top: 1px solid var(--rule); }
.page-cta-inner {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.page-cta h2 { font-size: clamp(2rem, 4.6vw, 3.3rem); letter-spacing: -0.02em; }
.page-cta .btn { margin-top: 2rem; }

/* ============================================================
   SERVICES / STUDIO / CONTACT
   ============================================================ */

.section-intro {
  max-width: 52ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
}

/* Services: same grounds and type scale as the home page.
   Section heading → row title → body lead → muted body; nothing else. */
.top-section { padding-top: clamp(2rem, 4vw, 3rem); padding-bottom: clamp(4.5rem, 9vw, 7rem); }
/* Services: page head + Core services share one gradient ground */
.page-top > section { position: relative; z-index: 1; }
.aura-top-right {
  top: -6rem;
  right: -10%;
  width: min(74vw, 66rem);
  aspect-ratio: 1 / 0.8;
  background:
    radial-gradient(closest-side at 62% 26%, rgba(18, 62, 174, 0.22), transparent 64%),
    radial-gradient(closest-side at 54% 44%, rgba(23, 105, 232, 0.24), transparent 72%),
    radial-gradient(closest-side at 38% 62%, rgba(21, 154, 245, 0.18), transparent 74%),
    radial-gradient(closest-side at 72% 72%, rgba(32, 212, 245, 0.12), transparent 72%);
}
.aura-top-left {
  top: 2rem;
  left: -12%;
  width: min(48vw, 42rem);
  aspect-ratio: 1.2 / 1;
  background:
    radial-gradient(closest-side at 48% 50%, rgba(21, 154, 245, 0.13), transparent 72%),
    radial-gradient(closest-side at 60% 36%, rgba(32, 212, 245, 0.09), transparent 70%);
}
/* Carries the colour down through the service list, then fades out */
.aura-top-low {
  bottom: -8%;
  right: 4%;
  width: min(62vw, 56rem);
  aspect-ratio: 1.3 / 1;
  background:
    radial-gradient(closest-side at 50% 50%, rgba(23, 105, 232, 0.12), transparent 72%),
    radial-gradient(closest-side at 30% 60%, rgba(32, 212, 245, 0.09), transparent 70%);
}
.svc-beyond { background: var(--white); padding-block: clamp(4.5rem, 9vw, 7rem); }

.core-rows { border-top: 1px solid var(--rule-strong); }
.core-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0.6rem 2rem;
  align-items: center;
  padding-block: clamp(1.6rem, 3vw, 2.3rem);
  border-bottom: 1px solid var(--rule-strong);
}
.core-row h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--midnight);
}
.core-row p { color: var(--text-muted); font-size: 1.05rem; max-width: 46ch; }

.beyond-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.25rem 2rem;
  align-items: start;
}
.beyond-grid .section-heading { margin-bottom: 0; }
.body-lead {
  font-size: clamp(1.05rem, 1.5vw, 1.15rem);
  line-height: 1.75;
  color: var(--text);
  max-width: 58ch;
}

.closing-copy { max-width: 52ch; margin-top: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.closing-copy + .btn { margin-top: 2.6rem; }
.closing-copy p { font-size: clamp(1.05rem, 1.5vw, 1.15rem); color: var(--text-muted); }

/* Shared bands for interior pages: same rhythm as the home sections */
.band { padding-block: clamp(4.5rem, 9vw, 7rem); }
.band-white { background: var(--white); }
.band-grey { background: var(--section-grey); }

/* Heading-weight statement on the left, body copy on the right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 2rem;
  align-items: start;
}
.split-statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--midnight);
  max-width: 16ch;
}

/* Studio: founder */
.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 2rem;
  align-items: start;
}
.founder-slot {
  aspect-ratio: 4 / 5;
  max-width: 24rem;
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--white), var(--light-grey) 92%);
  border: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.2rem;
}
.founder-name { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.01em; color: var(--midnight); }
.founder-role { margin-top: 0.35rem; font-size: 1.05rem; color: var(--text-muted); }
.founder-copy { margin-top: clamp(1.5rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1.2rem; }

/* Studio: principles, numbered like the home process */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--rule-strong);
}
.principles li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-block: clamp(1.4rem, 2.8vw, 2rem);
  border-bottom: 1px solid var(--rule-strong);
}
.principle-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--riverr-blue);
}
.principles p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.35;
  color: var(--midnight);
}

.slot-note { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-grid .section-heading { margin-bottom: clamp(1.5rem, 3vw, 2rem); }
/* The Direct card comes first in the markup (so phones and screen readers
   meet it first) but sits in the right-hand column on wide screens. */
.contact-form-col { grid-column: 1; grid-row: 1; }
.contact-grid > .direct-block { grid-column: 2; grid-row: 1; }
.enquiry-form { display: flex; flex-direction: column; gap: clamp(1.4rem, 2.8vw, 1.9rem); max-width: 34rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: 0.92rem; font-weight: 400; color: var(--midnight); }
.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  color: var(--midnight);
  background: var(--white);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  min-height: 3.1rem;
  width: 100%;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--slate-grey); }
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--riverr-blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.18);
}
.field select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235B6A80' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
}
.form-status { font-size: 0.94rem; border-left: 2px solid var(--riverr-blue); padding-left: 0.9rem; }
.form-status:empty { display: none; }
.form-status[data-state="error"] { border-left-color: #B42318; color: #912018; }
/* Honeypot: off-screen for people, still in the form for bots */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Turnstile only shows itself when it needs the visitor to interact */
.cf-turnstile:empty { display: none; }
.form-success {
  max-width: 34rem;
  border-left: 2px solid var(--riverr-blue);
  padding: 0.25rem 0 0.25rem 1.25rem;
}
.form-success:focus { outline: none; }
.form-success h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.015em; color: var(--midnight); }
.form-success p { margin-top: 0.6rem; color: var(--text-muted); font-size: 1.05rem; }

.direct-block {
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--rule);
  padding: clamp(1.6rem, 3vw, 2.2rem);
}
.direct-block h2 { font-family: var(--font-body); font-weight: 400; font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1rem; }
.direct-block a { display: block; font-size: 1.05rem; }
.direct-block a + a { margin-top: 0.55rem; }
.direct-block span { display: block; margin-top: 0.9rem; color: var(--text-muted); font-size: 1.02rem; }

/* ============================================================
   FOOTER — Midnight, the brand's principal dark canvas
   ============================================================ */

.site-footer {
  background: var(--midnight);
  color: var(--white);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.footer-brand img { width: 124px; height: auto; }
.footer-tagline { margin-top: 1.2rem; color: var(--light-grey); font-size: 0.98rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col h3 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--slate-grey);  /* 4.6:1 on Midnight */
  margin-bottom: 0.45rem;
}
.footer-col a, .footer-col span { color: var(--light-grey); font-size: 0.95rem; font-weight: 300; width: fit-content; }
.footer-col a { transition: color 180ms var(--ease); }
.footer-col a:hover { color: var(--white); }
.footer-col a:focus-visible { outline-color: var(--bright-cyan); }
.footer-base {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-block: 1.5rem;
  border-top: 1px solid rgba(231, 235, 242, 0.14);
}
.footer-base p { font-size: 0.84rem; color: var(--slate-grey); text-align: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .aura-hero { width: 94vw; right: -32%; top: -12%; }
  .aura-hero-left { width: 80vw; left: -30%; }
  .aura-page { width: 94vw; right: -30%; }
  .aura-page-left { width: 80vw; left: -34%; }
  .aura-top-right { width: 94vw; right: -30%; }
  .aura-top-left, .aura-top-low { width: 80vw; }
  .service-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0.5rem 1.5rem; }
  .service-row p { grid-column: 1; }
  .service-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .index-item { grid-template-columns: 1fr; gap: 1.25rem; }
  .case-section, .group { grid-template-columns: 1fr; gap: 0.9rem; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { grid-template-columns: 1fr; }
  .beyond-grid { grid-template-columns: 1fr; }
  .core-row { grid-template-columns: 1fr; }
  .founder-grid, .split { grid-template-columns: 1fr; }
  .founder-slot { max-width: 22rem; }
  .principles { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form-col, .contact-grid > .direct-block { grid-column: auto; grid-row: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .frame-caption { grid-template-columns: 1fr; }
  .frame-caption .meta { justify-self: start; text-align: left; }
}

@media (max-width: 640px) {
  .logo-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-rail.is-static { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure-row.cols-2, .figure-row.cols-3 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .scope-list { grid-template-columns: 1fr; }
  .flow {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 0;
    padding-left: 2.1rem;
  }
  .flow::before {
    top: 0; bottom: 0; left: calc(var(--marker) / 2);
    right: auto; width: 1px; height: auto;
    background: linear-gradient(to bottom, var(--riverr-blue), var(--rule-strong) 60%);
  }
  .flow-marker { top: 0.35rem; left: -2.1rem; }
  .facts-table th, .facts-table td { display: block; width: auto; }
  .facts-table th { padding-bottom: 0.2rem; border-bottom: 0; }
  .facts-table td { padding-top: 0; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; }
  .closing .btn { width: 100%; }
}

/* Mobile home sections: one consistent vertical rhythm (3.75rem bands,
   1.5rem under headings) so nothing floats in oversized padding. */
@media (max-width: 640px) {
  .why { padding-block: 4rem; }
  .why-inner { gap: 1.5rem; }
  .why-copy p { font-size: 1.02rem; }

  .work, .process { padding-block: 3.75rem; }
  .work .section-heading, .process .section-heading { margin-bottom: 1.75rem; }
  .work-stack { gap: 2.25rem; }
  .frame-caption { padding-top: 0.9rem; gap: 0.25rem; }
  .frame-caption .meta { margin-top: 0.4rem; }

  .flow { gap: 1.6rem; }
  .flow-step p { max-width: none; }

  .closing-inner { padding-block: 4.5rem; }
  .closing .btn { margin-top: 1.75rem; }
  .closing-base { margin-top: 1.75rem; }

  /* Footer: centred brand, then each group as a heading over one
     wrapping row of links */
  .site-footer { padding-top: 3rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.25rem; text-align: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
  .footer-col {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.6rem;
  }
  .footer-col h3 { flex-basis: 100%; margin-bottom: 0.25rem; }
  /* On phones the burger menu already covers navigation, so the footer
     keeps only the Studio contact details. */
  .footer-grid > .footer-col:not(:last-child) { display: none; }
  .footer-base { margin-top: 2.5rem; }
}

/* Mobile interior page heads and the Work index */
@media (max-width: 640px) {
  .page-head-inner { padding-top: 3rem; padding-bottom: 2rem; }

  /* Filters become one swipeable row that runs to the screen edges,
     with a fade on the right hinting there is more to scroll. */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--shell-pad));
    padding: 3px 4rem 1.75rem var(--shell-pad);
    scroll-padding-inline: var(--shell-pad);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
            mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: none; scroll-snap-align: start; }

  .index-list { gap: 2.75rem; padding-bottom: 3.75rem; }
  .index-item { gap: 1rem; }
  .index-desc { margin-top: 0.55rem; max-width: none; }
  .index-meta .meta { margin-top: 0.6rem; }
  .index-more { margin-top: 0.75rem; }
}

/* Mobile Services (and the shared interior bands it uses) */
@media (max-width: 640px) {
  .top-section { padding-top: 1.25rem; padding-bottom: 3.75rem; }
  .top-section .section-heading { margin-bottom: 1.5rem; }
  .core-row { padding-block: 1.35rem; row-gap: 0.4rem; }
  .core-row p { font-size: 1rem; }

  .svc-beyond, .band { padding-block: 3.75rem; }
  .beyond-grid { gap: 1rem; }
  .body-lead { font-size: 1.02rem; line-height: 1.7; }

  .closing-copy { margin-top: 1rem; gap: 0.75rem; }
  .closing-copy p { font-size: 1rem; }
}

/* Mobile Studio */
@media (max-width: 640px) {
  .split { gap: 1rem; }
  .split-statement { font-size: 1.3rem; }

  /* Founder: a small portrait beside the name and role, bio full width
     below, so the placeholder no longer fills a whole screen. */
  .founder-grid {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    column-gap: 1.1rem;
    row-gap: 0;
    align-items: center;
  }
  .founder-slot { grid-row: 1 / span 2; max-width: none; padding: 0.5rem 0.6rem; }
  .founder-slot .slot-note { font-size: 0.68rem; line-height: 1.3; }
  .founder-text { display: contents; }
  .founder-name { grid-column: 2; align-self: end; }
  .founder-role { grid-column: 2; align-self: start; font-size: 0.95rem; }
  .founder-copy { grid-column: 1 / -1; margin-top: 1.5rem; }

  .principles li { grid-template-columns: 1.75rem 1fr; gap: 0.75rem; padding-block: 1.1rem; }
  .principles p { font-size: 1.08rem; }
}

/* Mobile Contact: direct details first (one tap to email or call; they
   are first in the markup too),
   then a tighter form with a full-width submit button */
@media (max-width: 640px) {
  .contact-grid { gap: 2.25rem; }
  .direct-block { padding: 1.25rem 1.4rem; }
  .direct-block h2 { margin-bottom: 0.6rem; }
  .direct-block span { margin-top: 0.6rem; }
  .contact-grid .section-heading { margin-bottom: 1.25rem; }
  .enquiry-form { gap: 1.15rem; }
  .field { gap: 0.4rem; }
  .field textarea { min-height: 7.5rem; }
  .enquiry-form .btn { width: 100%; }
}

/* Mobile case studies (shared by every project page) */
@media (max-width: 640px) {
  .case-head-inner { padding-top: 2.25rem; padding-bottom: 1.75rem; }
  .case-back { margin-bottom: 1.25rem; }
  .case-lede { font-size: 1.05rem; }

  .case-body { gap: 2.5rem; padding-block: 2.5rem 3rem; }
  .case-intro { font-size: 1.1rem; }
  .fig figcaption { margin-top: 0.5rem; }

  /* Project facts: label and value side by side, one compact row each */
  .facts h2 { margin-bottom: 1.1rem; }
  .facts-table tr {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.75rem;
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--rule);
  }
  .facts-table th, .facts-table td { display: block; width: auto; padding: 0; border: 0; }
  .facts-table th { padding-top: 0.12rem; }

  /* Gallery: two across so nineteen-plus images don't become a
     five-screen scroll; tap any tile to see it large. */
  .gallery-intro { margin-bottom: 1.5rem; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.75rem; }
  .gallery-grid .fig .fig-media { border-radius: calc(var(--radius) - 4px); }
  .gallery-grid figcaption { margin-top: 0.4rem; font-size: 0.78rem; line-height: 1.4; }
  /* Screenshot galleries (Onus) stay one per row at full width: an
     interface is unreadable as a thumbnail. */
  .gallery-grid.is-screens { grid-template-columns: 1fr; gap: 1.5rem; }
  .gallery-grid.is-screens .fig .fig-media { border-radius: var(--radius); }
  .gallery-grid.is-screens figcaption { margin-top: 0.55rem; font-size: 0.84rem; }
  /* Preview the first 12 tiles (GALLERY_PREVIEW in site_build.py) */
  .js .gallery-grid:not(.is-expanded) > .fig:nth-child(n+13) { display: none; }
  .js .gallery-more:not([hidden]) {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    min-height: 3.1rem;
    margin-top: 1.75rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    background: var(--white);
    color: var(--midnight);
    font: 400 1rem/1 var(--font-body);
    cursor: pointer;
  }
  .js .gallery-more:hover { border-color: var(--midnight); }
  .js .gallery-more:focus-visible { outline: 2px solid var(--riverr-blue); outline-offset: 2px; }

  .next-link { padding-block: 1.5rem; }
  .next-title { font-size: 1.15rem; }
  .page-cta-inner { padding-block: 3.75rem; }
  .page-cta .btn { margin-top: 1.5rem; }
}
@media (max-width: 640px) {
  /* Three-image rows become a mosaic: the first image full width, the
     other two side by side beneath it (tap to enlarge). */
  .figure-row.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .figure-row.cols-3 > .fig:first-child { grid-column: 1 / -1; }
  .figure-row.cols-3 > .fig:not(:first-child) figcaption { font-size: 0.78rem; line-height: 1.4; }

  /* Pairs of 4:3 photographs (SteamBio, Why Namibia) sit side by side;
     16:9 pairs such as Polar's before/after keep stacking at full width. */
  .figure-row.cols-2:has(> .ratio-43) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .figure-row.cols-2:has(> .ratio-43) figcaption { font-size: 0.78rem; line-height: 1.4; }
  .figure-row.cols-2:has(> .ratio-43) + .meta { margin-top: 0.6rem; }

  /* Grouped screens (Onus) and scope lists */
  .groups { gap: 2.25rem; }
  .group { gap: 0.6rem; }
  .group-copy .figure-row { margin-top: 1.1rem; gap: 1rem; }
  .scope-list li { padding-block: 0.65rem; font-size: 0.98rem; }

  /* Video series */
  .player { gap: 1.25rem; }
  .now-playing { margin-top: 0.6rem; }
  .playlist-heading { margin-bottom: 0.5rem; }
  .playlist button { padding: 0.7rem 0.25rem; font-size: 0.95rem; }
}
@media (max-width: 420px) {
  .page-cta .btn { width: 100%; }
}

/* Mobile "What we do": tighter section and row rhythm */
@media (max-width: 640px) {
  .services { padding-block: 3.75rem; }
  .services .section-heading { margin-bottom: 1.5rem; }
  .service-row { padding-block: 1.35rem; row-gap: 0.35rem; }
  .service-row p { font-size: 1rem; }
  .service-go { width: 2.5rem; height: 2.5rem; }
  .services-note { margin-top: 1.5rem; }
}

/* Mobile hero: centred, tighter vertical rhythm, quieter client logos */
@media (max-width: 640px) {
  .hero-inner {
    text-align: center;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  .hero-lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .clients { --logo-scale: 0.68; }
  .clients-row { padding-bottom: 1.75rem; }
  .logo-rail { padding-top: 1.5rem; row-gap: 0.75rem; }
  .logo-slot { height: 44px; }
}
