/* The Ember Project — brand system
   Colours, type and layout vocabulary per the brand specification.
   Paper background, Ink text, Terracotta as accent only.
   No gradients, no shadows beyond hairline borders. */

:root {
  --terracotta: #C96F35;      /* accent only — rules, one accent element per layout */
  --terracotta-dark: #A0521F; /* accent text and links on light backgrounds */
  --terracotta-hover: #7C3F18;
  --terracotta-on-dark: #DE8447; /* accent text on deep-ink — lifted to clear AA */
  --ink: #312F2C;             /* all body text and headings */
  --deep-ink: #26241F;        /* dark cover/hero backgrounds only */
  --paper: #FBFAF5;           /* default page background */
  --warm-grey: #6B6862;       /* bullets, rules, mono labels */
  --border: rgba(49, 47, 44, 0.2);
  --paper-border: rgba(251, 250, 245, 0.25);

  --display: 'Bricolage Grotesque', sans-serif;
  --body: 'Instrument Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  /* Type scale — a minor-third progression, not an accumulation of
     near-identical sizes. Every size on the site comes from here. */
  --t-label: 16px;   /* mono labels, footnotes — the brand minimum */
  --t-small: 17px;   /* supporting text inside components */
  --t-body: 18px;    /* running text */
  --t-lede: 22px;    /* section openers — a real step, not +1px */
  --t-h3: 25px;      /* component headings */
  --t-h2: clamp(32px, 5vw, 52px);
  --t-h1: clamp(44px, 7.5vw, 84px);

  /* Optical tracking: display type tightens as it grows. */
  --track-h1: -0.035em;
  --track-h2: -0.025em;
  --track-h3: -0.015em;

  --measure: 62ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Cross-page fades where the browser supports the View Transitions API */
@view-transition { navigation: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body); /* 16px minimum everywhere, always */
  line-height: 1.55;
  text-align: left;
  /* Proper kerning and ligatures; quotes and bullets hang into the
     margin where the browser supports it. */
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
}

img { max-width: 100%; height: auto; }

a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { color: var(--terracotta-hover); }

strong { font-weight: 600; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
  /* Keep headings from breaking to a lonely last word. */
  text-wrap: balance;
}
h1 { letter-spacing: var(--track-h1); }
h2 { letter-spacing: var(--track-h2); }
h3 { font-size: var(--t-h3); letter-spacing: var(--track-h3); line-height: 1.15; }

/* Avoid single-word last lines in running text. */
p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 16px;
  z-index: 10;
}
.skip-link:focus { left: 0; color: var(--paper); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* The header runs wider than the body measure so the full nav fits
   alongside the logo without squeezing it. */
.site-header .wrap {
  max-width: 1240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-logo { flex: none; }
.site-logo img { width: 96px; display: block; }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  align-items: center;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-grey);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 3px solid var(--terracotta);
  padding-bottom: 4px;
}
.site-nav a.nav-cta {
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 10px 16px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a.nav-cta:hover { background: var(--ink); color: var(--paper); }
.site-nav a.nav-cta[aria-current="page"] { border-bottom: 2px solid var(--ink); padding-bottom: 10px; }

/* Meeting cards (contact page) */
.meet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  max-width: 900px;
}
.meet-grid .contact-box { max-width: none; gap: 14px; }
.meet-grid .btn { align-self: flex-start; }
.meet-note { font-size: var(--t-small); color: var(--warm-grey); }

@media (max-width: 1220px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0 16px;
  }
  .site-nav li { width: 100%; border-top: 1px solid var(--border); }
  .site-nav a { display: block; padding: 14px 0; }
  .site-nav a[aria-current="page"] { border-bottom: none; border-left: 3px solid var(--terracotta); padding-left: 12px; }
  .site-nav a.nav-cta { display: inline-block; margin-top: 12px; padding: 10px 16px; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* ---------- Layout vocabulary ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--warm-grey);
}

/* The footer sits on deep ink but isn't tagged .dark, so it needs the
   same treatment — warm grey on deep ink is 2.8:1 and fails AA. */
