:root {
    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --local: #059669;
    --local-light: #ecfdf5;
    --cloud: #2563eb;
    --cloud-light: #dbeafe;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

code {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.2rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Navigation */
nav.topnav {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

nav.topnav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav.topnav .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

nav.topnav .brand-mark {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    margin-right: 0.5rem;
    vertical-align: middle;
    position: relative;
}

nav.topnav .brand-mark::before {
    content: "🔒";
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

nav.topnav .links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
}

nav.topnav .links a {
    color: var(--text-muted);
    font-weight: 500;
}

nav.topnav .links a:hover { color: var(--primary); text-decoration: none; }
nav.topnav .links a.active { color: var(--primary); }

/* Hero */
.hero {
    padding: 5rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.15;
}

.hero h1 .gradient {
    background: linear-gradient(90deg, var(--local), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero .cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.15s;
    text-decoration: none !important;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* Sections */
section {
    padding: 4rem 2rem;
}

section .container {
    max-width: 1100px;
    margin: 0 auto;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    text-align: center;
}

section .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Architecture diagram */
.arch-diagram {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.arch-flow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    min-width: 800px;
}

.arch-node {
    flex: 1;
    min-width: 180px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}

.arch-node.local {
    border-color: var(--local);
    background: var(--local-light);
}

.arch-node.cloud {
    border-color: var(--cloud);
    background: var(--cloud-light);
}

.arch-node.user {
    border-color: var(--text);
    background: var(--bg-elevated);
}

.arch-node .icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.arch-node .label {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.arch-node .sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.arch-node .badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.arch-node.local .badge { background: var(--local); }
.arch-node.cloud .badge { background: var(--cloud); }

.arch-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0 0.5rem;
}

.arch-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot.local { background: var(--local); }
.legend-dot.cloud { background: var(--cloud); }
.legend-dot.user { background: var(--text); }

/* Feature grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.8rem;
    transition: all 0.2s;
}

.feature:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.feature .icon {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.feature h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Comparison */
.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.comparison-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.8rem;
}

.comparison-card.bad {
    border-color: var(--danger);
    background: var(--danger-light);
}

.comparison-card.good {
    border-color: var(--local);
    background: var(--local-light);
}

.comparison-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-card ul {
    list-style: none;
    font-size: 0.92rem;
}

.comparison-card li {
    padding: 0.4rem 0;
    color: var(--text);
}

.comparison-card li::before {
    content: "✗ ";
    color: var(--danger);
    font-weight: 700;
    margin-right: 0.3rem;
}

.comparison-card.good li::before {
    content: "✓ ";
    color: var(--local);
}

/* Footer */
footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer .container {
    max-width: 1100px;
    margin: 0 auto;
}

footer .links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero .tagline { font-size: 1rem; }
    section { padding: 3rem 1rem; }
    section h2 { font-size: 1.5rem; }
    .arch-flow { flex-direction: column; }
    .arch-arrow { transform: rotate(90deg); padding: 0.5rem 0; }
    .comparison { grid-template-columns: 1fr; }
}
