/* ==========================================================================
   DMGN — Creative Agency
   Design system + components. Single stylesheet, no build step.
   Sections: 1 Tokens · 2 Reset · 3 Type · 4 Layout · 5 Glass · 6 Nav
             7 Buttons · 8 Hero · 9 Work · 10 Services · 11 Process
             12 Editorial · 13 Forms · 14 Footer · 15 Motion · 16 Utilities
   ========================================================================== */

/* 1 — Tokens ------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Brand — sampled from the DMGN identity mark */
  --brand-red: #ff2d3f;
  --brand-red-deep: #c8102e;
  --brand-blue: #4a9eff;
  --brand-blue-deep: #1b62a8;

  /* Surfaces */
  --ink: #0a0a0c;
  --ink-2: #111114;
  --ink-3: #17171c;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);

  /* Text — verified ≥4.5:1 on --ink */
  --fg: #f5f5f6;
  --fg-muted: #a9a9b3;
  --fg-dim: #77777f;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(18, 18, 22, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-blur: 18px;

  /* Type */
  --font-display: "Syne", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-3: clamp(1.95rem, 1.6rem + 1.7vw, 3rem);
  --step-4: clamp(2.4rem, 1.7rem + 3.4vw, 4.5rem);
  --step-5: clamp(3rem, 1.6rem + 6.4vw, 7rem);

  /* Space — 4pt rhythm */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;

  --shell: 78rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --radius: 4px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;

  --z-nav: 100;
  --z-overlay: 200;
}

/* 2 — Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: inherit; text-decoration-color: rgba(255, 255, 255, 0.28); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--brand-red); }

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

::selection { background: var(--brand-red); color: #fff; }

/* Fonts — self-hosted, subset, variable */
@font-face {
  font-family: "Syne";
  src: url("../fonts/syne-var.woff2") format("woff2-variations");
  font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2-variations");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

/* 3 — Type --------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-weight: 800; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.15; }
h4 { font-size: var(--step-1); line-height: 1.25; }

p { text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex; align-items: center; gap: var(--s-3);
}
.eyebrow::before {
  content: ""; width: 2rem; height: 1px;
  background: var(--brand-red); flex: none;
}
.eyebrow--plain::before { display: none; }

.lede {
  font-size: var(--step-1);
  color: var(--fg-muted);
  max-width: 46ch;
  line-height: 1.55;
}

.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { font-size: var(--step-2); margin-top: var(--s-7); }
.prose h3 { font-size: var(--step-1); margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: 1.2em; color: var(--fg-muted); }
.prose li + li { margin-top: var(--s-2); }
.prose a { color: var(--brand-blue); }
.prose strong { color: var(--fg); }
.prose blockquote {
  border-left: 2px solid var(--brand-red);
  padding-left: var(--s-5);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--fg);
}

/* 4 — Layout ------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.rule { border: 0; border-top: 1px solid var(--line-soft); }

.section-head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
@media (min-width: 62rem) {
  .section-head {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    column-gap: var(--s-7);
  }
  .section-head > .eyebrow { grid-column: 1 / -1; }
}

.grid { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 48rem) and (max-width: 61.99rem) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-4);
  transform: translateY(-200%);
  background: var(--fg); color: var(--ink);
  padding: var(--s-3) var(--s-5); border-radius: var(--radius);
  font-weight: 600; z-index: calc(var(--z-nav) + 10);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* 5 — Glass -------------------------------------------------------------- */
/* Used deliberately: navigation, overlays, and cards that sit over imagery
   or the ambient field. Not applied to plain content blocks. */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(23, 23, 28, 0.92); }
}

/* Ambient brand field behind the hero and CTA — the light source that makes
   the glass legible. Fixed cost: two gradients, no images, no script. */
.field { position: relative; isolation: isolate; overflow: clip; }
.field::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 130%;
  z-index: -1;
  background:
    radial-gradient(52% 46% at 18% 12%, rgba(200, 16, 46, 0.30), transparent 70%),
    radial-gradient(48% 44% at 84% 26%, rgba(27, 98, 168, 0.30), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.field::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
  pointer-events: none;
}

