/* ==========================================================================
   Glossy Branding Agency — design system
   Hand-written rebuild of glossybranding.com. No framework, no jQuery.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Rethink Sans";
  src: url("../fonts/RethinkSans-var.ttf") format("truetype-variations"),
       url("../fonts/RethinkSans-var.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rethink Sans";
  src: url("../fonts/RethinkSans-Italic-var.ttf") format("truetype-variations"),
       url("../fonts/RethinkSans-Italic-var.ttf") format("truetype");
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Colour */
  --paper:      #ffffff;
  --ink:        #111111;
  --ink-soft:   #333333;
  --gray:       #737373;
  --gray-on-dark: #b3b3b3;
  --smoke:      #f3f1f1;
  --cream:      #fffbe9;
  --line:       #e2e2e2;

  /* Type — fluid, clamped so it stays sane on very small and very wide screens.
     The original site scaled everything off 1vw, which breaks under browser zoom;
     clamp() keeps the same feel while remaining accessible. */
  --step--1: clamp(0.75rem, 0.71rem + 0.20vw, 0.875rem);
  --step-0:  clamp(0.938rem, 0.89rem + 0.24vw, 1.063rem);
  --step-1:  clamp(1.125rem, 1.02rem + 0.52vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.24rem + 1.30vw, 2.25rem);
  --step-3:  clamp(2rem, 1.48rem + 2.61vw, 3.5rem);
  --step-4:  clamp(2.5rem, 1.63rem + 4.35vw, 5rem);

  /* Type roles */
  --weight-heading: 400;
  --weight-heading-editorial: 400;

  /* Space */
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Layout */
  --gutter: clamp(1.25rem, 0.55rem + 3.5vw, 5.5rem);
  --measure: 62ch;
  --radius: 5px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 320ms;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: "Rethink Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--weight-heading);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

/* Rethink Sans only sings at regular: everything sits at 400, strong (and
   b/th) at 500, the face range caps there and no faux bold is synthesised. */
strong, b, th { font-weight: 500; }
body { font-synthesis-weight: none; }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* Respect users who ask for less motion. */
@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;
  }
}

/* --- Utilities ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: 1760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }

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

.eyebrow {
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--gray);
}

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

.skip-link {
  position: absolute;
  top: 0; left: var(--gutter);
  transform: translateY(-120%);
  z-index: 100;
  padding: var(--space-2xs) var(--space-s);
  background: var(--ink);
  color: var(--paper);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-m);
}

.logo { display: block; width: clamp(110px, 10vw, 154px); }
.logo img { width: 100%; }

/* Lottie injects its own <svg>; the static logo sits underneath until then so
   the mark is never missing, including with JavaScript off. */
.logo__anim { display: block; aspect-ratio: 154 / 58; }
.logo__anim svg { display: block; width: 100%; height: 100%; }

/* --- Cookie banner -------------------------------------------------------- */

/* The old site used a stark black strip with small white type and pill
   controls. This keeps that signature, using the current system tokens and an
   explicit equal-weight accept/reject choice. Hidden until JS has checked the
   stored preference, so returning visitors never see it flash. */
.cookie-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 1500;
  display: none;
  gap: var(--space-l);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-m) var(--gutter);
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  font-size: var(--step--1);
  transform: translateY(100%);
  transition: transform 420ms var(--ease);
}

.cookie-bar[data-open] { display: flex; }
.cookie-bar[data-open="true"] { transform: translateY(0); }

.cookie-bar__content { display: grid; gap: var(--space-2xs); max-width: 68ch; }

.cookie-bar__eyebrow {
  margin: 0;
  color: var(--paper);
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
}

.cookie-bar__text {
  max-width: 68ch;
  margin: 0;
  color: color-mix(in srgb, var(--paper) 78%, var(--gray-on-dark));
}
.cookie-bar__text a { text-decoration: underline; text-underline-offset: 0.22em; }
.cookie-link { text-decoration: underline; text-underline-offset: 0.5em; }

.cookie-bar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.btn.cookie-btn {
  justify-content: center;
  border-color: var(--paper);
  color: var(--paper);
  white-space: nowrap;
}
.btn.cookie-btn:hover,
.btn.cookie-btn:focus-visible { background: var(--paper); color: var(--ink); }