.dark .kicker, .site-footer .kicker { color: var(--paper); opacity: 0.7; }

.rule {
  width: 48px;
  height: 3px;
  background: var(--terracotta);
  border: none;
  margin: 24px 0 0;
}

section { padding: 72px 0; }
section.dark { padding: 96px 0; }

.section-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.section-head h1 { font-size: var(--t-h1); }
.section-head h2 { font-size: var(--t-h2); }
.section-head .rule { margin-top: 8px; }
.section-head .lede { font-size: var(--t-lede); line-height: 1.45; margin-top: 8px; }

/* Dark band — deep ink, cover style */
.dark {
  background: var(--deep-ink);
  color: var(--paper);
}
.dark a { color: var(--paper); text-decoration: underline; }
.dark a:hover { color: var(--paper); opacity: 0.8; }
.dark :focus-visible { outline-color: var(--paper); }

/* Stat trio */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.stat { border-top: 2px solid var(--warm-grey); padding-top: 20px; }
.stat .stat-figure {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(40px, 4.5vw, 58px);
  line-height: 1.05;
}
.stat p { font-size: var(--t-small); margin-top: 8px; }

/* Quote variant — a written commitment rather than a figure */
.stats.quotes .stat-figure {
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.stats.quotes .stat { border-top-color: var(--terracotta); }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
}

/* Square-bullet lists */
ul.squares {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 70ch;
}
ul.squares li { display: flex; gap: 16px; }
ul.squares li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--warm-grey);
  margin-top: 9px;
}

/* Ruled rows (timeline / definition rows) */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.rows .row:first-child { border-top: 2px solid var(--ink); }
.rows.closed .row:last-child { border-bottom: 2px solid var(--ink); }
.row .row-label {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--warm-grey);
  flex: none;
  width: 130px;
}
.row .row-body { max-width: 62ch; }

@media (max-width: 600px) {
  .row { flex-direction: column; gap: 6px; }
  .row .row-label { width: auto; }
}

/* Key/value rows (vacancy card) */
.kv { display: flex; flex-direction: column; }
.kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.kv > div:first-child { border-top: 2px solid var(--ink); }
.kv > div:last-child { border-bottom: 2px solid var(--ink); }
.kv dt {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin: 0;
}
.kv dd { margin: 0; font-weight: 600; text-align: right; max-width: 340px; font-size: var(--t-body); }
.kv dd.big { font-family: var(--display); font-weight: 800; font-size: var(--t-h3); letter-spacing: var(--track-h3); }

/* Key contact block — 2px solid Ink border box */
.contact-box {
  border: 2px solid var(--ink);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}
.contact-box .kicker { font-size: 16px; }
.contact-box .phone {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: var(--track-h3);
  color: var(--ink);
}
.contact-box a.phone:hover { color: var(--terracotta-hover); }

/* Two-up grid cards */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 56px;
}
.grid-2 > div { border-top: 2px solid var(--warm-grey); padding-top: 16px; }
.grid-2 h2, .grid-2 h3 { font-size: var(--t-h3); letter-spacing: var(--track-h3); margin-bottom: 10px; }
.grid-2 p { font-size: var(--t-small); }
.grid-2 .span-2 { grid-column: 1 / -1; border-top: 1px solid var(--border); }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Path cards (home) */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.paths.three { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.paths.three .path-card { padding: 28px; }
.paths.three .path-card h2 { font-size: 24px; }
.path-card {
  border: 2px solid var(--ink);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
}
.path-card h2, .path-card h3 { font-size: 28px; letter-spacing: var(--track-h3); }
.path-card p { font-size: 17px; }
.path-card .go {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  margin-top: auto;
  padding-top: 10px;
}
a.path-card { transition: background 0.25s ease, color 0.25s ease; }
a.path-card:hover { background: var(--ink); color: var(--paper); }
a.path-card:hover .kicker { color: var(--paper); opacity: 0.7; }
a.path-card:hover .go { color: var(--paper); }
a.path-card .go { transition: color 0.25s ease; }

@media (max-width: 960px) {
  .paths.three { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .paths { grid-template-columns: 1fr; }
}

/* Dark contact rows (footer / dark bands) */
.dark-rows { display: flex; flex-direction: column; max-width: 640px; }
.dark-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid var(--paper-border);
  padding: 16px 0;
  flex-wrap: wrap;
}
.dark-rows .big {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-lede);
  letter-spacing: var(--track-h3);
}
.dark-rows a { text-decoration: none; font-weight: 600; }
.dark-rows a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */

