/* 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;
  --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: 20ch;
  margin: 0;
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 430; letter-spacing: -.05em; line-height: .94;
  color: var(--navy);
}
h2 {
  max-width: 24ch;
  margin: clamp(56px, 7vw, 96px) 0 20px;
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 430; letter-spacing: -.04em; line-height: 1.06;
  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: 60ch; margin: 32px 0 0;
  font-size: clamp(18px, 1.6vw, 23px); line-height: 1.45;
  color: rgba(37, 42, 49, .78);
}
.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 h3 { margin: 0 0 12px; font-size: 21px; }
.card h3 a { text-decoration: none; }
.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; }
.site-foot h4 { 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; }
}
