:root {
  --ink: #1c2b25;
  --ink-soft: #3a4c43;
  --muted: #5c675c;
  --parch: #f3ead6;
  --parch-2: #f7f1e4;
  --card: #fffaf0;
  --line: #e0d3b6;
  --gold: #c8a24a;
  --gold-deep: #6e5014;
  --forest: #1e3b31;
  --forest-mid: #234237;
  --good: #1c5c3a;
  --bad: #8a332c;
  --header: #1c2b25;
  --header-ink: #f4ecd8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 14px 40px rgba(48, 36, 12, 0.08);
  --max: 1080px;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3ead2;
    --ink-soft: #ddd3bc;
    --muted: #b7ad96;
    --parch: #121c18;
    --parch-2: #17231e;
    --card: #1d2c26;
    --line: #345046;
    --gold: #d4b15e;
    --gold-deep: #e6c98a;
    --forest: #d7e6dc;
    --forest-mid: #9fc2ae;
    --good: #8dceab;
    --bad: #f0aaa4;
    --header: #0d1613;
    --header-ink: #f4ecd8;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(200, 162, 74, 0.16), transparent 55%),
    linear-gradient(var(--parch-2), var(--parch));
  background-attachment: fixed;
  font: 1.0625rem/1.65 var(--serif);
}
img, svg { max-width: 100%; }
a { color: var(--gold-deep); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  color: #1c2b25;
  padding: 8px 12px;
  z-index: 30;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 1px solid rgba(200, 162, 74, 0.35);
}
.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--header-ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  margin-right: auto;
  min-height: 44px;
}
.brand svg { display: block; flex: none; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}
.nav a {
  color: var(--header-ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
@media (max-width: 720px) {
  .nav { order: 3; width: 100%; padding-bottom: 4px; }
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 28px 20px 72px;
}
.wrap-wide {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 20px 80px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 4.6vw, 3.35rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); margin: 0 0 12px; }
h3 { font-size: 1.22rem; margin: 0 0 8px; }
p, li { color: var(--ink-soft); }
.lede { font-size: 1.18rem; line-height: 1.55; max-width: 38rem; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 10px;
}

.hero {
  display: grid;
  gap: 28px;
  align-items: center;
  padding: 36px 0 18px;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.12fr 0.88fr; gap: 48px; padding: 54px 0 20px; }
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.btn-primary { background: var(--forest-mid); color: #f6f1e4; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: rgba(200, 162, 74, 0.12); }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--gold); color: #1c1608; }
  .btn-primary:hover { filter: brightness(1.05); }
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stats li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}
.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.stats span { color: var(--muted); font-family: var(--sans); font-size: 0.82rem; }

.hero-card, .qa, .card, .audience, .feature, .step, .faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hero-card { padding: 22px 20px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(200, 162, 74, 0.18);
  color: var(--gold-deep);
}
.prompt, .qa h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.3; color: var(--ink); }
.choices { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.choices li,
.choices .choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  width: 100%;
  font: inherit;
  min-height: 48px;
  cursor: pointer;
}
.choices .choice:disabled { cursor: default; }
.letter {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
}
.choices .right { border-color: var(--good); background: rgba(28, 92, 58, 0.08); }
.choices .right .letter { background: var(--good); color: #f4ecd8; border-color: var(--good); }
.mark {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--good);
}
.ref, .source { color: var(--muted); font-size: 0.92rem; margin: 0; }
.note { margin: 10px 0 0; }

section { margin: 42px 0; }
.section-head { max-width: 40rem; margin-bottom: 18px; }
.grid-5, .grid-3, .grid-2 { display: grid; gap: 14px; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 980px) {
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 700px) and (max-width: 979px) {
  .grid-5 { grid-template-columns: 1fr 1fr; }
}
.audience, .feature, .step, .faq-item { padding: 18px 16px 16px; box-shadow: none; }
.audience h3, .feature h3, .step h3, .faq-item h3 { font-size: 1.12rem; }
.audience p, .feature p, .step p, .faq-item p { margin: 0; font-size: 0.98rem; }
.audience a.more, .closer a { font-family: var(--sans); font-weight: 700; font-size: 0.92rem; }
.step .num {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 6px;
}

