/* ============================================
   FPGA SYNTH - Styles
   A modern, premium synthesizer showcase
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);

    --accent-primary: #00d4ff;
    --accent-secondary: #7b2cbf;
    --accent-tertiary: #ff006e;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 50%, #ff006e 100%);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --border-color: rgba(255, 255, 255, 0.08);
    --glow-cyan: 0 0 30px rgba(0, 212, 255, 0.3);
    --glow-purple: 0 0 30px rgba(123, 44, 191, 0.3);

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.wave-line {
    position: absolute;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
    opacity: 0.1;
    animation: waveLine 8s linear infinite;
}

.wave-line:nth-child(1) {
    top: 20%;
    animation-delay: 0s;
}

.wave-line:nth-child(2) {
    top: 50%;
    animation-delay: 2s;
    opacity: 0.05;
}

.wave-line:nth-child(3) {
    top: 80%;
    animation-delay: 4s;
    opacity: 0.08;
}

@keyframes waveLine {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0%);
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.github-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
}

.github-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 5rem 5rem;
    z-index: 1;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(0, 212, 255, 0.2);
    }
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    box-shadow: var(--glow-cyan);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.4);
}

.hero-visual {
    width: 500px;
    height: 300px;
    position: relative;
}

.waveform-display {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.waveform-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(0, 212, 255, 0.03) 20px,
            rgba(0, 212, 255, 0.03) 21px);
}

/* Features Section */
.features {
    position: relative;
    z-index: 1;
    padding: 6rem 5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-cyan);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Demo Section */
.demo {
    position: relative;
    z-index: 1;
    padding: 6rem 3rem;
    background: linear-gradient(180deg, transparent, rgba(123, 44, 191, 0.05), transparent);
}

.demo-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.synth-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    backdrop-filter: blur(20px);
}

/* Waveform Viewer */
.waveform-section {
    margin-bottom: 2rem;
}

.waveform-viewer {
    width: 100%;
    height: 150px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.waveform-viewer canvas {
    width: 100%;
    height: 100%;
}

.waveform-label {
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 2px;
}

/* Control Sections */
.control-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--accent-primary);
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Mixer Grid */
.mixer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.mixer-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Knobs */
.knob-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.knob {
    width: 80px;
    height: 80px;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.knob-inner {
    position: absolute;
    inset: 8px;
    background: linear-gradient(145deg, #1a1a25, #0d0d12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.knob-indicator {
    width: 4px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    box-shadow: 0 0 10px var(--accent-primary);
}

.knob-ring {
    position: absolute;
    inset: 0;
    transform: rotate(-135deg);
}

.knob-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
    stroke-dasharray: 212;
    stroke-dashoffset: 70;
    stroke-linecap: round;
}

.knob-progress {
    fill: none;
    stroke: url(#knobGradient);
    stroke-width: 6;
    stroke-dasharray: 212;
    stroke-dashoffset: 212;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

.knob-value {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.channel-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Wave Icons */
.wave-icon {
    width: 40px;
    height: 20px;
    position: relative;
    opacity: 0.5;
}

.wave-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sine-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 10 Q10 0, 20 10 T40 10' stroke='%2300d4ff' fill='none' stroke-width='2'/%3E%3C/svg%3E");
}

.triangle-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 10 L10 2 L30 18 L40 10' stroke='%2300d4ff' fill='none' stroke-width='2'/%3E%3C/svg%3E");
}

.saw-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 18 L20 2 L20 18 L40 2' stroke='%2300d4ff' fill='none' stroke-width='2'/%3E%3C/svg%3E");
}

.square-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 18 L0 2 L10 2 L10 18 L20 18 L20 2 L30 2 L30 18 L40 18' stroke='%2300d4ff' fill='none' stroke-width='2'/%3E%3C/svg%3E");
}

.noise-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 10 L2 5 L4 15 L6 8 L8 12 L10 3 L12 17 L14 7 L16 13 L18 4 L20 16 L22 6 L24 14 L26 5 L28 15 L30 8 L32 12 L34 3 L36 17 L38 9 L40 10' stroke='%2300d4ff' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* 5-column mixer grid for noise */
.mixer-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Sliders */
.slider-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.slider-value {
    color: var(--accent-primary);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ADSR */
.adsr-container {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.adsr-visual {
    flex: 1;
    height: 150px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.adsr-visual canvas {
    width: 100%;
    height: 100%;
}

.adsr-sliders {
    display: flex;
    gap: 1.5rem;
}

.adsr-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.vertical-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    writing-mode: vertical-lr;
    direction: rtl;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.vertical-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.adsr-value {
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--accent-primary);
}

.adsr-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Presets */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.preset-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Keyboard */
.keyboard-section {
    margin-top: 2rem;
}

.keyboard {
    display: flex;
    justify-content: center;
    position: relative;
    height: 180px;
    padding: 0 20px;
}

.key {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}

.key span {
    font-family: var(--font-display);
    font-size: 0.7rem;
    pointer-events: none;
}

.key.white {
    width: 60px;
    height: 180px;
    background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    z-index: 1;
    color: #333;
}

.key.white:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e5e5e5 100%);
}

.key.white.active {
    background: linear-gradient(180deg, var(--accent-primary) 0%, #0099cc 100%);
    color: white;
}

.key.black {
    width: 40px;
    height: 110px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 0 0 6px 6px;
    margin-left: -20px;
    margin-right: -20px;
    z-index: 2;
    color: #888;
}

.key.black:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

.key.black.active {
    background: linear-gradient(180deg, var(--accent-secondary) 0%, #5a1e8f 100%);
    color: white;
}

.keyboard-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Tech Section */
.tech-section {
    position: relative;
    z-index: 1;
    padding: 6rem 5rem;
}

.tech-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tech-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.tech-item:hover .tech-icon {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-cyan);
}

.tech-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    padding: 4rem 5rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

.footer-content p {
    color: var(--text-secondary);
}

.footer-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-secondary);
}

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

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        padding: 8rem 2rem 4rem;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
        max-width: 500px;
        margin-top: 3rem;
    }

    .header {
        padding: 1rem 1.5rem;
    }

    .nav {
        gap: 1rem;
    }

    .features,
    .demo,
    .tech-section {
        padding: 4rem 1.5rem;
    }

    .mixer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .slider-group {
        grid-template-columns: 1fr;
    }

    .adsr-container {
        flex-direction: column;
    }

    .keyboard {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .key.white {
        width: 45px;
    }

    .key.black {
        width: 30px;
        margin-left: -15px;
        margin-right: -15px;
    }
}