/* Shared tokens and components for every page. No page-specific type scale. */
:root {
  color-scheme: light dark;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --background: #f5f5f7;
  --surface: #fff;
  --rule: #e5e5ea;
  --accent: #1a8210;
  --tint: color-mix(in srgb, var(--accent) 6%, var(--surface));
  --hover: color-mix(in srgb, var(--text) 3%, var(--surface));
  --pressed: color-mix(in srgb, var(--text) 6%, var(--surface));
  --shadow: 0 2px 8px -4px #00000012;
  --body: 0.9375rem;
  --small: 0.8125rem;
  --title: 1.75rem;
  --inset: 1rem;
  --radius: 1.125rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --background: #101012;
    --surface: #1c1c1e;
    --rule: #303033;
    --accent: #47bf41;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font: var(--body)/1.65 var(--font);
  overflow-wrap: anywhere;
}
body > :is(header, main, footer) { width: min(100% - 2rem, 40rem); margin-inline: auto; }
main { flex: 1; padding-block: 1.75rem 2.5rem; }
img { display: block; max-width: 100%; height: auto; }

/* Three sizes; hierarchy comes from spacing, weight and color. */
h1, h2, h3 { font-weight: 600; }
h1 { margin: 0 0 0.5rem; font-size: var(--title); line-height: 1.25; letter-spacing: -0.025em; text-wrap: balance; }
h2 { margin: 1.5rem var(--inset) 0.5rem; color: var(--secondary); font-size: var(--small); line-height: 1.5; }
h3 { margin: 0 0 0.25rem; font-size: inherit; line-height: inherit; }
p, ul, ol { margin: 0 0 0.75rem; }
p { text-wrap: pretty; }
ul, ol { padding-inline-start: 1.25rem; }
li + li { margin-top: 0.25rem; }
:is(p, ul, ol):last-child { margin-bottom: 0; }
strong { font-weight: 600; }
.lead { color: var(--secondary); }
.meta { color: var(--secondary); font-size: var(--small); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:is(a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 0.375rem; }
[id] { scroll-margin-top: 1rem; }
.skip-link { position: absolute; z-index: 1; top: 0.5rem; left: 1rem; padding: 0.625rem 1rem; background: var(--surface); border-radius: 0.5rem; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* The same compact navigation and 44-point targets on every page. */
body > :is(header, footer) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
body > header { padding-block: 0.5rem; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; color: var(--text); font-weight: 600; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.5rem 0.75rem; border-radius: 0.75rem; color: var(--secondary); text-decoration: none; }
nav a[aria-current="page"] { color: var(--accent); background: var(--tint); font-weight: 600; }
body > footer { padding-block: 0.75rem 1.5rem; border-top: 1px solid var(--rule); color: var(--secondary); font-size: var(--small); }
footer p { margin: 0; padding-block: 0.5rem; }

.hero { padding-block: 0.25rem 0.75rem; text-align: center; }
.hero img { margin: 0 auto 1rem; }
.hero .lead { max-width: 30rem; margin-inline: auto; }

/* A card is one surface containing rows; only interactive rows react. */
.card { margin-block: 0.5rem 1.5rem; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; }
.card > * { margin: 0; padding: 0.875rem var(--inset); }
.card > * + * { border-top: 1px solid var(--rule); }
.card > a, summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; color: var(--text); font-weight: 600; text-decoration: none; }
.card > a::after, summary::after { content: ""; flex: none; width: 0.4375rem; height: 0.4375rem; margin-inline-end: 0.125rem; border: solid var(--secondary); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
.card > a:focus-visible, summary:focus-visible { outline-offset: -4px; }
.card > details { padding: 0; }
summary { padding: 0.875rem var(--inset); cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { transform: translateY(-20%) rotate(45deg); }
details[open] summary::after { transform: translateY(20%) rotate(225deg); }
details > :not(summary) { padding: 0 var(--inset) 0.875rem; }

.steps { counter-reset: step; }
.steps > li { display: grid; grid-template-columns: 1.625rem minmax(0, 1fr); column-gap: 0.75rem; counter-increment: step; }
.steps > li::before { content: counter(step) / ""; grid-row: span 2; display: grid; place-items: center; height: 1.625rem; border-radius: 50%; color: var(--accent); background: var(--tint); font-size: var(--small); font-weight: 600; font-variant-numeric: tabular-nums; }
.steps h3 { line-height: 1.625rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0; list-style: none; }
.tags li { margin: 0; padding: 0.125rem 0.625rem; border: 1px solid var(--rule); border-radius: 0.5rem; color: var(--secondary); font-size: var(--small); }

@media (hover: hover) {
  nav a:hover, .card > a:hover, summary:hover { background: var(--hover); color: var(--text); }
  .brand:hover, p a:hover { text-decoration: underline; }
}
nav a:active, .card > a:active, summary:active { background: var(--pressed); color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  nav a, .card > a, summary { transition: background-color 160ms ease, color 160ms ease; }
  summary::after { transition: transform 160ms ease; }
}
@media (forced-colors: active) {
  nav a[aria-current="page"] { text-decoration: underline; }
  :is(a, summary):focus-visible { outline-color: Highlight; }
  .steps > li::before { border: 1px solid CanvasText; }
}
