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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    /* Colors from app theme */
    --primary: #1a1a1a;
    --secondary: #4a4a4a;
    --accent: #3b82f6;
    --background: #ffffff;
    --background-secondary: #f9fafb;
    --background-muted: #f3f4f6;
    --surface: #f5f5f5;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Font Sizes */
    --font-xs: 12px;
    --font-sm: 14px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-xxl: 24px;
    --font-xxxl: 32px;
    --font-hero: clamp(40px, 8vw, 64px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-title {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-md);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link-cta {
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.nav-link-cta::after {
    display: none;
}

.nav-link-cta:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hero Section */
.hero {
    margin-top: 60px;
    padding: var(--space-xxl) var(--space-lg);
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(180deg, var(--background) 0%, var(--background-secondary) 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
    align-items: center;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

.hero-badge {
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.badge-text {
    background: var(--surface);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 500;
    border: 1px solid var(--border);
}

.hero-title {
    font-size: var(--font-hero);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    color: var(--primary);
}

.hero-title-accent {
    display: block;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.btn {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: var(--font-md);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hero-stats {
    display: flex;
    flex-direction: column;
    padding-left: var(--space-xl);
    border-left: 2px solid var(--border);
}

.stat-number {
    font-size: var(--font-xxl);
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: var(--font-sm);
    color: var(--text-tertiary);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: var(--space-md);
    max-width: 480px;
    width: 100%;
}

.stack-card {
    background: linear-gradient(160deg, #ffffff, #f9fafb);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stack-card:nth-child(2) {
    transform: translateY(6px);
}

.stack-card:nth-child(3) {
    transform: translateY(-6px);
}

.card-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
    font-size: var(--font-sm);
    font-weight: 700;
    border: none;
    align-self: flex-start;
}

.card-meta {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

/* Inline and block code share the same sizing as body text */
code {
    font-family: 'SFMono-Regular', 'Courier New', monospace;
    font-size: 1em;
    background: var(--background-muted);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

.code-snippet {
    font-family: 'SFMono-Regular', 'Courier New', monospace;
    background: transparent;
    color: #1a1a1a;
    padding: 0;
    border-radius: 0;
    border: none;
    overflow: visible;
    font-size: var(--font-sm);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin: var(--space-sm) 0;
}

.code-snippet code {
    display: block;
    white-space: inherit;
    font-size: inherit;
}

.code-snippet .keyword { color: #3b82f6; }
.code-snippet .function { color: #f59e0b; }
.code-snippet .property { color: #8b5cf6; }
.code-snippet .string { color: #10b981; }

.math-card .math-expression {
    width: 100%;
    height: 90px;
    display: block;
    margin: var(--space-sm) 0;
}

.audio-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
}

.audio-play {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.audio-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.audio-wave {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 4px;
    gap: 4px;
    align-items: end;
    height: 28px;
    width: 160px;
}

.audio-wave span {
    display: block;
    width: 4px;
    background: #9ca3af;
    border-radius: var(--radius-sm);
    animation: pulse 1.4s ease-in-out infinite;
}

.audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-wave span:nth-child(5) { animation-delay: 0.4s; }
.audio-wave span:nth-child(6) { animation-delay: 0.5s; }
.audio-wave span:nth-child(7) { animation-delay: 0.6s; }
.audio-wave span:nth-child(8) { animation-delay: 0.7s; }
.audio-wave span:nth-child(9) { animation-delay: 0.8s; }
.audio-wave span:nth-child(10) { animation-delay: 0.9s; }
.audio-wave span:nth-child(11) { animation-delay: 1.0s; }
.audio-wave span:nth-child(12) { animation-delay: 1.1s; }
.audio-wave span:nth-child(13) { animation-delay: 1.2s; }
.audio-wave span:nth-child(14) { animation-delay: 1.3s; }
.audio-wave span:nth-child(15) { animation-delay: 1.4s; }
.audio-wave span:nth-child(16) { animation-delay: 1.5s; }

@keyframes pulse {
    0%, 100% { height: 8px; opacity: 0.6; }
    50% { height: 26px; opacity: 1; }
}

.audio-time {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin: var(--space-sm) 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
    cursor: pointer;
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.file-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Features Section */
.features {
    padding: var(--space-xxl) var(--space-lg);
    background: var(--background-secondary);
}

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

.section-header {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: var(--font-lg);
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
}

.feature-title {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Why Section */
.why {
    padding: var(--space-xxl) var(--space-lg);
    background: white;
}

.why-container {
    max-width: 1000px;
    margin: 0 auto;
}

.why-grid {
    margin-top: var(--space-xxl);
}

.why-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    transition: background 0.3s ease;
}

.why-item:hover {
    background: var(--background-secondary);
}

.why-number {
    font-size: var(--font-xxxl);
    font-weight: 700;
    color: var(--border-medium);
}

.why-title {
    font-size: var(--font-xxl);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--primary);
}

.why-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Join Section */
.join {
    padding: var(--space-xxl) var(--space-lg);
    background: linear-gradient(135deg, var(--background-secondary), var(--background));
}

.join-container {
    max-width: 600px;
    margin: 0 auto;
}

.join-content {
    text-align: center;
}

.form-wrapper {
    margin: var(--space-xl) 0;
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.waitlist-fields {
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
}

.waitlist-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: var(--font-md);
}

.waitlist-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.waitlist-submit {
    white-space: nowrap;
}

.waitlist-helper {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.waitlist-error {
    font-size: var(--font-sm);
    color: var(--danger);
}

.join-benefits {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.benefit {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-md);
}

.benefit-icon {
    width: 20px;
    height: 20px;
    stroke: var(--success);
}

/* Footer */
.footer {
    padding: var(--space-xl) var(--space-lg);
    background: var(--primary);
    color: white;
}

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

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-logo {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

.footer-title {
    font-size: var(--font-lg);
    font-weight: 600;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: var(--space-xxl);
        padding-bottom: var(--space-xxl);
        padding-left: 0;
        padding-right: 0;
    }

    .hero-container {
        padding: 0 var(--space-lg);
    }

    .nav-links {
        gap: var(--space-md);
    }

    .nav-link:not(.nav-link-cta) {
        display: none;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .hero-visual {
        margin-top: var(--space-xl);
        margin-left: calc(-1 * var(--space-lg));
        margin-right: calc(-1 * var(--space-lg));
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
        column-gap: 0;
        row-gap: var(--space-md);
    }

    .stack-card {
        padding: var(--space-md);
    }

    .card-grid .stack-card:nth-child(2),
    .card-grid .stack-card:nth-child(3) {
        transform: none;
    }

    .code-snippet {
        font-size: var(--font-sm);
    }

    .hero-cta {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .hero-stats {
        padding-left: var(--space-md);
        padding-top: 0;
        border-left: 2px solid var(--border);
        border-top: none;
    }

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

    .why-item {
        grid-template-columns: 1fr;
    }

    .why-number {
        font-size: var(--font-xxl);
    }

    .join-benefits {
        flex-direction: column;
        align-items: center;
    }

    .audio-row {
        padding: var(--space-md) 0;
    }

    .audio-wave {
        width: 90px;
        max-width: 90px;
    }

    .audio-time {
        font-size: var(--font-xs);
    }

    .waitlist-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .waitlist-submit {
        width: 100%;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
    }
}
