/* MapleCivics landing — warm paper, maple red, boreal green.
   Palette from src/theme.ts of the app. System fonts only. */

:root {
  --maple: #a8232a;
  --maple-deep: #7e1a20;
  --maple-soft: #c6444a;
  --pine: #3e6b4f;
  --pine-soft: #5c8a6d;
  --paper: #fbf8f4;
  --paper-alt: #f3eee7;
  --card: #ffffff;
  --ink: #26221f;
  --ink-2: #5d564f;
  --ink-3: #8a8178;
  --line: #e5ded4;
  --line-soft: #f0eae1;
  --gold: #b87a1e;
  --focus: #33628c;
  --serif: "Iowan Old Style", "Palatino", "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --maple: #e0575d;
    --maple-deep: #c6444a;
    --maple-soft: #ee7a7f;
    --pine: #6fa383;
    --pine-soft: #8fbea1;
    --paper: #171310;
    --paper-alt: #211c18;
    --card: #241f1a;
    --ink: #f2ece4;
    --ink-2: #beb4a8;
    --ink-3: #8a8178;
    --line: #3a332c;
    --line-soft: #2c2620;
    --gold: #d99b45;
    --focus: #7fa8cc;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--maple); }
a:hover { color: var(--maple-deep); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: var(--paper); }

.wrap {
  max-width: 66rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand .leaf { color: var(--maple); }

.site-nav { margin-left: auto; }

.site-nav ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--maple); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
    z-index: 50;
  }
  .site-head { position: relative; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.9rem; }
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(60rem 30rem at 110% -10%, rgba(168, 35, 42, 0.07), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}

.hero h1 em {
  font-style: normal;
  color: var(--maple);
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-2);
  margin: 0 0 1.5rem;
  max-width: 34rem;
}

.launch-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
  margin-bottom: 1.1rem;
}
.launch-line::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pine);
}

.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.play-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.play-badge svg { display: block; }

.hero-note { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.9rem; max-width: 30rem; }

/* Mock-test scorecard illustration */

.scorecard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 10px 30px rgba(58, 42, 32, 0.1);
  max-width: 22rem;
  margin: 0 auto;
  transform: rotate(1.2deg);
}

.scorecard .sc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
}

.scorecard .sc-title { font-weight: 700; font-size: 0.95rem; }
.scorecard .sc-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--maple);
  font-size: 0.95rem;
}

.scorecard .sc-q { font-size: 0.95rem; margin: 0 0 0.8rem; }

.sc-opt {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--ink-2);
}
.sc-opt.right {
  border-color: var(--pine);
  color: var(--ink);
  background: rgba(62, 107, 79, 0.08);
  font-weight: 600;
}
.sc-opt.right::after { content: " ✓"; color: var(--pine); font-weight: 700; }

.sc-foot { font-size: 0.8rem; color: var(--ink-3); margin: 0.6rem 0 0; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.25rem; padding-top: 2.75rem; padding-bottom: 2.75rem; }
  .scorecard { transform: none; }
}

/* ---------- Numbers strip ---------- */

.numbers {
  background: var(--maple);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .numbers { background: var(--maple-deep); }
}

.numbers .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
}

.numbers .num { flex: 1 1 9rem; }
.numbers .num strong {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
}
.numbers .num span { font-size: 0.9rem; opacity: 0.9; }

/* ---------- Sections ---------- */

section { padding: 3.5rem 0; }

.section-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maple);
  margin: 0 0 0.4rem;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }

.section-intro { color: var(--ink-2); max-width: 42rem; margin: 0 0 2rem; }

/* Chapter ledger */

.alt { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.ledger {
  columns: 2;
  column-gap: 2.5rem;
  max-width: 54rem;
}

.ledger-row {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--line);
}

.ledger-row .dots { flex: 1; }
.ledger-row .l-name { font-weight: 600; }
.ledger-row .l-count {
  font-variant-numeric: tabular-nums;
  color: var(--maple);
  font-weight: 700;
  white-space: nowrap;
}

