/* ==========================================================================
   GOVERNANCE LAYER — symmetry as a system, not by eye
   One scale (4/8-pt) · one axis (shared container edges) · one repetition (each
   component behaves identically everywhere). Loaded after style.css/responsive.css.
   Scale: 4 8 12 16 24 32 40 48 64 80 96 128
   ========================================================================== */
:root {
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px;
  --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* frame: equal left/right breathing margin, 24 → 44 */
  --gutter: clamp(24px, 3.2vw, 44px);

  /* one radius family */
  --radius: 32px;      /* hero frames, statement panels */
  --radius-md: 24px;   /* every card */
  --radius-sm: 16px;   /* chips inside cards, inputs, small tiles */
  --notch: 24px;

  /* rhythm */
  --section-y: clamp(64px, 8vw, 128px);
  --section-y-tight: clamp(48px, 6vw, 96px);
  --head-gap: clamp(48px, 5vw, 64px);    /* section header → content */
  --grid-gap: var(--s-4);                /* 16 mobile */
  --pad-card: var(--s-6);                /* 24 mobile */

  /* one control height each */
  --btn-h: 48px; --btn-h-sm: 40px; --btn-ic: 36px; --btn-ic-sm: 28px;
}
@media (min-width: 768px) { :root { --grid-gap: var(--s-6); --pad-card: var(--s-8); } }

/* ---------- vertical rhythm ---------- */
.section { padding-block: var(--section-y); }
.section.tight { padding-block: var(--section-y-tight); }
.s-head { margin-bottom: var(--head-gap); gap: var(--s-6) var(--s-16); }
.s-head .h2, .s-head .h1, .eyebrow + .h1, .eyebrow + .h2 { margin-top: var(--s-6) !important; }
.h1 + .lede, .h2 + .lede, .h2 + p, .h1 + p { margin-top: var(--s-6); }
.lede + .acts, .lede + .btn, .ph-inner .acts, .s-head + .acts { margin-top: var(--s-8); }
.acts { gap: var(--s-3); }

/* ---------- card grids: one gutter everywhere ---------- */
.values, .aud-grid, .svc-grid, .explore, .plans, .lgrid, .p-facts, .steps, .mvv, .team,
.timeline, .diff, .kpis, .ccards, .charts, .contact-grid, .why, .dev-grid, .devs, .hero-side { gap: var(--grid-gap); }
.team { row-gap: var(--s-8); }
.stats { gap: 0; }

/* ---------- one card interior ---------- */
.value, .svc, .plan, .kpi, .ccard, .step, .mvv .card, .w, .chart-card, .contact-form, .side-card.lime-card, .diff > *, .bid-board {
  padding: var(--pad-card);
}
.value, .svc, .plan, .kpi, .ccard, .step, .mvv .card, .w, .chart-card, .dev, .ex-media, .lcard .lm, .member .ph, .svc-art, .side-card { border-radius: var(--radius-md); }
.chip, .field { border-radius: var(--radius-sm); }
.chip { border-radius: 999px; }
textarea.field, input.field, select { border-radius: var(--radius-sm); }
.field { height: var(--btn-h); }

/* equal heights inside every repeating set: cards stretch to the row, bottoms align */
.values > *, .svc-grid > *, .plans > *, .kpis > *, .mvv > *, .diff > *, .steps > *, .ccards > *, .aud-grid > * { height: 100%; }
.plan, .svc, .value, .kpi, .ccard, .mvv .card, .aud { display: flex; flex-direction: column; }
.plan .pfoot, .svc .link-arrow, .aud .link-arrow { margin-top: auto; }

/* listing cards: titles clamp to two lines so every card in a row is flush */
.lcard h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * 1.25em); }
.lcard .loc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard .facts { flex-wrap: nowrap; overflow: hidden; }
.lcard .facts span { white-space: nowrap; }

/* ---------- one button system (solid + outline are the same box) ---------- */
.btn { height: var(--btn-h); gap: var(--s-3); padding: 0 6px 0 var(--s-6); }
.btn .ic { width: var(--btn-ic); height: var(--btn-ic); }
.btn.ghost { padding: 0 var(--s-6); }
.btn.sm { height: var(--btn-h-sm); padding: 0 6px 0 var(--s-4); }
.btn.sm .ic { width: var(--btn-ic-sm); height: var(--btn-ic-sm); }
.btn.ghost.sm { padding: 0 var(--s-4); }
.btn .ic svg, .link-arrow svg { width: 16px; height: 16px; }   /* icon ladder: 16 in CTAs */