.cookie-link {
  padding: 0.65em 0.25em;
  color: inherit;
  font-size: var(--step--1);
}
.cookie-link:hover { color: var(--cream); }

.cookie-bar :focus-visible,
.cookie-preferences :focus-visible {
  outline-color: var(--paper);
}

/* Preference manager ------------------------------------------------------ */

.cookie-preferences[hidden] { display: none; }

.cookie-preferences {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: var(--gutter);
  background: rgb(17 17 17 / 0.72);
  backdrop-filter: blur(8px);
}

.cookie-preferences__dialog {
  width: min(100%, 54rem);
  max-height: calc(100svh - (2 * var(--gutter)));
  overflow-y: auto;
  padding: clamp(var(--space-m), 3vw, var(--space-l));
  border: 1px solid color-mix(in srgb, var(--paper) 24%, transparent);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 0.28);
}

.cookie-preferences__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-m);
}

.cookie-preferences__title {
  font-size: var(--step-2);
  font-weight: var(--weight-heading-editorial);
}

.cookie-preferences__close {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: calc(var(--space-2xs) * -1);
  border-radius: 50%;
  color: var(--paper);
  font-size: var(--step-1);
  line-height: 1;
}
.cookie-preferences__close:hover { background: color-mix(in srgb, var(--paper) 12%, transparent); }

.cookie-preferences__intro {
  max-width: 66ch;
  margin-top: var(--space-s);
  color: var(--gray-on-dark);
}

.cookie-options {
  margin-top: var(--space-l);
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
}

.cookie-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-s) var(--space-m);
  padding-block: var(--space-m);
  border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
}

.cookie-option__title {
  display: block;
  font-size: var(--step-0);
  font-weight: 400;
}

.cookie-option__description {
  grid-column: 1 / -1;
  max-width: 66ch;
  margin: 0;
  color: var(--gray-on-dark);
  font-size: var(--step--1);
}

.cookie-option__state {
  align-self: center;
  color: var(--gray-on-dark);
  font-size: var(--step--1);
  text-transform: uppercase;
}

.cookie-switch {
  appearance: none;
  position: relative;
  align-self: center;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--paper);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

.cookie-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.cookie-switch:checked { background: var(--cream); }
.cookie-switch:checked::after { transform: translateX(20px); background: var(--ink); }
.cookie-switch:disabled { cursor: not-allowed; opacity: 0.7; }

.cookie-preferences__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-l);
}

.cookie-settings-link {
  color: inherit;
  font-size: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.cookie-settings-link:hover { color: var(--ink); }

/* External media stays local and inert until that category is allowed. */
.consent-embed__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: start;
  gap: var(--space-s);
  padding: var(--space-l);
  background: var(--ink);
  color: var(--paper);
}
.consent-embed__placeholder[hidden] { display: none; }
.consent-embed__placeholder p { max-width: 46ch; margin: 0; color: var(--gray-on-dark); }

@media (max-width: 700px) {
  .cookie-bar {
    max-height: 80svh;
    overflow-y: auto;
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-m);
  }
  .cookie-bar__actions { width: 100%; justify-content: flex-start; }
  .cookie-bar__actions .cookie-btn { flex: 1 1 9rem; }
  .cookie-bar__actions .cookie-link { flex-basis: 100%; text-align: left; }
  .cookie-preferences { place-items: start center; padding: var(--space-s); }
  .cookie-preferences__dialog { max-height: calc(100svh - (2 * var(--space-s))); }
  .cookie-preferences__actions .cookie-btn { flex: 1 1 9rem; }
  .consent-embed__placeholder { padding: var(--space-m); }
}

/* --- Page transition ------------------------------------------------------ */

.transition {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: var(--paper);
  /* Hidden unless the script explicitly raises it: with JavaScript off no
     data-state is ever set, and an opaque default blanked the whole page. */
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--ease), visibility 420ms var(--ease);
}

.transition[data-state="in"] { opacity: 1; visibility: visible; }

.transition__logo { width: clamp(140px, 14vw, 220px); aspect-ratio: 154 / 58; }
.transition__logo svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .transition { display: none; }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

