:root {
  --bg: #e8e1d4;
  --paper: #f7f3eb;
  --card: #fffdf9;
  --ink: #1c1915;
  --muted: #5e574c;
  --faint: #8a8173;
  --line: #ddd3c3;
  --pine: #1b433c;
  --pine-2: #122e29;
  --mist: #e4eee9;
  --brass: #8b572d;
  --brass-2: #f3e6d6;
  --warn-bg: #f8efe4;
  --warn: #6c3a1e;
  --shadow: 0 16px 40px rgba(48, 36, 18, 0.07);
  --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Public Sans", "Segoe UI", sans-serif;
  --max: 1120px;
  --measure: 72ch;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 0% -10%, #f8f3ea 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #e1ebe6 0%, transparent 46%),
    var(--bg);
  line-height: 1.6;
  font-size: 1.05rem;
}

img { max-width: 100%; }

a { color: var(--pine); text-underline-offset: 0.16em; }
a:hover { color: var(--brass); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.6rem 0.9rem;
  z-index: 20;
}
.skip:focus { top: 0.75rem; color: white; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.wrap-narrow { width: min(780px, calc(100% - 2rem)); margin-inline: auto; }

.topbar {
  background: var(--pine-2);
  color: #efe8dc;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  flex-wrap: wrap;
}
.topbar a { color: #f3e6d4; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #f6f1e7;
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: 0.02em;
  border-radius: 0.35rem;
}
.brand strong { display: block; font-size: 1rem; letter-spacing: -0.01em; }
.brand em { display: block; font-style: normal; color: var(--muted); font-size: 0.78rem; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

#site-nav { display: flex; gap: 1.1rem; align-items: center; }
#site-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; }
#site-nav a[aria-current="page"] { color: var(--pine); box-shadow: inset 0 -2px 0 var(--brass); }

.search-form { display: flex; }
.search-form input {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  width: 9.5rem;
}

.crumbs { color: var(--muted); font-size: 0.88rem; margin: 1.25rem 0 0.4rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--faint); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.7rem); margin: 0.2rem 0 0.6rem; }
h2 { font-size: clamp(1.6rem, 2.4vw, 2.15rem); margin: 2rem 0 0.6rem; }
h3 { font-size: 1.3rem; margin: 1.4rem 0 0.4rem; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brass);
  margin: 0;
}
.deck { font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; color: #3a342c; margin-top: 0; }
.byline { color: var(--muted); font-size: 0.92rem; }

.hero { padding: 2.2rem 0 1rem; display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1.5rem; align-items: end; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 650;
  border: 1px solid transparent;
}
.btn-primary { background: var(--pine); color: #f6f1e7; }
.btn-primary:hover { background: var(--pine-2); color: white; }
.btn-ghost { background: transparent; border-color: #c9bfb0; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.feature-card, .card, .callout, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.feature-card { padding: 1.15rem 1.2rem 1.2rem; }
.score-row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; }
.score-num { font-family: var(--serif); font-size: 3.4rem; line-height: 0.9; letter-spacing: -0.04em; }
.score-num span { font-size: 1.1rem; color: var(--muted); }
.score-caption { color: var(--muted); font-size: 0.85rem; max-width: 16rem; text-align: right; }

.meter { height: 8px; background: #ece4d8; border-radius: 99px; margin: 0.8rem 0; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--pine), #3e7a68); border-radius: inherit; }

.stat-row, .card-grid, .guide-grid { display: grid; gap: 0.9rem; }
.stat-row { grid-template-columns: repeat(3, 1fr); margin: 0.5rem 0 1.5rem; }
.stat, .card { padding: 1rem 1.05rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.9rem; }
.stat strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 560; }
.stat p, .card p { margin: 0.3rem 0 0; color: var(--muted); }

.section { padding: 0.5rem 0 1.2rem; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.section-head a { font-weight: 650; }

.card-grid { grid-template-columns: repeat(3, 1fr); }
.guide-grid { grid-template-columns: repeat(2, 1fr); }
.card h3 { margin-top: 0.2rem; }
.card h3 a { text-decoration: none; color: inherit; }
.card h3 a:hover { color: var(--pine); }
.meta { color: var(--faint); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: #f3eee6; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font-family: var(--serif); font-size: 1.25rem; }

.prose { font-size: 1.05rem; }
.prose p, .prose li { color: #2a261f; }
.prose h2 { scroll-margin-top: 5.5rem; }
.prose .callout, .callout { padding: 0.95rem 1rem; margin: 1rem 0; background: var(--mist); border: 1px solid #cfe0d8; box-shadow: none; }
.callout.warn { background: var(--warn-bg); border-color: #ead7c6; }
.callout strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 560; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.35rem; }

.layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.4rem; align-items: start; padding-bottom: 2rem; }
.side { position: sticky; top: 5.4rem; display: grid; gap: 0.8rem; }
.side .panel { padding: 0.9rem 1rem; box-shadow: none; }
.side h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.side ol, .side ul { margin: 0; padding-left: 1.1rem; }
.side li { margin: 0.25rem 0; }

.feature-card .score-row { display: block; }
.feature-card .score-caption { text-align: left; max-width: none; margin: 0.35rem 0 0; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0.55rem; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 0.45rem; }
.facts dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 0.15rem 0 0; }

details.faq { border-top: 1px solid var(--line); padding: 0.7rem 0; }
details.faq summary { cursor: pointer; font-weight: 650; }
details.faq p { margin: 0.45rem 0 0; color: var(--muted); }

.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.related a { text-decoration: none; color: inherit; display: block; height: 100%; }
.related h3 { font-size: 1.15rem; }

.site-footer { margin-top: 2rem; background: var(--pine-2); color: #e7e0d4; }
.site-footer a { color: #f3e6d4; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 1.2rem; padding: 2rem 0 1.2rem; }
.site-footer h2 { color: white; font-size: 1.05rem; margin: 0 0 0.4rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.28rem 0; }
.legal { border-top: 1px solid rgba(255,255,255,0.12); padding: 0.9rem 0 1.3rem; color: #cbbfae; font-size: 0.88rem; }

.tag {
  display: inline-block;
  background: var(--brass-2);
  color: var(--warn);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.search-page input[type="search"] {
  width: min(100%, 36rem);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 0.7rem;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1.05rem;
}
.search-hit { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.search-hit strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 560; display: block; }
.search-hit span { color: var(--muted); }

@media (max-width: 980px) {
  .hero, .layout, .card-grid, .footer-grid { grid-template-columns: 1fr; }
  .stat-row, .related, .guide-grid { grid-template-columns: 1fr 1fr; }
  .side { position: static; }
  .nav-toggle { display: inline-flex; }
  #site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 1rem 1rem;
  }
  #site-nav.is-open { display: flex; }
  #site-nav.is-open .search-form { display: flex; width: 100%; }
  #site-nav.is-open .search-form input { width: 100%; }
  .site-header { position: sticky; }
}

@media (max-width: 640px) {
  .stat-row, .related, .guide-grid, .facts { grid-template-columns: 1fr; }
  .score-row { align-items: flex-start; }
  .score-caption { text-align: left; }
  h1 { font-size: 2.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
