:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-cyan: #38bdf8;
    --accent-purple: #a855f7;
    --accent-green: #22c55e;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for fixed header */
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px var(--accent-cyan);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-purple);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-cyan);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Structure */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--accent-cyan);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1rem;
}

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

.cta-button {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    animation: fadeIn 1s ease-out;
}

#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    /* Slightly lower opacity for background */
    pointer-events: none;
    /* Let clicks pass through */
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

/* Features / Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1rem;
    transition: transform 0.3s, border-color 0.3s;
}

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

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-cyan);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Problem & Solution */
.split-section {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.split-content {
    flex: 1;
}

.split-visual {
    flex: 1;
    background: var(--bg-secondary);
    height: 400px;
    /* Placeholder height */
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
}

footer a {
    color: var(--accent-cyan);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .split-section {
        flex-direction: column;
    }

    .nav-links {
        display: none;
    }
}

/* Custom Range Input */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--glass-border);
    border-radius: 2px;
}

input[type=range]:focus {
    outline: none;
}

/* Button Warning State */
.btn-warning {
    background: #f59e0b;
    /* Amber 500 */
    color: #000;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Adjust header for mobile */
    header {
        padding: 0.5rem 0;
    }

    nav {
        flex-direction: row;
        /* Keep row for logo and menu button */
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.25rem;
        /* Revert to row for better alignment, or stack if really narrow */
        flex-direction: row;
        align-items: center;
        width: auto;
        line-height: 1.2;
    }

    /* Wrap logo text if screen is very narrow */
    .logo span {
        display: inline-block;
        margin-right: 4px;
    }

    /* Sidebar logic */
    #sidebar {
        position: fixed;
        width: 100%;
        height: 100%;
        left: -100%;
        top: 0;
        transition: left 0.3s ease-in-out;
        z-index: 2000;
        background: rgba(15, 23, 42, 0.98);
        /* Less transparent for better readability */
        backdrop-filter: blur(15px);
        display: flex;
        /* Flex to center content */
        flex-direction: column;
        justify-content: center;
        /* Center items vertically */
        padding: 2rem;
    }

    #sidebar.open {
        left: 0;
    }

    #main-view {
        width: 100%;
        height: 100vh;
    }

    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        width: 100%;
        /* Full width buttons in mobile control panel */
        margin-bottom: 0.5rem;
    }

    input[type=range]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        margin-top: -10px;
    }

    .back-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        display: block;
        width: 100%;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin-bottom: 2rem;
    }

    /* Fix for split sections overlap - simplified */
    .split-section {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 0;
        height: auto !important;
        /* Force auto height */
    }

    .split-content {
        flex: 0 0 auto;
        width: 100%;
        order: 2;
        /* Content second */
    }

    .split-visual {
        flex: 0 0 auto;
        width: 100%;
        min-height: 200px;
        /* Reduces minimum height */
        height: auto;
        order: 1;
        /* Visual first */
        margin-bottom: 0;
    }

    /* Fix typography scaling */
    .hero {
        padding-top: 100px;
        /* More space for fixed header */
        align-items: flex-start;
        /* Align top for better mobile view */
        padding-bottom: 2rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.5;
    }

    h1 {
        font-size: 2rem;
        /* Reduced size */
        margin-bottom: 1rem;
        word-wrap: break-word;
        /* Prevent overflow */
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* Desktop only styles */
@media (min-width: 769px) {
    .reverse-on-desktop {
        flex-direction: row-reverse;
    }
}