@font-face {
  font-family: "EB Garamond";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ebgaramond-400.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/ebgaramond-600.woff2") format("woff2");
}
/* RWA Legal Index — brand direction 01.
   The system commits to a single light "parchment" look with navy inversions,
   so there is no dark-mode inversion here on purpose. */
:root {
  --navy: #101b2d;
  --navy-2: #16263d;
  --navy-deep: #0a1321;
  --blue: #315c73;
  --copper: #b46f45;
  --paper: #f3f0e8;
  --paper-2: #e8e4da;
  --graphite: #252a31;
  --mint: #7fc7a4;
  --white: #fbfaf6;
  --line: rgba(16, 27, 45, .16);
  --line-soft: rgba(16, 27, 45, .09);
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: "Suisse Int'l", "Helvetica Neue", Inter, system-ui, Arial, sans-serif;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --max: 1440px;
  --pad: clamp(24px, 7vw, 112px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--graphite);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 16px; top: 16px; z-index: 50;
  padding: 10px 16px; background: var(--navy); color: var(--white);
}

/* ── The mark: index grid + one copper data point (the jurisdiction in focus) ── */
.mark {
  position: relative;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 1px solid currentColor;
  background:
    linear-gradient(45deg, transparent 47%, currentColor 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, currentColor 48% 52%, transparent 53%);
}
.mark::after {
  content: "";
  position: absolute; right: -5px; bottom: -5px;
  width: 7px; height: 7px;
  background: var(--copper);
  border: 2px solid var(--navy);
}

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 68px;
  padding: 12px var(--pad);
  color: var(--white);
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.topbar__brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.topbar__name { font-size: 11px; font-weight: 650; letter-spacing: .18em; line-height: 1.25; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__link,
.nav__trigger {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: rgba(255,255,255,.7);
  font: 500 10px/1 var(--mono);
  letter-spacing: .09em; text-transform: uppercase; text-decoration: none;
}
.nav__link:hover, .nav__trigger:hover,
.nav__link[aria-current="page"] { color: var(--mint); }
.nav__link[aria-current="page"] { color: var(--white); }
.nav__trigger::after {
  content: ""; width: 5px; height: 5px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s;
}
.nav__item { position: relative; }
.nav__item[data-open="true"] .nav__trigger { color: var(--mint); }
.nav__item[data-open="true"] .nav__trigger::after { transform: translateY(1px) rotate(-135deg); }

.nav__panel {
  position: absolute; top: calc(100% + 14px); left: -20px;
  display: none; min-width: 290px;
  padding: 10px;
  color: var(--graphite);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(10, 19, 33, .3);
}
.nav__item[data-open="true"] .nav__panel,
.nav__item:focus-within .nav__panel { display: block; }
.nav__panel a {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 12px;
  color: var(--graphite); text-decoration: none;
  font-size: 13px;
}
.nav__panel a:hover { background: var(--paper); color: var(--navy); }
.nav__panel a small { color: var(--blue); font: 500 10px var(--mono); letter-spacing: .04em; white-space: nowrap; }
.nav__panel hr { margin: 8px 12px; border: 0; border-top: 1px solid var(--line-soft); }
.nav__panel .nav__all { color: var(--copper); font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }

.nav__burger {
  display: none;
  padding: 9px 12px;
  color: var(--white); background: none;
  border: 1px solid rgba(255,255,255,.3);
  font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
}

/* ── Page shell ── */
.page { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 88px) var(--pad) 96px; }
.crumbs { margin-bottom: 34px; color: var(--blue); font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.crumbs a { color: var(--blue); }
.crumbs span[aria-hidden] { opacity: .45; margin: 0 6px; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
  color: var(--copper);
  font: 600 11px var(--mono); letter-spacing: .13em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--copper); }

