/* Midterm Madness 2026 — site styles. Brand tokens come from tokens.css (Michael Cameron Personal Brand). */
:root {
  --party-r: #9e3b2f;
  --party-d: #2c5f93;
  --party-i: #3f4552;
  --white: #ffffff;
  --pad: clamp(20px, 3vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-page); color: var(--text-strong); font-family: var(--font-body); font-size: 17px; line-height: 1.55; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; display: block; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--mc-navy); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.label { font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-label); text-transform: uppercase; line-height: 1.4; }
.muted { color: var(--text-muted); }
.display { font-family: var(--font-display); font-weight: 400; line-height: var(--leading-display); letter-spacing: var(--tracking-display); margin: 0; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.08; margin: 0; }
.h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.08; margin: 0; }
.accent-italic { font-family: var(--font-text); font-style: italic; }
.small { font-size: 15px; }
.fine { font-size: 13px; line-height: 1.45; color: var(--text-muted); }

/* ---------- layout ---------- */
.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--pad); }
.rule-top { border-top: 1px solid var(--rule-strong); padding-top: 20px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface-panel); color: var(--text-on-navy); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-top: 12px; padding-bottom: 12px; }
.topbar a { color: var(--text-on-navy-muted); text-decoration: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 0; }
.topbar a:hover, .topbar a[aria-current="page"] { color: var(--text-on-navy); text-decoration: underline; }
.topbar .home { color: var(--text-on-navy); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border: 1px solid var(--mc-navy); border-radius: 0; background: var(--mc-navy); color: var(--mc-paper); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--mc-ink); border-color: var(--mc-ink); color: var(--mc-paper); }
.btn.secondary { background: transparent; color: var(--mc-navy); }
.btn.secondary:hover { background: var(--mc-navy); color: var(--mc-paper); }
.btn.ink { background: var(--mc-ink); border-color: var(--mc-ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--link); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.input { height: 48px; padding: 0 14px; border: 1px solid var(--text-body); border-radius: 0; background: var(--white); font-family: var(--font-body); font-size: 17px; color: var(--text-strong); width: 100%; }
.notice { padding: 12px 14px; border: 1px solid var(--rule-soft); background: var(--white); font-size: 15px; }
.notice.error { border-color: var(--party-r); color: var(--party-r); }
.notice.ok { border-color: var(--mc-navy); }

/* ---------- landing mosaic (scales as one unit) ---------- */
.mm-wrap { container-type: inline-size; width: 100%; }
.mm-mosaic { display: grid; width: 100%; aspect-ratio: 1920 / 1080; padding: 1.1cqw; gap: 1.1cqw; background: var(--mc-paper);
  grid-template-columns: 612fr 296fr 295fr 296fr 295fr; grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-areas: "cap title title title hall" "cap title title title scales" "cap voter pattern suit scales" "cap voter pattern suit ticks"; }
.mm-cell { position: relative; overflow: hidden; background: var(--mc-navy); min-width: 0; min-height: 0; }
.mm-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mm-cap { grid-area: cap; } .mm-title { grid-area: title; } .mm-hall { grid-area: hall; } .mm-scales { grid-area: scales; }
.mm-ticks { grid-area: ticks; } .mm-voter { grid-area: voter; } .mm-pattern { grid-area: pattern; } .mm-suit { grid-area: suit; }
.mm-title { display: flex; flex-direction: column; justify-content: center; gap: 1.2cqw; padding: 0 2.6cqw; color: var(--text-on-navy); }
.mm-eye { font-family: var(--font-mono); font-size: 1.55cqw; letter-spacing: .14em; text-transform: uppercase; }
.mm-h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 5.4cqw; line-height: 1.04; letter-spacing: -.01em; }
.mm-rule { height: 1px; background: var(--rule-on-navy); }
.mm-tag { margin: 0; font-family: var(--font-text); font-style: italic; font-size: 2.1cqw; line-height: 1.25; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; justify-content: space-between; }
.cta-row > :first-child { flex: 999 1 420px; min-width: 0; }
.cta-row > :last-child { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- ballot ---------- */
.progress { position: sticky; top: 0; z-index: 5; background: var(--surface-deep); color: var(--text-on-navy); }
.progress .inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--pad); max-width: 760px; margin: 0 auto; }
.progress .bar { flex: 0 1 200px; height: 6px; background: var(--mc-graphite); }
.progress .bar > span { display: block; height: 6px; background: var(--mc-pewter-light); width: 0; transition: width .2s; }
.chamber-head { padding-top: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { min-height: 40px; padding: 6px 12px; border: 1px solid var(--text-muted); background: transparent; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-strong); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--mc-ink); color: var(--mc-paper); border-color: var(--mc-ink); }
.race { padding: 14px 0 16px; border-bottom: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 8px; }
.race-top { display: flex; justify-content: space-between; gap: 8px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--text-muted); border-radius: 0; background: transparent; color: var(--text-strong); font-family: var(--font-body); font-size: 16px; line-height: 1.2; text-align: left; cursor: pointer; }
.side .tag { flex: 0 0 auto; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid currentColor; font-family: var(--font-mono); font-size: 12px; }
.side.r .tag { color: var(--party-r); } .side.d .tag { color: var(--party-d); } .side.i .tag { color: var(--party-i); }
.side[aria-pressed="true"].r { background: var(--party-r); border-color: var(--party-r); color: var(--mc-paper); }
.side[aria-pressed="true"].d { background: var(--party-d); border-color: var(--party-d); color: var(--mc-paper); }
.side[aria-pressed="true"].i { background: var(--party-i); border-color: var(--party-i); color: var(--mc-paper); }
.side[aria-pressed="true"] .tag { color: var(--mc-paper); }
.side[disabled] { cursor: default; }
.bet { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper button { width: 48px; height: 48px; border: 1px solid var(--text-strong); border-radius: 0; background: transparent; font-size: 22px; color: var(--text-strong); cursor: pointer; }
.big-r, .big-d { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.big-r { color: var(--party-r); } .big-d { color: var(--party-d); }
.big-r small, .big-d small { font-family: var(--font-mono); font-size: 12px; margin-left: 4px; }
.seat-input { width: 84px; height: 48px; text-align: center; border: 1px solid var(--rule-soft); background: var(--white); font-family: var(--font-display); font-size: 32px; color: var(--party-r); }
.tally { border: 1px solid var(--rule-soft); background: var(--white); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tally-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; font-size: 15px; }
.tally-grid .n { font-family: var(--font-display); font-size: 22px; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--mc-navy); }
.savebar { position: sticky; bottom: 0; z-index: 5; background: var(--mc-paper); border-top: 1px solid var(--rule-strong); }
.savebar .inner { max-width: 760px; margin: 0 auto; padding: 12px var(--pad); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.status { font-size: 14px; color: var(--text-muted); }

/* ---------- leaderboard ---------- */
.lb-grid { display: flex; flex-wrap: wrap; gap: 40px; }
.lb-main { flex: 999 1 560px; min-width: 0; }
.lb-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.scroll-x { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; padding: 8px 8px 12px; font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
table.data td { padding: 12px 8px; border-top: 1px solid var(--rule-soft); vertical-align: top; }
table.data .num { text-align: right; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
.name-cell { font-family: var(--font-display); font-size: 22px; line-height: 1.15; }
.navy-panel { background: var(--surface-panel); color: var(--text-on-navy); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.navy-panel .label { color: var(--text-on-navy-muted); }
.seatbar { display: flex; height: 28px; border: 1px solid var(--rule-on-navy); }
.seatbar span { display: block; height: 100%; }
.split { display: flex; height: 22px; min-width: 160px; }
.split span { display: flex; align-items: center; color: var(--mc-paper); font-family: var(--font-mono); font-size: 11px; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.split .d { background: var(--party-d); } .split .r { background: var(--party-r); justify-content: flex-end; }
.footer { margin-top: 72px; background: var(--surface-deep); color: var(--text-on-navy-muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; padding-top: 28px; padding-bottom: 28px; }
.footer a { color: var(--text-on-navy); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- admin ---------- */
.sugg { border: 1px solid var(--text-muted); background: var(--white); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.partybox { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--mc-paper); font-family: var(--font-mono); font-size: 12px; }
.partybox.r { background: var(--party-r); } .partybox.d { background: var(--party-d); } .partybox.i { background: var(--party-i); } .partybox.o { background: var(--mc-slate); }
.callrow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.callrow .who { flex: 1 1 auto; min-width: 0; }
.callbtn { width: 48px; height: 48px; border: 1px solid; border-radius: 0; background: transparent; font-family: var(--font-mono); font-size: 13px; cursor: pointer; }
.callbtn.r { border-color: var(--party-r); color: var(--party-r); } .callbtn.d { border-color: var(--party-d); color: var(--party-d); } .callbtn.i { border-color: var(--party-i); color: var(--party-i); }
.callbtn.o { border-color: var(--mc-slate); color: var(--mc-slate); }
.callbtn[aria-pressed="true"].r { background: var(--party-r); color: var(--mc-paper); }
.callbtn[aria-pressed="true"].d { background: var(--party-d); color: var(--mc-paper); }
.callbtn[aria-pressed="true"].i { background: var(--party-i); color: var(--mc-paper); }
.callbtn[aria-pressed="true"].o { background: var(--mc-slate); color: var(--mc-paper); }
.seg { display: flex; border: 1px solid var(--text-strong); }
.seg button { flex: 1 1 0; min-height: 44px; border: 0; border-left: 1px solid var(--text-strong); background: transparent; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-strong); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--mc-ink); color: var(--mc-paper); }

@media (max-width: 640px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hide-sm { display: none; }
  body { font-size: 16px; }
}
