/* MacroWeek public site. Plain CSS, no JavaScript, no build step.
   Colour tokens come from plans/macroweek/design/tokens.json (background, surface,
   labelPrimary, labelSecondary, separator, provenanceA for links). Every text/background
   pair is at or above 4.5:1 in both modes; the measured ratios are in the slot report. */

:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --surface: #F2F2F7;
  --text: #000000;
  --text-2: #66666A;
  --link: #2F4F8F;
  --rule: #E5E5EA;
  --measure: 42rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1C1C1E;
    --text: #FFFFFF;
    --text-2: #98989F;
    --link: #8FB0E8;
    --rule: #2C2C2E;
  }
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Skip link: visible only when focused. */
.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--link);
  border: 2px solid var(--link);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus { top: var(--gutter); }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 3px;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.site-header, .site-footer {
  border-bottom: 1px solid var(--rule);
}
.site-footer {
  border-bottom: 0;
  border-top: 1px solid var(--rule);
  margin-top: auto;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.site-header nav, .site-footer > div, main {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1.125rem;
  margin-right: auto;
}
.site-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.site-header a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

main { padding-top: 1.5rem; padding-bottom: 3rem; }
.site-footer > div { padding-top: 1.25rem; padding-bottom: 1.5rem; }

h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: 2rem; margin: 0.5rem 0 0.5rem; }
h2 { font-size: 1.375rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }

p, li, dd { max-width: 70ch; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }
li > ul, li > ol { margin-top: 0.4rem; }

.meta { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 1.5rem; }
.lead { font-size: 1.125rem; }

/* "On this page" list. */
.toc {
  background: var(--surface);
  border-radius: 10px;
  padding: 1rem 1rem 0.5rem;
  margin: 1.5rem 0;
}
.toc h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: 1.5rem; }
.toc li { break-inside: avoid; }
@media (max-width: 480px) { .toc ol { columns: 1; } }

/* Retention and category lists. */
dl.rows { margin: 0 0 1rem; }
dl.rows div {
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
dl.rows div:last-child { border-bottom: 1px solid var(--rule); }
dl.rows dt { font-weight: 600; }
dl.rows dd { margin: 0.25rem 0 0; }

.note {
  background: var(--surface);
  border-radius: 10px;
  padding: 1rem;
  margin: 1.25rem 0;
}
.note p:last-child { margin-bottom: 0; }

.badge-placeholder {
  display: inline-block;
  border: 2px dashed var(--text-2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-2);
  margin: 0.5rem 0 1.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.links { list-style: none; padding: 0; }
.links li { margin-bottom: 0.75rem; }
.links a { font-weight: 600; }
.links span { display: block; color: var(--text-2); font-size: 0.9375rem; }
