:root {
    --bg: #0b1020;
    --bg-soft: #111733;
    --panel: rgba(255, 255, 255, 0.04);
    --panel-border: rgba(255, 255, 255, 0.10);
    --text: #e7ecff;
    --muted: #97a0c7;
    --accent: #38e1ff;
    --accent-2: #7c5cff;
    --legal: #34e0a1;
    --illegal: #ff5d73;
    --radius: 18px;
    --maxw: 1080px;
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, .display {
    font-family: "Space Grotesk", "Inter", sans-serif;
    line-height: 1.1;
    margin: 0;
    font-weight: 600;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Background ambience ---------- */
.glow {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 50% at 15% 0%, rgba(124, 92, 255, 0.25), transparent 60%),
        radial-gradient(55% 50% at 95% 10%, rgba(56, 225, 255, 0.18), transparent 60%),
        radial-gradient(80% 60% at 50% 110%, rgba(124, 92, 255, 0.14), transparent 60%);
}
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
}

/* ---------- Nav ---------- */
header.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(11, 16, 32, 0.6);
    border-bottom: 1px solid var(--panel-border);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: var(--text);
    font-size: 17px;
}
.brand:hover { text-decoration: none; }
.nav-cta {
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    color: var(--text);
    background: var(--panel);
    transition: transform .15s ease, border-color .15s ease;
}
.nav-cta:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 70px; position: relative; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--panel-border);
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--panel);
    margin-bottom: 26px;
}
.eyebrow .pulse {
    width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 0 rgba(56,225,255,.6);
    animation: pulse 2.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(56,225,255,.5); }
    70% { box-shadow: 0 0 0 12px rgba(56,225,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(56,225,255,0); }
}
.hero h1 {
    font-size: clamp(38px, 7vw, 76px);
    font-weight: 700;
    letter-spacing: -1.5px;
    max-width: 16ch;
}
.hero h1 .grad {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead {
    color: var(--muted);
    font-size: clamp(16px, 2vw, 19px);
    max-width: 62ch;
    margin: 26px 0 0;
}
.hero p.lead + p.lead { margin-top: 16px; }
.hero-actions { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 26px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
    color: #06121a;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 40px -14px rgba(56, 225, 255, 0.7);
}
.btn-ghost {
    color: var(--text);
    background: var(--panel);
    border-color: var(--panel-border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-title {
    font-size: clamp(26px, 4vw, 40px);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-sub { color: var(--muted); margin: 0 0 36px; max-width: 60ch; }

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Results ---------- */
.results-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 1.4fr;
    gap: 22px;
    align-items: stretch;
}
.tally { padding: 30px; display: flex; gap: 26px; align-items: center; }
.donut {
    --legal-pct: 0;
    width: 168px; height: 168px; flex: 0 0 168px;
    border-radius: 50%;
    background: conic-gradient(
        var(--legal) 0 calc(var(--legal-pct) * 1%),
        var(--illegal) calc(var(--legal-pct) * 1%) 100%
    );
    display: grid; place-items: center;
    position: relative;
    transition: background .8s cubic-bezier(.2,.8,.2,1);
}
.donut::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: var(--bg-soft);
    box-shadow: inset 0 0 30px rgba(0,0,0,.5);
}
.donut .center {
    position: relative; z-index: 2; text-align: center;
}
.donut .center .num {
    font-family: "Space Grotesk", sans-serif;
    font-size: 30px; font-weight: 700; line-height: 1;
}
.donut .center .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.legend { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legend-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.swatch { width: 12px; height: 12px; border-radius: 4px; }
.swatch.legal { background: var(--legal); box-shadow: 0 0 14px rgba(52,224,161,.5); }
.swatch.illegal { background: var(--illegal); box-shadow: 0 0 14px rgba(255,93,115,.5); }
.legend-val { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 20px; }
.legend-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 6px; }
.legend-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.legend-bar.legal > span { background: var(--legal); }
.legend-bar.illegal > span { background: var(--illegal); }
.total-votes { margin-top: 4px; font-size: 13px; color: var(--muted); }

.quotes { display: grid; grid-template-rows: 1fr 1fr; gap: 22px; }
blockquote {
    margin: 0;
    padding: 26px 28px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}
blockquote p { margin: 0; font-size: 18px; font-weight: 500; font-family: "Space Grotesk", sans-serif; }
blockquote .stat { color: var(--accent); }
blockquote cite { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); font-style: normal; }

/* ---------- Vote form ---------- */
.vote-card { padding: 34px; max-width: 640px; margin: 0 auto; }
.choice {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 22px;
}
.choice button {
    font-family: "Space Grotesk", sans-serif;
    font-size: 16px; font-weight: 600;
    padding: 18px; border-radius: 14px; cursor: pointer;
    background: rgba(255,255,255,.03);
    border: 1.5px solid var(--panel-border);
    color: var(--text);
    transition: all .15s ease;
}
.choice button .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.choice button:hover { transform: translateY(-2px); }
.choice button[aria-pressed="true"].illegal { border-color: var(--illegal); background: rgba(255,93,115,.12); box-shadow: 0 0 0 3px rgba(255,93,115,.12); }
.choice button[aria-pressed="true"].legal { border-color: var(--legal); background: rgba(52,224,161,.12); box-shadow: 0 0 0 3px rgba(52,224,161,.12); }

label.field { display: block; margin-bottom: 16px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; letter-spacing: .3px; }
input[type="text"], textarea {
    width: 100%;
    font-family: inherit; font-size: 15px;
    color: var(--text);
    background: rgba(255,255,255,.03);
    border: 1.5px solid var(--panel-border);
    border-radius: 12px;
    padding: 13px 15px;
    resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,225,255,.15);
}
.cf-turnstile { margin-bottom: 18px; }
.vote-submit { width: 100%; margin-top: 6px; }
.thanks { text-align: center; padding: 20px 0; }
.thanks h3 { font-size: 24px; margin-bottom: 8px; }
.thanks p { color: var(--muted); margin: 0 0 18px; }

/* ---------- Comments ---------- */
.comments { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.comment { padding: 22px 24px; }
.comment .tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
    padding: 5px 11px; border-radius: 999px; margin-bottom: 12px;
}
.comment .tag.illegal { color: var(--illegal); background: rgba(255,93,115,.12); }
.comment .tag.legal { color: var(--legal); background: rgba(52,224,161,.12); }
.comment p.msg { margin: 0 0 14px; font-size: 15.5px; }
.comment .meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.comment .meta .name { color: var(--text); font-weight: 600; }

/* ---------- Footer ---------- */
footer {
    border-top: 1px solid var(--panel-border);
    padding: 34px 0;
    color: var(--muted);
    font-size: 14px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 820px) {
    .results-grid { grid-template-columns: 1fr; }
    .tally { flex-direction: column; text-align: center; }
    .legend { width: 100%; }
}
@media (max-width: 480px) {
    .choice { grid-template-columns: 1fr; }
    .hero { padding: 60px 0 40px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
