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

:root {
    --primary-color: #6c63ff;
    --secondary-color: #ff6584;
    --accent-color: #f4e1d2;
    --text-color: #2d3436;
    --bg-color: #f5f5f5;
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: 0.3s ease;
}

/* Dark mode variables */
.dark {
    --primary-color: #6c63ff;
    --secondary-color: #ff6584;
    --accent-color: #a0a0a0;
    --text-color: #e0e0e0;
    --bg-color: #1a1a2e;
    --nav-bg: #16213e;
    --card-bg: #1e2a4a;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: background-color 0.5s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

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

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-menu a:hover, .nav-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Language switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

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

/* Mobile navigation toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-color);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: currentColor;
    border-radius: 2px;
}

/* Main content */
.main-content {
    padding-top: 100px;
    min-height: 100vh;
}

.section {
    display: none;
    padding: 4rem 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.section.active {
    display: block;
    opacity: 1;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 5rem 0;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.cta-btn:hover {
    background-color: #4a44d0;
    transform: translateY(-2px);
}

.icon-btn {
    background: none;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Section headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: var(--accent-color);
}

/* Demo containers */
.demo-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Canvas */
canvas {
    display: block;
    width: 100%;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
    margin: 0 auto;
}

/* Controls */
.controls, .game-controls, .viz-controls, .waveform-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.control-btn, .game-btn, .viz-btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.control-btn:hover, .game-btn:hover, .viz-btn:hover {
    background-color: #4a44d0;
    transform: translateY(-2px);
}

/* Audio keyboard */
.synth-keys {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.synth-key {
    width: 60px;
    height: 150px;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    color: black;
    font-weight: bold;
}

.synth-key:hover {
    background-color: #f0f0f0;
    transform: translateY(-5px);
}

.synth-key:active {
    background-color: #ddd;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: 0;
        top: 70px;
        width: 100%;
        background-color: var(--nav-bg);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
    }

    .nav-menu.show {
        transform: translateY(0);
    }

    .nav-toggle {
        display: flex;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .synth-keys {
        gap: 0.5rem;
    }

    .synth-key {
        width: 45px;
        height: 120px;
        font-size: 0.8rem;
    }
}