/* =============================================================
   FVC Build Ltd — design system
   Direction: "established craftsman / architectural"
   Dominant brand navy (#002387) on warm paper, Fraunces + Hanken
   Grotesk, hairline blueprint detailing, restrained spring motion.
   ============================================================= */

/* Ampersand override: keep a calm, upright serif ampersand for U+0026 only,
   so "&" never reads as an "@"; every other glyph comes from the display face. */
@font-face {
  font-family: "AmpFix";
  src: local("Georgia"), local("Times New Roman"), local("Times");
  unicode-range: U+0026;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --navy: #002387;
  --navy-700: #001b6b;
  --navy-900: #00103f;
  --navy-300: #6f83c4;

  --ink: #171b26;
  --muted: #55607a;
  --paper: #f4f2ec;
  --paper-2: #eceae1;
  --surface: #ffffff;

  --line: rgba(0, 35, 135, 0.16);
  --line-strong: rgba(0, 35, 135, 0.34);
  --on-navy: #ffffff;
  --on-navy-muted: rgba(255, 255, 255, 0.72);
  --on-navy-line: rgba(255, 255, 255, 0.22);

  --accent: #ffb300;            /* hi-vis amber — non-text UI cues only */
  --focus: #ffb300;

  --font-display: "AmpFix", "Bitter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: clamp(0.83rem, 0.8rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.18rem, 1.08rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 2.1rem);
  --step-3: clamp(1.85rem, 1.5rem + 1.9vw, 3rem);
  --step-4: clamp(2.35rem, 1.8rem + 3vw, 4.4rem);
  --step-5: clamp(2.9rem, 1.9rem + 5.2vw, 6.6rem);

  /* Vertical rhythm — every vertical gap is a multiple of this, and it is both the
     body line-height and the blueprint grid row height, so text rides the grid. */
  --rhythm: 1.875rem;                  /* 30px */

  --sp-2xs: 0.5rem;                    /* 8px  — hairline detail only */
  --sp-xs: 0.75rem;                   /* 12px — hairline detail only */
  --sp-s: var(--rhythm);              /* 30px */
  --sp-m: var(--rhythm);              /* 30px */
  --sp-l: calc(var(--rhythm) * 2);    /* 60px */
  --sp-xl: calc(var(--rhythm) * 3);   /* 90px */
  --sp-2xl: calc(var(--rhythm) * 4);  /* 120px */
  --sp-3xl: calc(var(--rhythm) * 6);  /* 180px */

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --maxw: 1240px;
  --readw: 68ch;

  --r-s: 2px;
  --r-m: 5px;

  --shadow-1: 0 1px 2px rgba(0, 16, 63, 0.06), 0 6px 16px -4px rgba(0, 16, 63, 0.08);
  --shadow-2: 0 2px 6px rgba(0, 16, 63, 0.08), 0 22px 48px -16px rgba(0, 16, 63, 0.26);

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.55s;
}

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

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;              /* 17px — fixed so the baseline grid holds */
  line-height: var(--rhythm);        /* 30px rows */
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  /* Headings ride the same 30px grid as body copy: one row for small
     headings, whole multiples for the display sizes below. */
  line-height: var(--rhythm);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Display-sized headings: a whole number of grid rows so the text after
   them resyncs to the baseline grid regardless of how many lines they wrap to. */
.section-head h2,
.prose h2,
.display-m,
.quote blockquote { line-height: calc(var(--rhythm) * 2); }

.page-head h1,
.error-page h1,
.cta-band h2,
.display-l,
.display-xl { line-height: calc(var(--rhythm) * 3); }

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

/* Grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Blueprint grid — rows are exactly one line of body text (--rhythm) and the
   pattern is nudged so the ruled lines fall on the text baselines. */
.grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--rhythm) var(--rhythm);
  background-position: center calc(var(--rhythm) * 0.74);
}

.rule { height: 1px; background: var(--line); border: 0; }