h1 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 88px);
  font-weight: 600; letter-spacing: -.015em; line-height: .98;
  color: var(--navy);
}
h2 {
  max-width: 26ch;
  margin: clamp(56px, 7vw, 96px) 0 20px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 600; letter-spacing: -.01em; line-height: 1.08;
  color: var(--navy);
}
h3 { margin: 44px 0 10px; font-size: 19px; font-weight: 560; letter-spacing: -.01em; color: var(--navy); }
h3 a, h2 a { color: inherit; }
p, li { max-width: 68ch; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

.standfirst {
  max-width: 58ch; margin: 30px 0 0;
  font-family: var(--serif);
  font-size: clamp(20px, 1.7vw, 26px); line-height: 1.5;
  color: rgba(37, 42, 49, .82);
}
.stamp {
  margin: 30px 0 0; padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  color: var(--blue); font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.note { color: rgba(37,42,49,.66); font-size: 13px; }

.callout {
  max-width: 68ch; margin: 32px 0;
  padding: 26px 30px;
  background: var(--white);
  border-left: 3px solid var(--copper);
}
.callout strong { color: var(--navy); }

/* ── Cards ── */
.cards { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); background: var(--line); border: 1px solid var(--line); margin-top: 28px; }
.card { padding: 32px; background: var(--white); }
/* Card titles are h2 so the hub's outline runs h1 → h2 without a skipped level.
   Their size is a card property, not a heading-level one. */
.card h2, .card h3 { margin: 0 0 12px; font-size: 21px; line-height: 1.25; letter-spacing: 0; }
.card h2 a, .card h3 a { text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--blue); }
.card p { margin: 0; font-size: 14px; color: rgba(37,42,49,.7); }
.card__index { display: block; margin-bottom: 20px; color: var(--copper); font: 600 10px var(--mono); letter-spacing: .13em; }

/* ── Tables: mono numerals, uppercase mono headers ── */
.scroller { overflow-x: auto; margin: 26px 0; border: 1px solid var(--line); background: var(--white); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
th {
  color: var(--blue); background: var(--paper-2);
  font: 600 9px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper); }
td strong { color: var(--navy); }
td.num, table.rows td { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
td.quote, table.rows td.quote {
  min-width: 22rem; white-space: normal;
  font-family: var(--sans); font-size: 12.5px; color: rgba(37,42,49,.62);
}

.conflicts { margin: 26px 0 0; }
.conflicts dt { margin-top: 26px; color: var(--navy); font-weight: 600; font-size: 15px; }
.conflicts dd { max-width: 68ch; margin: 8px 0 0; color: rgba(37,42,49,.72); font-size: 14.5px; }

/* ── Anchor targets ──
   Dropdown links point at table rows. Two things break that by default: the sticky bar
   covers the target, and a row inside an overflow container is not always reached by the
   browser's own hash scroll (handled in base.njk). scroll-margin keeps it clear of the bar. */
[id] { scroll-margin-top: 92px; }
tr:target { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--copper); }
h3:target { color: var(--copper); }

/* ── Footer ── */
.site-foot { color: rgba(255,255,255,.6); background: var(--navy); }
.site-foot__grid {
  display: grid; gap: 48px;
  grid-template-columns: minmax(240px, 1.2fr) repeat(auto-fit, minmax(150px, 1fr));
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) var(--pad);
}
.site-foot__brand { display: flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; }
.site-foot__blurb { max-width: 34ch; margin: 24px 0 0; font-size: 13.5px; line-height: 1.6; }
/* Footer column labels are navigation labels, not document headings — they carry no
   heading level so they cannot jump the page outline from h2 to h4. */
.site-foot__h { display: block; margin: 0 0 16px; color: var(--mint); font: 600 10px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.site-foot ul { margin: 0; padding: 0; list-style: none; }
.site-foot li { margin-bottom: 10px; }
.site-foot a { color: rgba(255,255,255,.72); font-size: 13.5px; text-decoration: none; }
.site-foot a:hover { color: var(--mint); }
.site-foot__bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 30px;
  max-width: var(--max); margin: 0 auto;
  padding: 24px var(--pad);
  background: var(--navy-deep);
  color: rgba(255,255,255,.5);
  font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.site-foot__bar strong { color: var(--copper); font-weight: 500; }

@media (max-width: 960px) {
  .nav {
    position: absolute; top: 100%; right: 0; left: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--pad) 20px;
    background: var(--navy-2);
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .nav[data-open="true"] { display: flex; }
  .nav__link, .nav__trigger { justify-content: space-between; width: 100%; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav__panel { position: static; min-width: 0; margin: 0 0 10px; box-shadow: none; }
  .nav__burger { display: inline-block; }
  .topbar { position: relative; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  h1 { font-size: 38px; }
  .card { padding: 24px; }
  .callout { padding: 20px 22px; }
}

/* ── Correction form ── */
.cx-form { max-width: 46rem; margin: 28px 0; display: grid; gap: 20px; }
.cx-form label { display: grid; gap: 6px; }
.cx-form label span { font-size: 14px; color: var(--navy); font-weight: 560; }
.cx-form label small { display: block; font-weight: 400; color: rgba(37,42,49,.6); font-size: 12.5px; }
.cx-form input, .cx-form textarea {
  font: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid var(--line); background: var(--white); color: var(--graphite);
  border-radius: 0;
}
.cx-form input:focus, .cx-form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.cx-form button {
  justify-self: start; padding: 12px 26px;
  font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--white); background: var(--navy); border: 0; cursor: pointer;
}
.cx-form button:hover { background: var(--navy-2); }
.cx-form button:disabled { opacity: .5; cursor: default; }
.cx-status { min-height: 1.2em; margin: 0; font-size: 14px; color: var(--blue); }
.cx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.report-link { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* ── CTAs ── */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.cta {
  display: inline-flex; align-items: center; padding: 12px 22px;
  font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--navy); color: var(--navy); background: transparent;
}
.cta:hover { background: var(--navy); color: var(--white); }
.cta--primary { background: var(--navy); color: var(--white); }
.cta--primary:hover { background: var(--navy-2); color: var(--white); }
.cta--ghost { border-color: var(--line); color: var(--blue); }
.cta--ghost:hover { background: var(--paper-2); color: var(--navy); }

/* ── Filter bar ── */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0; }
.filterbar input[type="search"], .filterbar select {
  font: inherit; font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--line); background: var(--white); color: var(--graphite);
}
.filterbar input[type="search"] { min-width: 16rem; flex: 1 1 16rem; }
.filterbar input:focus, .filterbar select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.filterbar__count { font: 500 11px var(--mono); color: var(--blue); }
.filterbar__cta { margin-left: auto; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--copper); text-decoration: none; }
.filterbar__cta:hover { color: var(--navy); }

