/* ===================================
   SoundX Design System — Dark OLED Luxury
   Aesthetic: Recording studio darkness,
   precision waveforms, amber-gold accents
   =================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* --- Palette --- */
    --black: #000000;
    --black-soft: #0a0a0a;
    --surface-1: #111111;
    --surface-2: #1a1a1a;
    --surface-3: #222222;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --accent: #10B981;
    --accent-dim: rgba(16, 185, 129, 0.15);
    --accent-glow: rgba(16, 185, 129, 0.25);

    --text-primary: #F5F5F5;
    --text-secondary: #A3A3A3;
    --text-tertiary: #737373;
    --text-accent: var(--accent);

    /* --- Typography --- */
    --font-heading: 'Space Grotesk', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'DM Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* --- Spacing (8px grid) --- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-8: 48px;
    --sp-10: 64px;
    --sp-12: 80px;
    --sp-16: 120px;

    /* --- Radius --- */
    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 20px;
    --r-full: 9999px;

    /* --- Motion --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 0.15s;
    --dur-base: 0.3s;
    --dur-slow: 0.6s;

    /* --- Layout --- */
    --max-w: 1200px;
    --max-w-wide: 1440px;
    --max-w-narrow: 720px;
    --gutter: 24px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

img {
    max-width: 100%;
    display: block;
}

/* ===================================
   Film Grain Overlay (signature detail)
   =================================== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

@media (prefers-reduced-motion: reduce) {
    body::after { display: none; }
}

/* ===================================
   Navbar
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 1000;
    transition: background var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
    border-bottom: 1px solid transparent;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}

.nav-container {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-8);
    list-style: none;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color var(--dur-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--dur-base) var(--ease-out);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.mobile-theme-toggle {
    display: none;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    width: 22px;
    height: 1.5px;
    background: var(--text-primary);
    transition: all var(--dur-base) var(--ease-out);
    border-radius: 1px;
}

/* Mobile sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--surface-1);
    z-index: 1001;
    transition: right var(--dur-base) var(--ease-out);
    padding: 80px var(--sp-6) var(--sp-6);
    border-left: 1px solid var(--border);
}

.mobile-sidebar.open {
    right: 0;
}

.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--dur-base);
}

.mobile-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-theme-toggle { display: block; }
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 12px 28px;
    border-radius: var(--r-full);
    border: none;
    cursor: pointer;
    transition: all var(--dur-base) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 15px;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 13px;
}

/* ===================================
   Section
   =================================== */
.section {
    padding: var(--sp-16) var(--gutter);
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-5);
}

.section-desc {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 560px;
}

/* ===================================
   Cards
   =================================== */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-8);
    transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-out);
}

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

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--black);
    border-top: 1px solid var(--border);
    padding: var(--sp-12) var(--gutter) var(--sp-8);
    position: relative;
    overflow: hidden;
}

.footer-grid {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--sp-10);
    padding-bottom: var(--sp-10);
    border-bottom: 1px solid var(--border);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-top: var(--sp-4);
    max-width: 320px;
}

.footer-links h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--sp-5);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color var(--dur-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--sp-6);
    flex-wrap: wrap;
    gap: var(--sp-4);
}

.footer-copyright {
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer-legal {
    display: flex;
    gap: var(--sp-5);
}

.footer-legal a {
    font-size: 13px;
    color: var(--text-tertiary);
    transition: color var(--dur-fast);
}

.footer-legal a:hover {
    color: var(--text-secondary);
}

/* Footer waveform bars */
.footer-waveform {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
    opacity: 0.12;
}

.footer-waveform .bar {
    width: 2px;
    background: var(--accent);
    border-radius: 1px 1px 0 0;
    animation: waveBar 1.2s ease-in-out infinite;
}

@keyframes waveBar {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ===================================
   Scroll Animations
   =================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    :root { --gutter: 20px; }

    .section { padding: var(--sp-12) var(--gutter); }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--sp-6);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-links h4 {
        margin-bottom: var(--sp-4);
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===================================
   Utilities
   =================================== */
.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