/* 6 — Nav ---------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav[data-stuck="true"] {
  background: var(--glass-bg-strong);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.nav__inner {
  display: flex; align-items: center; gap: var(--s-5);
  min-height: 4.5rem;
}

.brand {
  display: flex; align-items: center; gap: var(--s-3);
  text-decoration: none; flex: none;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand__name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.05rem; letter-spacing: -0.02em; line-height: 1;
}
.brand__role {
  display: block; font-family: var(--font-body);
  font-size: 0.62rem; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg-dim); margin-top: 2px;
}

.nav__links { display: none; }
.nav__links ul {
  display: flex; align-items: center; gap: var(--s-5);
  list-style: none; padding: 0; margin: 0;
}
.nav__links a {
  text-decoration: none; font-size: 0.95rem; color: var(--fg-muted);
  padding: var(--s-2) 0; position: relative;
  transition: color var(--dur) var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a[aria-current="page"] { color: var(--fg); }
.nav__links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--brand-red);
}

.nav__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); min-width: 0; }

/* On the narrowest phones the header CTA cannot sit beside the logo and the
   menu button without pushing the bar past the viewport. The mobile panel
   carries a full-width "Start a Project" button, so drop it from the bar. */
@media (max-width: 29.99rem) {
  .nav__actions > .btn { display: none; }
}

.nav__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
}
.nav__toggle svg { width: 20px; height: 20px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

.nav__panel {
  position: fixed; inset: 4.5rem 0 auto 0;
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--s-5) var(--gutter) var(--s-7);
  z-index: var(--z-overlay);
}
.nav__panel[hidden] { display: none; }
.nav__panel ul { list-style: none; padding: 0; margin: 0; }
.nav__panel li + li { border-top: 1px solid var(--line-soft); }
.nav__panel a {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) 0; min-height: 48px;
  font-family: var(--font-display); font-size: var(--step-2);
  text-decoration: none;
}
.nav__panel .btn { margin-top: var(--s-5); width: 100%; justify-content: center; }

@media (min-width: 62rem) {
  .nav__links { display: block; margin-left: var(--s-6); }
  .nav__toggle { display: none; }
  .nav__panel { display: none !important; }
}

/* 7 — Buttons ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--fg);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-3);
  min-height: 48px; padding: 0 var(--s-5);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn--primary { --btn-bg: var(--brand-red); --btn-fg: #fff; }
.btn--primary:hover { --btn-bg: #ff4655; }

.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--fg);
  border-color: var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.05); }

.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: 0.88rem; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-weight: 600; text-decoration: none; color: var(--fg);
  border-bottom: 1px solid var(--brand-red); padding-bottom: 2px;
}
.link-arrow svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translate(3px, -3px); }

/* 8 — Hero --------------------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(3rem, 7vw, 6rem); }
.hero__grid { display: grid; gap: var(--s-6); }
.hero h1 { margin-block: var(--s-5) 0; max-width: 15ch; }
.hero .lede { margin-top: var(--s-5); max-width: 52ch; }
.hero .btn-row { margin-top: var(--s-6); }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-7);
  list-style: none; padding: 0;
}
.hero__meta li {
  font-size: var(--step--1); color: var(--fg-muted);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--glass-border); border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* 9 — Work --------------------------------------------------------------- */
.work-grid { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) {
  .work-grid { grid-template-columns: repeat(6, 1fr); }
  .work-card { grid-column: span 3; }
  .work-card--wide { grid-column: span 6; }
  .work-card--third { grid-column: span 2; }
}

.work-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-2);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.work-card:hover { border-color: var(--line); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .work-card:hover { transform: none; } }

.work-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ink-3);
}
.work-card--wide .work-card__media { aspect-ratio: 16 / 9; }
.work-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 500ms var(--ease);
}
.work-card:hover .work-card__media img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .work-card:hover .work-card__media img { transform: none; } }

.work-card__body { padding: var(--s-5); display: grid; gap: var(--s-3); }
.work-card__tags {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  list-style: none; padding: 0; margin: 0;
}
.work-card__tags li {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim);
}
.work-card__tags li + li::before { content: "· "; }
.work-card h3 { font-size: var(--step-1); }
.work-card p { color: var(--fg-muted); font-size: 0.95rem; }

