/* Self-hosted fonts (SIL Open Font License, see fonts/) */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url("fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 500; font-display: swap; src: url("fonts/public-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-display: swap; src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #FFFFFF;
  --field: #F4F2EC; /* inputs and script boxes, so they read against white */
  --card: #FFFFFF;
  --ink: #14161A;
  --mute: #5E636B;
  --faint: #8A8F96;
  --line: #E2DED5;
  --soft: #ECEAE4;
  --blue: #1E3FD0;
  --amber: #9A6408;
  --amber-bar: #D9A441;
  --gray: #5E636B;
  --gray-bar: #C9C5BC;
  --display: "Barlow Condensed", "Archivo", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.app { max-width: 480px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10; height: 56px;
  display: flex; justify-content: space-between; align-items: center; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.btn-pill {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--blue); color: #fff; font: 600 14px var(--body); text-decoration: none; white-space: nowrap;
}
.header-cta { transition: opacity 0.2s, transform 0.2s; }
.header-cta.is-hidden { opacity: 0; transform: translateY(-4px); pointer-events: none; visibility: hidden; }
.wordmark { font: 700 22px/1 var(--display); text-decoration: none; }

/* Layout */
.block { padding: 16px 16px; }
.block.tight-top { padding-top: 8px; }
.block.tight-bottom { padding-bottom: 8px; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }

/* Type */
.mono { font: 500 11px/1.3 var(--mono); letter-spacing: 0.04em; color: var(--faint); text-transform: uppercase; }
.mono.dark { color: var(--mute); }
h1 { font: 700 46px/44px var(--display); letter-spacing: 0; }
/* No orphan words: balance headings, avoid single-word last lines in body text. */
h1, h2, .leader, .name, .headline { text-wrap: balance; }
p, li, label { text-wrap: pretty; }
h2 { font: 700 23px/1.15 var(--display); }
.lede { font-size: 16px; line-height: 23px; color: var(--mute); }
.small { font-size: 13px; line-height: 19px; color: var(--mute); }
.tiny { font-size: 12px; line-height: 17px; color: var(--faint); }
.link { font: 600 14px var(--body); color: var(--blue); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; }

/* Surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.note { background: var(--soft); border-radius: 14px; padding: 14px; }
.card-link { display: block; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; transition: border-color 0.15s, transform 0.1s; }
.card-link:hover { border-color: var(--gray-bar); }
.card-link:active { transform: scale(0.99); }
.card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-sm {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font: 600 14px var(--body); color: var(--ink);
  text-decoration: none; align-self: flex-start;
}
a.btn-sm:hover { border-color: var(--gray-bar); }
.card-link:hover .btn-sm { border-color: var(--gray-bar); }

/* Buttons and inputs */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 16px var(--body); text-decoration: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.input {
  width: 100%; height: 52px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  font: 400 16px var(--body);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.error { color: #B3261E; font-size: 13px; }

/* Status: dot plus text, never a pill */
.status { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--body); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-oppose { color: var(--blue); }
.s-uncommitted { color: var(--amber); }
.s-backs { color: var(--gray); }

/* Bars and legend */
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--soft); }
.bar span { display: block; height: 100%; }
.legend { display: flex; justify-content: space-between; gap: 8px; }
.legend .n { font: 500 20px/1.2 var(--mono); }
.key { display: flex; align-items: center; gap: 6px; font: 500 13px var(--body); color: var(--mute); margin-top: 4px; }
.key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--swatch); }

/* Big stats */
.stat { display: flex; align-items: flex-end; align-items: last baseline; gap: 12px; }
.stat .num { font: 700 44px/46px var(--display); }
.meter-stat { display: flex; align-items: baseline; gap: 8px; }
.meter-stat .num { font: 700 56px/58px var(--display); }
.meter-stat .of { font: 600 23px var(--display); color: var(--mute); }
.leader { font: 700 28px/1.1 var(--display); }

/* Filter chips (tappable, so these are pills) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; font: 500 13px var(--body);
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Rows */
.date-row { display: flex; gap: 14px; padding: 14px 16px; }
.date-row .when { font: 500 13px var(--mono); width: 92px; flex: none; white-space: nowrap; }
.alt-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.alt-row .who { flex: 1; }
.alt-row .name { font: 600 16px var(--body); }
.alt-row .count { text-align: right; }
.alt-row .count b { display: block; font: 700 22px/1.1 var(--display); }
.member { padding: 14px 16px; }
.member .head { display: flex; gap: 8px; align-items: flex-start; }
.member .who { flex: 1; }
.member .name { font: 600 16px var(--body); }
.member .quote { font-size: 14px; line-height: 20px; margin-top: 6px; }
.member .mono { margin-top: 6px; }
.member .mono a { text-decoration: none; }
.news { display: block; padding: 16px; text-decoration: none; }
.news .headline { font: 600 20px/23px var(--display); margin-top: 8px; }
.tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font: 500 12px var(--body); color: var(--mute); }

/* Call cards */
.rep { display: flex; flex-direction: column; gap: 14px; }
.rep .head { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--soft); flex: none;
  display: grid; place-items: center; font: 600 15px var(--body); color: var(--mute);
}
.rep .name { font: 700 23px/1.15 var(--display); }
.rep .vote { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.script { background: var(--field); border-radius: 10px; padding: 12px; }
.script p { font-size: 14px; line-height: 20px; margin: 6px 0; }
.script p.mono { font-size: 11px; line-height: 1.3; margin: 0; }
.rep .numbers { display: flex; justify-content: space-between; align-items: center; }
.rep .numbers .mono { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--mute); }

/* Footer nav: sits at the end of the page, not sticky */
.foot { border-top: 1px solid var(--line); margin-top: 8px; padding: 8px 4px 24px; }
.foot nav { display: flex; }
.foot a { flex: 1; text-align: center; text-decoration: none; font: 500 13px var(--body); color: var(--faint); padding: 14px 0; }
.foot a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Search */
.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 42px; height: 48px; background: #fff; -webkit-appearance: none; appearance: none; }

/* Hero issue list */
.stakes { list-style: none; }
.stakes li { position: relative; padding-left: 24px; }
.stakes li::before { content: "\00b7"; position: absolute; left: 8px; font-weight: 600; }
.stack > .stakes { margin-top: 12px; }
.alt-tip a { color: var(--blue); font-weight: 600; text-decoration: none; }
.s-unknown { color: var(--faint); }

/* Source submission form */
#source-form label, #source-form legend { font-weight: 600; }
#source-form fieldset { border: 0; padding: 0; margin: 0; }
#source-form .radio { font-weight: 400; display: flex; gap: 8px; align-items: center; }
textarea.input { resize: vertical; font: inherit; }
select.input { appearance: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#source-form > label { display: block; }
#source-form > label, #source-form > fieldset, #source-form > .error, #source-form > button { margin-top: 22px; }
#source-form > label + .input, #source-form > label + select { margin-top: 6px; }
#source-form > label:first-child { margin-top: 0; }
#source-form > .tiny { margin-top: 12px; }
#source-form fieldset > .radio { margin-top: 8px; }

#source-form .input[aria-invalid="true"] { border-color: #B3261E; }
#source-form fieldset[aria-invalid="true"] legend { color: #B3261E; }