.skip-link {
  position: absolute;
  left: var(--sp-s);
  top: var(--sp-s);
  z-index: 10000;
  padding: 0.6em 1em;
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-m);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Type utilities ---------- */
.eyebrow {
  display: block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 2.2em;
  height: 1px;
  margin-right: 0.7em;
  vertical-align: 0.32em;
  background: currentColor;
}
.on-navy .eyebrow,
.eyebrow.is-light { color: var(--accent); }

.display-xl { font-size: var(--step-5); }
.display-l { font-size: var(--step-4); }
.display-m { font-size: var(--step-3); }
.lede {
  font-size: var(--step-1);
  line-height: var(--rhythm);        /* one grid row per line */
  color: var(--muted);
  max-width: 46ch;
}
.on-navy .lede { color: var(--on-navy-muted); }

.mono-note {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.on-navy .mono-note { color: var(--on-navy-muted); }

/* ---------- Buttons & links ---------- */
.btn {
  --bg: var(--navy);
  --fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.5em;
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--bg);
  border-radius: var(--r-m);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-spring),
    background-color 0.25s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn::after {
  content: "";
  position: absolute;
  left: 1.5em;
  right: 1.5em;
  bottom: 0.62em;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-spring);
}
.btn:hover::after { transform: scaleX(1); }

.btn--ghost {
  --bg: transparent;
  --fg: var(--navy);
  border-color: var(--line-strong);
}
.btn--ghost:hover { --bg: rgba(0, 35, 135, 0.05); }
.btn--light { --bg: #fff; --fg: var(--navy); border-color: #fff; }
.on-navy .btn--ghost,
.hero .btn--ghost { --fg: #fff; border-color: rgba(255, 255, 255, 0.5); }
.on-navy .btn--ghost:hover,
.hero .btn--ghost:hover { --bg: rgba(255, 255, 255, 0.12); border-color: #fff; }

.link {
  color: var(--navy);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s var(--ease-spring), color 0.2s;
  padding-bottom: 0.1em;
}
.link:hover { background-size: 0 1px; }
.link--arrow::after { content: " \2192"; }
.on-navy .link { color: #fff; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Corner-tick card ---------- */
.tick {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
}
.tick::before,
.tick::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--navy);
}
.tick::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.tick::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
/* The scrolled background/blur lives on a pseudo-element rather than
   .site-header itself, because backdrop-filter on the header would make it
   a containing block for the fixed-position mobile .nav overlay — sizing
   the "full screen" menu to the header's own small box instead of the
   viewport (links clip off-screen, the closed menu peeks out below it). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(244, 242, 236, 0.88);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-m);
  padding-block: var(--sp-s);
}
.brand { display: inline-flex; align-items: center; gap: 0.62em; text-decoration: none; }
.brand img { height: 34px; width: auto; }
/* One-time header-mark draw-in (JS adds body.logo-intro once per session,
   see main.js) — a left-to-right wipe, like a line being drawn on a plan. */
.js .logo-intro .brand img { clip-path: inset(0 100% 0 0); }
.js body.is-ready.logo-intro .brand img {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.9s var(--ease-spring) 0.1s;
}
.brand__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--navy);
}
.brand__word span { display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }
@media (max-width: 520px) {
  .brand__word span { display: none; }
  .brand__word { font-size: 0.98rem; }
  .brand img { height: 30px; }
}

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

/* Icon-only call button, mobile only — the full "Call ..." link lives
   inline in .nav on desktop, but .nav is a fixed off-canvas overlay on
   mobile, so without this a phone call was only reachable by opening
   the menu. Sits next to the hamburger instead of floating in the header. */
