:root,
[data-theme="dark"] {
    --bg-primary: hsl(240 6% 10%);
    --bg-secondary: hsl(240 4% 16%);
    --bg-card: hsl(240 6% 10%);
    --bg-card-hover: hsl(240 4% 16%);
    --bg-code: hsl(225 15% 12%);
    --text-primary: hsl(240 5% 93%);
    --text-secondary: hsl(240 5% 65%);
    --text-muted: hsl(240 5% 40%);
    --accent: hsl(168 60% 45%);
    --accent-hover: hsl(168 60% 55%);
    --accent-subtle: hsl(168 60% 45% / 0.1);
    --accent-glow: hsl(168 60% 45% / 0.25);
    --accent-orange: #ffaa44;
    --accent-blue: #5a9aff;
    --accent-purple: #b388ff;
    --border: hsl(240 4% 16%);
    --border-hover: hsl(240 4% 20%);
    --radius: 0.75rem;
    --radius-sm: calc(var(--radius) - 4px);
}

[data-theme="light"] {
    --bg-primary: hsl(0 0% 100%);
    --bg-secondary: hsl(240 5% 96%);
    --bg-card: hsl(0 0% 100%);
    --bg-card-hover: hsl(240 5% 96%);
    --bg-code: hsl(225 15% 17%);
    --text-primary: hsl(240 10% 4%);
    --text-secondary: hsl(240 4% 46%);
    --text-muted: hsl(240 4% 46%);
    --accent: hsl(168 60% 40%);
    --accent-hover: hsl(168 60% 35%);
    --accent-subtle: hsl(168 60% 40% / 0.08);
    --accent-glow: hsl(168 60% 40% / 0.15);
    --accent-orange: #e07000;
    --accent-blue: #2962ff;
    --accent-purple: #7c4dff;
    --border: hsl(240 6% 90%);
    --border-hover: hsl(240 6% 85%);
    --radius: 0.75rem;
    --radius-sm: calc(var(--radius) - 4px);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--nav-bg, hsl(240 6% 10% / 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 0.75rem; }
.nav-logo {
    width: 2rem; height: 2rem; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
}
.nav-title { font-weight: 600; font-size: 0.9rem; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    padding: 0.375rem 0.75rem; border-radius: var(--radius-sm);
    font-size: 0.8rem; font-weight: 500; transition: all 0.2s;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.nav-links a.active { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    width: 2rem; height: 2rem; border-radius: var(--radius-sm);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 6rem 2rem 4rem; position: relative; overflow: hidden;
}
.hero-grain {
    position: absolute; inset: 0; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}
.hero-glow {
    position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, hsl(168 60% 45% / 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { text-align: center; max-width: 800px; position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 1rem; border-radius: 9999px;
    background: var(--accent-subtle); border: 1px solid hsl(168 60% 45% / 0.2);
    color: var(--accent); font-size: 0.8rem; font-weight: 500; margin-bottom: 1.5rem;
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.5rem;
}
.hero-title .accent { color: var(--accent); }
.hero-title .orange { color: var(--accent-orange); }
.hero-title .blue { color: var(--accent-blue); }
.hero-subtitle {
    font-size: 1.125rem; color: var(--text-secondary);
    max-width: 600px; margin: 0 auto 2.5rem; line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem; cursor: pointer;
    text-decoration: none; border: none; transition: all 0.2s;
}
.btn-primary {
    background: var(--accent); color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover); transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
    background: var(--bg-card-hover); color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.hero-stats {
    display: flex; gap: 2rem; justify-content: center; margin-top: 3rem;
    padding-top: 2rem; border-top: 1px solid var(--border);
}
.hero-stat { text-align: center; }
.hero-stat-value {
    font-size: 1.75rem; font-weight: 800; color: var(--accent);
    letter-spacing: -0.02em;
}
.hero-stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.section {
    padding: 5rem 2rem; max-width: 1100px; margin: 0 auto;
}
.section-header {
    text-align: center; margin-bottom: 3rem;
}
.section-label {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; font-weight: 600; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem;
}
.section-label::before, .section-label::after {
    content: ''; width: 2rem; height: 1px; background: var(--accent);
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800;
    letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1rem;
}
.section-subtitle {
    color: var(--text-secondary); font-size: 1.05rem;
    max-width: 600px; margin: 0 auto; line-height: 1.7;
}

.two-col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.col-content h3 {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.col-content p {
    color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem;
}
.col-content ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.col-content ul li {
    padding-left: 1.5rem; position: relative; color: var(--text-secondary);
    font-size: 0.95rem;
}
.col-content ul li::before {
    content: '→'; position: absolute; left: 0; color: var(--accent); font-weight: 600;
}
.col-visual {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
    display: flex; flex-direction: column; gap: 1rem;
}

.arch-flow {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    flex-wrap: wrap;
}
.arch-node {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1rem 1.5rem; background: var(--bg-card-hover);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    min-width: 120px; transition: all 0.2s;
}
.arch-node:hover { border-color: var(--accent); transform: translateY(-2px); }
.arch-node .icon { font-size: 1.5rem; }
.arch-node .label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.arch-arrow { color: var(--accent); font-size: 1.5rem; font-weight: 300; }

.steps { display: flex; flex-direction: column; gap: 1.5rem; counter-reset: step; }
.step {
    display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem;
    padding: 1.5rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: all 0.2s;
}
.step:hover { border-color: var(--border-hover); }
.step-number {
    width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm);
    background: var(--accent-subtle); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}
.step-content h4 { font-weight: 600; margin-bottom: 0.5rem; font-size: 1rem; }
.step-content p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.code-block {
    background: var(--bg-code); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-top: 1rem;
}
.code-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 1rem;
    background: hsl(225 15% 15% / 0.5);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-muted);
}
.code-lang { font-weight: 600; color: var(--accent); }
.copy-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.75rem; padding: 0.25rem 0.5rem;
    border-radius: 4px; transition: all 0.2s;
}
.copy-btn:hover { color: var(--accent); background: var(--accent-subtle); }
.code-block pre {
    padding: 1rem; overflow-x: auto; font-size: 0.85rem;
    line-height: 1.6; margin: 0;
}
.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: hsl(210 20% 90%);
}
.code-block .comment { color: hsl(168 30% 50% / 0.7); }
.code-block .keyword { color: var(--accent-purple); }
.code-block .string { color: var(--accent-orange); }
.code-block .function { color: var(--accent-blue); }
.code-block .tag { color: var(--accent); }

.cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.card {
    padding: 1.5rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: all 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon {
    width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; margin-bottom: 1rem;
}
.card-icon--gov { background: hsl(168 60% 45% / 0.15); color: var(--accent); }
.card-icon--forms { background: hsl(240 60% 60% / 0.15); color: var(--accent-blue); }
.card-icon--portal { background: hsl(30 60% 55% / 0.15); color: var(--accent-orange); }
.card-icon--data { background: hsl(280 60% 65% / 0.15); color: var(--accent-purple); }
.card h4 { font-weight: 600; margin-bottom: 0.5rem; font-size: 1rem; }
.card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.demo-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.demo-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    background: var(--bg-card-hover);
}
.demo-tab {
    padding: 0.75rem 1.25rem; font-size: 0.85rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer; border: none;
    background: none; border-bottom: 2px solid transparent;
    transition: all 0.2s; font-family: inherit;
}
.demo-tab:hover { color: var(--text-primary); }
.demo-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.demo-body { padding: 1.5rem; }
.demo-preview {
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    padding: 1.5rem; margin-top: 1rem;
}
.gov-card-preview {
    background: var(--bg-card-hover); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.25rem; margin-bottom: 0.75rem;
    display: flex; justify-content: space-between; align-items: center;
}
.gov-card-info h5 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.gov-card-info p { font-size: 0.8rem; color: var(--text-muted); }
.gov-card-status {
    padding: 0.25rem 0.75rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 600;
}
.gov-card-status--open { background: hsl(168 60% 45% / 0.15); color: var(--accent); }
.gov-card-status--closed { background: hsl(0 84% 60% / 0.15); color: var(--accent-red, #ff6b6b); }
.gov-card-status--pending { background: hsl(39 100% 50% / 0.15); color: var(--accent-orange); }

.benefits-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.benefit {
    text-align: center; padding: 2rem 1rem;
}
.benefit-value {
    font-size: 2.5rem; font-weight: 800; color: var(--accent);
    letter-spacing: -0.03em; margin-bottom: 0.5rem;
}
.benefit-label { font-weight: 600; margin-bottom: 0.25rem; }
.benefit-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.cta-section {
    text-align: center; padding: 5rem 2rem;
    background: linear-gradient(180deg, transparent 0%, var(--bg-card) 100%);
    border-top: 1px solid var(--border);
}
.cta-section h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800;
    letter-spacing: -0.02em; margin-bottom: 1rem;
}
.cta-section p {
    color: var(--text-secondary); max-width: 500px;
    margin: 0 auto 2rem; line-height: 1.7;
}

.footer {
    text-align: center; padding: 2rem; color: var(--text-muted);
    font-size: 0.85rem; border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .top-nav { padding: 0.75rem 1rem; }
    .nav-links { display: none; }
    .two-col { grid-template-columns: 1fr; gap: 2rem; }
    .hero-stats { flex-direction: column; gap: 1rem; }
    .arch-node { min-width: 80px; padding: 0.75rem 1rem; }
    .arch-arrow { font-size: 1rem; }
    .section { padding: 3rem 1rem; }
    .hero { padding: 5rem 1rem 3rem; }
}
