/* Per-site palette. Everything below is the shared stylesheet,
   byte-identical across the three sites. */
:root { --accent: #d98a2b; --accent-ink: #5c3a12; }
@media (prefers-color-scheme: dark) { :root { --accent-ink: #d98a2b; } }

/* One stylesheet for all three skeleton sites. Only the --accent pair in the
   generated :root block above this differs per site.

   Selectors target semantics, not presentation classes: the current nav item
   is `a[aria-current="page"]`, the aside is `aside`, the card grid is a
   `<ul>` of `<article>`s. If a role or state goes missing the page visibly
   breaks, which is the whole point — the accessibility tree is the interface
   for screen readers, for the crawler and for an agent reading the page, so
   it must not be allowed to rot silently behind a parallel set of classes. */

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

:root {
  color-scheme: light dark;
  --bg:      #ffffff;
  --surface: #f5f6f8;
  --ink:     #1a1d21;
  --muted:   #5b6570;
  --line:    #dfe3e8;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #14171a;
    --surface: #1c2126;
    --ink:     #e8ebee;
    --muted:   #9aa5b1;
    --line:    #2b3238;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Skip link — visible the moment it is focused, hidden otherwise. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: .6rem 1rem;
  background: var(--accent);
  color: #fff;
  z-index: 10;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

/* ── layout ──────────────────────────────────────────────────────── */

body > header,
main,
body > footer { max-width: var(--measure); margin-inline: auto; padding-inline: 1.25rem; }

body > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.5rem;
  padding-block: 1.5rem 1rem;
}

body > header > a {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1px;
}

nav[aria-label="Primary"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav[aria-label="Primary"] a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  border-bottom: 2px solid transparent;
}
nav[aria-label="Primary"] a:hover { color: var(--ink); border-bottom-color: var(--line); }

/* State lives in aria-current, so the style has to read it from there. */
nav[aria-label="Primary"] a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

main { padding-block: 1rem 3rem; }

/* ── type ────────────────────────────────────────────────────────── */

h1 {
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: .75rem 0 1rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 2.5rem 0 .75rem;
}

h3 { font-size: 1.0625rem; line-height: 1.3; margin: 0 0 .4rem; }

p, ul, ol, dl { margin: 0 0 1rem; }

main > p:first-of-type,
.lead { font-size: 1.1875rem; line-height: 1.55; color: var(--ink); }

section { margin: 0; }
section + section { border-top: 1px solid var(--line); padding-top: .25rem; }

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: .4rem; }

dl { display: grid; gap: .3rem 0; }
dt { font-weight: 650; }
dd { margin: 0 0 1rem; color: var(--muted); }

aside {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: .9rem 1.1rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: .97rem;
}
aside > p { margin: 0; }

/* Card grid — a list of articles, styled as a list of articles. */
ul.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0 0 1.5rem;
  list-style: none;
}
ul.cards > li { margin: 0; }
ul.cards article {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
ul.cards p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ── footer ──────────────────────────────────────────────────────── */

body > footer {
  border-top: 1px solid var(--line);
  padding-block: 1.25rem 2.5rem;
  color: var(--muted);
  font-size: .9rem;
}
body > footer p { margin: 0 0 .35rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