.header-call {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  color: var(--navy);
  transition: transform 0.25s var(--ease-spring), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.header-call svg { width: 19px; height: 19px; }
.header-call:hover { background: rgba(0, 35, 135, 0.05); border-color: var(--navy); }
.header-call:active { transform: translateY(1px); }
@media (max-width: 860px) {
  .header-call { display: inline-flex; }
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.2rem); }
.nav__list { display: flex; gap: clamp(1rem, 2.5vw, 2rem); list-style: none; padding: 0; }
.nav__link {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink);
  padding: 0.3em 0;
  position: relative;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-spring);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--navy); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: var(--r-m);
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--navy);
  transform: translateX(-50%);
  transition: transform 0.3s var(--ease-spring), opacity 0.2s;
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateX(-50%) rotate(45deg); top: 0; background: #fff; }
body.nav-open .nav-toggle span::after { transform: translateX(-50%) rotate(-45deg); top: 0; background: #fff; }

@media (max-width: 860px) {
  .nav-toggle { display: block; z-index: 130; }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-l);
    background: var(--navy);
    color: #fff;
    padding: var(--gutter);
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease-spring);
    z-index: 120;
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav__list { flex-direction: column; gap: var(--sp-m); text-align: center; }
  .nav__link { color: #fff; font-family: var(--font-display); font-size: var(--step-2); }
  .nav__link[aria-current="page"] { color: #fff; }
  .nav__link::after { background: var(--accent); }
  .nav .btn { align-self: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero__media,
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__media img { object-fit: cover; }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 16, 63, 0) 0%, rgba(0, 16, 63, 0.14) 45%, rgba(0, 16, 63, 0.52) 80%, rgba(0, 16, 63, 0.72) 100%),
    linear-gradient(96deg, rgba(0, 16, 63, 0.58) 0%, rgba(0, 16, 63, 0.24) 40%, rgba(0, 16, 63, 0) 66%);
  z-index: -1;
}
.hero__media .tint {
  position: absolute;
  inset: 0;
  background: var(--navy);
  mix-blend-mode: multiply;
  opacity: 0.09;
  z-index: -1;
}
.hero__inner { padding-block: clamp(2.5rem, 8vh, 6rem) clamp(3.25rem, 11vh, 7rem); }
.hero h1 {
  font-size: var(--step-5);
  font-weight: 500;
  line-height: 1.06;                 /* hero sits over a photo, not the grid */
  max-width: 15ch;
  margin-block: 0.35em 0.6em;
}
.hero .lede { color: rgba(255, 255, 255, 0.86); line-height: 1.5; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-s); margin-top: var(--sp-l); }
.hero__spec {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-s);
  border-top: 1px solid var(--on-navy-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 2em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- Section head ---------- */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-s);
  max-width: 60ch;
  margin-bottom: var(--sp-xl);
}
.section-head h2 { font-size: var(--step-3); font-weight: 500; line-height: calc(var(--rhythm) * 2); }
.section-head--split {
  max-width: none;
  grid-template-columns: 1.1fr 1fr;
  align-items: end;
  gap: var(--sp-l);
}
@media (max-width: 720px) { .section-head--split { grid-template-columns: 1fr; } }

.workshop-note {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: calc(var(--rhythm) * 2);
  text-align: center;
  max-width: 32ch;
  margin-inline: auto;
}

/* ---------- Services list ---------- */
/* Hairline rules are drawn with box-shadow, not border, so they add no height
   and the rows stay on the baseline grid. */
.services { box-shadow: 0 -1px 0 var(--line); }
.service {
  display: grid;
  grid-template-columns: 5rem minmax(0, 22ch) 1fr;
  gap: var(--sp-m);
  align-items: baseline;
  padding-block: var(--sp-l);
  box-shadow: 0 1px 0 var(--line);
  transition: padding-left 0.4s var(--ease-spring);
}
.service:hover { padding-left: var(--sp-s); }
.service__no { font-family: var(--font-mono); color: var(--navy-300); font-size: var(--step-0); }
.service__name { font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem); font-weight: 500; line-height: var(--rhythm); }
.service__desc { color: var(--muted); }
.service:hover .service__no { color: var(--navy); }
@media (max-width: 720px) {
  .service { grid-template-columns: 2.25rem 1fr; }
  .service__desc { grid-column: 1 / -1; }
}