.work-card__link::after {
  content: ""; position: absolute; inset: 0;
}

/* Detailed case-study block (Work page) */
.case { display: grid; gap: var(--s-6); padding-block: var(--s-8); border-top: 1px solid var(--line-soft); }
@media (min-width: 62rem) {
  .case { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-8); align-items: start; }
  .case--flip > .case__media { order: -1; }
}
.case__media img { border-radius: var(--radius-lg); border: 1px solid var(--line-soft); width: 100%; }
.case__body { display: grid; gap: var(--s-4); align-content: start; }
.case__facts { display: grid; gap: var(--s-4); margin-top: var(--s-3); }
@media (min-width: 30rem) { .case__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.case__facts dt {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: var(--s-1);
}
.case__facts dd { margin: 0; color: var(--fg); font-size: 0.95rem; }

/* 10 — Services ---------------------------------------------------------- */
.cap {
  display: grid; gap: var(--s-4);
  padding: var(--s-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  align-content: start;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cap:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); }
.cap__num {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--brand-red);
}
.cap h3 { font-size: var(--step-1); }
.cap ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.cap li {
  font-size: 0.92rem; color: var(--fg-muted);
  padding-left: 1.1rem; position: relative;
}
.cap li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-blue);
}

/* 11 — Process ----------------------------------------------------------- */
.process { display: grid; gap: 0; counter-reset: step; }
.process__step {
  display: grid; gap: var(--s-3);
  padding-block: var(--s-6);
  border-top: 1px solid var(--line-soft);
}
.process__step:last-child { border-bottom: 1px solid var(--line-soft); }
@media (min-width: 48rem) {
  .process__step {
    grid-template-columns: 6rem minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--s-6); align-items: baseline;
  }
}
.process__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--step-2); color: var(--brand-red);
  letter-spacing: -0.03em;
}
.process__step h3 { font-size: var(--step-2); }
.process__step p { color: var(--fg-muted); }

/* 12 — Editorial (insights, testimonials, notes) -------------------------- */
.post-card {
  display: grid; gap: var(--s-4);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.post-card__media { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-lg); background: var(--ink-3); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim);
}
.post-card :is(h2, h3) { font-size: var(--step-1); }
.post-card :is(h2, h3) a { text-decoration: none; }
.post-card :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; }
.post-card p { color: var(--fg-muted); font-size: 0.95rem; }