/* The wipe-fill link: a cream block slides up behind the label on hover.
   Pure CSS — the original used a Webflow interaction. */
.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.45em 0.85em;
  font-size: var(--step--1);
  font-weight: 400;
  isolation: isolate;
  transition: color var(--dur) var(--ease);
  overflow: hidden;
  border-radius: var(--radius);
}

.nav__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform var(--dur) var(--ease);
}

.nav__link:hover::before,
.nav__link:focus-visible::before { transform: translateY(0); }

.nav__link:hover,
.nav__link:focus-visible { color: var(--paper); }

.nav__link[aria-current="page"] { color: var(--gray); }

.has-hero.nav-invert .site-header:not([data-past-hero="true"]) .nav__link[aria-current="page"] {
  color: var(--gray-on-dark);
}

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
}
.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav__toggle span + span { margin-top: 6px; }

@media (max-width: 860px) {
  .nav__toggle { display: block; }

  .nav__list {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-s);
    background: var(--paper);
    font-size: var(--step-2);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition:
      transform var(--dur) var(--ease),
      visibility 0s linear var(--dur);
  }
  .nav[data-open="true"] .nav__list {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .nav__link { font-size: var(--step-2); }

  .nav[data-open="true"] .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav[data-open="true"] .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav[data-open="true"] .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .nav__toggle { position: relative; z-index: 2; }
}

/* --- Hero ----------------------------------------------------------------- */

.hero { padding-block: var(--space-xl) var(--space-l); }

/* Test: the homepage hero on a soft-cornered image panel. */
.hero-panel {
  background: var(--smoke) url("../img/hero-bg.jpg") center / cover no-repeat;
  border-radius: var(--radius);
  padding: clamp(2rem, 1rem + 4vw, 5rem);
  overflow: hidden;
}

.hero__title {
  max-width: 18ch;
  font-size: var(--step-4);
}

/* The site sets the lead-in ("Hello, we are a") in regular and the
   proposition in bold, inside one heading. */
.hero__title .light { font-weight: var(--weight-heading-editorial); }

.hero__lead {
  max-width: 58ch;
  margin-top: var(--space-l);
  font-size: var(--step-0);
  color: var(--ink-soft);
}

/* --- Case grid ------------------------------------------------------------ */

.case-grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(2, 1fr);
}

/* The homepage runs a six-column grid whose column spans repeat every 14 cards:
   3+3 · 2+4 · 4+2 · 3+3 · 3+3 · 2+4 · 3+3. Aspect ratios scale with the span so
   every row keeps one height, the way the original's named grid areas do. */
.case-grid--feature { grid-template-columns: repeat(6, 1fr); }

.case-grid--feature > * { grid-column: span 3; aspect-ratio: 16 / 10; }

.case-grid--feature > :nth-child(14n+3),
.case-grid--feature > :nth-child(14n+6),
.case-grid--feature > :nth-child(14n+11) {
  grid-column: span 2;
  aspect-ratio: 16 / 15;
}

.case-grid--feature > :nth-child(14n+4),
.case-grid--feature > :nth-child(14n+5),
.case-grid--feature > :nth-child(14n+12) {
  grid-column: span 4;
  aspect-ratio: 32 / 15;
}

/* The cases overview is a plain four-up grid, not the homepage rhythm. */
.case-grid--uniform { grid-template-columns: repeat(4, 1fr); }
.case-grid--uniform > * { aspect-ratio: 16 / 10; }

/* Two-up hero-size work cards for the homepage. */
.case-grid--duo { grid-template-columns: repeat(2, 1fr); }
.case-grid--duo > * { aspect-ratio: 16 / 10; }

@media (max-width: 1100px) {
  .case-grid--uniform { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .case-grid,
  .case-grid--duo,
  .case-grid--feature,
  .case-grid--uniform { grid-template-columns: 1fr; }
  .case-grid--feature > *,
  .case-grid--feature > :nth-child(14n+3),
  .case-grid--feature > :nth-child(14n+4),
  .case-grid--feature > :nth-child(14n+5),
  .case-grid--feature > :nth-child(14n+6),
  .case-grid--feature > :nth-child(14n+11),
  .case-grid--feature > :nth-child(14n+12) {
    grid-column: span 1;
    aspect-ratio: 16 / 10;
  }
}

.case-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--smoke);
}

