/* ==========================================================================
   TAS — design system
   Brand palette and typography carried over from tasimpact.ca; layout,
   scale, rhythm and interaction rebuilt.
   ========================================================================== */

/* --------------------------------------------------------------- fonts --- */
@font-face {
  font-family: 'ABC Whyte';
  src: url('/assets/fonts/ABCWhyte-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'ABC Whyte';
  src: url('/assets/fonts/ABCWhyte-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Akkurat Mono LL';
  src: url('/assets/fonts/AkkuratMonoLLWeb-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens --- */
:root {
  /* Brand — sampled from the existing TAS theme */
  --tas-green: #006e5a;
  --tas-green-dark: #005848;
  --tas-green-tint: #d2f0eb;
  --tas-plum: #822864;
  --tas-plum-dark: #682050;
  --tas-plum-tint: #faebf0;
  --tas-blue: #005ab9;
  --tas-blue-dark: #004894;
  --tas-blue-tint: #d7f0ff;
  --tas-amber: #faaf3c;
  --tas-amber-tint: #fff5dc;
  --tas-lime: #b5d100;

  /* Motif palettes — the geometric blocks. Pale field, mid tone, deep tone. */
  --motif-blue-pale: #d7f0ff;
  --motif-blue-mid: #00a0ff;
  --motif-blue-deep: #005ab9;
  --motif-amber-pale: #fff5dc;
  --motif-amber-mid: #faaf3c;
  --motif-amber-deep: #c88c30;
  --motif-green-pale: #d2f0eb;
  --motif-green-mid: #61bdac;
  --motif-green-deep: #006e5a;
  --motif-plum-pale: #faebf0;
  --motif-plum-mid: #a8407c;
  --motif-plum-deep: #822864;
  /* Mono: the logo's off-black and white, over the beige ground. */
  --motif-mono-pale: #ffffff;
  --motif-mono-mid: #ddd7c9;
  --motif-mono-deep: #191713;

  /* Surfaces & ink. One light theme — a barely-beige ground, with cards kept
     white so they lift off it. There is deliberately no dark mode. */
  --bg: #faf8f2;
  --bg-sunk: #f2eee3;
  --bg-raised: #ffffff;
  --bg-invert: #191713;
  --ink: #191713;
  --ink-soft: #5a544a;
  --ink-faint: #8b8579;
  --ink-invert: #faf8f2;
  --rule: #e7e1d4;
  --rule-strong: #cec7b6;

  --accent: var(--tas-green);
  --accent-ink: #ffffff;

  /* Type */
  --sans: 'ABC Whyte', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'Akkurat Mono LL', ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.34rem + 0.8vw, 2.125rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.5vw, 3rem);
  --step-4: clamp(2.4rem, 1.85rem + 2.7vw, 4.25rem);
  --step-5: clamp(2.9rem, 1.9rem + 5vw, 6.5rem);

  /* Space */
  --gutter: clamp(1.25rem, 0.9rem + 1.7vw, 4rem);
  --section: clamp(4rem, 2.8rem + 6vw, 10rem);
  --measure: 62ch;
  /* Fills the viewport on large and 4K displays instead of capping at a
     desktop-era width: 94vw governs up to ~3520px, which covers 4K. The rem
     ceiling only bites on super-ultrawides, where a full-bleed line length
     would be unreadable. Prose stays bounded by --measure and .wrap--narrow. */
  --max: min(94vw, 220rem);

  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------- reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.01em; }

p { text-wrap: pretty; }
a { color: inherit; }

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

::selection { background: var(--tas-amber); color: #14171a; }

/* --------------------------------------------------------------- layout --- */
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - (var(--gutter) * 2), 58rem); margin-inline: auto; }

.section { padding-block: var(--section); }
.section--sunk { background: var(--bg-sunk); }
.section--tight { padding-block: calc(var(--section) * 0.6); }

/* Explicit column counts rather than auto-fill: on a 4K display auto-fill would
   run to eight or nine columns and the cards would stop reading as cards.

   Two kinds of grid:
   - .cols-2/3/4 hold a KNOWN, small number of items (three pillars, four
     reports). They cap at that count — more tracks than items would leave a
     gap in the first row.
   - .cols-flex holds an open-ended list (the portfolio, the news archive) and
     keeps gaining columns on wide displays. */
.grid { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }

@media (min-width: 40rem) { .cols-3, .cols-4, .cols-flex { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .cols-3, .cols-4, .cols-flex { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 84rem) { .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 106rem) { .cols-flex { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 142rem) { .cols-flex { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 178rem) { .cols-flex { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 0.75rem; }

/* ------------------------------------------------------------ typography --- */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  display: block;
}

.lead {
  font-size: var(--step-2);
  line-height: 1.22;
  letter-spacing: -0.018em;
  max-width: 22ch;
  text-wrap: balance;
}

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.6; }
.prose h2, .prose h3 { margin-top: 2em; color: var(--ink); }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: var(--gutter);
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.prose ul { padding-left: 1.2em; color: var(--ink-soft); font-size: var(--step-1); }
.prose li + li { margin-top: 0.5em; }
.prose a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.rule { border: 0; border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------- links --- */
.link {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding-block: 0.35em;
  border-bottom: 1px solid var(--rule-strong);
  transition: gap 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.link::after { content: '→'; transition: transform 0.3s var(--ease); }
.link:hover { gap: 0.9em; border-color: var(--accent); color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0.95em 1.5em;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* --------------------------------------------------------------- header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header[data-stuck='true'] { border-bottom-color: var(--rule); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding-block: clamp(0.9rem, 0.7rem + 0.6vw, 1.35rem);
  transition: padding 0.3s var(--ease);
}
.header[data-stuck='true'] .header__inner { padding-block: 0.8rem; }

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand svg { width: clamp(88px, 8vw, 118px); height: auto; }
.brand svg path { fill: var(--ink); transition: fill 0.3s var(--ease); }
.brand:hover svg path { fill: var(--accent); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.4rem); }
.nav__list { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.4rem); list-style: none; padding: 0; }
.nav__item { position: relative; }

.nav__link {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.nav__link:hover, .nav__link[aria-current='page'] { color: var(--ink); }
/* Underline uses ::before so it never collides with the dropdown chevron on ::after. */
.nav__link[aria-current='page']::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
}
.nav__item--has-children > .nav__link::after {
  content: '';
  width: 0.32em; height: 0.32em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-0.1em);
  transition: transform 0.25s var(--ease);
}
.nav__item--has-children:hover > .nav__link::after,
.nav__item--has-children:focus-within > .nav__link::after { transform: rotate(225deg) translateY(0.15em); }

.nav__sub {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 13rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  box-shadow: 0 18px 40px -20px rgb(0 0 0 / 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.nav__item--has-children:hover > .nav__sub,
.nav__item--has-children:focus-within > .nav__sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__sub a {
  display: block;
  padding: 0.6rem 0.9rem;
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: var(--radius);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__sub a:hover { background: var(--bg-sunk); color: var(--ink); }

.header__actions { display: flex; align-items: center; gap: 0.75rem; }

.portal-link {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0.7em 1.1em;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.portal-link::after { content: '↗'; font-size: 0.9em; }
.portal-link:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.icon-btn {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.icon-btn:hover { border-color: var(--rule-strong); color: var(--accent); }

.burger { display: none; }

/* Mobile nav */
@media (max-width: 62rem) {
  .burger { display: grid; }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 6rem var(--gutter) var(--gutter);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav[data-open='true'] { transform: translateX(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav__item { border-bottom: 1px solid var(--rule); }
  .nav__link { font-size: var(--step-1); letter-spacing: 0.04em; padding-block: 1.05rem; color: var(--ink); }
  .nav__item--has-children > .nav__link::after { display: none; }
  .nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0 0 1rem;
    min-width: 0;
  }
  .nav__sub a { padding: 0.5rem 0; color: var(--ink-faint); }
  .header__actions .portal-link { display: none; }
  .nav .portal-link { margin-top: 2rem; justify-content: center; }
}
@media (min-width: 62.0625rem) {
  .nav .portal-link { display: none; }
}

/* --------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  min-height: clamp(30rem, 78vh, 46rem);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(4 12 10 / 0.55) 0%, rgb(4 12 10 / 0.2) 38%, rgb(4 12 10 / 0.82) 100%);
}
.hero__body {
  position: relative;
  z-index: 1;
  color: #fff;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero__title {
  font-size: var(--step-5);
  max-width: 16ch;
  letter-spacing: -0.03em;
}
.hero__title em { font-style: normal; color: var(--tas-amber); }
.hero__sub {
  margin-top: 1.75rem;
  max-width: 46ch;
  font-size: var(--step-1);
  color: rgb(255 255 255 / 0.86);
}
.hero__sub p + p { margin-top: 0.8em; }
.hero__actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__actions .btn--ghost { color: #fff; border-color: rgb(255 255 255 / 0.42); }
.hero__actions .btn--ghost:hover { background: #fff; color: #14171a; border-color: #fff; }

/* Page hero (interior pages) */
.pagehead { padding-block: clamp(4rem, 3rem + 5vw, 8rem) clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.pagehead__title { font-size: var(--step-4); max-width: 18ch; }
.pagehead__sub { margin-top: 1.5rem; max-width: var(--measure); font-size: var(--step-1); color: var(--ink-soft); }
.pagehead .eyebrow { margin-bottom: 1.25rem; }

.banner {
  position: relative;
  aspect-ratio: 21 / 8;
  min-height: 16rem;
  overflow: hidden;
  border-radius: var(--radius);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------- stats --- */
.stats { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); border-top: 1px solid var(--rule); }
.stat { padding: clamp(1.75rem, 3vw, 2.75rem) 0; border-bottom: 1px solid var(--rule); }
.stat + .stat { border-left: 1px solid var(--rule); padding-left: clamp(1.25rem, 2.5vw, 2.5rem); }
.stat__value { font-size: var(--step-4); line-height: 1; letter-spacing: -0.035em; font-weight: 500; }
.stat__unit { font-size: 0.42em; letter-spacing: -0.01em; color: var(--ink-faint); margin-left: 0.25em; }
.stat__label { margin-top: 1rem; font-size: var(--step--1); color: var(--ink-soft); max-width: 26ch; line-height: 1.5; }
@media (max-width: 48rem) {
  .stat + .stat { border-left: 0; padding-left: 0; }
}

/* Compact 2×2 variant, for sitting the metrics beside body copy in a column
   that would otherwise be empty below its heading. */
.stats--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2.25rem;
}
.stats--compact .stat { padding-block: 1.15rem; }
.stats--compact .stat + .stat { border-left: 0; padding-left: 0; }
.stats--compact .stat:nth-child(even) {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1rem, 1.6vw, 1.5rem);
}
.stats--compact .stat__value { font-size: var(--step-2); letter-spacing: -0.03em; }
.stats--compact .stat__unit { font-size: 0.46em; }
.stats--compact .stat__label { margin-top: 0.55rem; font-size: 0.8125rem; max-width: 24ch; }
.stats__note { margin-top: 1rem; font-size: var(--step--1); color: var(--ink-faint); }

/* --------------------------------------------------------------- cards --- */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover { border-color: var(--rule-strong); transform: translateY(-4px); box-shadow: 0 24px 48px -30px rgb(0 0 0 / 0.35); }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-sunk); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.card:hover .card__media img { transform: scale(1.045); }
.card__body { padding: clamp(1.25rem, 2vw, 1.75rem); display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.card__title { font-size: var(--step-1); letter-spacing: -0.015em; }
.card__text { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.55; }
.card__meta { margin-top: auto; padding-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.32em 0.6em;
  border-radius: var(--radius);
  background: var(--bg-sunk);
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag--status { background: var(--tas-green-tint); color: var(--tas-green-dark); }
.tag--city { background: var(--tas-blue-tint); color: var(--tas-blue-dark); }

/* Editorial feature card.
   Split rather than overlaid: TAS news imagery is often a social tile with its own
   baked-in typography, and white text over that is unreadable. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.feature:hover { border-color: var(--rule-strong); box-shadow: 0 24px 48px -30px rgb(0 0 0 / 0.35); }
.feature__media { position: relative; overflow: hidden; background: var(--bg-sunk); min-height: clamp(15rem, 34vw, 26rem); }
.feature__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.035); }
.feature__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  padding: clamp(1.5rem, 3vw, 3rem);
}
.feature__title { font-size: var(--step-2); max-width: 20ch; }
.feature__text { font-size: var(--step-0); color: var(--ink-soft); max-width: 46ch; line-height: 1.6; }
.feature__body .link { margin-top: 0.75rem; align-self: flex-start; }
@media (max-width: 52rem) {
  .feature { grid-template-columns: 1fr; }
  .feature__media { min-height: 0; aspect-ratio: 16 / 10; }
}

/* --------------------------------------------------------------- split --- */
.split {
  display: grid;
  gap: var(--gutter) clamp(2rem, 6vw, 7rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 64rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); } }
.split--sticky > :first-child { position: sticky; top: 7rem; }
@media (max-width: 48rem) { .split--sticky > :first-child { position: static; } }

/* --------------------------------------------------------------- motifs --- */
/* Flat geometric blocks built from quarter-discs, in the TAS palette. */
.motif { display: block; width: 100%; height: 100%; }

/* Sat behind a section as texture. Low alpha so type stays the loudest thing. */
.motif-bleed {
  position: absolute;
  inset-block: 0;
  inline-size: clamp(16rem, 34vw, 44rem);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
/* Fade the inner edge so the block dissolves into the section instead of
   ending on a hard vertical seam. */
.motif-bleed--end {
  inset-inline-end: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 72%);
  mask-image: linear-gradient(to right, transparent, #000 72%);
}
.motif-bleed--start {
  inset-inline-start: 0;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 72%);
  mask-image: linear-gradient(to left, transparent, #000 72%);
}
.motif-bleed .motif { height: 100%; object-fit: cover; }
.has-bleed { position: relative; overflow: hidden; }
.has-bleed > .wrap { position: relative; z-index: 1; }
@media (max-width: 52rem) { .motif-bleed { display: none; } }

/* --------------------------------------------------------------- quadnav --- */
/* Alternating label / motif tiles — the block pattern from the current homepage. */
.quadnav {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}
@media (min-width: 46rem) { .quadnav { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 75rem) { .quadnav { grid-template-columns: repeat(4, 1fr); } }

.quadnav__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  /* Square is the intent, but on wide screens an uncapped square cell becomes a
     600px+ tall block. The cap wins and the motif slices to fit. */
  max-block-size: 26rem;
  border: 0.5px solid var(--rule);
}
.quadnav__cell--art { padding: 0; }

.quadnav__cell--label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 2.2vw, 2rem);
  text-decoration: none;
  background: var(--bg-raised);
  transition: background 0.3s var(--ease);
}
.quadnav__cell--label:hover { background: var(--bg-sunk); }
.quadnav__title { font-size: var(--step-2); letter-spacing: -0.02em; }
.quadnav__cta {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.7em 1.35em;
  border-radius: 100px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  transition: gap 0.3s var(--ease);
}
.quadnav__cta::after { content: '→'; }
.quadnav__cell--label:hover .quadnav__cta { gap: 0.95em; }
.quadnav__cell--label[data-family='blue'] .quadnav__cta { background: var(--motif-blue-deep); }
.quadnav__cell--label[data-family='amber'] .quadnav__cta { background: var(--motif-amber-deep); }
.quadnav__cell--label[data-family='green'] .quadnav__cta { background: var(--motif-green-deep); }
.quadnav__cell--label[data-family='mono'] .quadnav__cta { background: var(--motif-mono-deep); }

/* Card-corner motif — a small tile that sits at the head of a pillar. */
.pillar__art { aspect-ratio: 2 / 1; margin: calc(-1 * clamp(1.5rem, 3vw, 2.25rem)); margin-bottom: 0; }

/* --------------------------------------------------------------- pillars --- */
.pillar {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
}
.pillar h3 { font-size: var(--step-1); }
.pillar p { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.6; }

/* --------------------------------------------------------------- steps --- */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: minmax(3.5rem, 6rem) 1fr;
  gap: var(--gutter);
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule);
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step__n { font-family: var(--mono); font-size: var(--step--1); color: var(--accent); letter-spacing: 0.08em; padding-top: 0.35em; }
.step__title { font-size: var(--step-1); }
.step__text { margin-top: 0.65rem; color: var(--ink-soft); max-width: var(--measure); }
@media (max-width: 40rem) { .step { grid-template-columns: 1fr; gap: 0.5rem; } }

/* --------------------------------------------------------------- timeline --- */
.timeline { display: grid; gap: 0; }
.era {
  display: grid;
  grid-template-columns: minmax(5rem, 9rem) 1fr;
  gap: var(--gutter);
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.era:last-child { border-bottom: 1px solid var(--rule); }
.era__label { font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.era__text { color: var(--ink-soft); max-width: var(--measure); }
@media (max-width: 40rem) { .era { grid-template-columns: 1fr; gap: 0.5rem; } }

/* ------------------------------------------------------------------ map --- */
.map { margin: 0; }
.map__canvas {
  width: 100%;
  height: auto;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: visible;
}
.map__land { fill: var(--bg-raised); stroke: var(--rule-strong); stroke-width: 1.5; }

.map__pin { cursor: pointer; }
.map__dot { fill: var(--motif-blue-deep); stroke: var(--bg-raised); stroke-width: 2.5; transition: r 0.25s var(--ease); }
.map__halo { fill: var(--motif-blue-deep); opacity: 0; transition: opacity 0.25s var(--ease); }
.map__pin[data-family='amber'] .map__dot, .map__pin[data-family='amber'] .map__halo { fill: var(--motif-amber-deep); }
.map__pin[data-family='green'] .map__dot, .map__pin[data-family='green'] .map__halo { fill: var(--motif-green-deep); }
.map__pin[data-family='plum'] .map__dot, .map__pin[data-family='plum'] .map__halo { fill: var(--motif-plum-deep); }

.map__label {
  font-family: var(--mono);
  font-size: 15px;
  text-anchor: middle;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--bg-sunk);
  stroke-width: 5;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.map__pin:hover .map__label,
.map__pin:focus-visible .map__label { opacity: 1; }
.map__pin:hover .map__halo,
.map__pin:focus-visible .map__halo { opacity: 0.22; }
.map__pin:hover .map__dot { r: 9; }
/* A hidden pin is one the filter excluded. */
.map__pin[hidden] { display: none; }

.map__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
}
.map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.map__legend li { display: flex; align-items: center; gap: 0.55em; }
.map__swatch { width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--motif-blue-deep); }
.map__swatch[data-family='amber'] { background: var(--motif-amber-deep); }
.map__swatch[data-family='green'] { background: var(--motif-green-deep); }
.map__credit { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-faint); }

/* --------------------------------------------------------------- filters --- */
.filters {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.5rem;
  border-block: 1px solid var(--rule);
}
.filters__group {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7rem) 1fr;
  gap: 0.4rem 1rem;
  align-items: baseline;
}
.filters__group > .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filters__label {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}
.filters__foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}
@media (max-width: 40rem) {
  .filters__group { grid-template-columns: 1fr; }
}
.chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.5em 0.85em;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { border-color: var(--rule-strong); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters__spacer { flex: 1; }
.filters__count { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-faint); letter-spacing: 0.06em; }
.filters__clear {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.filters__clear:hover { color: var(--accent); }
.empty { padding-block: 4rem; text-align: center; color: var(--ink-faint); }

/* --------------------------------------------------------------- article --- */
.article__meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }

.contact-block { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-block h3 { font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 400; }
.contact-block a, .contact-block p { font-size: var(--step-1); color: var(--ink); text-decoration: none; }
.contact-block a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }

/* --------------------------------------------------------------- footer --- */
.footer { background: var(--bg-sunk); border-top: 1px solid var(--rule); padding-block: var(--section) 2.5rem; }
.footer__top { display: grid; gap: var(--gutter) clamp(2rem, 5vw, 5rem); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.footer__brand svg { width: 118px; }
.footer__brand svg path { fill: var(--ink); }
.footer__land { margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.6; max-width: 52ch; }
.footer__col h4 { font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 400; margin-bottom: 1rem; }
.footer__col ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer__col a { font-size: var(--step--1); text-decoration: none; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: var(--section);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.footer__bottom a { text-decoration: none; }
.footer__bottom a:hover { color: var(--accent); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* --------------------------------------------------------------- reveal --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- print --- */
@media print {
  .header, .footer, .filters, .skip { display: none; }
  body { color: #000; background: #fff; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}

/* A heading sharing its row with an intro: give the heading the wider track so
   the display type keeps its scale. */
@media (min-width: 64rem) {
  .split--lead { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; }
}
.split--lead .pagehead__title { max-width: 15ch; }
.split--lead .prose p:first-child { margin-top: 0; }