.site-footer { background: var(--deep-ink); color: var(--paper); padding: 80px 0 48px; }
.site-footer h2 { font-size: var(--t-h2); }
.site-footer .footnote {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 48px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.site-footer a { color: var(--paper); }

/* ---------- Job board ---------- */

.job-filters {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.job-filter { display: flex; flex-direction: column; gap: 8px; }
.job-filter select {
  font-family: var(--body);
  font-size: var(--t-small);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 10px 14px;
  min-width: 220px;
}
.job-count { margin-left: auto; padding-bottom: 12px; }

.job-list { display: flex; flex-direction: column; }
details.job { border-top: 1px solid var(--border); }
details.job:first-child { border-top: 2px solid var(--ink); }
details.job:last-child { border-bottom: 2px solid var(--ink); }

details.job summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
}
details.job summary::-webkit-details-marker { display: none; }
details.job summary:hover .job-title { color: var(--terracotta-hover); }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.job-title-wrap, .job-facts { display: flex; flex-direction: column; gap: 6px; }
.job-facts { text-align: right; align-items: flex-end; }
.job-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-h3);
  letter-spacing: var(--track-h3);
}
.job-title::after {
  content: " +";
  color: var(--terracotta-dark);
}
details.job[open] .job-title::after { content: " –"; }
.job-pay { font-weight: 600; font-size: var(--t-body); }

.job-body {
  padding: 8px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 70ch;
}
.job-summary { font-weight: 600; }
.job-body .kv > div:first-child { border-top: 2px solid var(--ink); }
.job-body .kv dd { font-weight: 500; }
.job-none { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 24px 0; }

@media (max-width: 600px) {
  .job-facts { text-align: left; align-items: flex-start; }
  .job-count { margin-left: 0; }
}

/* ---------- Hero (home cover) ---------- */

.hero {
  min-height: calc(88vh - 96px);
  display: flex;
  align-items: center;
  padding: 72px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero-copy { display: flex; flex-direction: column; gap: 24px; }

.hero-title {
  font-size: clamp(44px, 6vw, 80px);
  letter-spacing: var(--track-h1);
  line-height: 1.0;
  text-wrap: balance;
  max-width: 15ch;
}

.hero .lede { font-size: clamp(19px, 2vw, var(--t-lede)); line-height: 1.45; max-width: 56ch; opacity: 0.9; }

.strap {
  font-family: var(--mono);
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--terracotta-dark);
  margin-top: -8px;
}

.dark .strap { color: var(--terracotta-on-dark); }

.hero-mark { width: clamp(180px, 24vw, 320px); flex: none; }

.hero-ctas { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 8px; }

.hero-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 24px;
}
.hero-meta .sep { width: 8px; height: 8px; background: var(--terracotta); flex: none; }

@media (max-width: 900px) {
  .hero { min-height: 0; padding: 72px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-mark { order: -1; width: 160px; }
}

/* Buttons — hairline borders only, no gradients or shadows */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px 28px;
  border: 2px solid var(--ink);
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }

.dark .btn, .btn.btn-on-dark {
  border-color: var(--paper);
  color: var(--paper);
  text-decoration: none;
}
.dark .btn:hover, .btn.btn-on-dark:hover { background: var(--paper); color: var(--ink); opacity: 1; }

.dark .btn-solid, .btn-solid.btn-on-dark { background: var(--paper); color: var(--ink); }
.dark .btn-solid:hover { background: var(--paper); color: var(--terracotta-hover); }