.case-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.case-card:hover .case-card__media,
.case-card:focus-visible .case-card__media { transform: scale(1.03); }

.case-card__body {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 0.15em;
  padding: var(--space-m);
  color: var(--paper);
  background: linear-gradient(to top, rgb(0 0 0 / 0.62), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.case-card:hover .case-card__body,
.case-card:focus-visible .case-card__body { opacity: 1; }

.case-card__name { font-size: var(--step-1); font-weight: var(--weight-heading); }
.case-card__baseline { font-size: var(--step--1); opacity: 0.85; }

.case-card__flag {
  position: absolute;
  top: var(--space-s); left: var(--space-s);
  padding: 0.2em 0.6em;
  border-radius: 100px;
  background: var(--cream);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 400;
}

/* --- Case detail ---------------------------------------------------------- */

/* A case opens on a full-screen frame, with the header laid over it. */
.case-hero {
  margin: 0;
  overflow: hidden;
  background: var(--smoke);
  height: 100svh;
  min-height: 32rem;
}

/* News detail heroes sit in a fixed 16:9 frame; non-16:9 sources cover-crop. */
.case-hero--ratio {
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.case-hero__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: var(--space-l);
  transform: translateX(-50%);
  z-index: 3;
  padding: 0.5em 1.2em;
  border-radius: 100px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--ink);
  font-size: var(--step--1);
  text-transform: uppercase;
}

.case-hero-wrap { position: relative; }

/* Header floats over the hero rather than pushing it down. */
.has-hero .site-header {
  position: absolute;
  inset: 0 0 auto;
  background: none;
  backdrop-filter: none;
}

/* The CMS "White Nav Text" switch: light type over a dark opening frame. */
.has-hero.nav-invert .site-header { color: var(--paper); }
.has-hero.nav-invert .nav__toggle span { background: var(--paper); }
.has-hero.nav-invert .lottie-fallback { filter: invert(1) brightness(2); }

/* Once the hero has scrolled away the header behaves normally again. */
.has-hero .site-header[data-past-hero="true"] {
  position: fixed;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}
.has-hero.nav-invert .site-header[data-past-hero="true"] .nav__toggle span { background: var(--ink); }
.has-hero.nav-invert .site-header[data-past-hero="true"] .lottie-fallback { filter: none; }

@media (max-width: 860px) {
  /* The full-screen menu panel is opaque, so keep its links readable. */
  .has-hero.nav-invert .nav[data-open="true"] { color: var(--ink); }
}

/* --- Case overview -------------------------------------------------------- */

.case-overview { padding-block: var(--space-2xl) 0; }

.case-overview__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.case-overview__title {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.76rem);
  font-weight: var(--weight-heading-editorial);
  letter-spacing: -0.01em;
}

.case-overview__date {
  margin: 0;
  font-size: var(--step--1);
  text-transform: uppercase;
  color: var(--gray);
}

.case-overview__baseline {
  max-width: 26ch;
  margin-top: var(--space-m);
  font-size: clamp(1.15rem, 0.95rem + 0.85vw, 1.8rem);
  line-height: 1.25;
}

/* Four facts side by side, each label above its value. */
.case-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-m);
  margin: var(--space-2xl) 0 0;
  padding-block: var(--space-l);
  border-block: 1px solid var(--line);
}

.case-facts dt {
  font-size: var(--step--1);
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.4em;
}
.case-facts dd { margin: 0; }

.case-overview__figure {
  width: 100%;
  margin-top: var(--space-2xl);
  border-radius: var(--radius);
}

.case-overview .case-intro { margin-top: var(--space-2xl); max-width: var(--measure); }

.case-website { padding-block: var(--space-xl); }

@media (max-width: 860px) {
  .case-facts { grid-template-columns: repeat(2, 1fr); gap: var(--space-l) var(--space-m); }
}
@media (max-width: 500px) {
  .case-facts { grid-template-columns: 1fr; }
}

/* --- Case closing blocks -------------------------------------------------- */

.case-block { padding-block: var(--space-2xl); border-top: 1px solid var(--line); }