/* ── Sticky table headers within scrollers ── */
.scroller { position: relative; }
.scroller thead th { position: sticky; top: 0; z-index: 1; }

/* ── Mobile: hint that wide tables scroll sideways ── */
@media (max-width: 700px) {
  .scroller { position: relative; }
  .scroller::after {
    content: "→ scroll"; position: absolute; top: 6px; right: 8px;
    font: 600 9px var(--mono); letter-spacing: .08em; text-transform: uppercase;
    color: var(--blue); background: var(--paper); padding: 2px 6px; opacity: .8; pointer-events: none;
  }
  .filterbar__cta { margin-left: 0; }
}

/* ── Stat tiles (data-dense dashboard pattern) ── */
.stats { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); background: var(--line); border: 1px solid var(--line); margin: 32px 0; }
.stat { padding: 22px 20px; background: var(--white); }
.stat__n { font-family: var(--mono); font-size: clamp(26px, 3vw, 38px); font-weight: 500; letter-spacing: -.03em; color: var(--navy); line-height: 1; }
.stat__n .u { font-size: .5em; color: var(--copper); margin-left: 2px; }
.stat__l { margin-top: 10px; font: 500 10px/1.35 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }

/* ── Hero data-viz card ── */
.hero-grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; margin-top: 8px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } }
.vizcard { border: 1px solid var(--line); background: var(--white); padding: 26px 28px; box-shadow: 0 20px 50px rgba(16,27,45,.08); }
.vizcard__h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.vizcard__t { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.vizcard__d { font: 500 10px var(--mono); color: var(--copper); }
.spread { display: grid; gap: 14px; }
.spread__row { display: grid; gap: 5px; }
.spread__lab { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--graphite); }
.spread__lab b { color: var(--navy); }
.spread__track { height: 6px; background: var(--paper-2); overflow: hidden; }
.spread__fill { height: 100%; background: var(--blue); transform-origin: left; }
.spread__row:nth-child(1) .spread__fill { background: var(--copper); }
.vizcard__foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft); font: 500 11px/1.5 var(--mono); color: var(--ink-soft, #5b636b); }

/* ── Compact bar chart (cost spreads) ── */
.barchart { display: grid; gap: 10px; margin: 24px 0; }
.barchart__row { display: grid; grid-template-columns: 12rem 1fr 4rem; align-items: center; gap: 12px; }
.barchart__lab { font: 500 12px var(--mono); color: var(--graphite); text-align: right; }
.barchart__track { height: 22px; background: var(--paper-2); position: relative; }
.barchart__fill { height: 100%; background: var(--navy); }
.barchart__val { font: 600 12px var(--mono); color: var(--copper); }
@media (max-width: 640px) { .barchart__row { grid-template-columns: 8rem 1fr 3rem; } .barchart__lab { font-size: 10px; } }


/* ── On-page table of contents ── */
.toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 28px 0; padding: 16px 20px; background: var(--white); border: 1px solid var(--line); }
.toc a { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--blue); text-decoration: none; }
.toc a:hover { color: var(--navy); text-decoration: underline; }
