/*
  Direction A — "Paper" (docs/brand/brand-kit.md), the same tokens as
  src/ui/theme.ts. Contrast pairs are pre-verified there against WCAG 2.1 —
  do not hand-tune a hex value here without re-checking against that table.
  Nothing in this revamp touches a color value; only type, motion and
  accessibility rules changed, so the existing verification still holds.

  No web fonts, no CDN, no external request of any kind: the site's own
  network footprint should be zero, on the same principle the app is built
  on. The serif stack below is the closest system-safe approximation of
  Source Serif 4 / Literata.

  Serif is deliberate here and nowhere else — docs/brand/brand-kit.md
  (serif question, decided 2026-08-11): the app stays sans throughout
  because its screens are dense and numeric; the website keeps the serif
  because it's prose and headings, and "serif numerals read as a record"
  is exactly the brand promise this surface exists to state.
*/

:root {
  --background: #FBFAF7;
  --surface: #F2F0EA;
  --border: #D2CCBD;
  --border-strong: #8A8474;
  --text: #1A1815;
  --text-muted: #5F5A4E;
  --accent: #2F5D50;
  --accent-text: #FFFFFF;
  --danger: #9B2C1E;
  --motion-fast: 180ms;
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14130F;
    --surface: #1D1C17;
    --border: #3A372E;
    --border-strong: #6E6858;
    --text: #F2F0EA;
    --text-muted: #A8A192;
    --accent: #7FB8A6;
    --accent-text: #14130F;
    --danger: #E8846F;
  }
}

/* Users who ask for more contrast get thicker, more definite boundaries —
   borderStrong everywhere border was doing merely decorative work. */
@media (prefers-contrast: more) {
  :root { --border: var(--border-strong); }
  a { text-decoration-thickness: 2px; }
  .card { border-width: 2px; }
}

/* Motion is opt-in by capability, not by default. Every transition below is
   declared once here and turned off in one place for anyone who asks. */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 400 17px/1.6 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

/* Visible only when it has focus, first thing in the tab order. */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top var(--motion-fast) var(--motion-ease);
  z-index: 10;
}

.skip-link:focus-visible {
  top: 1rem;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

h1, h2 {
  font-family: ui-serif, "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(1.65rem, 1.35rem + 1.5vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
}

.tagline {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
}

p { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  transition: color var(--motion-fast) var(--motion-ease),
              text-decoration-thickness var(--motion-fast) var(--motion-ease);
}

a:hover { text-decoration-thickness: 2px; }

/* One visible ring, everywhere, instead of relying on the browser default —
   which varies and is easy to lose against a warm off-white background. */
a:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.muted { color: var(--text-muted); }

nav.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  font-size: 0.95rem;
}

nav.top a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.25rem;
  letter-spacing: 0.01em;
}

nav.top a:hover { color: var(--text); }

nav.top strong {
  font-family: ui-serif, "Source Serif 4", Georgia, serif;
  color: var(--text);
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  transition: border-color var(--motion-fast) var(--motion-ease);
}

.card:hover { border-color: var(--border-strong); }

.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.standing {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  border-left: 3px solid var(--border-strong);
  padding-left: 1rem;
  margin: 3rem 0 0;
}

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

footer a { color: var(--text-muted); }

ul { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