/* ---------- FAQ accordion ---------- */
/* `summary` sits in the baseline-grid trim selector list below, and a
   trimmed box has to stay display:block (flex containers can't be
   trimmed — see .eyebrow) — so the number and the +/- icon are
   positioned absolutely rather than laid out as a row alongside the
   question text, leaving the summary itself in plain block flow. */
.faq { box-shadow: 0 -1px 0 var(--line); }
.faq__item {
  position: relative;
  padding-top: var(--sp-l);
  box-shadow: 0 1px 0 var(--line);
}
.faq__item summary {
  display: block;
  list-style: none;
  cursor: pointer;
  padding-inline: 5rem 3rem;
  padding-bottom: var(--sp-s);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  font-weight: 500;
  transition: padding-left 0.4s var(--ease-spring);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item:hover summary { padding-left: calc(5rem + var(--sp-s)); }
.faq__no {
  position: absolute;
  left: 0;
  top: var(--sp-l);
  font-family: var(--font-mono);
  color: var(--navy-300);
  font-size: var(--step-0);
}
.faq__item:hover .faq__no { color: var(--navy); }
.faq__icon {
  position: absolute;
  right: 0;
  top: calc(var(--sp-l) + 0.4em);
  width: 0.9rem;
  height: 0.9rem;
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: var(--navy);
}
.faq__icon::before { width: 100%; height: 1px; }
.faq__icon::after {
  width: 1px;
  height: 100%;
  transition: transform 0.35s var(--ease-spring);
}
.faq__item[open] .faq__icon::after { transform: rotate(90deg); }
.faq__answer {
  max-width: 60ch;
  padding-inline: 5rem 3rem;
  padding-bottom: var(--sp-l);
  color: var(--muted);
  animation: faq-in 0.35s var(--ease-spring);
}
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .faq__item summary { padding-inline: 2.75rem 2.25rem; font-size: var(--step-0); }
  .faq__item:hover summary { padding-left: calc(2.75rem + var(--sp-s)); }
  .faq__no { font-size: var(--step--1); }
  .faq__answer { padding-inline: 2.75rem 2.25rem; }
}

