/* Matar + Partners — Architecture & Development
   One typeface (Hanken Grotesk), the brief's restrained palette, an editorial 12-column grid.
   Stone #A5A19A is reserved for rules and details: it fails AA as text, so secondary text uses --muted. */

/* Hanken Grotesk (SIL Open Font License), self-hosted variable font, weights 100–900 */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F7F6F2;        /* warm white — primary background */
  --ink: #252525;       /* charcoal — text, navigation */
  --stone: #A5A19A;     /* stone grey — rules, details */
  --muted: #6B675F;     /* darker stone for secondary text (5.4:1 on --bg) */
  --beige: #E8E4DC;     /* subtle backgrounds */
  --white: #FFFFFF;     /* galleries */

  --font: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --margin: clamp(20px, 4.2vw, 72px);
  --gutter: clamp(16px, 2vw, 32px);
  --header-h: 72px;
  --section: clamp(88px, 12vw, 192px);

  --t-display: clamp(2.6rem, 6.2vw, 6.4rem);
  --t-h1: clamp(2.4rem, 4.8vw, 4.6rem);
  --t-h2: clamp(1.8rem, 3.2vw, 3rem);
  --t-h3: clamp(1.25rem, 1.6vw, 1.5rem);
  --t-lead: clamp(1.2rem, 1.7vw, 1.6rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-label: 0.75rem;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--bg); }

.skip { position: absolute; left: var(--margin); top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; font-size: var(--t-small); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout primitives ---------- */
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.rule { border: 0; border-top: 1px solid var(--stone); margin: 0; opacity: .6; }

.label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.lead { font-size: var(--t-lead); line-height: 1.45; font-weight: 300; letter-spacing: -0.005em; }

.link {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: var(--t-small); font-weight: 500;
  border-bottom: 1px solid currentColor; padding-bottom: 3px;
  transition: gap .3s var(--ease), opacity .2s;
}
.link::after { content: "→"; font-weight: 400; }
.link:hover { gap: 1em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-inline: var(--margin);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: rgba(165, 161, 154, .45); }

.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; white-space: nowrap; line-height: 1.2; }
.brand__name { font-size: .875rem; font-weight: 500; letter-spacing: .2em; margin-right: -.2em; text-transform: uppercase; }
/* Left margin is smaller because the R before it already carries .2em of letter-spacing */
.brand__name span { letter-spacing: 0; margin: 0 .35em 0 .15em; font-weight: 300; }
/* Descriptor is set to exactly the wordmark's width (both lines start and end together).
   The negative margin cancels the trailing letter-space after the last letter. */
.brand__desc { font-size: 9px; font-weight: 500; letter-spacing: .0911em; margin-right: -.0911em; text-transform: uppercase; color: var(--muted); }

.nav ul { display: flex; gap: clamp(20px, 2.6vw, 44px); }
.nav a {
  font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  padding-block: 6px; border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }

.menu-btn { display: none; font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 10px 0 10px 16px; }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg);
    padding: 32px var(--margin);
    visibility: hidden; opacity: 0; transition: opacity .25s, visibility 0s .25s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transition: opacity .25s; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { display: block; font-size: 2rem; font-weight: 300; letter-spacing: -0.01em; text-transform: none; padding-block: 10px; border: 0; }
  .nav a[aria-current="page"] { color: var(--muted); }
  body.menu-open { overflow: hidden; }
}

/* ---------- Pictures ---------- */
.pic { position: relative; overflow: hidden; background: var(--beige); }

.pic img { width: 100%; height: 100%; object-fit: cover; transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.pic img.is-pending { opacity: 0; }
.pic__tag {
  position: absolute; left: 12px; bottom: 12px;
  font-size: .6875rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: rgba(247, 246, 242, .88); padding: 4px 8px;
}

/* ---------- Home: hero ---------- */
.hero { position: relative; padding-inline: var(--margin); }
.hero .pic { height: min(calc(100svh - var(--header-h) - 56px), 66vw); min-height: 320px; }
.hero .pic img { object-position: 50% 55%; }
.hero__caption { display: flex; justify-content: space-between; gap: 24px; padding-top: 14px; font-size: var(--t-small); color: var(--muted); min-height: 56px; }
.hero__caption a:hover { color: var(--ink); }
@media (max-width: 700px) {
  .hero { padding-inline: 0; }
  .hero .pic { height: auto; min-height: 0; aspect-ratio: 1 / 1; }
  .hero__caption { padding-inline: var(--margin); flex-direction: column; gap: 2px; }
}

/* ---------- Home: intro ---------- */
.intro__title { grid-column: 1 / span 10; font-size: var(--t-display); line-height: .98; letter-spacing: -0.035em; }
.intro__text { grid-column: 7 / span 5; margin-top: clamp(40px, 6vw, 96px); }
.intro__meta { grid-column: 1 / span 4; margin-top: clamp(40px, 6vw, 96px); align-self: end; }
@media (max-width: 900px) {
  .intro__title { grid-column: 1 / -1; }
  .intro__text { grid-column: 1 / -1; }
  .intro__meta { grid-column: 1 / -1; order: 3; margin-top: 32px; }
}

/* ---------- Section heads ---------- */
.head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(40px, 5vw, 80px); }
.head h2 { font-size: var(--t-h2); }

