:root {
  --bg: #f7f1e8;
  --surface: #fffaf2;
  --ink: #2b2118;
  --muted: #6b5b4b;
  --accent: #a8411c;
  --accent-hover: #8d3414;
  --gold: #e0a03a;
  --border: #e5d8c7;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
}
.brand:hover { text-decoration: none; }
.brand-stamp {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fffaf2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }

.site-main { flex: 1; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fffaf2;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--ink);
  text-decoration: none;
}

/* Hero / Quiz Stage */
.hero-stage {
  padding: 48px 0 32px;
}
.quiz-mount {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}
.quiz-intro { text-align: center; }
.challenge-banner {
  background: #f4e6d2;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}
.challenge-banner strong { color: var(--accent); }
.quiz-h1 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--ink);
}
.quiz-lead {
  font-size: 18px;
  color: var(--muted);
  margin: 0 auto 24px;
  max-width: 54ch;
}
.quiz-cta-row {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.btn-start {
  min-width: 240px;
  min-height: 54px;
  font-size: 18px;
}
.quiz-micro {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Sections */
.section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 24px;
  color: var(--ink);
}
.section-head { margin-bottom: 32px; }
.section-head .section-title { margin-bottom: 12px; }
.section-intro {
  font-size: 16px;
  color: var(--muted);
  max-width: 70ch;
  margin: 0;
}

/* How It Works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f4e6d2;
  color: #8d3414;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-icon svg { width: 22px; height: 22px; }
.step-body h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.step-body p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* Decade Timeline */
.decade-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.decade-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.decade-row:last-child { border-bottom: none; padding-bottom: 0; }
.decade-marker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.decade-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.decade-span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.decade-content h3 {
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.decade-content p {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
}

/* Tips numbered list */
.tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tip-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.tip-num {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
  min-width: 44px;
  display: inline-block;
}
/* Tips are numbered from 01 by CSS, so the count never drifts from the data */
.tips-list { counter-reset: tip; }
.tip-row { counter-increment: tip; }
.tip-num::before { content: counter(tip, decimal-leading-zero); }
.tip-text h3 {
  font-size: 18px;
  margin: 0 0 6px;
}
.tip-text p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.faq-q {
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.faq-item[open] .faq-q::after { content: '−'; }
.faq-a p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.related-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.related-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.related-card h3 { font-size: 18px; margin: 0 0 6px; }
.related-card p { font-size: 14px; color: var(--muted); margin: 0; }

/* Prose & Legal */
.prose-page { padding: 48px 0 64px; }
.prose-container { max-width: 780px; }
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}
.prose-page h1 {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.prose-lead, .legal-updated {
  color: var(--muted);
  margin: 0 0 24px;
}
.prose-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 32px 0 12px;
}
.prose-body p, .prose-body li {
  color: var(--ink);
  max-width: 70ch;
}
.prose-cta { margin-top: 32px; }

/* 404 */
.not-found { padding: 64px 0; text-align: center; }
.not-found-inner { max-width: 520px; }
.nf-stamp {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
}
.not-found h1 { font-family: var(--font-display); font-size: 36px; margin: 0 0 12px; }
.not-found p { color: var(--muted); margin: 0 0 24px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-brand { font-family: var(--font-display); font-size: 18px; }
.footer-tagline { margin: 4px 0 0; font-size: 14px; color: var(--muted); max-width: 60ch; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
}
.footer-copy { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { flex-wrap: wrap; padding: 12px 0; }
  .site-nav { gap: 8px 16px; flex-wrap: wrap; }
  .hero-stage { padding: 24px 0 24px; }
  .quiz-mount { padding: 24px 16px; }
  .quiz-h1 { font-size: clamp(26px, 7vw, 30px); }
  .quiz-lead { font-size: 16px; }
  .btn-start { width: 100%; }
  .steps-grid, .related-grid { grid-template-columns: 1fr; }
  .decade-row { grid-template-columns: 1fr; gap: 8px; }
  .tip-row { padding: 16px; gap: 12px; }
  .section { padding: 32px 0; }
}