.case-block__title {
  font-size: clamp(1.25rem, 1rem + 1.08vw, 2.08rem);
  font-weight: var(--weight-heading-editorial);
  margin-bottom: var(--space-l);
}

.case-block__lead { max-width: 52ch; margin-bottom: var(--space-l); }

/* Services stay in their four CMS taxonomies rather than merging into one list. */
.what-we-did {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-l) var(--space-m);
  font-size: var(--step--1);
}

.what-we-did__label {
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.6em;
}
.what-we-did__col p { margin: 0 0 0.35em; }

@media (max-width: 860px) { .what-we-did { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .what-we-did { grid-template-columns: 1fr; } }

/* --- More cases ----------------------------------------------------------- */

.more-cases {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.more-cases__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-m);
}

.more-cases__card { display: grid; gap: 0.2em; }
.more-cases__card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-s);
  transition: opacity var(--dur) var(--ease);
}
.more-cases__card:hover img { opacity: 0.75; }
.more-cases__name { display: block; font-size: var(--step-1); }
.more-cases__baseline { display: block; font-size: var(--step--1); color: var(--gray-on-dark); }

@media (max-width: 700px) { .more-cases__grid { grid-template-columns: 1fr; } }

/* Facts + services sit in a narrow rail beside the intro on wide screens. */
.case-intro-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .case-intro-grid { grid-template-columns: 1fr; gap: var(--space-l); }
}

.case-meta { margin: 0; }

.case-meta__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1em;
  padding-block: var(--space-s);
  border-bottom: 1px solid var(--line);
}
.case-meta__row:first-child { border-top: 1px solid var(--line); }

.case-meta dt {
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--gray);
}
.case-meta dd { margin: 0; }

.case-tags { margin-top: var(--space-l); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: var(--space-s);
}

.tag-list li {
  padding: 0.3em 0.8em;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.case-flag {
  display: inline-block;
  margin-bottom: var(--space-s);
  padding: 0.2em 0.7em;
  border-radius: 100px;
  background: var(--cream);
  font-size: var(--step--1);
  font-weight: 400;
}

/* --- Case sections (the CMS-driven visual body) --------------------------- */

.case-section { padding-block: var(--space-xl); }

.case-section__head {
  max-width: var(--measure);
  margin-bottom: var(--space-l);
}

.case-section__title {
  font-size: var(--step-2);
  margin-bottom: var(--space-s);
}

/* Full / Half / Third come straight from the CMS "Visual Type" option. */
.case-section__grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: 1fr;
}
.case-section__grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.case-section__grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .case-section__grid[data-cols="3"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .case-section__grid[data-cols="2"],
  .case-section__grid[data-cols="3"] { grid-template-columns: 1fr; }
}

.media {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--smoke);
}

.media--embed {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.media--embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-slogan {
  font-size: var(--step-2);
  font-weight: var(--weight-heading);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: var(--space-m);
}

/* Rich text arriving from the CMS — keep it readable whatever it contains. */
.case-intro :where(h2, h3, h4) { margin-top: var(--space-l); }
.case-intro :where(img, video) {
  border-radius: var(--radius);
  margin-block: var(--space-m);
}
.case-intro a { text-decoration: underline; }

.case-figure {
  width: 100%;
  border-radius: var(--radius);
}

.case-quote {
  max-width: 46ch;
  margin: 0 auto;
  text-align: center;
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.case-quote footer {
  margin-top: var(--space-m);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--gray);
  text-transform: uppercase;
}

.case-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-m);
  border-top: 1px solid var(--line);
  padding-top: var(--space-l);
}

.case-pager__link { display: grid; gap: 0.2em; }
.case-pager__link:last-child { text-align: right; margin-left: auto; }
.case-pager__name { font-size: var(--step-1); font-weight: var(--weight-heading); letter-spacing: -0.02em; }
.case-pager__link:hover .case-pager__name { color: var(--gray); }

/* --- Marquee -------------------------------------------------------------- */

/* The four process steps run past as a strip between the steps and the client
   wall. Two identical tracks slide left; when the first has travelled its own
   width the pair resets, so the loop reads as continuous. */
.marquee {
  --marquee-duration: 38s;
  display: flex;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: var(--space-s);
  user-select: none;
}