/* ---------- Motion ----------
   Everything is gated behind html.anim, which js/reveal.js only adds
   when prefers-reduced-motion is not set. */

.anim .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.anim .reveal.in { opacity: 1; transform: none; }

/* Hero load sequence */
.anim .hero-seq {
  opacity: 0;
  transform: translateY(26px);
  animation: hero-up 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
@keyframes hero-up { to { opacity: 1; transform: none; } }

.anim .hero-rule {
  width: 48px;
  transform: scaleX(0);
  transform-origin: left;
  animation: rule-grow 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) 0.55s forwards;
}
@keyframes rule-grow { to { transform: scaleX(1); } }

/* The hero mark draw-in is driven entirely from JS via the Web
   Animations API (ambient.js) — no CSS dash rules, which Safari
   mishandles. */

.anim .hero-mark .pane {
  opacity: 0;
  animation: pane-in 0.4s ease forwards;
}
.anim .hero-mark .pane:nth-of-type(1) { animation-delay: 1.15s; }
.anim .hero-mark .pane:nth-of-type(2) { animation-delay: 1.25s; }
.anim .hero-mark .pane:nth-of-type(3) { animation-delay: 1.35s; }
.anim .hero-mark .pane:nth-of-type(4) { animation-delay: 1.45s; }
@keyframes pane-in { to { opacity: 1; } }

/* Job rows */
details.job summary { transition: background 0.2s ease; }
details.job summary:hover { background: rgba(49, 47, 44, 0.04); }

/* ---------- Ember fields (hero + every dark band) ---------- */

.hero, .dark, .site-footer { position: relative; }
.hero { overflow: hidden; }
.hero > .wrap, .dark > .wrap, .site-footer > .wrap { position: relative; z-index: 1; }
.ember-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Section marker: the four-pane window from the logo ---------- */

.section-head .kicker::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 14px;
  vertical-align: -1px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect width='9' height='9' fill='%236B6862'/%3E%3Crect x='11' width='9' height='9' fill='%236B6862'/%3E%3Crect y='11' width='9' height='9' fill='%236B6862'/%3E%3Crect x='11' y='11' width='9' height='9' fill='%23C96F35'/%3E%3C/svg%3E");
}
.dark .section-head .kicker::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect width='9' height='9' fill='%23FBFAF5' opacity='0.7'/%3E%3Crect x='11' width='9' height='9' fill='%23FBFAF5' opacity='0.7'/%3E%3Crect y='11' width='9' height='9' fill='%23FBFAF5' opacity='0.7'/%3E%3Crect x='11' y='11' width='9' height='9' fill='%23C96F35'/%3E%3C/svg%3E");
}

/* ---------- Wales district map (Beds page) ---------- */

.map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 64px;
  align-items: start;
}
#wales-map svg { width: 100%; height: auto; display: block; }
#wales-map .district {
  fill: rgba(49, 47, 44, 0.05);
  stroke: rgba(49, 47, 44, 0.4);
  stroke-width: 1;
  stroke-linejoin: round;
  transition: fill 0.2s ease;
}
#wales-map .district:hover { fill: rgba(201, 111, 53, 0.28); }
#wales-map .district.covered {
  fill: rgba(201, 111, 53, 0.4);
  stroke: var(--terracotta-dark);
  stroke-width: 1.5;
}
.map-label { margin-top: 16px; min-height: 1.5em; }
@media (max-width: 860px) {
  .map-wrap { grid-template-columns: 1fr; }
}

/* ---------- Scroll-driven timeline ---------- */
/* Add `timeline` to any `.rows` block that reads as a sequence — a
   process, a set of steps, an escalation route. The rail fills and the
   markers light as the reader scrolls past each row. */