/* ---------- Stat strip ---------- */
.on-navy { background: var(--navy); color: #fff; }
.on-navy--deep { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-m);
}
.stat { padding-top: var(--sp-s); border-top: 1px solid var(--on-navy-line); }
.stat__num { font-family: var(--font-display); font-size: var(--step-3); font-weight: 400; display: block; }
.stat__label { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-navy-muted); }
.stat__label--solo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-1);
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
  display: block;
  padding-top: 0.2em;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.8rem);
}
.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring),
    border-color 0.3s;
}
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.work-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.work-card__media img,
.work-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-spring);
}
.work-card:hover .work-card__media img { transform: scale(1.05); }
.work-card__cap {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.3em;
  padding: var(--sp-s) var(--sp-m) var(--sp-m);
}
.work-card__cat { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-300); }
.work-card:hover .work-card__cat { color: var(--navy); }
.work-card__title { color: var(--ink); font-size: var(--step-0); font-weight: 500; }
.work-grid--preview { grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 3vw, 2rem); }
.work-grid--preview .work-card__media { aspect-ratio: 3 / 2; }
.work-grid--preview .work-card__cap { padding: var(--sp-m) var(--sp-m) var(--sp-l); gap: 0.45em; }
.work-grid--preview .work-card__title { font-size: var(--step-1); }
@media (max-width: 900px) { .work-grid--preview { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .work-grid--preview { grid-template-columns: 1fr; } }

.work-card--feature { grid-column: 1 / -1; }
.work-card--feature .work-card__media { aspect-ratio: 21 / 9; }
.work-card--feature .work-card__title { font-size: var(--step-1); }
@media (max-width: 640px) {
  .work-card--feature .work-card__media { aspect-ratio: 4 / 3; }
}

/* Filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: var(--sp-l); }
.chip {
  padding: 0.5em 1.05em;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.work-card[hidden] { display: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 4rem);
  background: rgba(0, 16, 63, 0.86);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__fig { max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: var(--sp-s); }
.lightbox__fig img { max-height: 78svh; width: auto; margin-inline: auto; border: 1px solid rgba(255, 255, 255, 0.15); }
.lightbox__cap { color: rgba(255, 255, 255, 0.8); font-family: var(--font-mono); font-size: var(--step--1); text-align: center; }
.lightbox__btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  transition: background-color 0.2s, transform 0.3s var(--ease-spring);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.08); }
.lightbox__close { top: clamp(1rem, 4vw, 2rem); right: clamp(1rem, 4vw, 2rem); }
.lightbox__prev { left: clamp(0.5rem, 3vw, 2rem); top: 50%; }
.lightbox__next { right: clamp(0.5rem, 3vw, 2rem); top: 50%; }
@media (max-width: 640px) {
  .lightbox__prev { top: auto; bottom: 1rem; left: 1rem; }
  .lightbox__next { top: auto; bottom: 1rem; right: 1rem; }
}

/* ---------- Process ---------- */
.steps { position: relative; display: grid; gap: 0; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: var(--sp-m);
  padding-block: var(--sp-l);
  box-shadow: 0 -1px 0 var(--line);
}
.step:last-child { box-shadow: 0 -1px 0 var(--line), 0 1px 0 var(--line); }
.step__no { font-family: var(--font-mono); color: var(--navy-300); position: relative; z-index: 1; }
.step h3 { font-size: var(--step-1); font-weight: 500; line-height: var(--rhythm); margin-bottom: 0; }
.step p { color: var(--muted); max-width: 52ch; }
.step__meta { margin-top: var(--rhythm); font-family: var(--font-mono); font-size: var(--step--1); color: var(--navy); letter-spacing: 0.04em; }
@media (max-width: 720px) {
  .step { grid-template-columns: 2.25rem 1fr; gap: var(--sp-s); }
}

/* ---------- Feature split (image + text) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}
.split--flip .split__media { order: 2; }
.split__media { position: relative; }
.split__media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); }
.split__media.is-wide img { aspect-ratio: 4 / 3; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--flip .split__media { order: 0; }
}

/* ---------- Values / feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(1rem, 2.5vw, 1.6rem); }
.card { padding: var(--sp-m) var(--sp-l) var(--sp-l); color: var(--ink); }
.card p:last-child { margin-bottom: 0; }
.card h3 { font-size: var(--step-1); font-weight: 500; margin-bottom: 0; color: var(--ink); }
.card p { color: var(--muted); }
.card__no { font-family: var(--font-mono); color: var(--navy); font-weight: 500; font-size: var(--step--1); display: block; margin-bottom: var(--sp-s); }

/* ---------- Testimonial ---------- */
.quote { max-width: min(28ch + 22vw, 60ch); margin-inline: auto; text-align: center; }
.quote blockquote { font-family: var(--font-display); font-size: var(--step-3); font-weight: 400; line-height: calc(var(--rhythm) * 2); letter-spacing: -0.02em; text-wrap: balance; }
.quote figcaption { margin-top: var(--sp-m); font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-navy-muted); }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .eyebrow { margin-inline: auto; margin-bottom: var(--sp-m); }
/* Centred eyebrow gets a matching line on both sides (the default .eyebrow
   only has one on the left, meant for left-aligned section heads). */
