/* ============================================================================
   AAR — base: reset, typography, browser surfaces
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---- Headings ------------------------------------------------------------ */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-variation-settings: "opsz" 120;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h3 {
  font-size: 1.05rem;
  font-variation-settings: "opsz" 24;
  line-height: 1.3;
}

/* ---- Prose --------------------------------------------------------------- */

p { margin: 0 0 var(--space-3); text-wrap: pretty; }

.measure     { max-width: var(--measure); }
.measure--lead { max-width: var(--measure-lead); }

.lead {
  font-size: 1.25rem;
  line-height: 1.5;
  font-variation-settings: "opsz" 20;
  color: var(--ink-soft);
  max-width: var(--measure-lead);
}

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

/* ---- Links --------------------------------------------------------------- */

a {
  color: var(--sakura-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

a:hover { color: var(--sakura-deep); }

/* ---- Mono: data + identifiers ONLY --------------------------------------- */

code, kbd, samp, pre,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums slashed-zero;
}

code {
  font-size: .875rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  padding: .08em .34em;
}

pre {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.6;
  overflow-x: auto;
}

.micro {
  font-family: var(--mono);
  font-size: .6875rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- Rules --------------------------------------------------------------- */

hr, .rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-6) 0;
}

.rule--strong { border-top-color: var(--rule-strong); }

/* ---- Tables: tabular, ruled ---------------------------------------------- */

table { border-collapse: collapse; width: 100%; }
th, td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  font-weight: 600;
}

/* ---- Browser surfaces (DESIGN.md) ---------------------------------------- */

::selection { background: var(--sakura-wash); color: var(--ink); }

:root { caret-color: var(--sakura-deep); accent-color: var(--sakura-deep); }

:focus-visible {
  outline: 2px solid var(--sakura-deep);
  outline-offset: 2px;
}

::placeholder { color: var(--ink-faint); opacity: 1; }

* { scrollbar-width: thin; scrollbar-color: var(--rule) var(--paper-deep); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 2px solid var(--paper-deep); }

/* ---- Utility ------------------------------------------------------------- */

.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;
}

.skip-link { display: none !important; }

