/* Shared layout and components. Brand colors and fonts come from brand.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
[tabindex="-1"]:focus { box-shadow: none; outline: none; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--bg-raised); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
.measure { max-width: var(--measure); margin-inline: auto; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.logo { display: block; }
.logo img { height: 44px; width: auto; }
.logo .rev { display: none; }
.site-nav { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-ui); font-size: 16px; font-weight: 600; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--brand); text-decoration: underline; }

/* Type */
h1, h2, h3 { font-family: var(--font-head); color: var(--head-color); text-wrap: balance; margin: 0; }
h1 { font-size: 30px; line-height: 38px; font-weight: 700; letter-spacing: -0.005em; }
h2 { font-size: 24px; line-height: 32px; font-weight: var(--h2-weight); margin: 40px 0 12px; }
h3 { font-size: 21px; line-height: 29px; font-weight: var(--h3-weight); margin: 28px 0 8px; }
@media (min-width: 720px) {
  h1 { font-size: 36px; line-height: 44px; }
  h2 { font-size: 28px; line-height: 36px; }
  h3 { font-size: 22px; line-height: 30px; }
}
p { margin: 0 0 24px; }
.kicker { font-family: var(--font-ui); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.lede { font-size: 21px; line-height: 32px; margin: 16px 0 20px; }
.byline { font-family: var(--font-ui); font-size: 15px; line-height: 22px; color: var(--muted); margin: 0 0 24px; }
.caption, .small { font-family: var(--font-ui); font-size: 15px; line-height: 22px; color: var(--muted); }
article ul, article ol { padding-left: 1.3em; margin: 0 0 24px; }
article li { margin-bottom: 10px; }
strong { font-weight: var(--strong-weight); }

/* Article */
.article { padding-block: 32px 48px; }
.article > header { margin-bottom: 8px; }
.keybox { background: var(--accent-soft); border-radius: var(--radius-box); padding: 20px 22px; margin: 8px 0 28px; }
.keybox .big { font-family: var(--font-head); font-size: 28px; line-height: 36px; font-weight: 700; color: var(--accent-ink-strong); margin: 0 0 4px; }
.keybox p:last-child { margin-bottom: 0; }
.note { border: 1px solid var(--line); border-radius: var(--radius-box); padding: 16px 18px; margin: 0 0 24px; background: var(--bg-raised); }
.note .tag { font-family: var(--font-ui); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.note.info .tag { color: var(--info); }
.note.warn .tag { color: var(--warn); }
.note p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: 16px; line-height: 22px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink); }
tr.hl td { background: var(--accent-soft); }
.sources { font-family: var(--font-ui); font-size: 15px; line-height: 22px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 40px; }
.sources ol { padding-left: 1.2em; }
.disclaimer { font-family: var(--font-ui); font-size: 15px; line-height: 22px; color: var(--muted); }
.cta { display: block; border: 1px solid var(--line); background: var(--bg-raised); border-radius: var(--radius-box); padding: 18px 20px; text-decoration: none; color: var(--ink); margin: 0 0 28px; }
.cta strong { display: block; font-family: var(--font-head); font-size: 21px; line-height: 28px; color: var(--head-color); margin-bottom: 4px; }
.cta span { font-family: var(--font-ui); font-size: 16px; color: var(--brand); font-weight: 600; }

/* Ads: one labelled slot, reserved height to avoid layout shift */
.ad { margin: 32px 0; text-align: center; }
.ad-label { display: block; font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot { min-height: 250px; background: var(--ad-fill); border-radius: 2px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--font-ui); font-size: 13px; }
.ad-slot.filled { background: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: var(--radius-btn); border: 0; background: var(--brand-fill); color: var(--on-brand); font-family: var(--font-ui); font-size: 18px; line-height: 24px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--line); }

/* Home */
.hero { padding-block: 40px 24px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 34px; line-height: 42px; max-width: 18ch; }
@media (min-width: 720px) { .hero h1 { font-size: 44px; line-height: 52px; } }
.hero .lede { max-width: 60ch; }
.grid { display: grid; gap: 24px; grid-template-columns: 1fr; padding-block: 32px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); border-top: 3px solid var(--card-rule); padding-top: 14px; }
.card h3 { margin: 0; font-size: 22px; line-height: 30px; }
.card p { margin: 0; font-size: 17px; line-height: 26px; color: var(--muted); font-family: var(--font-ui); }
.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.section-title { font-family: var(--font-ui); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 0; }

/* Quiz */
.quiz { padding-block: 24px 48px; max-width: 600px; margin-inline: auto; }
.quiz-progress { font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.bar { height: 8px; background: var(--line); border-radius: 9999px; overflow: hidden; margin-bottom: 24px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 9999px; width: 0; transition: width .25s ease; }
.quiz h1 { font-size: 26px; line-height: 34px; }
@media (min-width: 720px) { .quiz h1 { font-size: 30px; line-height: 38px; } }
.quiz .why { font-size: 18px; line-height: 28px; color: var(--muted); margin: 12px 0 20px; }
.answers { display: grid; gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; }
.answer { width: 100%; min-height: 58px; text-align: left; padding: 14px 18px; border-radius: var(--radius-btn); border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--ink); font-family: var(--font-ui); font-size: 18px; line-height: 24px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
.answer:hover { border-color: var(--brand); }
.answer[aria-pressed="true"] { background: var(--accent-soft); border: 2px solid var(--brand); padding: 13px 17px; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.quiz-result .big { font-family: var(--font-head); font-size: 40px; line-height: 48px; font-weight: 700; color: var(--accent-ink-strong); margin: 8px 0 12px; }
.quiz noscript p { background: var(--accent-soft); padding: 16px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 32px 48px; font-family: var(--font-ui); font-size: 15px; line-height: 22px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0 0 8px; }

/* Legal pages */
.page { padding-block: 32px 48px; }
.page h2 { font-size: 24px; line-height: 32px; }

@media (prefers-color-scheme: dark) {
  .logo .std { display: none; }
  .logo .rev { display: block; }
}
@media (prefers-reduced-motion: reduce) { .bar > span { transition: none; } }