.marquee__track {
  display: flex;
  flex: none;
  gap: var(--space-l);
  padding-right: var(--space-l);
  animation: marquee var(--marquee-duration) linear infinite;
}

.marquee span {
  flex: none;
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--gray);
}

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

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee__track + .marquee__track { display: none; }
}

/* --- Client wall ---------------------------------------------------------- */

/* Seven across, as on the original; it steps down rather than reflowing freely
   so the rows stay even. */
.client-wall {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-s);
}

@media (max-width: 1200px) { .client-wall { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 860px)  { .client-wall { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .client-wall { grid-template-columns: repeat(3, 1fr); } }

/* No tile behind the marks — they sit straight on the page, as on the original.
   The height is set outright rather than via aspect-ratio: the logo's
   `max-height: 100%` only resolves against a definite height, and without one
   large marks fell back to their intrinsic size and burst out of the grid. */
.client {
  display: grid;
  /* One definite row: the logo's max-height percentage only resolves against
     a definite track, and an auto row sizes to the image and clips instead. */
  grid-template-rows: 100%;
  place-items: center;
  height: clamp(4.5rem, 7vw, 8rem);
  padding: var(--space-s);
  overflow: hidden;
}

/* Constrain rather than stretch. `height: 100%` inside a tile whose row height
   comes from its own content is circular, so large logos fell back to their
   intrinsic size and pushed the grid straight through the footer. */
.client__logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.client--linked:hover .client__logo,
.client--linked:focus-visible .client__logo {
  opacity: 0.55;
  transform: scale(1.04);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.4em;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-size: var(--step--1);
  font-weight: 400;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--paper); }

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover, .btn--solid:focus-visible { background: var(--paper); color: var(--ink); }

.btn[hidden] { display: none; }

/* --- News ----------------------------------------------------------------- */

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: var(--space-l) var(--space-m);
}

.news-item__link { display: block; }
.news-item__link:hover .news-item__title { color: var(--gray); }

/* The original's click cue: the card media flips to its negative on hover. */
.news-item__media img,
.news-item__media video { transition: filter var(--dur) var(--ease); }
.news-item__link:hover .news-item__media img,
.news-item__link:hover .news-item__media video { filter: invert(1); }

.news-item__media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--smoke);
  margin-bottom: var(--space-s);
}
.news-item__media img,
.news-item__media video { width: 100%; height: 100%; object-fit: cover; }

.news-item__date { font-size: var(--step--1); color: var(--gray); }
.news-item__title { margin: 0.2em 0 0.4em; font-size: var(--step-1); }
.news-item__excerpt { font-size: var(--step--1); color: var(--ink-soft); }
.news-item__more {
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 0.5em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gray);
  transition: text-decoration-color var(--dur) var(--ease);
}
.news-item__link:hover .news-item__more { text-decoration-color: currentColor; }

/* --- Editorial / prose ---------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-xl); }
.prose h3 { margin-top: var(--space-l); }
.prose ul { margin: var(--space-s) 0; }
.prose li { padding-left: 1.2em; text-indent: -1.2em; }
.prose li::before { content: "•"; color: var(--gray); padding-right: 0.6em; }
.prose figure { margin: var(--space-l) 0; }
.prose figure :where(img, video) { width: 100%; margin: 0; }
.prose blockquote {
  margin: var(--space-l) 0;
  padding-left: var(--space-m);
  border-left: 1px solid var(--ink);
  font-size: var(--step-1);
  line-height: 1.4;
}

.steps { counter-reset: step; display: grid; gap: var(--space-xl); }
.step__num { font-size: var(--step-1); color: var(--gray); font-weight: 400; }

/* Wrapper for the four steps; each step carries its own rule and padding. */
.about-steps { display: block; }

/* About sets its own, quieter type scale: the page title is regular weight at
   roughly 44px, not the heavy display size the other heroes use. */
.about-hero__title {
  max-width: 22ch;
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.76rem);
  font-weight: var(--weight-heading-editorial);
  line-height: 1.15;
}

.about-hero__lead {
  max-width: 46ch;
  margin-top: var(--space-l);
  font-size: clamp(1.15rem, 0.95rem + 0.85vw, 1.8rem);
  line-height: 1.35;
}