.ledger-total {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  max-width: 54rem;
  margin-top: 0.9rem;
  font-weight: 700;
}
.ledger-total .l-count { color: var(--maple); }

@media (max-width: 640px) { .ledger { columns: 1; } }

/* Feature rows: alternating prose blocks, not a card grid */

.feature-row {
  display: grid;
  grid-template-columns: minmax(3rem, 4.5rem) 1fr;
  gap: 1.25rem;
  max-width: 46rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line-soft);
}
.feature-row:first-of-type { border-top: 0; }

.feature-num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--maple-soft);
  line-height: 1;
}

.feature-row p { margin: 0.35rem 0 0; color: var(--ink-2); }

/* Region band */

.region-band .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.region-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.95rem;
}
.region-list li {
  break-inside: avoid;
  padding: 0.3rem 0;
  border-bottom: 1px dotted var(--line);
  color: var(--ink-2);
}
.region-list li b { color: var(--ink); font-weight: 600; }

@media (max-width: 820px) {
  .region-band .wrap { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Guides */

.guide-list { list-style: none; margin: 0; padding: 0; max-width: 46rem; }

.guide-list li { border-top: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 1px solid var(--line); }

.guide-list a {
  display: block;
  padding: 1.1rem 0.25rem;
  text-decoration: none;
  color: var(--ink);
}
.guide-list a:hover .g-title { color: var(--maple); text-decoration: underline; }
.g-title { font-weight: 700; font-size: 1.1rem; display: block; }
.g-desc { color: var(--ink-2); font-size: 0.95rem; display: block; margin-top: 0.2rem; }

/* FAQ */

.faq-item { border-bottom: 1px solid var(--line); max-width: 46rem; }
.faq-item:first-of-type { border-top: 1px solid var(--line); }

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  padding: 1rem 0.25rem;
  cursor: pointer;
}
.faq-q::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--maple);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }

.faq-a { padding: 0 0.25rem 1.1rem; color: var(--ink-2); max-width: 42rem; }
.faq-a p { margin: 0 0 0.6rem; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-item.js .faq-a { display: none; }
.faq-item.js.open .faq-a { display: block; }

/* Coming soon band */

.cta-band {
  background: var(--paper-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.cta-band .wrap { max-width: 44rem; }
.cta-band .badge-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-foot {
  padding: 2.5rem 0 3rem;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.site-foot .foot-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 4rem;
  margin-bottom: 1.5rem;
}

.site-foot h3 { font-size: 0.95rem; color: var(--ink); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 0.4rem; }
.site-foot a { color: var(--ink-2); }

.disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  max-width: 52rem;
}
.disclaimer p { margin: 0 0 0.6rem; }

/* ---------- Guide pages ---------- */

.article-head { border-bottom: 1px solid var(--line); padding: 2rem 0 1.75rem; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0 0 1rem;
}
.breadcrumb a { color: var(--ink-2); }
.breadcrumb span[aria-hidden] { margin: 0 0.35rem; }

.article-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  letter-spacing: -0.015em;
}
.article-head .lede { color: var(--ink-2); font-size: 1.1rem; margin: 0; max-width: 42rem; }
.article-meta { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.8rem; }

article.guide { max-width: 44rem; margin: 0 auto; padding: 2.25rem 0 1rem; }

article.guide h2 {
  font-size: 1.5rem;
  margin-top: 2.2rem;
}
article.guide h3 { margin-top: 1.6rem; }
article.guide p, article.guide li { color: var(--ink-2); }
article.guide li { margin-bottom: 0.4rem; }
article.guide strong { color: var(--ink); }

article.guide table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 1.25rem 0;
}
article.guide th, article.guide td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
article.guide th { color: var(--ink); border-bottom: 2px solid var(--maple); }

.callout {
  background: var(--paper-alt);
  border-left: 4px solid var(--pine);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
  font-size: 0.97rem;
}
.callout.red { border-left-color: var(--maple); }

.next-reads {
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
}
.next-reads h2 { font-size: 1.2rem; margin-top: 0; }
