/* ════════════════════════════════════════════════════════════════════════════
   BASE — element typography + prose. Consumes tokens only.
   (The shared reset.css still runs first; this layer defines the system's
   type treatment and wins the cascade for the public bundle.)
   ════════════════════════════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
}

/* ── Headings — one hierarchy, everywhere ──────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semi);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}
h1 { font-size: var(--text-5xl); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p { margin: 0; }

/* ── Links ─────────────────────────────────────────────────────────────────── */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
a:hover { color: var(--color-accent-hover); }

/* Identical visible focus on every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ── Mono numerals — the system's signature type treatment ─────────────────── */
.ao-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Eyebrow label (small caps over headings, used everywhere) ─────────────── */
.ao-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-3);
}
.ao-eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--color-accent);
}
.ao-ink .ao-eyebrow { color: var(--color-on-ink-3); }

/* ── Prose — styles rich-text ({!! !!}) content from the DB ────────────────── */
.ao-prose {
  max-width: var(--measure);
  color: var(--color-text-2);
}
.ao-prose h2, .ao-prose h3, .ao-prose h4 { margin: 1.6em 0 0.6em; }
.ao-prose h2:first-child, .ao-prose h3:first-child, .ao-prose p:first-child { margin-top: 0; }
.ao-prose p { margin: 0 0 1em; }
.ao-prose ul, .ao-prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.ao-prose li { margin-bottom: 0.4em; }
.ao-prose li::marker { color: var(--color-accent); }
.ao-prose a { text-decoration: underline; text-underline-offset: 2px; }
.ao-prose strong { font-weight: var(--weight-semi); color: var(--color-text); }
.ao-prose blockquote {
  margin: 1.5em 0;
  padding-left: var(--space-5);
  border-left: 2px solid var(--color-accent);
  color: var(--color-text-2);
}
.ao-prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-muted);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}
.ao-prose hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}
.ao-prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: var(--text-sm); }
.ao-prose th, .ao-prose td {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  text-align: left;
}
.ao-prose th { background: var(--color-bg-soft); font-weight: var(--weight-semi); color: var(--color-text); }
.ao-prose img { max-width: 100%; height: auto; border-radius: var(--radius-lg); }

/* Highlight notice used by legal documents (also present in DB-stored bodies) */
.ao-prose .legal-notice {
  background: var(--color-accent-light);
  border-left: 2px solid var(--color-accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ── Skip link ─────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-3) var(--space-5);
  background: var(--color-ink);
  color: var(--color-on-ink);
  border-radius: var(--radius-md);
  font-weight: var(--weight-medium);
  transition: top var(--dur-fast) var(--ease-standard);
}
.skip-link:focus { top: var(--space-4); color: var(--color-on-ink); }

::selection { background: var(--color-accent-light); }