/* ---------- reserved corners are mirrored: content never runs under a corner badge ---------- */
.side-card.lime-card > div:not(.tab), .ex-card .ex-body, .kpi > span { padding-right: var(--s-12); }

/* ---------- footer on the same frame + grid ---------- */
.foot-top { gap: var(--s-10) var(--s-12); }

@media (max-width: 640px) {
  .s-head { gap: var(--s-4); }
  .lede + .acts, .ph-inner .acts { margin-top: var(--s-6); }
  .hero-side { gap: var(--grid-gap); }
}

/* the hero frame shares the content frame: one left edge, one right edge */
.top-shell { max-width: var(--maxw); padding-top: var(--s-4); }
.member.lead { align-self: stretch; }
.member.lead .ph { aspect-ratio: auto; height: 100%; }
@media (max-width: 640px) { .member.lead .ph { height: auto; } }
/* team: every name/role block is the same height so rows are flush */
.member h3, .member p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.member h3 { min-height: calc(2 * 1.2em); line-height: 1.2; }
.member p { min-height: calc(2 * 1.45em); line-height: 1.45; }
.team-cta { align-self: stretch; display: flex; flex-direction: column; }
.team-cta .ph { flex: 1; aspect-ratio: auto; min-height: 260px; }
@media (min-width: 641px) { .member h3 { min-height: 1.2em; -webkit-line-clamp: 1; } }
/* pinned bottom links keep a fixed 24px gap above them */
.svc .link-arrow, .aud .link-arrow, .plan .pfoot { margin-top: auto; }
.svc p, .aud p { margin-bottom: var(--s-6); }
.team-cta h3 { display: block; min-height: 0; -webkit-line-clamp: unset; }
.chip { white-space: nowrap; }
/* nav pill: links grouped and centred in the pill, CTA on the right edge; outer gaps stay equal */
.nav-pill { justify-content: flex-start; gap: var(--s-1); }
.nav-pill a.nl:first-child { margin-left: auto; }
.nav-pill .btn { margin-left: auto; }
/* About story: the floating key keeps its own size (was inheriting the photo cover rule) */
.story-media .floater { inset: auto; left: var(--s-6); bottom: var(--s-6); top: auto; width: 150px; height: auto; object-fit: contain; }

/* ---------- round 5: thinner mobile frame, badge + subscribe fixes, mobile crops ---------- */
/* mobile frame: side margin cut 70% (24 → 8, on the 4-pt scale) so content gets the width */
@media (max-width: 640px) { :root { --gutter: 8px; } }

/* "Visit or call" badge: the mark was inheriting the full-bleed photo rule (absolute, 100% × 100%) */
.touch-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spin-badge .core img { position: static; inset: auto; width: 30px; height: 30px; object-fit: contain; scale: 1 !important; transform: none; }
.spin-badge .core { width: 64px; height: 64px; }
@media (max-width: 640px) { .spin-badge .core { width: 52px; height: 52px; } .spin-badge .core img { width: 24px; height: 24px; } }

/* subscribe tab: sized to the frame, never wider than it; leaves a notch's width on the right */
@media (max-width: 640px) {
  .touch-media { min-height: 0; aspect-ratio: 4 / 5; }
  .touch-media > img { object-position: 50% 22%; }
  .touch-media .news { width: calc(100% - var(--notch) - var(--s-4)); max-width: none; box-sizing: border-box; padding: var(--s-4) var(--s-4) var(--s-1) var(--s-1); }
  .touch-media .news p { overflow-wrap: anywhere; }
  .news form { width: 100%; box-sizing: border-box; }
  .news .btn.sm { flex: none; }
}

/* picture positioning on phones: single-column media cards go landscape so each photo keeps its
   whole subject instead of a tall sliver of one side; focal points come from the img's object-position */
@media (max-width: 640px) {
  .ex-media { aspect-ratio: 4 / 3; }
  .dev { aspect-ratio: 4 / 3.4; }
  .side-card.photo img, .dev img, .gallery .g img { object-position: 50% 50%; }
}

