/* Shared base stylesheet for every site.
 *
 * Token names match the Device Lifespan stylesheet so components move between
 * sites unchanged. A site restyles itself by overriding tokens in its own CSS,
 * loaded after this file - never by editing this one.
 *
 * Dark mode is declared twice: the media query follows the OS, and the
 * data-theme scope lets the toggle win in both directions. */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --text: #0b0d11;
  --muted: #3a3d46;
  --faint: #5d616d;
  --border: #d5d8df;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --accent-soft: #eff6ff;
  --good: #0e6b3f;
  --warn: #8a5300;
  --bad: #bb2418;
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --max: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #07080b;
    --surface: #111318;
    --surface-2: #181b22;
    --text: #f3f4f6;
    --muted: #c3c6ce;
    --faint: #9a9fab;
    --border: #2a2e38;
    --accent: #60a5fa;
    --accent-contrast: #07080b;
    --accent-soft: #0f1d33;
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080b;
  --surface: #111318;
  --surface-2: #181b22;
  --text: #f3f4f6;
  --muted: #c3c6ce;
  --faint: #9a9fab;
  --border: #2a2e38;
  --accent: #60a5fa;
  --accent-contrast: #07080b;
  --accent-soft: #0f1d33;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
main { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1, h2, h3 { line-height: 1.2; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.site-nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  max-width: var(--max); margin: 0 auto; padding: 1rem;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav-right { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 600; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}

label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, select {
  width: 100%; padding: .6rem .75rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.btn-primary, .theme-toggle {
  display: inline-block; font: inherit; cursor: pointer; border-radius: var(--radius-sm);
  padding: .6rem 1rem; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); border: 0; font-weight: 600; }
.theme-toggle { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: .35rem .7rem; }

footer {
  max-width: var(--max); margin: 0 auto; padding: 2rem 1rem; color: var(--faint);
  font-size: .875rem; border-top: 1px solid var(--border);
}
.affiliate-note { color: var(--faint); }

/* Hidden visually, still read by screen readers. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