.timeline { position: relative; padding-left: 44px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline .progress {
  position: absolute;
  left: 5px;
  top: 0;
  width: 2px;
  height: 0;
  background: var(--terracotta);
}
.timeline .row { position: relative; }
.timeline .row::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 26px;
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 2px solid var(--warm-grey);
  z-index: 1;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.timeline .row.lit::before {
  background: var(--terracotta);
  border-color: var(--terracotta);
}
.timeline .row.lit .row-label { color: var(--ink); font-weight: 500; }

/* Same mechanism on the dark bands — the rail and the unlit markers have
   to sit on deep ink rather than paper, and the accent lifts to clear AA. */
.dark .timeline::before { background: var(--paper-border); }
.dark .timeline .progress { background: var(--terracotta-on-dark); }
.dark .timeline .row::before {
  background: var(--deep-ink);
  border-color: rgba(251, 250, 245, 0.45);
}
.dark .timeline .row.lit::before {
  background: var(--terracotta-on-dark);
  border-color: var(--terracotta-on-dark);
}
.dark .timeline .row.lit .row-label { color: var(--paper); opacity: 1; font-weight: 500; }

/* The same treatment on .dark-rows, whose steps are plain divs rather
   than .row. The progress bar is a child div too, so every rule here has
   to exclude it — including `position`, or it stops being absolute and
   the bar drifts off the rail by the width of the padding. */
.dark-rows.timeline { max-width: 684px; }
.dark-rows.timeline > div:not(.progress) { position: relative; }
.dark-rows.timeline > div:not(.progress)::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: var(--deep-ink);
  border: 2px solid rgba(251, 250, 245, 0.45);
  z-index: 1;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.dark-rows.timeline > div.lit::before {
  background: var(--terracotta-on-dark);
  border-color: var(--terracotta-on-dark);
}
.dark-rows.timeline > .progress { border: 0; padding: 0; }

@media (max-width: 600px) {
  .timeline { padding-left: 32px; }
  .timeline .row::before { left: -32px; top: 24px; }
  .dark-rows.timeline > div::before { left: -32px; }
}

/* ---------- Paper grain ---------- */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%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");
}

/* ---------- Numerals ---------- */

.kv dd, .stat-figure, .job-pay, .phone, .dark-rows .big, .row .row-label {
  font-variant-numeric: tabular-nums;
}

/* ---------- Checklist (room-ready evidence) ---------- */

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 56px;
}
.checklist { display: flex; flex-direction: column; }
.checklist .kicker { border-top: 2px solid var(--warm-grey); padding: 14px 0 8px; }
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: var(--t-small);
}
.checklist li:last-child { border-bottom: 1px solid var(--border); }
.checklist li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  position: relative;
  top: 2px;
}
.dark .checklist li::before { border-color: var(--paper); }

@media (max-width: 760px) {
  .checklist-grid { grid-template-columns: 1fr; }
}

/* ---------- Numbered rules ---------- */

.rules .row-label {
  width: 44px;
  font-size: 17px;
  letter-spacing: 0.08em;
}
.rules .row { align-items: baseline; }
.rules .row-body { font-size: var(--t-lede); line-height: 1.4; }
.dark .rules .row { border-top-color: var(--paper-border); }
.dark .rules .row:first-child { border-top: 2px solid var(--paper); }
.dark .rules.closed .row:last-child { border-bottom: 2px solid var(--paper); }
.dark .rules .row-label { color: var(--paper); opacity: 0.6; }

/* ---------- Three-up comparison (service models) ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.grid-3 > div { border-top: 2px solid var(--ink); padding-top: 20px; }
/* These are h2 for document structure — they follow the page h1 with no
   section head between them — but they read at component scale. */
.grid-3 h2, .grid-3 h3 { font-size: var(--t-h3); letter-spacing: var(--track-h3); margin-bottom: 12px; }
.model-spec { display: flex; flex-direction: column; margin-top: 16px; }
.model-spec > div {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: var(--t-small);
}
.model-spec dt {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin: 0 0 4px;
}
.model-spec dd { margin: 0; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; gap: 32px; }
}

/* Utility */
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 20px; }
.note { font-size: var(--t-small); color: var(--warm-grey); max-width: var(--measure); }