.about-hero__note {
  max-width: 62ch;
  margin-top: var(--space-l);
  font-size: clamp(0.95rem, 0.87rem + 0.43vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Each step is a narrow label column and a wide body column, divided by a hairline. */
.about-step {
  display: grid;
  grid-template-columns: 1fr 4fr;
  column-gap: clamp(2rem, 1rem + 5vw, 8.33rem);
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--line);
}

.about-step__num {
  font-size: clamp(1.25rem, 1rem + 1.08vw, 2.08rem);
  font-weight: var(--weight-heading-editorial);
  margin-bottom: var(--space-l);
}

.about-step__baseline {
  font-size: clamp(1.25rem, 1rem + 1.08vw, 2.08rem);
  font-weight: var(--weight-heading-editorial);
  line-height: 1.2;
  text-wrap: balance;
}

.about-step__icon { width: clamp(28px, 3vw, 44px); margin-top: var(--space-xl); }

.about-step__body {
  border-left: 1px solid var(--ink);
  padding-left: clamp(1.5rem, 0.8rem + 3.5vw, 5rem);
}

.about-step__body h3 { font-weight: var(--weight-heading-editorial); font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.5rem); }
.about-step__body > p { margin-top: var(--space-m); max-width: 62ch; }

/* Nine services read as a three-up index, uppercase and small. */
.about-step__services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35em var(--space-m);
  margin-top: var(--space-l);
  font-size: var(--step--1);
  text-transform: uppercase;
}
.about-step__services li { padding-left: 1em; text-indent: -1em; }
.about-step__services li::before { content: "•"; color: var(--gray); padding-right: 0.5em; }

@media (max-width: 860px) {
  .about-step { grid-template-columns: 1fr; row-gap: var(--space-l); }
  .about-step__body { border-left: 0; padding-left: 0; }
  .about-step__icon { margin-top: var(--space-m); }
  .about-step__services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .about-step__services { grid-template-columns: 1fr; }
}

/* --- Consultancy sections ------------------------------------------------- */

/* Measured off the live page: a 1200px column, each section led by its own
   80px mark, then kicker, title, lead and body on one shared type scale. */
.consultancy-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding-block: var(--space-2xl);
}

/* A rule separates each section from the one above. The original inserts an
   empty 1px element between them; a border does the same job without the div. */
.consultancy-section + .consultancy-section,
.consultancy-section + .consultancy-cta {
  border-top: 1px solid var(--line);
}

.consultancy-section__mark { width: clamp(52px, 5vw, 80px); }

.consultancy-kicker {
  margin: 0;
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.83rem);
  text-transform: uppercase;
  color: var(--ink);
}

.consultancy-section__title {
  max-width: 24ch;
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.76rem);
  font-weight: var(--weight-heading-editorial);
  line-height: 1.15;
}

.consultancy-lead {
  max-width: 42ch;
  font-size: clamp(1.15rem, 0.95rem + 0.85vw, 1.8rem);
  line-height: 1.3;
}

.consultancy-body {
  max-width: 62ch;
  font-size: clamp(0.95rem, 0.87rem + 0.43vw, 1.3rem);
  line-height: 1.45;
}
.consultancy-body p + p { margin-top: 0.9em; }
.consultancy-body li { font-size: inherit; }
.consultancy-body:has(> .cols-2),
.consultancy-body:has(> .cols-3) { max-width: none; }
.consultancy-body:has(> .cols-3) > p,
.consultancy-body:has(> .cols-2) > p { max-width: 62ch; font-size: var(--step-0); }
.consultancy-body a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gray);
  transition: text-decoration-color var(--dur) var(--ease);
}
.consultancy-body a:hover { text-decoration-color: currentColor; }
.hero__lead a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gray);
  transition: text-decoration-color var(--dur) var(--ease);
}
.hero__lead a:hover { text-decoration-color: currentColor; }

/* --- Home & about: pillar columns, fact strips, inline links -------------- */

