/* The Ballot — public website. No external scripts or images, and the one
   font file is self-hosted (fonts/manrope.woff2), not loaded from a CDN.
   Deliberately plain: neutral colours, no gradients, no icons, no decoration. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/site/fonts/manrope.woff2") format("woff2");
}
:root {
  --ink: #17191d;
  --muted: #5e636c;
  --faint: #8a8f97;
  --bg: #fbfbf9;
  --alt: #f2f2ef;
  --card: #ffffff;
  --line: #e2e2dd;
  --hover-line: #c9c9c2;
  --blue: #2457c5;              /* links only */
  --blue-soft: #eef2fa;
  --accent-ink: #17191d;
  --btn-bg: #17191d;
  --btn-bg-hover: #000000;
  --btn-ink: #ffffff;
  --nav-bg: #fbfbf9;
  --field-bg: #ffffff;
  --field-line: #cfcfc8;
  --green: #15803d;
  --ok-bg: #f0f7f2; --ok-bg-hover: #e6f2ea; --ok-ink: #14532d; --ok-line: #cfe4d6;
  --warn-bg: #fbf6e9; --warn-ink: #6b4f00; --warn-line: #eadfbf;
  --err-bg: #fbf0f1; --err-ink: #8a1230; --err-line: #efc9d0;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: none;
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .08);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Dark theme: follows the device setting, unless the visitor picked one with
   the switch in the top bar (theme.js stores it as data-theme on <html>). The
   two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ebebe7; --muted: #a3a7ae; --faint: #7d828a; --bg: #121315; --alt: #191a1d; --card: #1a1c1f;
    --line: #2d2f34; --hover-line: #44474e; --blue: #93b4ee; --blue-soft: #1c2433; --accent-ink: #ebebe7;
    --btn-bg: #ebebe7; --btn-bg-hover: #ffffff; --btn-ink: #121315; --nav-bg: #121315;
    --field-bg: #191a1d; --field-line: #3a3d43; --green: #4ade80;
    --ok-bg: #12241a; --ok-bg-hover: #163021; --ok-ink: #9be3b3; --ok-line: #24442f;
    --warn-bg: #2a2412; --warn-ink: #f0d58c; --warn-line: #4d4220;
    --err-bg: #2f161c; --err-ink: #ffb8c5; --err-line: #5a2632;
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ebebe7; --muted: #a3a7ae; --faint: #7d828a; --bg: #121315; --alt: #191a1d; --card: #1a1c1f;
  --line: #2d2f34; --hover-line: #44474e; --blue: #93b4ee; --blue-soft: #1c2433; --accent-ink: #ebebe7;
  --btn-bg: #ebebe7; --btn-bg-hover: #ffffff; --btn-ink: #121315; --nav-bg: #121315;
  --field-bg: #191a1d; --field-line: #3a3d43; --green: #4ade80;
  --ok-bg: #12241a; --ok-bg-hover: #163021; --ok-ink: #9be3b3; --ok-line: #24442f;
  --warn-bg: #2a2412; --warn-ink: #f0d58c; --warn-line: #4d4220;
  --err-bg: #2f161c; --err-ink: #ffb8c5; --err-line: #5a2632;
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1040px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-sm); z-index: 100; border: 1px solid var(--line); }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.btn-primary, .btn-small { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover, .btn-small:hover { background: var(--btn-bg-hover); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-ghost, .btn-link { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover, .btn-link:hover { border-color: var(--hover-line); background: var(--alt); }
.btn-link { width: 100%; }

/* ---------- top bar ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; height: 60px; gap: 18px; }
.nav-inner > .brand { margin-right: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: #fff; border: 1px solid var(--line); flex: none; }
.brand-mark img { width: 26px; height: 26px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-toggle, .theme-toggle { flex: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.nav-toggle:hover, .theme-toggle:hover { color: var(--ink); border-color: var(--hover-line); }
.nav-toggle { display: none; }
.nav-inner .theme-toggle { order: 2; }
.nav-inner .nav-toggle { order: 3; }

/* ---------- opening ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
/* the ballot logo, very faint, behind the right side of the opening */
.hero-watermark { position: absolute; top: 50%; right: max(-60px, calc((100% - 1040px) / 2 - 60px)); width: 460px; max-width: 70vw; transform: translateY(-50%); opacity: .06; pointer-events: none; user-select: none; z-index: 0; }
:root[data-theme="dark"] .hero-watermark { filter: invert(1); opacity: .07; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-watermark { filter: invert(1); opacity: .07; }
}
.hero .wrap { position: relative; z-index: 1; }
.hero-inner { padding: 88px 0 72px; max-width: 760px; }
.btn-red { background: #e11d48; color: #fff; }
.btn-red:hover { background: #c81440; }
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -.02em; line-height: 1.12; }
.lead { font-size: clamp(17px, 1.7vw, 19px); color: var(--muted); max-width: 36em; margin: 20px 0 30px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hero-cta a:not(.btn) { color: var(--ink); font-weight: 600; }

/* ---------- sections ---------- */
.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 0 32px; }
.section-head h2 { font-size: clamp(24px, 2.8vw, 30px); }
.section-head p { color: var(--muted); margin: 10px 0 0; }

/* how an election runs: a plain numbered list */
.how { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.how li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 6px 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.how li:last-child { border-bottom: 1px solid var(--line); }
.how li::before { content: counter(step) "."; color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.how li b { display: block; }
.how li span { color: var(--muted); grid-column: 2; }
.how h3 { font-size: 18px; margin-bottom: 10px; }
.how-side p { color: var(--muted); }
.how-side .btn { margin-top: 6px; }

/* ---------- live elections ---------- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.live-empty { grid-column: 1 / -1; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px 20px; margin: 0; }
.elec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.elec-top { display: flex; align-items: center; gap: 12px; }
.elec-logo { flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.elec-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.elec-logo.mono { background: var(--alt); color: var(--ink); font-weight: 700; font-size: 16px; }
.elec h3 { font-size: 17px; }
.elec-org { color: var(--muted); font-size: 14px; margin-top: 1px; }
.badge { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--muted); }
.badge.open { color: var(--ok-ink); }
.badge.open::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.badge.upcoming { color: var(--warn-ink); }
.meter { height: 6px; border-radius: 99px; background: var(--alt); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.elec-stats { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.elec-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- registration on-going (row on a card, and its own page) ---------- */
.reg-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.reg-btn:hover { border-color: var(--hover-line); background: var(--alt); }
.reg-btn:focus-visible, .reg-back:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.reg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: reg-pulse 1.6s ease-in-out infinite; }
@keyframes reg-pulse { 50% { opacity: .35; } }
.reg-open { margin-left: auto; color: var(--blue); font-weight: 600; text-decoration: underline; }

.reg-back { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.reg-back:hover { color: var(--ink); }
.reg-page { max-width: 760px; padding-top: 44px; padding-bottom: 72px; }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ok-ink); font-size: 14px; font-weight: 600; }
.reg-page h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; }
.reg-org { color: var(--muted); font-size: 16px; margin: 6px 0 26px; }
.reg-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.reg-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 10px; text-align: center; }
.reg-tile b { display: block; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.reg-tile span { color: var(--muted); font-size: 14px; }
.reg-table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.reg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.reg-table th, .reg-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.reg-table tbody tr:last-child th, .reg-table tbody tr:last-child td { border-bottom: 0; }
.reg-table thead th { color: var(--muted); font-size: 13px; font-weight: 600; text-align: right; }
.reg-table thead th:first-child, .reg-table tbody th { text-align: left; }
.reg-table tbody th { font-weight: 600; }
.reg-table td { text-align: right; font-variant-numeric: tabular-nums; }
.reg-table td:last-child { font-weight: 700; }
.reg-note { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ---------- before you use it ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about h2 { font-size: clamp(24px, 2.8vw, 30px); margin-bottom: 14px; }
.about p { color: var(--muted); }
.about p b { color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); }
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts li b { color: var(--ink); }

/* ---------- footer ---------- */
.footer { padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- "coming soon" ---------- */
body.offline { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.soon { max-width: 30em; }
.soon-logo { width: 56px; height: 56px; margin: 0 0 24px; border-radius: 10px; background: #fff; display: grid; place-items: center; border: 1px solid var(--line); }
.soon-logo img { width: 44px; height: 44px; object-fit: contain; }
.soon h1 { font-size: clamp(28px, 5vw, 38px); }
.soon-tag { font-size: 18px; font-weight: 600; color: var(--ink); margin: 14px 0 8px; }
.soon-note { color: var(--muted); margin: 0; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero-inner { padding: 56px 0 48px; }
  .section { padding: 48px 0; }
  .how, .about { grid-template-columns: 1fr; gap: 32px; }
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 60px; left: 0; right: 0; background: var(--nav-bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 18px; display: none; }
  .nav.nav-open .nav-links { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav-links .btn { margin-top: 14px; }
}
@media (max-width: 480px) {
  .reg-page { padding-top: 28px; }
  .reg-tiles { gap: 8px; }
  .reg-tile { padding: 14px 6px; }
  .reg-tile b { font-size: 22px; }
  .reg-table { font-size: 14px; }
  .reg-table th, .reg-table td { padding: 11px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .reg-dot { animation: none; }
}

/* Shown only on an administrator's preview of the site */
.preview-bar { background: #fde68a; color: #4a3200; text-align: center; font-weight: 700; font-size: 14px; padding: 9px 16px; border-bottom: 1px solid #e0b93a; }
.how-title { font-size: clamp(24px, 2.8vw, 30px); margin-bottom: 20px; }
.reg-location { margin: -14px 0 24px; font-size: 16px; }
.reg-rule { margin: 18px 0 0; font-size: 16px; font-weight: 700; }