.quote {
  display: grid; gap: var(--s-4);
  padding: var(--s-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.quote blockquote { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.35; }
.quote figcaption { font-size: 0.9rem; color: var(--fg-muted); }

.note {
  border: 1px dashed var(--line);
  border-left: 2px solid var(--brand-blue);
  border-radius: var(--radius);
  padding: var(--s-5);
  color: var(--fg-muted);
  font-size: 0.95rem;
  background: rgba(27, 98, 168, 0.06);
}
.note strong { color: var(--fg); }

.stat-row { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat dt { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); }
.stat dd { margin: var(--s-2) 0 0; font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; }

/* 13 — Forms ------------------------------------------------------------- */
.form { display: grid; gap: var(--s-5); }
.form__grid { display: grid; gap: var(--s-5); }
@media (min-width: 40rem) { .form__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.field-group { display: grid; gap: var(--s-2); }
.field-group label { font-size: 0.88rem; font-weight: 500; }
.field-group .req { color: var(--brand-red); }
.field-group .hint { font-size: 0.8rem; color: var(--fg-dim); }

.control {
  width: 100%; min-height: 48px;
  padding: var(--s-3) var(--s-4);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 1rem; /* ≥16px: prevents iOS zoom-on-focus */
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.control::placeholder { color: var(--fg-dim); }
.control:hover { border-color: rgba(255, 255, 255, 0.2); }
.control:focus { border-color: var(--brand-blue); background: rgba(255, 255, 255, 0.06); }
textarea.control { min-height: 9rem; resize: vertical; line-height: 1.6; }
select.control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23a9a9b3' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
  background-size: 12px 8px;
  padding-right: var(--s-7);
}
select.control option { background: var(--ink-2); color: var(--fg); }

.control[aria-invalid="true"] { border-color: var(--brand-red); }
.field-error {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 0.83rem; color: #ff8a92;
}
.field-error:empty { display: none; }
.field-error svg { width: 14px; height: 14px; flex: none; }

.form-status {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.form-status:empty { display: none; }
.form-status[data-state="ok"] { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); color: #b7f4c8; }
.form-status[data-state="error"] { border-color: rgba(255, 45, 63, 0.45); background: rgba(255, 45, 63, 0.08); color: #ffb3b9; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 14 — Footer ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line-soft); padding-block: var(--s-8) var(--s-6); }
.footer__grid { display: grid; gap: var(--s-7); }
/* Four columns only once there is room for them; two-up on tablet. */
@media (min-width: 48rem) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); } }
@media (min-width: 62rem) { .footer__grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }
.footer h2 { font-size: var(--step-1); }
.footer h3 {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim);
  margin-bottom: var(--s-4);
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.footer a { text-decoration: none; color: var(--fg-muted); font-size: 0.95rem; }
.footer a:hover { color: var(--fg); }
.footer address { font-style: normal; color: var(--fg-muted); font-size: 0.95rem; display: grid; gap: var(--s-2); }
.footer address a, .footer address span { overflow-wrap: anywhere; }

.social { display: flex; gap: var(--s-2); margin-top: var(--s-5); }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.social a:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.05); }
.social svg { width: 18px; height: 18px; }

.footer__base {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  justify-content: space-between; align-items: center;
  margin-top: var(--s-7); padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem; color: var(--fg-dim);
}

/* 15 — Motion ------------------------------------------------------------ */
/* Reveal-on-scroll is strictly an enhancement. Content is visible by default;
   it is only hidden where scripting is available to bring it back, and site.js
   carries a timeout fallback in case the observer never fires. */
@media (scripting: enabled) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 520ms var(--ease), transform 520ms var(--ease);
  }
  [data-reveal].is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* 16 — Utilities --------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.text-muted { color: var(--fg-muted); }
.measure { max-width: 60ch; }
.center { text-align: center; margin-inline: auto; }

/* Page masthead (interior pages) */
.masthead { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem); }
.masthead h1 { font-size: var(--step-4); max-width: 18ch; }
.masthead .lede { margin-top: var(--s-5); }

.breadcrumb { font-size: 0.82rem; color: var(--fg-dim); margin-bottom: var(--s-5); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line); }
.breadcrumb a { text-decoration: none; color: var(--fg-muted); }

/* CTA band */
.cta-band { padding-block: clamp(3.5rem, 7vw, 6rem); }
.cta-band__inner {
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius-lg);
  display: grid; gap: var(--s-5);
}
.cta-band h2 { max-width: 14ch; }

/* 404 */
.error-page { min-height: 72dvh; display: grid; align-content: center; padding-block: var(--s-9); }
.error-page .code {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--step-5); color: var(--brand-red); line-height: 1;
}

/* 17 — Layout utilities --------------------------------------------------- */
/* These exist because the Content Security Policy forbids inline style
   attributes; every one-off style in the markup resolves to a class here. */
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }
.mt-hair { margin-top: 0.35rem; }

.text-sm { font-size: 0.95rem; }
.text-xs { font-size: 0.9rem; }
.cap p.text-muted { font-size: 0.92rem; }

.measure-tight { max-width: 44ch; }

/* Article and card headings that must not take the full display scale. */
.h-md { font-size: var(--step-1); }
.article-title { font-size: var(--step-4); }

/* Bordered media inside prose and case studies. */
.framed {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.contact-list {
  font-style: normal;
  display: grid;
  gap: var(--s-3);
  color: var(--fg-muted);
}
.contact-list a { overflow-wrap: anywhere; }

.items-start { align-items: start; }

/* Supporting shots beneath a case study's lead image. */
.case__strip {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-4);
}
@media (min-width: 30rem) {
  .case__strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.case__strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
