/* base.css — reset, typography, utilities. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

body {
  min-height: 100vh;
  overflow-x: hidden; /* horizontal track is the only place we scroll left-right */
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.2;
  margin: 0 0 var(--sp-4) 0;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--ts-h1); }
h2 { font-size: var(--ts-h2); }
h3 { font-size: var(--ts-h3); }

p {
  margin: 0 0 var(--sp-4) 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
li { hyphens: auto; -webkit-hyphens: auto; }

/* Justified text is wrong for short labels, badges, monospace metadata,
   nav chips, and tabular cells — opt those back to left-aligned. */
.landing-eyebrow,
.tile-cta,
.methodology-cta,
.tag, .chip,
.legend-row,
.more-hint,
.case-card-meta,
.case-cited-list li,
.citing-group li,
.connected-list li,
.timeline-legend span,
.juris-table td,
.juris-table th,
.juris-bars .name,
.juris-bars .count,
.combobox-menu li,
.cases-empty,
.stats-grid dt,
.stats-grid dd,
.site-footer dt,
.site-footer dd,
.toast,
.map-tooltip {
  text-align: left;
  hyphens: none;
}

a {
  color: var(--accent-cool);
  text-decoration-color: color-mix(in srgb, var(--accent-cool) 40%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
a:hover, a:focus-visible {
  text-decoration-color: var(--accent-cool);
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

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

::selection {
  background: color-mix(in srgb, var(--accent-warm) 35%, transparent);
  color: var(--text-strong);
}

.mono { font-family: var(--font-mono); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--ts-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}
.tag[data-region="Global North"] {
  background: color-mix(in srgb, var(--region-north) 22%, transparent);
  color: color-mix(in srgb, var(--region-north) 80%, var(--text-strong));
}
.tag[data-region="Global South"] {
  background: color-mix(in srgb, var(--region-south) 22%, transparent);
  color: color-mix(in srgb, var(--region-south) 80%, var(--text-strong));
}
.tag[data-region="International"] {
  background: color-mix(in srgb, var(--region-international) 22%, transparent);
  color: color-mix(in srgb, var(--region-international) 80%, var(--text-strong));
}

.hairline {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--sp-8) 0;
}

/* Container queries are great in 2026; cap content width at 920 by default. */
.container {
  max-width: 920px;
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 640px) {
  :root { --ts-display: 2.0rem; --ts-h1: 1.55rem; --ts-h2: 1.25rem; }
}