.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xl); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl); }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-l); }
@media (max-width: 980px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

.rule-col {
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}
.rule-col--ink { border-top-color: var(--ink); }
.rule-col h3, .rule-col p { margin: 0; }
.rule-col h3 { font-size: var(--step-1); }

/* A single-row trio closes with a bottom hairline too; multi-row grids
   keep only their top rules so rows never double up. */
.cols-3:not(:has(> :nth-child(4))) > .rule-col {
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-l);
}
.rule-col p, .rule-col li { font-size: var(--step-0); }

.col-num, .col-note { font-size: var(--step--1); color: var(--gray); }
.col-baseline {
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--gray);
}
.fact-figure { font-size: var(--step-2); font-weight: 400; letter-spacing: -0.02em; }

.textlink {
  text-decoration: underline;
  text-underline-offset: 0.5em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gray);
  transition: text-decoration-color var(--dur) var(--ease);
}
.textlink:hover { text-decoration-color: currentColor; }

/* The cue arrow leads: it sits before the text on every text link and
   read-more, outside the underline. */
.textlink::before,
.news-item__more::before {
  content: "\2192";
  display: inline-block;
  margin-right: 0.35em;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-top: var(--space-l); }

/* Language switch: a nav link with a small globe. Same box model as its
   siblings (inline-block, text baseline) so it lines up with them; the globe
   is an inline icon nudged onto the baseline. */
.nav__link--lang { white-space: nowrap; }
.nav__link--lang svg {
  display: inline-block;
  vertical-align: -0.18em;
  margin-right: 0.15em;
}

/* One section sits on a tinted panel on the original. */
.consultancy-section--highlight {
  max-width: none;
  border-radius: var(--radius);
  background: var(--cream);
  padding: var(--space-2xl) var(--space-l);
}

.consultancy-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: flex-start;
  border-radius: var(--radius);
  background: var(--smoke);
  padding: var(--space-2xl) var(--space-l);
  margin-top: var(--space-2xl);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr));
  gap: var(--space-xl);
  align-items: start;
}

/* --- FAQ ------------------------------------------------------------------ */

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

.faq__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-m);
  width: 100%;
  padding: var(--space-m) 0;
  font-size: var(--step-1);
  font-weight: 400;
  text-align: left;
}

.faq__q::after {
  content: "+";
  flex: none;
  font-size: var(--step-2);
  font-weight: 400;
  transition: transform var(--dur) var(--ease);
}
.faq__item[data-open="true"] .faq__q::after { transform: rotate(45deg); }

/* Animated open/close without JS height math. */
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.faq__item[data-open="true"] .faq__a { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p { padding-bottom: var(--space-m); max-width: var(--measure); color: var(--ink-soft); }

/* --- Contact -------------------------------------------------------------- */

.contact-details { font-size: var(--step-1); line-height: 1.9; }
.contact-details a:hover { text-decoration: underline; }

.field { display: grid; gap: var(--space-2xs); margin-bottom: var(--space-m); }
.field label { font-size: var(--step--1); color: var(--gray); }
.field input, .field textarea {
  font: inherit;
  padding: 0.7em 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-xl) var(--space-l);
  font-size: var(--step--1);
}

/* Like the approved concept: the logo sits left, the link columns cluster on
   the right, and the legal row runs small underneath the full width. */
.site-footer .container {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.site-footer__grid {
  display: flex;
  gap: var(--space-2xl);
  margin-top: 0;
}

@media (max-width: 860px) {
  .site-footer .container { grid-template-columns: 1fr; }
  .site-footer__grid { flex-direction: column; gap: var(--space-l); margin-top: var(--space-l); }
}

.site-footer li + li { margin-top: 0.35em; }
.site-footer a:hover { color: var(--gray); }

/* Stacked, not side by side: measured on the live footer at 83px wide with a
   12px gap, both badges sharing one left edge. */
.site-footer__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}
.site-footer__badges img { width: 83px; height: auto; }

.site-footer__legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-l);
  margin-top: var(--space-xl);
  color: var(--gray);
  font-size: 0.75rem;
}
.site-footer__legal a:hover { color: var(--ink); }

/* --- Loading / empty states ---------------------------------------------- */

.is-loading { color: var(--gray); font-size: var(--step--1); }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    var(--smoke) 25%,
    color-mix(in srgb, var(--smoke) 94%, var(--ink)) 50%,
    var(--smoke) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
