:root {
  --purple: #5b2c86;
  --purple-dark: #42205f;
  --purple-soft: #f3eef8;
  --purple-line: #ddd0ea;
  --grey: #8e9095;
  --ink: #221d28;
  --muted: #6b6573;
  --bg: #faf9fb;
  --card: #ffffff;
  --line: #e7e3eb;
  --radius: 10px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--purple); }
a:hover { color: var(--purple-dark); }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { flex: none; display: block; line-height: 0; }
.brand img { height: 72px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-end; flex: 1; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500;
  padding: 6px 10px; border-radius: 999px;
}
.site-nav a:hover { background: var(--purple-soft); color: var(--purple-dark); }
.site-nav a[aria-current="page"] { background: var(--purple); color: #fff; }

main.wrap { flex: 1; padding-top: 32px; padding-bottom: 48px; }

h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 0; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 8px; max-width: 46em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Home */
.hero { padding: 16px 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; font-weight: 700; color: var(--purple); margin: 0 0 8px; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; border-top: 4px solid var(--purple);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card a:hover { border-color: var(--purple-line); border-top-color: var(--purple); box-shadow: 0 6px 20px rgba(66, 32, 95, .08); transform: translateY(-1px); }
.card h2 { color: var(--purple-dark); margin-bottom: 6px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card .card-meta { margin-top: auto; margin-bottom: 0; font-size: 13px; color: var(--grey); }

/* Section pages */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

.filter { margin: 20px 0 8px; max-width: 420px; }
.filter label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.filter input {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.filter input:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px var(--purple-soft); }

.year { margin-top: 28px; }
.year h2 { font-size: 15px; color: var(--purple); letter-spacing: 0.04em; padding-bottom: 6px; border-bottom: 2px solid var(--purple-line); }

.docs { list-style: none; padding: 0; margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.year .docs { margin-top: 10px; }
.doc + .doc { border-top: 1px solid var(--line); }
.doc > a, .doc.missing { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.doc > a { text-decoration: none; color: var(--ink); }
.doc > a:hover { background: var(--purple-soft); }
.doc > a:hover .doc-title { color: var(--purple-dark); text-decoration: underline; }
.icon { width: 26px; height: 26px; flex: none; color: var(--purple); }
.doc-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc-meta { flex: none; font-size: 13px; color: var(--grey); white-space: nowrap; }
.doc.missing { color: var(--muted); }
.doc.missing .icon { color: #c4c0c9; }

.tag {
  flex: none; display: inline-block; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 999px; background: #f0eef2; color: var(--muted); white-space: nowrap;
}

.note { margin-top: 28px; padding: 14px 16px; background: var(--purple-soft); border-radius: var(--radius); font-size: 15px; color: var(--ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 20px 0; font-size: 14px; }
.site-footer p { margin: 0 0 4px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand img { height: 56px; }
  .site-nav { justify-content: flex-start; }
  .site-nav a { font-size: 14px; padding: 5px 9px; }
  main.wrap { padding-top: 20px; }
  .lede { font-size: 17px; }
  .doc > a, .doc.missing { padding: 12px; flex-wrap: wrap; }
  .doc-meta, .doc .tag { margin-left: 38px; }
  .doc-title { flex-basis: calc(100% - 38px); }
}

@media (prefers-reduced-motion: reduce) {
  .card a { transition: none; }
  .card a:hover { transform: none; }
}

@media print {
  .site-nav, .filter, .skip { display: none; }
  .doc > a::after { content: " (" attr(href) ")"; font-size: 12px; color: var(--muted); }
}