/* ---------- Home: key figures, who we work for, how we build ---------- */
.intro__text p + p { margin-top: 16px; }
.kf { list-style: none; padding: 0; margin: clamp(48px, 6vw, 96px) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); border-top: 1px solid rgba(165, 161, 154, .6); }
.kf li { padding-top: 20px; display: flex; flex-direction: column; gap: 6px; }
.kf__value { font-size: var(--t-h1); font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kf__label { font-size: var(--t-small); color: var(--muted); }
@media (max-width: 600px) { .kf { grid-template-columns: 1fr; gap: 0; } .kf li { padding: 16px 0; border-bottom: 1px solid rgba(165, 161, 154, .45); flex-direction: row; align-items: baseline; gap: 16px; } .kf__value { font-size: var(--t-h2); min-width: 3.2ch; } }
.who { row-gap: 24px; }
.who__item { grid-column: span 3; display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 1px solid var(--ink); transition: opacity .2s; }
.who__item:hover .who__name { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.who__name { font-size: var(--t-h3); letter-spacing: -0.01em; }
.who__name::after { content: " →"; color: var(--muted); }
.who__desc { font-size: var(--t-small); color: var(--muted); max-width: 30ch; }
@media (max-width: 900px) { .who__item { grid-column: span 6; } }
@media (max-width: 560px) { .who__item { grid-column: 1 / -1; } }
.hwb { row-gap: 24px; padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid rgba(165, 161, 154, .6); }
.hwb__title { font-size: var(--t-h2); margin-top: 16px; }
.hwb .link { margin-top: 8px; }

/* ---------- Home: selected projects (asymmetric) ---------- */
/* Aligned rows (2 / 1 / 3). Each card's flex-grow is its photo's aspect ratio,
   so every image in a row shares the same top and bottom edge, uncropped. */
.sel-row { display: flex; gap: var(--gutter); align-items: flex-start; }
.sel-row + .sel-row { margin-top: clamp(56px, 7vw, 112px); }
.sel-row .card { flex: var(--ar) 1 0; min-width: 0; }
.sel-row .pic { aspect-ratio: var(--ar); }
.card { display: block; }
.card .pic img { transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.card:hover .pic img { transform: scale(1.02); }
.card__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 16px; }
.card__title { font-size: var(--t-h3); font-weight: 400; letter-spacing: -0.01em; line-height: 1.25; }
.card__sub { font-size: var(--t-small); color: var(--muted); margin-top: 4px; }
.card__status { font-size: .6875rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 1100px) {
  .sel-row .card__meta { flex-direction: column; gap: 6px; }
  .sel-row .card__status { order: 3; }
}
@media (max-width: 1024px) and (min-width: 701px) {
  .sel-row .card__title { font-size: 1.125rem; }
}
@media (max-width: 700px) {
  .sel-row .card__meta { flex-direction: row; }
  .sel-row { flex-direction: column; gap: 48px; }
  .sel-row .card { flex: none; width: 100%; }
}

/* ---------- Home: expertise ---------- */
.expertise-list { counter-reset: ex; }
.ex { grid-column: span 4; border-top: 1px solid var(--stone); padding-top: 24px; display: flex; flex-direction: column; }
.ex__no { font-size: var(--t-small); color: var(--muted); margin-bottom: clamp(40px, 6vw, 96px); font-variant-numeric: tabular-nums; }
.ex h3 { font-size: var(--t-h2); margin-bottom: 20px; }
.ex p { color: var(--muted); max-width: 34ch; flex: 1; }
.ex .link { align-self: flex-start; margin-top: 12px; }
@media (max-width: 900px) { .ex { grid-column: 1 / -1; margin-bottom: 56px; } .ex__no { margin-bottom: 24px; } }
@media (max-width: 900px) and (min-width: 601px) {
  .ex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); margin-bottom: 40px; }
  .ex__no { grid-column: 1 / -1; }
  .ex h3 { grid-column: 1; }
  .ex p, .ex .link { grid-column: 2; }
  .ex .link { justify-self: start; }
  .ex p { max-width: none; }
}

