/* ==========================================================================
   Johan Evert — site styles
   Earthy rural-modern. Palette lifted from the Farm Safety app itself.
   Single stylesheet, no build step, no dependencies.
   ========================================================================== */

/* --- 0. Fonts (self-hosted — no third-party request, works offline) ------- */

@font-face {
  font-family: "Archivo Var";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader Var";
  src: url("../fonts/newsreader-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Surfaces — dry-veld neutrals, biased green rather than cream */
  --bone:        #EBEAE1;   /* page background */
  --bone-2:      #E0E0D4;   /* alternating band */
  --card:        #F9F9F4;
  --night:       #171C18;   /* dark sections — green-black, not brown-black */
  --night-2:     #1F2620;

  /* Ink */
  --ink:         #161A13;
  --ink-2:       #3F4438;
  --muted:       #5E6253;
  --on-night:    #E7E9E0;
  --on-night-mut:#9AA093;

  /* Accents — the app's own values */
  --green:       #2F6B4F;
  --green-dark:  #22513C;
  --green-soft:  #D6E1D6;
  --ochre:       #C87613;   /* fills, rules, accents */
  --ochre-ink:   #8E520B;   /* the same accent, darkened for small text on light */
  --clay:        #B23A33;

  /* Lines */
  --line:        #D0D0C1;
  --line-soft:   #DEDED1;
  --line-input:  #7F7F68;   /* form-control borders — WCAG 1.4.11 wants 3:1 for UI boundaries */
  --line-night:  #2E3730;

  /* Type — expanded grotesque for display, screen serif for reading */
  --display: "Archivo Var", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ui:      "Archivo Var", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif:   "Newsreader Var", "Newsreader", Georgia, "Times New Roman", serif;

  /* Rhythm */
  --wrap:    1140px;
  --wrap-sm: 720px;
  --r-sm:  8px;
  --r:    14px;
  --r-lg: 22px;

  --shadow:    0 1px 2px rgba(22,26,19,.05), 0 8px 24px -12px rgba(22,26,19,.18);
  --shadow-lg: 0 2px 4px rgba(22,26,19,.06), 0 28px 60px -24px rgba(22,26,19,.4);
}

/* Display type: Archivo pushed wide. Utility type: Archivo pulled narrow.
   One family, two personalities — signage and small print. */
.u-display { font-family: var(--display); font-variation-settings: "wdth" 115, "wght" 650; }
.u-ui      { font-family: var(--ui);      font-variation-settings: "wdth" 92,  "wght" 500; }

/* --- 2. Reset ------------------------------------------------------------ */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-variation-settings: "wdth" 114, "wght" 640;
  line-height: 1.08;
  letter-spacing: -.022em;
  text-wrap: balance;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.05rem, 4.6vw, 3.15rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.4rem); letter-spacing: -.026em; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.32rem); font-variation-settings: "wdth" 108, "wght" 660; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

/* --- 3. Layout ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}
.wrap--narrow { max-width: var(--wrap-sm); }

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }
.section--bone2 { background: var(--bone-2); }
.section--night {
  background: var(--night);
  color: var(--on-night);
}
.section--night h2, .section--night h3 { color: var(--on-night); }
.section--night p { color: var(--on-night-mut); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* --- 4. Type helpers ----------------------------------------------------- */

.eyebrow {
  font-family: var(--ui);
  font-variation-settings: "wdth" 90, "wght" 620;
  font-size: .74rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--green);
  flex: none;
}
.section--night .eyebrow { color: var(--ochre); }
.section--night .eyebrow::before { background: var(--ochre); }

.lead {
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-2);
}
.section--night .lead { color: var(--on-night-mut); }

.measure { max-width: 62ch; }

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--ui);
  font-variation-settings: "wdth" 96, "wght" 600;
  font-size: .94rem;
  line-height: 1;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }

.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--green); color: var(--green-dark); }