/* ---------- partner logos (hero marquee): official marks, greyscale files, one optical height ---------- */
.marquee-track { align-items: center; gap: var(--s-16); }
.mq-item { opacity: 1; }
.mq-item img { display: block; width: auto; flex: none; opacity: .78; transition: opacity var(--motion-normal, .25s) ease; }
.mq-item.seal img { height: 48px; }
.mq-item.mark img { height: 40px; }
.mq-item:hover img { opacity: 1; }
.mq-item svg { width: 32px; height: 32px; color: var(--ink-4); }
@media (max-width: 640px) {
  .marquee-track { gap: var(--s-10); }
  .mq-item.seal img { height: 40px; }
  .mq-item.mark img { height: 32px; }
}

/* ---------- round 7 ---------- */
/* 1 · the brand tab lives inside the hero frame; the frame's rounded corner was clipping it and its
      anti-aliased edge showed as a grey arc. The tab is the corner, so the frame corner is square there. */
:has(> .site-head) { border-top-left-radius: 0 !important; }

/* 2 · quote card: Denford fills the whole right column edge to edge (no floating card, no dead strips);
      controls become a horizontal glass pill bottom-right, mirroring the name tab bottom-left */
.quote-person { align-items: stretch; justify-content: stretch; }
.quote-person img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: cover; object-position: 50% 16%; }
.quote-person::before { left: 0; right: 0; top: 0; transform: none; width: auto; height: 100%; aspect-ratio: auto; border-radius: 0; }
.quote-person::after { left: 0; transform: none; width: 100%; height: 100%; z-index: 1; background: linear-gradient(90deg, var(--ink-2) 0, rgba(20, 22, 13, 0) 28%), linear-gradient(0deg, rgba(20, 22, 13, .75), rgba(20, 22, 13, 0) 38%); }
.q-ctrl { z-index: 3; top: auto; bottom: var(--s-6); right: var(--s-6); transform: none; flex-direction: row; align-items: center; height: auto; width: auto; gap: var(--s-2); padding: 6px; }
.q-ctrl .qdots { flex-direction: row; padding-inline: var(--s-1); }
.q-ctrl .qdots i.on { height: 4px; width: 18px; }

/* 3 · plan cards: the label tab owns the top 48px; the list always starts a full card-padding below it */
.plan { padding-top: calc(48px + var(--pad-card)); }

/* 4 · subscribe tab on phones: leave enough photo on the right for the fillet + frame corner to
      form one rounded end instead of meeting in a point (24 notch + 32 radius < 64) */
@media (max-width: 640px) { .touch-media .news { width: calc(100% - var(--s-16)); } }
/* the brand tab never shrinks under its logo; the nav pill is the element that gives way */
.brand-tab { flex: none; }
.site-head .nav-pill { min-width: 0; }
@media (max-width: 1240px) and (min-width: 981px) { .nav-pill a.nl { padding-inline: 10px; font-size: .86rem; } }
@media (max-width: 1280px) and (min-width: 981px) { .nav-pill a.nl { padding: 11px 10px; font-size: .84rem; } }
/* below 1180px the full link row no longer fits beside an unsquashed logo: switch to the menu button */
@media (max-width: 1180px) {
  .nav-pill a.nl, .nav-pill .btn { display: none; }
  .nav-pill { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; flex: 0 0 auto; margin: 12px 12px 0 auto; }
  .burger { display: grid; }
}
/* Denford's only photo is 352×470: size his column near that so it fills edge to edge without upscaling blur */
@media (min-width: 1001px) { .quote-card { grid-template-columns: minmax(0, 1fr) 380px; } }
.q-ctrl button svg { transform: rotate(-90deg); }

/* ---- Typography: Morn throughout, headlines at 0 tracking ---- */
h1, h2, h3, .h-display, .h1, .h2, .h3,
.value h3, .aud h3, .lcard h3, .ex-card h3,
.menu nav a, .quote blockquote,
h1 *, h2 *, h3 *, .h-display *, .h1 *, .h2 *, .h3 * { letter-spacing: 0; }
.ex-card h3 small { letter-spacing: .1em; }
