:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-soft: #fffdf8;
  --bg-deep: #eadfcf;
  --panel: #fffaf2;
  --text: #1d1d1b;
  --muted: #5f5a52;
  --accent: #0b6b53;
  --accent-strong: #074f3e;
  --accent-soft: rgba(11, 107, 83, 0.1);
  --border: #e4d8c8;
  --border-strong: #d2c1a9;
  --warning: #b9520a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Source Sans 3', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 50% -120px, #fffdf8 0%, var(--bg) 55%, var(--bg-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin: 0 0 12px; }
h3 { font-size: 1.25rem; margin: 0 0 10px; }
h4 { font-size: 1.05rem; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-family: 'Source Sans 3', sans-serif; font-weight: 700; }

p { font-size: 1.02rem; line-height: 1.7; color: var(--muted); margin: 0 0 14px; }

a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

ul, ol { line-height: 1.7; color: var(--muted); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: rgba(255, 252, 246, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 140ms ease, color 140ms ease;
}

.site-nav a:hover { color: var(--accent-strong); background: var(--accent-soft); }

.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-cta {
  margin-left: 4px;
  padding: 9px 14px !important;
  background: var(--accent);
  color: white !important;
  border-radius: 999px;
}

.nav-cta:hover { background: var(--accent-strong) !important; }

.nav-cta[aria-disabled="true"] {
  background: var(--muted) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: default;
  pointer-events: none;
  opacity: 0.7;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.wrap.narrow { max-width: 820px; }

.page-hero {
  margin: 0 0 32px;
  padding: 16px 0 8px;
}

.page-hero .eyebrow { margin-bottom: 16px; display: inline-block; }
.page-hero p { font-size: 1.12rem; max-width: 60ch; color: var(--muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(37, 28, 13, 0.06);
}

.card + .card { margin-top: 18px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.card-grid .card { padding: 24px; }

.card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.card h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.45rem; }
.card p { font-size: 0.98rem; margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }

.card .tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.tag.neutral { background: rgba(0,0,0,0.05); color: var(--muted); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 0.96rem;
}

.button:hover { border-color: var(--border-strong); }

.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: white; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ---------- Lists / definitions ---------- */
.definition-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.definition-list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.definition-list > div:first-child { border-top: 0; padding-top: 4px; }
.definition-list dt { font-weight: 700; color: var(--text); }
.definition-list dd { margin: 0; color: var(--muted); line-height: 1.6; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 252, 246, 0.7);
  margin-top: 48px;
}

.footer-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.1fr;
  gap: 24px;
}

.footer-col h4 { color: var(--accent); margin-bottom: 12px; font-size: 0.78rem; }

.footer-col p, .footer-col a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
}

.footer-col a:hover { color: var(--accent-strong); text-decoration: underline; }

.footer-brand { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }

.footer-disclaimer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}

/* ---------- Color swatches (for surface/access pages) ---------- */
.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 1px solid rgba(0,0,0,0.06);
}

/* ---------- Stat tiles ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
}

.stat-tile .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.stat-tile .stat-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.2rem;
  color: var(--accent);
  margin-top: 6px;
  line-height: 1;
}

.stat-tile .stat-hint { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }

/* ---------- Bars (for breakdowns) ---------- */
.bar-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 60px;
  gap: 14px;
  align-items: center;
}

.bar-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-size: 0.94rem;
}

.bar-track {
  position: relative;
  height: 10px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 999px;
}

.bar-count {
  text-align: right;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Mobile nav ---------- */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .site-nav {
    order: 99;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 4px;
    margin-left: 0;
  }
  .site-nav[hidden] { display: none; }
  .site-nav a { padding: 10px 12px; }
}

@media (max-width: 720px) {
  .wrap { padding: 32px 18px 48px; }
  .card { padding: 22px; }
  .footer-wrap { grid-template-columns: 1fr; }
  .definition-list > div { grid-template-columns: 1fr; gap: 4px; }
}