.section--night .btn--ghost { border-color: var(--line-night); color: var(--on-night); }
.section--night .btn--ghost:hover { border-color: var(--ochre); color: var(--ochre); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* --- 6. Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(235, 234, 225, .90);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px -18px rgba(22,26,19,.6);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 660;
  font-size: 1.1rem;
  letter-spacing: -.018em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-family: var(--ui);
  font-variation-settings: "wdth" 96, "wght" 500;
  font-size: .93rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { background: var(--bone-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--green-dark); font-variation-settings: "wdth" 96, "wght" 640; }

/* The nav CTA is a button first, a nav link second — these need to out-rank
   the .nav a colour/background rules above. */
.nav a.btn { margin-left: 8px; padding: 11px 20px; }
.nav a.btn--primary { background: var(--green); color: #fff; font-variation-settings: "wdth" 96, "wght" 600; }
.nav a.btn--primary:hover { background: var(--green-dark); color: #fff; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 96, "wght" 600;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bone);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 22px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 6px; border-radius: var(--r-sm); }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* --- 7. Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 8vw, 96px);
}
.hero::after {
  /* soft veld-horizon wash */
  content: "";
  position: absolute;
  inset: auto -10% -55% -10%;
  height: 70%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(47,107,79,.10), transparent 70%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.24fr .76fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero h1 { margin-bottom: .35em; }
.hero h1 em {
  font-style: normal;
  color: var(--green-dark);
}

.hero__sub {
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 1.9em;
}

.hero__device {
  position: relative;
  justify-self: center;
  max-width: 292px;
  filter: drop-shadow(0 30px 50px rgba(30,28,24,.28));
}
.hero__device img { border-radius: 26px; }

.hero__note {
  margin-top: 20px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__device { max-width: 265px; margin-top: 8px; }
  .hero__sub { max-width: none; }
}

/* --- 8. Stat strip ------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--bone); padding: 26px 24px; }
.stat__n {
  font-family: var(--display);
  font-variation-settings: "wdth" 118, "wght" 680;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--green-dark);
  display: block;
  margin-bottom: 8px;
}
.stat__l {
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--muted);
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* --- 9. Cards ------------------------------------------------------------ */

.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 30px;
}
.card h3 { margin-bottom: .45em; }
.card p { font-size: .96rem; color: var(--ink-2); }

.card--service { display: flex; flex-direction: column; }
.card__icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--green-soft);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--green-dark);
}
.card__tag {
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 90, "wght" 600;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Project card — the big one */
.project {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 52px);
  box-shadow: var(--shadow);
}
.project__shots {
  display: flex;
  justify-content: center;
  gap: 14px;
}
.project__shots img {
  width: 138px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.project__shots img:first-child { transform: rotate(-3deg); }
.project__shots img:last-child  { transform: rotate(3deg) translateY(10px); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--ui);
  font-variation-settings: "wdth" 90, "wght" 620;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 6px 13px;
  margin-bottom: 18px;
}
.badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; padding: 0; list-style: none; }
.tags li {
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 500;
  font-size: .8rem;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
}

@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project__shots { order: -1; }
}

/* --- 10. Feature list (case study) --------------------------------------- */

.features { display: grid; gap: clamp(48px, 6vw, 80px); }

.feature {
  display: grid;
  grid-template-columns: 1fr 248px;
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
}
.feature:nth-child(even) { grid-template-columns: 248px 1fr; }
.feature:nth-child(even) .feature__shot { order: -1; }

.feature__shot img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.feature h3 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
.feature__n {
  font-family: var(--ui);
  font-variation-settings: "wdth" 88, "wght" 660;
  font-size: .76rem;
  letter-spacing: .14em;
  color: var(--ochre-ink);
  display: block;
  margin-bottom: 12px;
}

@media (max-width: 800px) {
  .feature,
  .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature__shot { order: -1; max-width: 260px; margin-inline: auto; }
  .feature:nth-child(even) .feature__shot { order: -1; }
}

/* Screen strip */
.strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 24px 22px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.strip figure {
  margin: 0;
  flex: none;
  width: 190px;
  scroll-snap-align: center;
}
.strip img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line-night);
  box-shadow: var(--shadow-lg);
}
.strip figcaption {
  margin-top: 12px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 92, "wght" 500;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--on-night-mut);
  text-align: center;
}

/* --- 11. Numbered / bullet lists ----------------------------------------- */

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ticks li {
  position: relative;
  padding-left: 30px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.ticks strong {
  font-family: var(--ui);
  font-variation-settings: "wdth" 98, "wght" 620;
  font-size: .95rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px; top: .55em;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--green);
}
.section--night .ticks li { color: var(--on-night-mut); }
.section--night .ticks li::before { border-color: var(--ochre); }

.stack-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line-night);
  border: 1px solid var(--line-night);
  border-radius: var(--r);
  overflow: hidden;
}
.stack-list li {
  background: var(--night-2);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: baseline;
  font-size: .94rem;
  color: var(--on-night-mut);
}
.stack-list b {
  color: var(--on-night);
  font-family: var(--ui);
  font-variation-settings: "wdth" 88, "wght" 640;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .stack-list li { grid-template-columns: 1fr; gap: 6px; }
}

/* --- 12. Prose (about / story) ------------------------------------------- */

.prose p { font-size: 1.06rem; line-height: 1.72; color: var(--ink-2); }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose .pull {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.35;
  color: var(--ink);
  border-left: 3px solid var(--ochre);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
}

/* --- 13. CTA + footer ---------------------------------------------------- */

.cta {
  text-align: center;
  border-top: 1px solid var(--line);
}
.cta h2 { max-width: 18ch; margin-inline: auto; }
.cta .lead { max-width: 52ch; margin-inline: auto; margin-bottom: 2em; }
.cta .btn-row { justify-content: center; }

