/* --- CSS Variables --- */
:root {
    --bg-body: #070b14;
    --bg-nav: rgba(7, 11, 20, 0.95);
    --bg-card: #0a0f1c;
    --bg-section: #05080f;
    --bg-editor: #0b1120;
    --bg-editor-header: #111827;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(30, 41, 59, 0.8);
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background-color: var(--blue-600);
    color: white;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(to right, var(--blue-400), var(--emerald-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Layout Utilities --- */
.container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }

/* --- Navigation --- */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 50;
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo span { color: var(--blue-500); }
.logo svg { color: var(--blue-500); fill: rgba(59, 130, 246, 0.2); }

.desktop-menu { display: none; align-items: center; gap: 2rem; }
.desktop-menu a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.desktop-menu a:hover { color: white; }

.btn-primary {
    background-color: var(--blue-600);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-primary:hover { background-color: var(--blue-700); }

.btn-outline {
    background-color: transparent;
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.btn-outline:hover { background-color: rgba(30, 41, 59, 0.5); }

.mobile-btn { display: flex; color: var(--text-muted); padding: 0.5rem; }
.mobile-btn:hover { color: white; }

.mobile-menu {
    display: none;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem 1rem;
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block;
    padding: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 0.375rem;
}
.mobile-menu a:hover { background-color: rgba(30, 41, 59, 0.5); color: white; }

@media (min-width: 768px) {
    .desktop-menu { display: flex; }
    .mobile-btn { display: none; }
    .mobile-menu { display: none !important; }
}

/* --- Hero Section --- */
.hero {
    position: relative;
    padding: 8rem 0 5rem;
    overflow: hidden;
}
@media (min-width: 1024px) { .hero { padding: 12rem 0 8rem; } }

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, #1e293b 1px, transparent 1px),
        linear-gradient(to bottom, #1e293b 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
    opacity: 0.2;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 48rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
}
@media (min-width: 1024px) { .hero h1 { font-size: 4.5rem; } }

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
}
@media (min-width: 1024px) { .hero p { font-size: 1.25rem; } }

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 640px) { .hero-buttons { flex-direction: row; } }

.hero-buttons .btn-primary { padding: 1rem 2rem; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.hero-buttons .btn-outline { padding: 1rem 2rem; font-size: 1rem; }

/* --- Trust Metrics --- */
.metrics-section {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 3rem 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
@media (min-width: 768px) { .metrics-grid { grid-template-columns: repeat(4, 1fr); gap: 0;} }

.metric-item {
    padding-left: 1rem;
    border-left: 1px solid rgba(30, 41, 59, 0.6);
}
@media (min-width: 768px) {
    .metric-item { padding-left: 2rem; }
    .metric-item:first-child { border-left: none; padding-left: 0; }
}

.metric-value { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.025em; }
.metric-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }

/* --- Solutions (Pillars) --- */
.solutions { padding: 6rem 0; }
.section-header { 
    max-width: 48rem; 
    margin-bottom: 4rem; 
    margin-left: 1rem;
    margin-right: 1rem;
}
@media (min-width: 768px) {
    .section-header {
        margin-left: 0;
        margin-right: 0;
    }
}
.section-header h2 { font-size: 2.25rem; margin-bottom: 1rem; }
.section-header p { font-size: 1.125rem; color: var(--text-muted); font-weight: 300; }

.cards-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}
@media (min-width: 768px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 0;
    overflow-wrap: break-word;
    margin-left: 1rem;
    margin-right: 1rem;
}
@media (min-width: 768px) {
    .card {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}
.card:hover { border-color: rgba(59, 130, 246, 0.5); }

.card-core {
    background: linear-gradient(to bottom, #0d1629, var(--bg-card));
    border-color: rgba(30, 58, 138, 0.5);
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--blue-600);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom-left-radius: 0.5rem;
}

.card-icon { margin-bottom: 1.5rem; color: var(--blue-500); }
.card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card .subtitle { font-size: 0.75rem; font-weight: 600; color: var(--blue-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; flex-grow: 1; }

.card-features { margin-top: auto; }
.card-features li { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.875rem; color: #cbd5e1; margin-bottom: 0.75rem; }
.card-features li svg { color: var(--emerald-500); flex-shrink: 0; margin-top: 0.125rem; }

/* --- Architecture --- */
.architecture {
    background-color: var(--bg-section);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4rem 0;
}
@media (min-width: 1024px) { .architecture { padding: 6rem 0; } }

.arch-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    width: 100%;
}
@media (min-width: 1024px) { 
    .arch-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 4rem;
    } 
}

.arch-text {
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
}
.arch-text h2 { font-size: 1.75rem; margin-bottom: 1.5rem; line-height: 1.2; }
@media (min-width: 768px) { .arch-text h2 { font-size: 2.25rem; } }

.arch-text p { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; font-weight: 300; }
@media (min-width: 768px) { .arch-text p { font-size: 1.125rem; } }

.arch-text strong { color: white; font-weight: 500; }

.arch-features {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.arch-feature { display: flex; align-items: flex-start; gap: 1rem; }
.arch-feature-icon {
    padding: 0.5rem;
    border-radius: 0.25rem;
    display: flex;
}
.icon-blue { background-color: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #60a5fa; }
.icon-emerald { background-color: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--emerald-400); }

.arch-feature-text h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.arch-feature-text p { font-size: 0.875rem; margin-bottom: 0; }

/* -- Code Editor UI -- */
.code-wrapper { 
    position: relative; 
    width: 100%;
    min-width: 0;
}
.code-glow {
    position: absolute;
    inset: -0.25rem;
    background: linear-gradient(to right, var(--blue-600), var(--emerald-600));
    filter: blur(16px);
    opacity: 0.1;
    border-radius: 0.5rem;
    pointer-events: none;
}
@media (max-width: 767px) {
    .code-glow { filter: blur(8px); opacity: 0.05; }
}

.code-editor {
    position: relative;
    background-color: var(--bg-editor);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-editor-header);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0;
}
.code-dots { display: flex; gap: 0.375rem; }
.dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background-color: #475569; }
.code-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em; margin-left: 0.75rem; }

.code-body {
    padding: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: #cbd5e1;
}
@media (min-width: 768px) {
    .code-body {
        padding: 1.5rem;
        font-size: 0.8125rem;
    }
}
.code-body pre { margin: 0; }

/* Syntax highlighting */
.token-comment { color: #64748b; font-style: italic; }
.token-keyword { color: #60a5fa; font-weight: 500; }
.token-function { color: var(--emerald-400); }
.token-control { color: #c084fc; }

.code-footer {
    padding: 0.5rem 1rem;
    background-color: #0d1424;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.code-success { color: var(--emerald-500); }
.code-latency { color: var(--text-muted); }

/* --- CTA Section --- */
.cta {
    position: relative;
    padding: 6rem 0;
    background-color: var(--bg-body);
    overflow: hidden;
    text-align: center;
}
.cta-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(30, 58, 138, 0.05);
    border-top: 1px solid rgba(30, 58, 138, 0.1);
    border-bottom: 1px solid rgba(30, 58, 138, 0.1);
}
.cta-content { position: relative; z-index: 10; max-width: 48rem; margin: 0 auto; }
.cta-icon { margin: 0 auto 1.5rem; color: var(--blue-500); opacity: 0.8; display: flex; justify-content: center; }
.cta h2 { font-size: 2.25rem; margin-bottom: 1.5rem; letter-spacing: -0.025em; }
@media (min-width: 768px) { .cta h2 { font-size: 3rem; } }
.cta p { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 2.5rem; font-weight: 300; }

.cta-buttons { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    justify-content: center;
    margin-left: 1rem;
    margin-right: 1rem;
}
@media (min-width: 640px) { 
    .cta-buttons { 
        flex-direction: row; 
        margin-left: 0;
        margin-right: 0;
    } 
}

.btn-white {
    background-color: white;
    color: var(--bg-body);
    padding: 0.875rem 2rem;
    border-radius: 0.375rem;
    font-weight: 700;
    transition: background-color 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.btn-white:hover { background-color: #e2e8f0; }

.btn-dark {
    background-color: var(--bg-card);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.875rem 2rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-dark:hover { background-color: rgba(30, 41, 59, 0.8); }

/* --- Footer --- */
footer {
    background-color: var(--bg-section);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}
@media (min-width: 768px) {
    .footer-inner { flex-direction: row; justify-content: space-between; }
}

.footer-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; }
.footer-logo svg { color: var(--blue-500); }
.footer-logo span { color: var(--blue-500); }

.footer-copy { font-size: 0.875rem; color: var(--text-muted); font-weight: 300; text-align: center;}

.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: white; }

/* SVG Utilities */
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 2.5rem; height: 2.5rem; }