:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --muted: #5c5c56;
  --line: #d8d8d2;
  --accent: #1f4e5f;
  --pass: #1e6b3c;
  --pass-bg: #e6f4ea;
  --fail: #9c2f2f;
  --fail-bg: #fbe9e9;
  --review: #8a5a00;
  --review-bg: #fdf3dc;
  --unknown: #5c5c56;
  --unknown-bg: #eeeeea;
  --blocked: var(--fail);
  --at-risk: var(--review);
  --on-track: var(--pass);
  --radius: 10px;
  --shadow: 0 1px 3px rgba(28, 28, 26, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 28px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.lede {
  max-width: 46rem;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 20px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--accent);
  text-underline-offset: 3px;
}

main section {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

p {
  margin: 0 0 12px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #efefe9;
  border-radius: 4px;
  padding: 1px 5px;
}

pre.code-block {
  background: #1c1c1a;
  color: #e8e8e2;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
}

pre.code-block code {
  background: none;
  color: inherit;
  padding: 0;
}

.toggle {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.toggle-button {
  font: inherit;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.toggle-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.toggle-button:hover,
.toggle-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.verdict {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 12px 0 0;
}

.badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.pass,
.badge.on_track {
  background: var(--pass-bg);
  color: var(--pass);
  border-color: var(--pass);
}

.badge.fail,
.badge.blocked {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: var(--fail);
}

.badge.needs_review,
.badge.at_risk {
  background: var(--review-bg);
  color: var(--review);
  border-color: var(--review);
}

.badge.unknown {
  background: var(--unknown-bg);
  color: var(--unknown);
  border-color: var(--unknown);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card p:last-child {
  margin-bottom: 0;
}

.lesson {
  font-weight: 600;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.freshness-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.freshness-row {
  margin-bottom: 14px;
}

.freshness-row:last-child {
  margin-bottom: 0;
}

.freshness-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.freshness-bar {
  height: 10px;
  background: var(--unknown-bg);
  border-radius: 999px;
  overflow: hidden;
}

.freshness-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--pass);
}

.freshness-fill.aged {
  background: var(--review);
}

.freshness-fill.stale {
  background: var(--fail);
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
  border-bottom: none;
}

.kind-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kind-label {
  width: 110px;
  font-size: 0.9rem;
  text-align: right;
}

.kind-track {
  flex: 1;
  height: 14px;
  background: var(--unknown-bg);
  border-radius: 999px;
  overflow: hidden;
}

.kind-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.kind-count {
  width: 3rem;
  font-variant-numeric: tabular-nums;
}

.drift-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.drift-item .date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.drift-change {
  font-size: 0.95rem;
}

.drift-change .from {
  color: var(--fail);
}

.drift-change .to {
  color: var(--pass);
}

.site-footer {
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .kind-label {
    width: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toggle {
    display: none;
  }
}
