/* ActiveCivic — a well-made public notice: calm type, one ballot-blue accent,
   highlighter yellow reserved for "explain". Motion lives in the globe and the
   runway carousel only. */
:root {
  --paper: #f7f8fa; --panel: #ffffff; --ink: #14213d; --muted: #55607a; --rule: #d9dde6;
  --ballot: #1d4ed8; --ballot-ink: #ffffff; --ballot-soft: #e5ecff; --mark: #ffe58a; --mark-ink: #14213d;
  --yes: #15803d; --no: #b91c1c; --away: #8a93a8; --warn: #b45309;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --runway: #14213d; --hl: #ffe58a;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(20 33 61 / 6%), 0 8px 24px rgb(20 33 61 / 8%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1322; --panel: #141c2f; --ink: #e6eaf3; --muted: #9aa5bd; --rule: #26304a;
    --ballot: #7aa2ff; --ballot-ink: #0d1322; --ballot-soft: #1b2849; --mark: #f5d55f; --mark-ink: #14213d;
    --yes: #4ade80; --no: #f87171; --away: #6b7591; --warn: #fbbf24;
    --runway: #070b16; --hl: rgb(245 213 95 / 38%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); }
body.text-lg { font-size: 18.5px; }
img { max-width: 100%; display: block; }
a { color: var(--ballot); }
:focus-visible { outline: 2px solid var(--ballot); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.narrow { max-width: 760px; }
.mono { font-family: var(--mono); font-size: .8rem; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--panel); padding: 8px 12px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; }
.brand .mark::after { content: ""; position: absolute; inset: 6px 5px 5px; border: 2.5px solid var(--mark); border-top: 0; border-left-color: transparent; transform: rotate(-45deg) translate(1px, -2px); border-radius: 1px; }
.brand .city { font-family: var(--mono); font-weight: 500; font-size: .72rem; color: var(--muted); border: 1px solid var(--rule); padding: 1px 7px; border-radius: 99px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
nav a[aria-current="page"], nav a:hover { color: var(--ink); background: var(--ballot-soft); }

main { min-height: 70vh; outline: none; }
.footer { border-top: 1px solid var(--rule); margin-top: 64px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px 40px; color: var(--muted); font-size: .9rem; }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem var(--sans); padding: 10px 18px; border-radius: 99px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ballot); }
.btn-primary { background: var(--ballot); border-color: var(--ballot); color: var(--ballot-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-mark { background: var(--mark); border-color: var(--mark); color: var(--mark-ink); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem var(--mono); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--rule); color: var(--muted); white-space: nowrap; background: var(--panel); }
.chip.topic { color: var(--ink); background: var(--ballot-soft); border-color: transparent; }
.chip.rung { border-style: dashed; }
.chip.yes { color: var(--yes); border-color: currentColor; }
.chip.no { color: var(--no); border-color: currentColor; }
.chip.away, .chip.abstain { color: var(--away); border-color: currentColor; }
.chip.draft { color: var(--warn); border-color: currentColor; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Landing */
.hero { position: relative; overflow: hidden; padding-block: 40px 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; }
.hero h1 mark { background: linear-gradient(transparent 58%, var(--hl) 58%); color: inherit; padding: 0 .05em; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin-top: 16px; }
.hero .row { margin-top: 24px; }
.stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stats span { font-size: .82rem; color: var(--muted); }

.globe-stage { position: relative; height: min(560px, 92vw); perspective: 1400px; display: grid; place-items: center; touch-action: pan-y; cursor: grab; user-select: none; }
.globe-stage:active { cursor: grabbing; }
.globe { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.tile { position: absolute; width: var(--tw); height: calc(var(--tw) * .75); left: calc(var(--tw) / -2); top: calc(var(--tw) * -.375); border-radius: 10px; overflow: hidden; backface-visibility: hidden; box-shadow: 0 6px 18px rgb(20 33 61 / 18%); transition: filter .2s; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover { filter: brightness(1.08); }
.tile-label { position: absolute; left: 6px; right: 6px; bottom: 6px; font: 500 .62rem/1.3 var(--mono); background: rgb(13 19 34 / 78%); color: #fff; padding: 4px 6px; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-label, .tile:focus-visible .tile-label { opacity: 1; }
.globe-hint { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; }
.globe-controls { position: absolute; top: 8px; right: 8px; }

.lifted { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.lifted .card { animation: lift .7s cubic-bezier(.2, .8, .2, 1) both; }
.lifted .card:nth-child(2) { animation-delay: .12s; }
.lifted .card:nth-child(3) { animation-delay: .24s; }
@keyframes lift { from { transform: translateY(24px); opacity: .001; } to { transform: none; opacity: 1; } }

.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 56px; }
.how h3 { font-size: 1.05rem; margin-bottom: 6px; }
.how p { color: var(--muted); font-size: .95rem; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--ballot); box-shadow: var(--shadow); }
.card h3 { font-size: 1.02rem; font-weight: 700; }
.card .facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .82rem; color: var(--muted); }
.card .facts b { color: var(--ink); font-weight: 600; }
.why { font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--rule); padding-top: 8px; }
.why strong { color: var(--ink); font-weight: 600; }
.card-thumb { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
.card-thumb img { width: 64px; height: 64px; border-radius: 8px; }

/* Onboarding */
.steps { display: flex; gap: 6px; margin-block: 24px 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--rule); }
.steps span.on { background: var(--ballot); }
.onb h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); letter-spacing: -.02em; }
.onb .hint { color: var(--muted); margin-top: 8px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.topic-tile { display: flex; flex-direction: column; gap: 8px; align-items: stretch; border: 2px solid var(--rule); border-radius: var(--radius); background: var(--panel); padding: 10px; cursor: pointer; font: 600 .92rem var(--sans); color: var(--ink); text-align: left; }
.topic-tile img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.topic-tile[aria-pressed="true"] { border-color: var(--ballot); background: var(--ballot-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; max-width: 420px; }
.field label { font-weight: 600; }
.field select, .field input { font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--ink); }
.onb-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* Feed */
.page-head { padding-block: 32px 16px; display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -.02em; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-block: 32px 12px; }
.section-title h2 { font-size: 1.15rem; }
.runway { position: relative; background: var(--runway); color: #f2f5fb; border: 1px solid var(--rule); border-radius: 16px; padding: 22px; overflow: hidden; }
.runway-track { display: flex; gap: 16px; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.runway-slide { flex: 0 0 min(560px, 86%); background: var(--panel); color: var(--ink); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; opacity: .55; transform: scale(.96); transition: opacity .4s, transform .4s; text-decoration: none; min-width: 0; }
.runway-slide.active { opacity: 1; transform: none; }
.runway-slide h3 { font-size: 1.15rem; }
.runway-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.runway-bar .eyebrow { color: #c9d2e8; }
.runway-dots { display: flex; gap: 6px; }
.runway-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: rgb(255 255 255 / 30%); padding: 0; cursor: pointer; }
.runway-dots button[aria-current="true"] { background: var(--mark); width: 22px; }
.runway .btn { background: transparent; color: #f2f5fb; border-color: rgb(255 255 255 / 30%); }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.meetings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.meeting { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; background: var(--panel); font-size: .9rem; }
.meeting b { display: block; }
.empty { border: 1px dashed var(--rule); border-radius: var(--radius); padding: 24px; color: var(--muted); text-align: center; }

/* Item page */
.item-head { padding-block: 28px 8px; display: flex; flex-direction: column; gap: 12px; }
.item-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.keyfacts div { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.keyfacts span { font: 500 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.keyfacts b { font-size: .98rem; overflow-wrap: anywhere; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 24px; align-items: start; }
.story { display: flex; flex-direction: column; gap: 16px; }
.story-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.story-card h2 { font-size: 1.1rem; }
.story-card .src { font-size: .78rem; color: var(--muted); }
.quote { border-left: 3px solid var(--rule); padding-left: 14px; font-size: .98rem; }
.quote p + p { margin-top: 10px; }
.quote.selectable ::selection, .quote.selectable::selection { background: var(--mark); color: var(--mark-ink); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--ballot); margin-top: 7px; }
.timeline .vote-names { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.timeline .vote-names b { color: var(--ink); font-weight: 600; }
.aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.aside .card h3 { font-size: .95rem; }
.explain-pop { position: absolute; z-index: 40; }
.explain-panel { background: var(--panel); border: 1px solid var(--mark); border-left: 4px solid var(--mark); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.explain-panel .label { font: 500 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.explain-panel blockquote { margin: 0; font-style: italic; color: var(--muted); font-size: .9rem; }
.perspectives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perspectives > div { border: 1px dashed var(--rule); border-radius: 8px; padding: 12px; color: var(--muted); font-size: .9rem; }

/* Reps */
.rep-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.rep-card { flex: 0 0 180px; scroll-snap-align: start; border: 2px solid var(--rule); background: var(--panel); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.rep-card[aria-pressed="true"] { border-color: var(--ballot); background: var(--ballot-soft); }
.rep-card .initials { width: 44px; height: 44px; border-radius: 99px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; }
.rep-card b { font-size: .95rem; line-height: 1.25; }
.rep-card span { font-size: .78rem; color: var(--muted); }
.rep-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.rep-stats div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.rep-stats b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.rep-stats span { font-size: .8rem; color: var(--muted); }
.vote-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.vote-table th, .vote-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.vote-table th { font: 500 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.scroll-x { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); }
.note { background: var(--ballot-soft); border-radius: 8px; padding: 10px 14px; font-size: .9rem; }

.prose { display: flex; flex-direction: column; gap: 14px; max-width: 68ch; }
.prose h2 { font-size: 1.2rem; margin-top: 16px; }

@media (max-width: 860px) {
  .hero-grid, .layout { grid-template-columns: minmax(0, 1fr); }
  .globe-stage { height: min(440px, 96vw); }
  .lifted, .how { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .perspectives { grid-template-columns: minmax(0, 1fr); }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .topic-tile { font-size: .8rem; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