.site-footer {
  background: var(--night);
  color: var(--on-night-mut);
  padding: 56px 0 40px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 96, "wght" 450;
  font-size: .9rem;
}
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { color: var(--ochre); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer .brand { color: var(--on-night); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer__legal {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line-night);
  font-size: .82rem;
  color: #8C8A7E;
}

/* --- 14. Reveal on scroll ------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* --- 15. Print ----------------------------------------------------------- */

@media print {
  .site-header, .nav, .cta, .site-footer { display: none; }
  body { background: #fff; }
}

/* --- 16. Testimonials ----------------------------------------------------- */

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .quotes { grid-template-columns: 1fr; } }

.quote {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 30px;
}
.quote::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--ochre);
  flex: none;
}
.quote__text {
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}
.quote__who {
  margin: auto 0 0;
  font-family: var(--ui);
  font-variation-settings: "wdth" 92, "wght" 550;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--muted);
}

/* Empty slot — deliberately unmistakable, so a placeholder can never be
   read as a real quote. Delete the --empty modifier once a quote is in. */
.quote--empty {
  background: transparent;
  border: 1.5px dashed var(--line);
}
.quote--empty::before { background: var(--line); }
.quote--empty .quote__text {
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .92rem;
  color: var(--muted);
}

/* --- 17. Browser mockup (website work samples) ---------------------------- */

.browser {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--bone-2);
  border-bottom: 1px solid var(--line);
}
.browser__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
}
.browser__url {
  margin-left: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--card);
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser img { width: 100%; display: block; }

/* Second work card: landscape shot wants more of the row than the phones do,
   and sits on the opposite side so the two cards don't read as a template. */
.project--site { grid-template-columns: 1.2fr .8fr; }
.project--site .project__shot { order: -1; }
@media (max-width: 860px) {
  .project--site { grid-template-columns: 1fr; }
}

/* --- 18. Chapters (case study with few images) ---------------------------- */
/* The Farm Safety page alternates text with app screens. This page has one
   screenshot and a lot of reasoning, so it uses a sidenote layout instead —
   label left, argument right. Deliberately not the same page twice. */

.chapters { display: grid; gap: clamp(44px, 5.5vw, 72px); }

.chapter {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}
.chapter:first-child { border-top: 0; padding-top: 0; }

.chapter__label { position: relative; }
.chapter__label .eyebrow { margin-bottom: .6rem; }
.chapter__label h3 {
  /* narrower than the page's other headings so it holds two lines, not four */
  font-variation-settings: "wdth" 98, "wght" 660;
  font-size: clamp(1.2rem, 1.8vw, 1.42rem);
  letter-spacing: -.018em;
  margin: 0;
}

.chapter__body > p { color: var(--ink-2); }
.chapter__body > p:first-child {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  color: var(--ink);
}
.chapter__aside {
  margin-top: 20px;
  padding: 18px 22px;
  border-left: 2px solid var(--ochre);
  background: var(--card);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .95rem;
  color: var(--ink-2);
}
.chapter__aside b {
  font-family: var(--ui);
  font-variation-settings: "wdth" 92, "wght" 620;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ochre-ink);
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 780px) {
  .chapter { grid-template-columns: 1fr; gap: 14px; }
}

/* Inline diagram */
.figure {
  margin: 26px 0 0;
  padding: 26px 24px 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow-x: auto;
}
.figure svg { display: block; margin-inline: auto; min-width: 460px; }
.figure figcaption {
  margin-top: 16px;
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* Inline code — the one place a monospace face belongs */
code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bone-2);
  color: var(--ink);
}
.section--night code { background: var(--night-2); color: var(--on-night); }

/* --- 19. How it starts ---------------------------------------------------- */
/* Numbered because this genuinely is a sequence — step 2 can't precede step 1. */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.step {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 28px 26px;
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-family: var(--ui);
  font-variation-settings: "wdth" 100, "wght" 680;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: .45em; }
.step p { font-size: .96rem; color: var(--ink-2); }

/* --- 20. Enquiry form ----------------------------------------------------- */

.form {
  display: grid;
  gap: 18px;
  text-align: left;
  max-width: 560px;
  margin-inline: auto;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 7px; }
.field > label {
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 600;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.field input,
.field select,
.field textarea {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-input);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field ::placeholder { color: var(--muted); opacity: 1; }
.field select {
  font-family: var(--ui);
  font-variation-settings: "wdth" 96, "wght" 450;
  /* keep the native control — it behaves better on a phone than anything custom */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233F4438' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47,107,79,.16);
}
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__submit { justify-self: start; }
.form__note {
  font-family: var(--ui);
  font-variation-settings: "wdth" 94, "wght" 450;
  font-size: .86rem;
  color: var(--muted);
}
.form__note a { color: var(--green-dark); }

/* Facts line on a work card — proof that survives without a click */
.project__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  font-family: var(--ui);
  font-variation-settings: "wdth" 92, "wght" 550;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.project__facts li { display: flex; align-items: center; gap: .5em; }
.project__facts li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
