/* ═══════════════════════════════════════════════════════════════
   VOTE COUNT BINFACE — "Intergalactic Returning Officer"
   UK ballot-paper bureaucracy × retro space B-movie × Ceefax
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #101014;
  --paper: #f2efe6;
  --paper-deep: #e7e2d3;
  --space: #07070d;
  --space-2: #101024;
  --red: #d2202f;
  --silver-1: #e8ebef;
  --silver-2: #aeb4bd;
  --silver-3: #6d7480;
  --tt-yellow: #ffff00;
  --tt-cyan: #00ffff;
  --tt-green: #00ff00;
  --tt-blue: #0000c8;
  --display: "Archivo Black", "Archivo", sans-serif;
  --body: "Archivo", sans-serif;
  --tele: "VT323", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }
.muted { color: var(--silver-3); font-weight: 400; }

sup { font-size: 0.55em; line-height: 0; }
sup a { color: inherit; opacity: 0.55; text-decoration: none; }
sup a:hover { opacity: 1; text-decoration: underline; }

/* ── Teletext ticker ─────────────────────────────────────────── */
.ticker {
  background: var(--tt-blue);
  color: var(--tt-yellow);
  font-family: var(--tele);
  font-size: 22px;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 3px solid var(--ink);
}
.ticker-track { display: inline-flex; animation: tick 42s linear infinite; padding: 4px 0; }
.ticker-track span { padding-right: 2em; }
.ticker sup a { color: var(--tt-cyan); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker { white-space: normal; }
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: radial-gradient(ellipse 120% 90% at 50% -10%, var(--space-2) 0%, var(--space) 70%);
  color: var(--silver-1);
  overflow: hidden;
  border-bottom: 6px solid var(--red);
}
.stars, .stars::before, .stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent),
    radial-gradient(1px 1px at 34% 68%, #ffffffb0, transparent),
    radial-gradient(2px 2px at 57% 12%, #fff, transparent),
    radial-gradient(1px 1px at 71% 44%, #ffffff90, transparent),
    radial-gradient(1.5px 1.5px at 88% 74%, #fff, transparent),
    radial-gradient(1px 1px at 22% 88%, #ffffffa0, transparent),
    radial-gradient(1.5px 1.5px at 44% 36%, #ffffffc0, transparent),
    radial-gradient(1px 1px at 92% 26%, #fff, transparent),
    radial-gradient(1px 1px at 6% 56%, #ffffff80, transparent),
    radial-gradient(1.5px 1.5px at 66% 90%, #ffffffb0, transparent);
}
.stars::before { transform: scale(1.7) rotate(40deg); opacity: 0.6; animation: twinkle 5s ease-in-out infinite alternate; }
.stars::after { transform: scale(2.6) rotate(110deg); opacity: 0.35; animation: twinkle 7s ease-in-out infinite alternate-reverse; }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.7; } }

.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 84px 24px 96px;
  text-align: center;
}
.hero-kicker {
  font-family: var(--tele);
  font-size: 21px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tt-cyan);
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 0.7s 0.1s ease-out forwards;
}
.hero-title { line-height: 0.92; margin-bottom: 30px; }
.hero-title span { display: block; font-family: var(--display); letter-spacing: 0.01em; }
.line-sm {
  font-size: clamp(28px, 4.5vw, 52px);
  color: var(--red);
  -webkit-text-stroke: 0;
  opacity: 0;
  animation: rise 0.7s 0.25s ease-out forwards;
}
.line-lg {
  font-size: clamp(64px, 13vw, 168px);
  opacity: 0;
  animation: rise 0.7s 0.4s ease-out forwards;
}
.line-lg.chrome {
  background: linear-gradient(180deg, #fdfdfd 0%, #c8cdd4 35%, #71787f 50%, #dfe3e8 62%, #999fa8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #0e0e12) drop-shadow(0 8px 18px rgba(0,0,0,0.6));
  animation-delay: 0.55s;
}
.hero-slogan {
  font-family: var(--tele);
  font-size: clamp(22px, 3vw, 32px);
  color: var(--tt-yellow);
  letter-spacing: 0.06em;
  margin-bottom: 44px;
  opacity: 0;
  animation: rise 0.7s 0.75s ease-out forwards;
}
.hero-quote {
  max-width: 620px;
  margin: 0 auto;
  border: 1px solid var(--silver-3);
  background: rgba(255,255,255,0.04);
  padding: 26px 30px;
  opacity: 0;
  animation: rise 0.7s 0.9s ease-out forwards;
}
.hero-quote p { font-size: 20px; font-weight: 500; font-style: italic; margin-bottom: 10px; }
.hero-quote cite { font-style: normal; font-size: 14px; color: var(--silver-2); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* CSS rosette */
.rosette {
  position: absolute;
  top: 40px;
  right: 6%;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  background:
    repeating-conic-gradient(from 0deg, var(--silver-2) 0deg 12deg, var(--silver-1) 12deg 24deg);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55), inset 0 0 0 8px var(--space);
  transform: rotate(-8deg);
  animation: rise 0.7s 1.1s ease-out forwards;
  opacity: 0;
}
.rosette span {
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 3px #ffffff30;
}
.rosette::after {
  content: "";
  position: absolute;
  bottom: -46px;
  left: 50%;
  width: 14px;
  height: 56px;
  background: linear-gradient(180deg, var(--silver-1), var(--silver-3));
  transform: translateX(-50%) skewX(-6deg);
  clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
}
@media (max-width: 900px) { .rosette { display: none; } }

/* ── Sections ────────────────────────────────────────────────── */
.section { padding: 84px 0; }
.section.paper { background: var(--paper); }
.section.paper:nth-of-type(odd) { background: var(--paper-deep); }
.section.dark { background: var(--ink); color: var(--paper); }

.sec-head {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 46px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
  position: relative;
  padding-left: 22px;
}
.sec-head::before {
  content: "";
  position: absolute;
  left: 0; top: 0.12em; bottom: 0.12em;
  width: 8px;
  background: var(--red);
}
.head-note { font-family: var(--body); font-size: 0.42em; font-weight: 500; color: var(--silver-3); letter-spacing: 0.02em; text-transform: none; }
.sec-lede { max-width: 760px; font-size: 18px; margin-bottom: 18px; }

/* ── Ballot paper ────────────────────────────────────────────── */
.ballot-paper {
  margin-top: 44px;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  max-width: 720px;
}
.ballot-head {
  border-bottom: 2px solid var(--ink);
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 15px;
}
.ballot-note { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--silver-3); }
.ballot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--ink);
}
.cand-name { display: block; font-family: var(--display); font-size: 22px; letter-spacing: 0.02em; }
.cand-party { display: block; font-size: 14px; color: var(--silver-3); }
.ballot-box {
  flex: 0 0 auto;
  width: 58px;
  height: 44px;
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
}
.ballot-box.marked span {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  transform: rotate(-4deg);
  font-family: var(--body);
}
.ballot-foot { padding: 14px 22px; font-size: 13px; color: var(--silver-3); }

/* ── BINFAX (Ceefax) ─────────────────────────────────────────── */
.binfax { background: #0a0a0a; padding: 72px 0; }
.tt-screen {
  font-family: var(--tele);
  background: #000;
  color: #fff;
  max-width: 780px;
  margin: 0 auto;
  padding: 26px 30px 30px;
  font-size: 23px;
  line-height: 1.35;
  border-radius: 10px;
  box-shadow: 0 0 0 10px #1a1a1a, 0 0 0 12px #333, 0 24px 60px rgba(0,0,0,0.8), inset 0 0 80px rgba(0,0,0,0.55);
  position: relative;
  overflow: hidden;
}
.tt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 3px);
}
.tt-bar { display: flex; justify-content: space-between; gap: 12px; color: #fff; margin-bottom: 4px; }
.tt-p { color: var(--tt-green); }
.tt-title { color: #fff; background: var(--red); padding: 0 10px; }
.tt-date { color: var(--tt-cyan); }
.tt-head {
  font-family: var(--tele);
  font-weight: 400;
  font-size: 40px;
  color: var(--tt-yellow);
  background: var(--tt-blue);
  display: inline-block;
  padding: 0 12px;
  margin: 10px 0 18px;
  letter-spacing: 0.02em;
}
.tt-list { list-style: none; display: grid; gap: 14px; }
.tt-list li { color: #e6e6e6; }
.tt-y { color: var(--tt-yellow); padding-right: 8px; }
.tt-c { color: var(--tt-cyan); padding-right: 8px; }
.tt-list sup a { color: var(--tt-green); opacity: 0.9; }
.tt-foot { margin-top: 22px; color: var(--tt-green); }

@media (max-width: 480px) {
  .tt-screen { font-size: 18px; padding: 20px 18px 24px; }
  .tt-head { font-size: 26px; }
  .tt-bar { font-size: 17px; }
  .line-lg { font-size: clamp(52px, 15.5vw, 168px); }
}

/* ── Lore grid ───────────────────────────────────────────────── */
.lore-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.lore-card {
  background: #fff;
  border: 2px solid var(--ink);
  padding: 24px 24px 26px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lore-card:nth-child(odd) { transform: rotate(-0.5deg); }
.lore-card:nth-child(even) { transform: rotate(0.4deg); }
.lore-card:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 6px 6px 0 var(--ink); }
.lore-card h3 {
  font-family: var(--display);
  font-size: 19px;
  margin-bottom: 10px;
  text-transform: uppercase;
  border-bottom: 3px solid var(--red);
  display: inline-block;
  padding-bottom: 4px;
}
.lore-card p { font-size: 15.5px; }

/* ── Record table ────────────────────────────────────────────── */
.record-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 36px;
  font-size: 16px;
}
.record-table th {
  font-family: var(--display);
  text-transform: uppercase;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--silver-2);
  border-bottom: 2px solid var(--silver-3);
  padding: 10px 14px;
}
.record-table td { padding: 13px 14px; border-bottom: 1px solid #2c2c34; vertical-align: top; }
.record-table .num {
  font-family: var(--display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.record-table tr.next { background: linear-gradient(90deg, #d2202f22, transparent 70%); }
.record-table tr.next td { border-bottom: none; }
.record-table tr.next .num { color: var(--red); }
.record-note { margin-top: 18px; font-size: 13px; color: var(--silver-2); }
@media (max-width: 640px) {
  .record-table { display: block; overflow-x: auto; font-size: 14px; }
  .record-table td, .record-table th { padding: 9px 8px; }
  .record-table .num { font-size: 16px; }
}

/* ── Policies ────────────────────────────────────────────────── */
.policy-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}
.policy {
  background: #fff;
  border: 2px solid var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.pnum {
  font-family: var(--tele);
  font-size: 26px;
  color: var(--red);
}
.policy h3 { font-family: var(--display); font-size: 19px; text-transform: uppercase; line-height: 1.15; }
.policy p { font-size: 15px; flex: 1; }
.ptag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
}
.ptag.done { background: var(--tt-green); color: #063; color: #033d13; }
.ptag.serious { background: var(--red); color: #fff; }

/* ── Serious bit ─────────────────────────────────────────────── */
.serious-bit { border-top: 6px solid var(--red); text-align: left; }
.serious-bit p { margin-bottom: 18px; font-size: 18px; }
.serious-bit a { color: var(--tt-cyan); }
.vote-line { font-size: 22px; }
.cta {
  display: inline-block;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 18px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  padding: 16px 28px;
  margin-top: 8px;
  box-shadow: 6px 6px 0 rgba(255,255,255,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 rgba(255,255,255,0.2); }

/* ── Help grid ───────────────────────────────────────────────── */
.help-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.help-card {
  display: block;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.help-card:hover { transform: translateY(-4px); box-shadow: 6px 6px 0 var(--ink); }
.help-card h3 { font-family: var(--display); font-size: 17px; text-transform: uppercase; margin-bottom: 8px; }
.help-card p { font-size: 14px; color: #3a3a42; }

/* ── Sources ─────────────────────────────────────────────────── */
.sources { background: var(--paper-deep); border-top: 2px solid var(--ink); }
.src-list { margin: 26px 0 0 22px; display: grid; gap: 8px; font-size: 14.5px; }
.src-list a { color: var(--ink); }
.src-list li:target { background: #ffe9a8; outline: 6px solid #ffe9a8; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--space);
  color: var(--silver-2);
  padding: 48px 0 56px;
  font-size: 14px;
  border-top: 6px solid var(--red);
}
.footer p { margin-bottom: 12px; max-width: 820px; }
.footer a { color: var(--silver-1); }
.foot-small { font-size: 12.5px; }
