/* Shared styles for every page: tokens, nav bar, footer, and content pages */
:root {
  --bg: #fafaf7; --card: #ffffff; --text: #111111; --muted: #66665f; --line: #e7e6df; --soft: #f1f0e9;
  --brand: #fffc00; --brand-ink: #111111; --accent: #c9a800; --err: #b3261e;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f; --card: #17171a; --text: #f3f3f0; --muted: #9b9b95; --line: #2a2a2e; --soft: #1f1f23;
    --accent: #fffc00; --err: #ff8a80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* nav bar */
.site-header { padding: 16px 0; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; gap: 12px; }
.home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.01em; flex: none; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; }
.main-nav { margin-left: auto; display: flex; gap: 4px; }
.main-nav a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.main-nav a:hover { color: var(--text); background: var(--soft); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--soft); }

/* footer */
.site-footer { margin-top: auto; padding: 48px 0 28px; }
.site-footer .wrap { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; font-size: 12px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current="page"] { color: var(--text); }

/* content pages */
.prose { padding: 32px 0 8px; line-height: 1.65; }
.prose h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 10px; }
.prose .lede { font-size: 17px; color: var(--muted); margin: 0 0 28px; max-width: 620px; }
.prose .updated { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.prose h2 { font-size: 20px; letter-spacing: -0.01em; margin: 36px 0 8px; }
.prose h3 { font-size: 16px; margin: 0 0 4px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose a { text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose code { background: var(--soft); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.summary { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 18px; margin: 0 0 28px; }
.summary p { margin: 0; }

/* guides */
.crumbs { margin: 0 0 6px; font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::before { content: "← "; }
.guide-list h3 a { text-decoration: none; }
.guide-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--brand); }

/* cards and steps */
.cards, .prose .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 0 !important; }
.card .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; margin-bottom: 12px; }
.card .ic svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.steps { list-style: none; padding: 0 !important; margin: 8px 0 0; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 18px 64px; margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.steps p { margin: 0; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 10px; margin-top: 8px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 20px; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* call to action */
.cta { margin: 40px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.cta p { margin: 0; font-weight: 600; }
.btn { display: inline-flex; align-items: center; border-radius: 12px; padding: 10px 18px; background: var(--brand); color: var(--brand-ink); font-weight: 650; text-decoration: none !important; }
.btn:hover { filter: brightness(.96); }

/* reserved ad space (filled by /ads.js); min-height keeps the page from jumping when an ad loads */
.ad-slot { margin: 36px auto; min-height: 120px; max-width: 728px; position: relative; }
.ad-slot.ad-live::before { content: "Advertisement"; display: block; text-align: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot.ad-preview { border: 1.5px dashed var(--line); border-radius: 14px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ad-slot.ad-preview::after { content: "Ad space · " attr(data-size); }
.ad-slot.tall { min-height: 250px; }

@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 8px; }
  .main-nav { margin: 0 -10px; width: calc(100% + 20px); overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .cards, .prose .cards { grid-template-columns: 1fr; }
}