.cta-band .eyebrow::after {
  content: "";
  display: inline-block;
  width: 2.2em;
  height: 1px;
  margin-left: 0.7em;
  vertical-align: 0.32em;
  background: currentColor;
}
.cta-band h2 { font-size: var(--step-4); font-weight: 400; max-width: 18ch; margin-inline: auto; }
.cta-band .btn { margin-top: var(--sp-l); }
@media (max-width: 640px) {
  /* h1-scale headings use a 3-row line-height for single-line titles;
     once this one wraps to two lines on narrow screens that leaves a
     huge gap between them, so tighten it back to two rows here. */
  .cta-band h2 { line-height: calc(var(--rhythm) * 2); }
}

/* ---------- Forms ---------- */
.form-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } }

.field { margin-bottom: var(--sp-m); }
.field > label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0;
}
.field .req { color: var(--navy); }
/* Field controls are quantised to whole grid rows so every label in the
   stack keeps landing on a ruled line. */
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 0 1em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input,
.field select { height: calc(var(--rhythm) * 2); }
.field textarea { height: calc(var(--rhythm) * 6); padding-block: calc((var(--rhythm) - 1em) / 2); resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(0, 35, 135, 0.12); }
.field--error input,
.field--error select,
.field--error textarea { border-color: #b3261e; }
.field__error { display: none; margin-top: 0.45em; color: #b3261e; font-size: var(--step--1); }
.field--error .field__error { display: block; }

.field--check { position: relative; padding-left: calc(1.3em + 0.8em); }
.field--check input {
  position: absolute;
  left: 0;
  top: calc(var(--rhythm) - 1.3em);
  width: 1.3em;
  height: 1.3em;
  accent-color: var(--navy);
  cursor: pointer;
}
.field--check label {
  display: block;
  cursor: pointer;
  text-transform: none;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--muted);
  margin: 0;
}

.form__notice {
  margin-top: var(--sp-m);
  padding: var(--sp-m);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--navy);
  background: var(--surface);
  border-radius: var(--r-m);
}
.form__notice[hidden] { display: none; }

.contact-panel { padding: var(--sp-l); position: sticky; top: 6rem; }
@media (max-width: 900px) { .contact-panel { position: static; } }
.contact-panel h2 { font-size: var(--step-1); font-weight: 500; margin-bottom: var(--sp-m); }
.contact-list { list-style: none; padding: 0; display: grid; gap: var(--sp-m); }
.contact-list dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-navy-muted); margin-bottom: 0.2em; }
.contact-list dd { margin: 0; }
.contact-list a { color: #fff; }
.contact-panel__rule { height: 1px; background: var(--on-navy-line); border: 0; margin-block: var(--sp-l); }
.contact-panel__sub { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-navy-muted); margin-bottom: var(--sp-m); }
.next-steps { list-style: none; padding: 0; display: grid; gap: var(--sp-m); }
.next-steps li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.4rem; color: var(--on-navy-muted); font-size: var(--step--1); line-height: 1.6; }
.next-steps li span { font-family: var(--font-mono); color: var(--accent); }

/* ---------- About: closing two-up ---------- */
.about-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-l) clamp(2rem, 6vw, 5rem);
}
.about-foot > div + div { padding-left: clamp(2rem, 6vw, 5rem); border-left: 1px solid var(--on-navy-line); }
@media (max-width: 820px) {
  .about-foot { grid-template-columns: 1fr; }
  .about-foot > div + div { padding-left: 0; padding-top: var(--sp-l); border-left: 0; border-top: 1px solid var(--on-navy-line); }
}

/* ---------- Error page ---------- */
.error-page {
  min-height: 60svh;
  padding-block: var(--sp-2xl);
  border-bottom: 1px solid var(--line);
}
.error-page h1 { font-size: var(--step-4); font-weight: 400; margin-block: var(--rhythm) 0; max-width: 16ch; }
.error-page .lede { margin-top: var(--sp-s); max-width: 48ch; }
.error-page__cta { display: flex; flex-wrap: wrap; gap: var(--sp-s); margin-top: var(--sp-l); }