.crumbs {
  font-family: var(--sans);
  font-size: 0.88rem;
  margin: 18px 0 8px;
  color: var(--muted);
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li { color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }

.qa { padding: 18px 18px 16px; margin: 14px 0; box-shadow: none; }
.qa .meta { margin: 0 0 8px; font-family: var(--sans); font-size: 0.85rem; }
.answer { margin: 8px 0 0; color: var(--ink); }
.why { margin: 8px 0 0; }

.catalog { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (min-width: 800px) {
  .catalog { grid-template-columns: 1fr 1fr; }
}
.catalog a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 44px;
  color: var(--ink);
}
.catalog a strong { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.catalog a span { color: var(--muted); font-family: var(--sans); font-size: 0.82rem; }
.catalog a:hover { border-color: var(--gold); }

.closer {
  background: var(--forest);
  color: #f4ecd8;
  border-radius: 22px;
  padding: 28px 22px;
}
@media (prefers-color-scheme: dark) {
  .closer { background: #243f35; }
}
.closer h2, .closer p { color: #f4ecd8; }
.closer .btn-primary { background: var(--gold); color: #1c1608; }
.closer .btn-ghost { border-color: rgba(244, 236, 216, 0.5); color: #f4ecd8; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 20px 48px;
}
.foot { max-width: var(--max); margin: 0 auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 14px; }
.foot nav a { font-family: var(--sans); font-weight: 700; }
.legal { color: var(--muted); font-size: 0.88rem; max-width: 46rem; }

.prose h2 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: 0.3rem 0; }
.prose .card { padding: 18px 18px 8px; margin: 16px 0; }
.page-head { padding: 28px 0 8px; }
.page-head .sub { color: var(--muted); margin-top: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

.rule { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 28px 0; }
.rule i { display: block; height: 1px; width: 72px; background: var(--gold); opacity: 0.7; }
.rule b { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

#board[hidden] { display: none; }
/* The results screen already carries the badge. Hide the static one under the board while the round is open so the two do not stack. */
#board:not([hidden]) ~ .store-after { display: none; }
.feedback { min-height: 1.2em; }
.choice.is-right { border-color: var(--good); background: rgba(28, 92, 58, 0.1); }
.choice.is-wrong { border-color: var(--bad); background: rgba(138, 51, 44, 0.08); }
.progress { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#qnext { margin-top: 8px; }

#who, #how, #faq, #sample, #read { scroll-margin-top: 84px; }

/* App Store badge. The artwork is Apple's file, shown at 40px (48px in the
   hero) with clear space from margin. Nothing here redraws, recolors, or
   shadows the image. Until APP_STORE_URL is set, the slot is our own label. */
.store-slot { margin: 20px 0; }
.store-nav { margin: 0; }
.store-hero { margin: 16px 0 4px; }
.store-footer { margin: 18px 0 8px; }
.store-badge {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  border: 0;
}
.store-badge img {
  height: 40px;
  width: auto;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  display: block;
}
.store-hero .store-badge img { height: 48px; }
.store-badge .badge-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .store-slot:not(.store-nav) .store-badge .badge-light { display: none; }
  .store-slot:not(.store-nav) .store-badge .badge-dark { display: block; }
}
.store-soon {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}
.store-nav .store-soon {
  background: transparent;
  color: var(--header-ink);
  border-color: rgba(244, 236, 216, 0.45);
  font-size: 0.82rem;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .nav .store-nav { flex: 1 0 100%; }
  .store-nav .store-soon {
    white-space: normal;
    max-width: 100%;
  }
}
