:root {
    --bg: #0d0d0f;
    --bg-alt: #141416;
    --bg-card: #1a1a1e;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #00ffa3;
    --accent-hover: #00dd8a;
    --accent-dim: rgba(0, 255, 163, 0.1);
    --border: #2a2a2e;
    --radius: 6px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(13, 13, 15, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
    font-family: var(--mono);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-brand img, .nav-brand svg {
    width: 22px;
    height: 22px;
    display: block;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 32px 64px;
    background: radial-gradient(ellipse at 50% 30%, rgba(0,255,163,0.05) 0%, transparent 70%);
}

/* Quick-start code block */
.quickstart {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}

.quickstart-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.quickstart pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
}

.quickstart pre .comment { color: #555; }
.quickstart pre .string { color: var(--accent); }
.quickstart pre .flag { color: #888; }

.hero-content {
    text-align: center;
    max-width: 700px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 20px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0 0 36px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */
.section {
    padding: 80px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
    letter-spacing: -0.02em;
}

.section-sub {
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 48px;
    font-size: 1.05rem;
}

.section-dark {
    background: var(--bg-alt);
    max-width: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-dark .section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: border-color 0.2s, transform 0.15s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-icon {
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 10px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Template cards */
.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.template-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.template-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.template-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Angle cards */
.angle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
}

.angle-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--accent);
}

.angle-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.angle-card em {
    color: var(--text);
    font-style: normal;
    font-weight: 600;
}

.angle-card code {
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover { color: var(--accent); }

.footer-copy {
    color: #555;
    font-size: 0.8rem;
}

/* Demo poll widget */
.demo-poll {
    max-width: 600px;
    margin: 0 auto;
}

.demo-poll-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.demo-poll-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.demo-poll-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.demo-poll-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.demo-poll-choice {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    margin-bottom: 8px;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}

.demo-poll-choice:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.demo-poll-status {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.demo-poll-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.demo-poll-empty a {
    color: var(--accent);
    text-decoration: none;
}

/* Deploy code block */
.deploy-code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
    margin: 12px 0 0;
    overflow-x: auto;
    white-space: pre;
}

.deploy-code .comment { color: #555; }
.deploy-code .flag { color: #888; }
.deploy-code .string { color: var(--accent); }

/* Editor toolbar */
.editor-toolbar {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 0.8rem;
    font-family: var(--mono);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.toolbar-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.toolbar-btn.primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.toolbar-btn.primary:hover {
    background: var(--accent-hover);
}

/* Editor home link */
.editor-home {
    position: fixed;
    top: 12px;
    left: 60px;
    z-index: 1000;
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
    .grid-4 { grid-template-columns: 1fr; }
    .nav { padding: 12px 16px; }
    .section { padding: 48px 16px; }
    .hero { padding: 100px 16px 60px; }
}

/* Vote progress pills — four stages beneath the Cast Vote button so the
   user sees exactly where the ~10s proving flow is. Each stage goes:
   idle → active (spinning accent) → done (filled accent). */
.vote-progress {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.78rem;
}
.vote-stage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-card);
    transition: all 0.2s;
}
.vote-stage-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border);
    transition: background 0.2s, box-shadow 0.2s;
}
.vote-stage.active {
    color: var(--accent);
    border-color: var(--accent);
}
.vote-stage.active .vote-stage-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    animation: vote-pulse 1.2s ease-in-out infinite;
}
.vote-stage.done {
    color: var(--accent-hover);
    border-color: var(--accent-dim);
}
.vote-stage.done .vote-stage-dot {
    background: var(--accent-hover);
}
@keyframes vote-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