/* ---------- Home: studio band ---------- */
.band--beige { background: var(--beige); }
/* --muted is 4.4:1 on beige; a touch darker keeps small labels at AA (4.5:1+) */
.band--beige { --muted: #5C5850; }
.studio-intro__img { grid-column: 1 / span 6; }
.studio-intro__img .pic { aspect-ratio: 4 / 5; }
.studio-intro__text { grid-column: 8 / span 5; align-self: center; }
.studio-intro__text h2 { font-size: var(--t-h1); margin: 20px 0 32px; }
.studio-intro__text p { max-width: 42ch; }
@media (max-width: 900px) {
  .studio-intro__img, .studio-intro__text { grid-column: 1 / -1; }
  .studio-intro__img .pic { aspect-ratio: 4 / 3; }
  .studio-intro__text { margin-top: 48px; }
}

/* ---------- Home: partnerships (charcoal) ---------- */
.band--ink { background: var(--ink); color: var(--bg); }
.band--ink .label, .band--ink .muted { color: #B9B5AD; }
.partner__title { grid-column: 1 / span 8; font-size: var(--t-display); line-height: .98; letter-spacing: -0.035em; }
.partner__text { grid-column: 7 / span 5; margin-top: clamp(40px, 6vw, 88px); }
.partner__text p { color: #D9D6CF; }
.partner__text .link { margin-top: 16px; font-size: var(--t-body); }
@media (max-width: 900px) { .partner__title, .partner__text { grid-column: 1 / -1; } }

/* ---------- Footer ---------- */
.site-footer { padding: clamp(64px, 8vw, 120px) var(--margin) 32px; font-size: var(--t-small); }
.site-footer .grid { row-gap: 40px; }
.f-brand { grid-column: 1 / span 4; }
.f-brand .brand__name { display: block; margin-bottom: 4px; }
.f-col { grid-column: span 2; }
.f-col--wide { grid-column: span 3; }
.f-col h2 { font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.f-col li + li { margin-top: 4px; }
.f-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.f-social { display: flex; gap: 16px; margin-top: 14px; }
.f-social li + li { margin-top: 0; }
.f-base { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(56px, 7vw, 104px); padding-top: 20px; border-top: 1px solid rgba(165, 161, 154, .6); color: var(--muted); flex-wrap: wrap; }
@media (max-width: 900px) { .f-brand { grid-column: 1 / -1; } .f-col, .f-col--wide { grid-column: span 6; } }

/* ---------- Page heads ---------- */
.page-head { padding-top: clamp(56px, 8vw, 128px); padding-bottom: clamp(48px, 6vw, 96px); }
.page-head h1 { grid-column: 1 / span 8; font-size: var(--t-h1); line-height: 1; letter-spacing: -0.03em; }
.page-head .lead { grid-column: 7 / span 6; margin-top: clamp(28px, 4vw, 56px); }
.page-head .label { grid-column: 1 / -1; margin-bottom: 20px; }
@media (max-width: 900px) { .page-head h1, .page-head .lead { grid-column: 1 / -1; } }

/* ---------- Projects index ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-bottom: 20px; border-bottom: 1px solid rgba(165, 161, 154, .6); margin-bottom: 16px; }
.filters-sub { display: flex; flex-wrap: wrap; gap: 8px 40px; margin-bottom: clamp(40px, 5vw, 72px); }
.filters-sub__group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.filters-sub__label { font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.filters-sub button { font-size: .8125rem; color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; }
.filters-sub button:hover { color: var(--ink); }
.filters-sub button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.filters button { font-size: var(--t-small); color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.filters .count { font-variant-numeric: tabular-nums; font-size: .75rem; margin-left: 4px; vertical-align: super; }

/* Justified rows: each card grows in proportion to its photo's aspect ratio (--ar),
   so every image in a row has the same height and the row's edges line up.
   The ::after filler keeps the last, incomplete row from stretching. */
.p-grid { --row-h: clamp(200px, 17vw, 300px); display: flex; flex-wrap: wrap; column-gap: var(--gutter); row-gap: clamp(48px, 5vw, 80px); align-items: flex-start; }
.p-grid::after { content: ""; flex: 1000 1 0; }
.p-grid .card { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row-h)); min-width: 0; }
.p-grid .card[hidden] { display: none; }
.p-grid .card .pic { aspect-ratio: var(--ar, 4 / 3); }
@media (max-width: 1100px) { .p-grid .card .card__meta { flex-direction: column; gap: 6px; } }
@media (max-width: 640px) { .p-grid .card { flex: 1 1 100%; } .p-grid .card .card__meta { flex-direction: row; } }

.empty { color: var(--muted); }

/* Further record table */
.record { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.record th { text-align: left; font-weight: 500; font-size: var(--t-label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 16px 14px 0; border-bottom: 1px solid var(--stone); }
.record td { padding: 16px 16px 16px 0; border-bottom: 1px solid rgba(165, 161, 154, .45); vertical-align: top; }
.record td:first-child { font-size: var(--t-body); }
.record td.muted { color: var(--muted); }
@media (max-width: 760px) {
  .record thead { display: none; }
  .record tr { display: grid; grid-template-columns: 1fr auto; padding: 16px 0; border-bottom: 1px solid rgba(165, 161, 154, .45); }
  .record td { border: 0; padding: 0; }
  .record td:nth-child(2), .record td:nth-child(5) { grid-column: 1 / -1; color: var(--muted); }
  .record td:nth-child(3) { display: none; }
}

/* ---------- Project page ---------- */
.p-head { padding-top: clamp(40px, 6vw, 96px); padding-bottom: clamp(32px, 4vw, 56px); }
.crumb { font-size: var(--t-small); color: var(--muted); }
.crumb a:hover { color: var(--ink); }
.p-head h1 { font-size: var(--t-h1); line-height: 1; letter-spacing: -0.03em; margin-top: 24px; grid-column: 1 / span 9; }
.p-head .p-status { grid-column: 10 / span 3; align-self: end; justify-self: end; text-align: right; }
@media (max-width: 900px) { .p-head h1 { grid-column: 1 / -1; } .p-head .p-status { grid-column: 1 / -1; justify-self: start; text-align: left; margin-top: 16px; } }

.p-hero .pic { max-height: 88svh; }
.p-hero figcaption, .gallery figcaption { font-size: var(--t-small); color: var(--muted); padding-top: 12px; }

.p-body { row-gap: 48px; }
.facts { grid-column: 1 / span 4; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(165, 161, 154, .55); font-size: var(--t-small); }
.facts div:last-child { border-bottom: 1px solid rgba(165, 161, 154, .55); }
.facts dt { color: var(--muted); }
.narrative { grid-column: 6 / span 6; }
.narrative p:first-child { font-size: var(--t-lead); line-height: 1.45; font-weight: 300; }
@media (max-width: 900px) { .facts, .narrative { grid-column: 1 / -1; } .narrative { order: -1; } }

/* Gallery: images in one justified row share the same height (flex-grow = aspect ratio).
   A single image shows whole, never taller than the screen. */
.gallery { display: flex; gap: var(--gutter); align-items: flex-start; }
.gallery figure { flex: var(--ar) 1 0; min-width: 0; }
.gallery .pic { aspect-ratio: var(--ar); }
.gallery.is-single { justify-content: center; }
.gallery.is-single figure { flex: none; width: min(100%, calc(85svh * var(--ar))); }
@media (max-width: 700px) { .gallery { flex-direction: column; gap: 40px; } .gallery figure, .gallery.is-single figure { flex: none; width: 100%; } }

.credits { grid-column: 6 / span 6; font-size: var(--t-small); }
.credits h2 { font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.credits p { margin: 0 0 4px; }
@media (max-width: 900px) { .credits { grid-column: 1 / -1; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(165, 161, 154, .6); }
.pager a { padding: 28px 0; display: block; }
.pager a:last-child { text-align: right; }
.pager .label { display: block; margin-bottom: 6px; }
.pager .t { font-size: var(--t-h3); letter-spacing: -0.01em; }
.pager a:hover .t { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Text pages (Expertise, Studio) ---------- */
.chapter { row-gap: 32px; padding-block: clamp(64px, 8vw, 128px); border-top: 1px solid rgba(165, 161, 154, .6); }
.chapter__no { grid-column: 1 / span 1; font-size: var(--t-small); color: var(--muted); }
.chapter__title { grid-column: 2 / span 4; font-size: var(--t-h2); }
.chapter__body { grid-column: 7 / span 6; }
.chapter__body > p:first-child { font-size: var(--t-lead); line-height: 1.45; font-weight: 300; }
.chapter__body h3 { font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 40px 0 12px; line-height: 1.6; }
.chapter__body ul.items li { padding: 12px 0; border-top: 1px solid rgba(165, 161, 154, .45); }
.chapter__body ul.items li:last-child { border-bottom: 1px solid rgba(165, 161, 154, .45); }
.chapter__body ul.items strong { font-weight: 500; }
.proof { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: var(--t-small); }
.proof a { border-bottom: 1px solid var(--stone); padding-bottom: 2px; }
.proof a:hover { border-color: var(--ink); }
@media (max-width: 900px) {
  .chapter__no { grid-column: 1 / -1; }
  .chapter__title { grid-column: 1 / -1; }
  .chapter__body { grid-column: 1 / -1; }
}

.wide-pic { padding-inline: var(--margin); }
/* Full photograph, uncropped, centred and never taller than the screen */
.wide-pic { display: grid; justify-content: center; }
.wide-pic .pic { aspect-ratio: var(--ar); width: min(calc(100vw - 2 * var(--margin)), calc(82svh * var(--ar))); }
/* caption takes the image's width without widening the column */
.wide-pic figcaption { font-size: var(--t-small); color: var(--muted); padding-top: 12px; width: 0; min-width: 100%; }

/* Roles glossary */
.roles div { display: grid; grid-template-columns: 13em 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid rgba(165, 161, 154, .45); }
.roles div:last-child { border-bottom: 1px solid rgba(165, 161, 154, .45); }
.roles dt { font-weight: 500; }
.roles dd { color: var(--muted); }
@media (max-width: 600px) { .roles div { grid-template-columns: 1fr; gap: 4px; } }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 8.5em 1fr; gap: 24px; padding: 14px 0; border-top: 1px solid rgba(165, 161, 154, .45); }
.timeline__when { font-variant-numeric: tabular-nums; color: var(--muted); }
.chapter__body .kf { margin-top: 8px; }
.chapter__body .kf__value { font-size: var(--t-h2); }

/* People */
.person + .person { margin-top: 48px; }
.person h3 { font-size: var(--t-h3) !important; font-weight: 400 !important; letter-spacing: -0.01em !important; text-transform: none !important; color: var(--ink) !important; margin: 0 0 4px !important; }
.person__link { margin-left: 14px; font-size: .6875rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--stone); padding-bottom: 1px; vertical-align: middle; white-space: nowrap; }
.person__link:hover { color: var(--ink); border-color: var(--ink); }
.person .role { font-size: var(--t-small); color: var(--muted); margin-bottom: 16px; }

/* ---------- Contact ---------- */
.routes { row-gap: 48px; }
.route { grid-column: span 6; border-top: 1px solid var(--ink); padding-top: 24px; }
.route h2 { font-size: var(--t-h2); margin: 16px 0 20px; }
.route p { color: var(--muted); max-width: 44ch; }
.route .link { margin-top: 8px; }
@media (max-width: 900px) { .route { grid-column: 1 / -1; } }

.form-wrap { grid-column: 1 / span 7; }
.office { grid-column: 9 / span 4; font-size: var(--t-small); }
.office h2 { font-size: var(--t-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.office address { font-style: normal; margin-bottom: 32px; }
@media (max-width: 900px) { .form-wrap, .office { grid-column: 1 / -1; } .office { margin-top: 56px; } }

.form h2 { font-size: var(--t-h2); margin-bottom: 32px; }
.field { margin-bottom: 24px; }
.field label, .field legend { display: block; font-size: var(--t-small); color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--stone); border-radius: 0;
  padding: 10px 0; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gutter); }
@media (max-width: 600px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
fieldset.field { border: 0; padding: 0; margin: 0 0 32px; }
.choices { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { position: relative; }
.field .choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 10px 18px; border: 1px solid var(--stone); font-size: var(--t-small); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.choice input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.hp { position: absolute; left: -10000px; }
.btn {
  display: inline-flex; align-items: center; gap: .8em;
  background: var(--ink); color: var(--bg);
  font-size: var(--t-small); font-weight: 500; letter-spacing: .02em;
  padding: 16px 28px; transition: gap .3s var(--ease), background .2s;
}
.btn::after { content: "→"; }
.btn:hover { gap: 1.2em; background: #000; }
.form-note { font-size: .8125rem; color: var(--muted); margin-top: 20px; max-width: 52ch; }

/* ---------- Utility columns ---------- */
.col-l { grid-column: 1 / span 5; }
.col-r { grid-column: 7 / span 6; }
@media (max-width: 900px) { .col-l, .col-r { grid-column: 1 / -1; } .col-l + .col-r { margin-top: 32px; } }

/* ---------- Service pages ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.2em; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 12px; font-size: var(--t-small); line-height: calc(var(--t-body) * 1.6); color: var(--muted); font-variant-numeric: tabular-nums; }
.step-time { display: block; font-size: var(--t-small); color: var(--muted); margin-top: 2px; }
.proof-row { margin-top: 8px; }
.proof-card { flex: var(--ar) 1 0; min-width: 0; }
.proof-card .card__meta { flex-direction: column; gap: 6px; }
/* chapter h3s are small-caps labels; project titles inside proof cards keep the card style */
.chapter__body .proof-card .card__title { font-size: var(--t-h3); font-weight: 400; letter-spacing: -0.01em; text-transform: none; color: var(--ink); margin: 0; line-height: 1.25; }
.proof-card__outcome { font-size: var(--t-small); color: var(--muted); margin-top: 10px; max-width: 40ch; }
.faq { padding: 20px 0; border-top: 1px solid rgba(165, 161, 154, .45); }
.faq:last-child { border-bottom: 1px solid rgba(165, 161, 154, .45); }
.faq h3 { font-size: var(--t-h3) !important; font-weight: 400 !important; letter-spacing: -0.01em !important; text-transform: none !important; color: var(--ink) !important; margin: 0 0 8px !important; line-height: 1.3; }
.faq p { margin: 0; color: var(--muted); }
.page-head .label a:hover { color: var(--ink); }
@media (max-width: 700px) { .proof-row { flex-direction: column; gap: 40px; } .proof-card { flex: none; width: 100%; } }

/* Draft placeholders: highlighted in previews; build.py --publish refuses to ship them */
.cost-table { margin-top: 24px; }
.cost-table td { font-size: var(--t-body); }
@media (max-width: 760px) { .cost-table thead { display: table-header-group; } .cost-table tr { display: table-row; } .cost-table td { display: table-cell; padding: 12px 12px 12px 0; border-bottom: 1px solid rgba(165,161,154,.45); color: inherit; } }

.narrative ul.items li { padding: 10px 0; border-top: 1px solid rgba(165, 161, 154, .45); font-size: var(--t-small); }
.narrative ul.items li:last-child { border-bottom: 1px solid rgba(165, 161, 154, .45); }
.narrative .story-h { margin: 28px 0 8px; }
.narrative .story-h:first-child, .narrative p + .story-h:first-of-type { margin-top: 0; }
.narrative .story-h + p { font-size: var(--t-body); line-height: 1.6; font-weight: 400; }
@media (max-width: 760px) { .record.track td:nth-child(3) { display: block; grid-column: 1 / -1; color: var(--muted); } }
.record.track td:first-child a { border-bottom: 1px solid var(--stone); }
.record.track td:first-child a:hover { border-color: var(--ink); }
.related-service { margin-top: 32px; font-size: var(--t-small); color: var(--muted); }
.related-service .link { margin-left: 8px; color: var(--ink); }

mark.todo { background: #FFE9A8; color: #4A3B00; padding: 1px 4px; font-size: .9em; }

/* ---------- Review mode (verification notes; never in publish builds) ---------- */
.verify { display: none; }
.review .verify {
  display: block; margin: 16px 0; padding: 12px 14px;
  background: #FFF6D6; color: #4A3B00; border-left: 3px solid #C99A00;
  font-size: .8125rem; line-height: 1.5;
}
.review .verify strong { display: block; font-weight: 600; margin-bottom: 4px; }
.review .verify ul { list-style: disc; padding-left: 18px; }
.review-bar { display: none; }
.review .review-bar { display: block; background: #4A3B00; color: #FFF6D6; font-size: .8125rem; padding: 8px var(--margin); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .card:hover .pic img { transform: none; }
}