/* ---------- Prose (terms) ---------- */
.prose { max-width: var(--readw); }
.prose h2 { font-size: var(--step-2); font-weight: 500; line-height: calc(var(--rhythm) * 2); margin-top: var(--sp-xl); margin-bottom: var(--sp-s); scroll-margin-top: 6rem; }
.prose h2:first-of-type { margin-top: var(--sp-l); }
.prose p { margin-bottom: var(--sp-s); }
.prose ol.clauses { padding-left: 1.4em; display: grid; gap: var(--rhythm); }
.prose ol.clauses ul { padding-left: 1.2em; margin-top: 0; }
.toc {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 var(--sp-l);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  box-shadow: 0 -1px 0 var(--line), 0 1px 0 var(--line);
  padding-block: var(--rhythm);
}
.toc a { color: var(--navy); text-decoration: none; display: block; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 560px) { .toc { grid-template-columns: 1fr; } }

/* ---------- Page header (non-hero) ---------- */
.page-head { padding-block: var(--sp-2xl) var(--sp-xl); box-shadow: 0 1px 0 var(--line); }
.page-head h1 { font-size: var(--step-4); font-weight: 400; margin-block: var(--rhythm) 0; max-width: 16ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #fff; padding-block: var(--sp-2xl) var(--sp-l); }
.site-footer a { color: rgba(255, 255, 255, 0.82); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--sp-l); }
.footer-grid h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-navy-muted); margin-bottom: var(--sp-s); }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.5em; }
.footer-brand img { height: 40px; width: auto; margin-bottom: var(--sp-s); }
.footer-brand p { color: var(--on-navy-muted); max-width: 34ch; font-size: var(--step--1); }
.footer-bottom {
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-m);
  border-top: 1px solid var(--on-navy-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-s);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--on-navy-muted);
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-spring); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .hero .reveal-up { opacity: 0; transform: translateY(18px); }
.js body.is-ready .hero .reveal-up {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-spring);
  transition-delay: calc(var(--i, 0) * 0.09s);
}

/* Footer: blur-and-rise fade-in, staggered column by column, once */
.js .footer-reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(8px);
  transition: opacity 0.75s var(--ease-out), transform 0.85s var(--ease-spring),
    filter 0.75s var(--ease-out);
  transition-delay: calc(var(--fr-i, 0) * 0.14s);
}
.js .footer-reveal.is-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .js .reveal,
  .js .footer-reveal,
  .js .hero .reveal-up { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ============================================================
   Baseline grid — hard lock  (progressive enhancement)
   ------------------------------------------------------------
   Every line of flow text has its half-leading trimmed away
   (text-box-trim), then its top padded up to a whole grid row
   (round(1cap → --rhythm)). The alphabetic baseline of every
   line — display headings and body copy alike — then falls
   exactly on a 30px ruled line, from one origin, on every page.
   Browsers without text-box-trim keep the earlier near-aligned
   look; nothing breaks.
   ============================================================ */
@supports (text-box-trim: trim-both) {
  /* scoped to the ruled sections only — navy bands, hero and footer
     keep their own vertical logic */
  .grid-bg :where(
    h1, h2, h3, h4,
    p, li, dt, dd, figcaption, summary,
    .eyebrow, .lede, .mono-note,
    .service__no, .service__name, .service__desc,
    .step__no, .step__meta,
    .work-card__title, .work-card__cat,
    .toc a, .field > label
  ) {
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
    /* push the cap down so the first baseline sits a whole number
       of rows below the box top */
    padding-top: calc(round(up, 1cap, var(--rhythm)) - 1cap);
  }

  /* ruled lines coincide with the section top (a rhythm multiple
     of padding above), so every trimmed baseline lands on one */
  .grid-bg { background-position: center 0; }

  /* a two-row gap under the page-head heading reads better than one */
  .page-head .lede { margin-top: var(--rhythm); }
}
