/* Politikerna — paper and ink. Rubric red marks attribution only. */
@font-face { font-family: "Spectral"; font-weight: 300; font-style: normal; font-display: swap; src: url("/static/fonts/spectral-300.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/spectral-400.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 400; font-style: italic; font-display: swap; src: url("/static/fonts/spectral-400i.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/spectral-500.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/spectral-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/jetbrains-mono-500.woff2") format("woff2"); }

:root {
  --paper: #FAF7F1;
  --card: #FFFDF9;
  --ink: #16130F;
  --body: #3D3830;
  --muted: #6B655C;
  --rule: #E3DDD2;
  --rule-strong: #C9C2B5;
  --near: #B9B2A5;
  --soft: #EFE9DF;
  --rubric: #A3231C;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --measure: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  color-scheme: only light;
}
/* Light only: every screenshot must match the paper link cards. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; hyphens: manual; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rubric); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--rubric); }
a.plain { text-decoration: none; }
a.plain:hover { color: var(--rubric); }
h1, h2, h3 { font-weight: 400; margin: 0; letter-spacing: -0.015em; text-wrap: pretty; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
::selection { background: var(--rubric); color: #FAF7F1; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric); }
.muted { color: var(--muted); }
.light { font-weight: 300; color: var(--body); }
.wordmark { font-weight: 500; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.wordmark .colon, .colon { color: var(--rubric); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; border-radius: 2px; }

/* Layout */
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-top: 22px; padding-bottom: 18px; }
.site-header .brand { display: flex; align-items: baseline; gap: 14px; }
.site-header .brand .wordmark { font-size: 28px; line-height: 1; }
.site-header .tagline { font-style: italic; color: var(--muted); font-size: 16px; }
.site-header nav { display: flex; gap: 24px; font-size: 15px; }
.site-header nav a { text-decoration: none; }
.site-header nav a[aria-current="page"] { font-weight: 500; }
main { flex: 1 0 auto; overflow-x: clip; }
.site-footer { border-top: 1px solid var(--ink); margin-top: 72px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px 40px; padding-top: 36px; padding-bottom: 36px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.site-footer .maker { display: flex; flex-direction: column; gap: 6px; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }

.section { padding-top: 64px; }
.rule { border: 0; border-top: 1px solid var(--ink); margin: 0; }
.rule-soft { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 48px 64px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 48px; }
.two-col.wide-first { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
@media (max-width: 860px) { .two-col, .two-col.wide-first, .three-col { grid-template-columns: minmax(0, 1fr); } }

/* Type scale */
.display { font-size: clamp(38px, 5.2vw, 66px); line-height: 1.06; }
.display .soft { color: var(--muted); }
.lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.5; font-weight: 300; max-width: 760px; }
.h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2; }
.h3 { font-size: 22px; line-height: 1.25; font-weight: 500; }
.small { font-size: 15px; }
.tiny { font-size: 13px; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 32px; background: var(--ink); color: var(--paper); font-size: 18px; font-weight: 500; border-radius: 3px; text-decoration: none; transition: filter .12s, opacity .12s; }
.btn:hover { filter: brightness(1.15); color: var(--paper); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.secondary:hover { color: var(--rubric); border-color: var(--rubric); filter: none; }
.btn.ghost { background: transparent; color: var(--muted); padding: 0 16px; }
.btn.ghost:hover { color: var(--rubric); filter: none; }
.btn.sm { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn.block { width: 100%; }
.cta-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }

/* Answer scale */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .scale { grid-template-columns: minmax(0, 1fr); } }
.scale-btn { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 3px; background: var(--card); font-size: 17px; text-align: left; transition: background .12s, color .12s; }
@media (min-width: 641px) { .scale-btn { justify-content: center; text-align: center; padding: 0 10px; font-size: 15px; } }
a.scale-btn { text-decoration: none; }
.scale-btn:hover { background: var(--soft); }
@media (min-width: 641px) { .scale-btn .you { display: none; } }
.scale-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.scale-btn .you { font-family: var(--mono); font-size: 12px; color: var(--near); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 3px; font-size: 15px; flex: 1 1 auto; transition: background .12s, border-color .12s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--soft); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check .box { width: 20px; height: 20px; border: 1px solid var(--ink); border-radius: 2px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; }
.check[aria-checked="true"] .box::after { content: ""; width: 10px; height: 10px; background: var(--ink); }
.progress { display: flex; gap: 4px; }
.progress span { flex: 1; height: 3px; background: var(--rule); }
.progress span.done { background: var(--ink); }
.progress span.now { background: var(--rubric); }

/* Quote and cards */
.quote { font-size: clamp(19px, 1.8vw, 22px); line-height: 1.45; padding-left: 20px; border-left: 2px solid var(--rubric); text-wrap: pretty; }
.quote .who { color: var(--rubric); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 640px) { .card { padding: 20px; } }
.card .meta { display: flex; gap: 12px 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

/* Ranking */
.rank { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 90px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rank:first-child { border-top: 1px solid var(--ink); }
.rank .name { font-size: 19px; }
.rank.first .name { font-weight: 500; }
.rank .name .flag { display: inline-block; white-space: nowrap; font-size: 10px; margin-left: 10px; vertical-align: middle; }
.rank .bar { height: 14px; background: var(--rule); position: relative; }
.rank .bar i { position: absolute; left: 0; top: 0; height: 100%; width: 0; transition: width .45s cubic-bezier(.2,.6,.2,1), left .45s cubic-bezier(.2,.6,.2,1); }
.rank .bar i.same { background: var(--ink); }
.rank .count { font-family: var(--mono); font-size: 15px; text-align: right; }
@media (max-width: 640px) { .rank { grid-template-columns: minmax(0, 1fr) 70px; } .rank .bar { grid-column: 1 / -1; order: 3; } }

/* Party grid */
.pgrid { display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); gap: 6px; min-width: 0; }
/* Wrap larger party sets on phones; the last row may be incomplete. */
@media (max-width: 640px) { .pgrid.dense { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pcell { min-height: 44px; min-width: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); background: var(--paper); font-size: 12px; letter-spacing: -0.01em; padding: 0 2px; overflow: hidden; border-radius: 0; }
.pgrid.dense .pcell { font-size: 10.5px; }
.pcell.same { background: var(--ink); color: var(--paper); }
.pcell.near { background: var(--near); }
.pcell.none { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.pcell.open { outline: 2px solid var(--rubric); outline-offset: -2px; }
.pcell:hover { filter: brightness(0.95); }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--ink); background: var(--paper); }
.legend i.same { background: var(--ink); }
.legend i.near { background: var(--near); }
.legend i.none { border-style: dashed; border-color: var(--muted); }

/* Question rows on the result page */
.qrow { border-bottom: 1px solid var(--rule); }
.qrow-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 560px); gap: 24px; align-items: center; padding: 18px 0; }
@media (max-width: 860px) { .qrow-head { grid-template-columns: minmax(0, 1fr); } }
.qrow.open { background: var(--card); margin: 0 -24px; padding: 0 24px; }
.qrow .receipt { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 32px; padding: 8px 0 28px 0; }
@media (max-width: 860px) { .qrow .receipt { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Release list */
.release { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 24px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.release:first-child { border-top: 1px solid var(--ink); }
.release .title { font-size: 21px; font-weight: 500; }
.release .blurb { font-size: 16px; color: var(--body); font-weight: 300; }
.release .open { text-align: right; font-size: 15px; }
@media (max-width: 640px) { .release { grid-template-columns: minmax(0, 1fr) 80px; gap: 12px 16px; } }

/* Share sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(22,19,15,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
@media (min-width: 641px) { .sheet-backdrop { align-items: center; } }
.sheet { width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 6px 6px 0 0; padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 641px) { .sheet { border-radius: 6px; padding: 28px; } }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 76px; border: 1px solid var(--rule-strong); border-radius: 3px; font-size: 13px; text-decoration: none; color: var(--ink); }
.share-tile:hover { border-color: var(--ink); color: var(--ink); }
.share-tile svg { stroke: currentColor; }
.link-preview { border: 1px solid var(--rule); border-radius: 4px; background: var(--card); overflow: hidden; }
.link-preview .top { padding: 16px 18px 12px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.link-preview .bottom { padding: 12px 18px; font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 3px; font-size: 14px; z-index: 60; }

/* Comparison table */
.cmp { display: grid; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cmp .q { font-size: 15px; line-height: 1.35; }
.cmp .a { min-height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font-size: 12px; text-align: center; line-height: 1.1; padding: 2px; background: var(--paper); }
.cmp .a.same { background: var(--ink); color: var(--paper); }
.cmp .a.near { background: var(--near); }
.cmp .a.none { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.cmp.head { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0; }

/* Source paragraph with the cited span */
.source-para { max-height: 320px; overflow: auto; padding: 16px 18px; border: 1px solid var(--rule); background: var(--card); line-height: 1.6; font-size: 16px; }
mark { background: var(--soft); color: inherit; box-shadow: inset 0 -2px 0 var(--rubric); padding: 0 2px; }

/* Numbered method list */
.steps { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 24px 24px; font-size: 18px; line-height: 1.5; }
.steps .n { font-family: var(--mono); font-size: 14px; color: var(--rubric); padding-top: 5px; }
.kv { display: flex; flex-direction: column; font-size: 16px; }
.kv div { padding: 12px 0; border-top: 1px solid var(--rule); }
.kv div:first-child { border-top-color: var(--ink); }
.kv div:last-child { border-bottom: 1px solid var(--ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
