/* ============================================
   Math Trainer - Promotional Website Styles
   Colors matched to the iOS app
   ============================================ */

:root {
    /* App colors */
    --add-start: #34C759;
    --add-end: #2FA8AC;
    --subtract-start: #FF9500;
    --subtract-end: #FF3B30;
    --multiply-start: #007AFF;
    --multiply-end: #4B0082;
    --divide-start: #FF9500;
    --divide-end: #FFCC00;
    --success: #34C759;
    --failure: #FF3B30;
    --competition-start: #FFCC00;
    --competition-end: #F29900;

    /* Base */
    --bg-main: #f8f9fc;
    --bg-white: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8888a0;
    --border-light: #e8e8f0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, 'SF Pro Rounded', 'SF Pro Display', BlinkMacSystemFont, 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ---- Navigation ---- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--multiply-start);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-nav {
    background: linear-gradient(135deg, var(--add-start), var(--add-end));
    color: white !important;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
}

.btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.35);
}

.btn-primary {
    background: linear-gradient(135deg, var(--add-start), var(--add-end));
    color: white;
    box-shadow: 0 8px 32px rgba(52, 199, 89, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(52, 199, 89, 0.4);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
    border-radius: var(--radius-md);
}

.lang-selector {
    position: relative;
}

.lang-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--multiply-start);
    color: var(--multiply-start);
}

.lang-arrow {
    font-size: 10px;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-width: 140px;
}

.lang-dropdown.open {
    display: block;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border: none;
    background: none;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.lang-option:hover {
    background: var(--bg-main);
    color: var(--multiply-start);
}

.lang-option.active {
    color: var(--multiply-start);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
}

/* ---- Hero ---- */

.hero {
    position: relative;
    padding: 140px 0 100px;
    background: linear-gradient(135deg, var(--multiply-start) 0%, var(--multiply-end) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(52, 199, 89, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 149, 0, 0.15) 0%, transparent 40%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    color: white;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    max-width: 480px;
    line-height: 1.7;
}

.hero-buttons {
    margin-bottom: 48px;
}

.hero-buttons .btn-primary {
    background: white;
    color: var(--multiply-start);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-buttons .btn-primary:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.appstore-badge-link {
    display: inline-block;
    transition: transform 0.2s;
}

.appstore-badge-link:hover {
    transform: scale(1.05);
}

.appstore-badge {
    height: 54px;
    width: auto;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: white;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

/* Screenshot carousel */

.hero-visual {
    display: flex;
    justify-content: center;
}

.screenshot-carousel {
    position: relative;
    width: 300px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}

.carousel-track {
    display: flex;
    will-change: transform;
}

.carousel-screenshot {
    min-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.screenshot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: 80px;
}

/* ---- Sections ---- */

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ---- Features ---- */

.features {
    padding: 100px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 36px 28px;
    border: 1px solid var(--border-light);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---- Modes ---- */

.modes {
    padding: 100px 0;
    background: var(--bg-white);
}

.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.mode-card {
    border-radius: 24px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.mode-learning {
    background: linear-gradient(135deg, rgba(52,199,89,0.08), rgba(47,168,172,0.08));
    border: 2px solid rgba(52,199,89,0.2);
}

.mode-competition {
    background: linear-gradient(135deg, rgba(255,204,0,0.08), rgba(242,153,0,0.08));
    border: 2px solid rgba(255,204,0,0.25);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.mode-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.mode-card p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.mode-features {
    list-style: none;
}

.mode-features li {
    padding: 8px 0;
    font-size: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-features li::before {
    content: '✓';
    font-weight: 700;
}

.mode-learning .mode-features li::before {
    color: var(--add-start);
}

.mode-competition .mode-features li::before {
    color: var(--competition-end);
}

/* ---- Exercises ---- */

.exercises {
    padding: 100px 0;
}

.subsection-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-left: 4px;
}

.subsection-memory {
    margin-top: 48px;
}

.operations-grid {
    display: grid;
    gap: 24px;
}

.operations-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.operations-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.operation-card {
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    transition: all 0.3s;
    color: white;
    position: relative;
    overflow: hidden;
}

.operation-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.operation-card:hover {
    transform: translateY(-6px);
}

.operation-card.op-add {
    background: linear-gradient(135deg, var(--add-start), var(--add-end));
    box-shadow: 0 8px 32px rgba(52, 199, 89, 0.3);
}

.operation-card.op-add:hover {
    box-shadow: 0 16px 48px rgba(52, 199, 89, 0.4);
}

.operation-card.op-subtract {
    background: linear-gradient(135deg, var(--subtract-start), var(--subtract-end));
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.3);
}

.operation-card.op-subtract:hover {
    box-shadow: 0 16px 48px rgba(255, 149, 0, 0.4);
}

.operation-card.op-multiply {
    background: linear-gradient(135deg, var(--multiply-start), var(--multiply-end));
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.operation-card.op-multiply:hover {
    box-shadow: 0 16px 48px rgba(0, 122, 255, 0.4);
}

.operation-card.op-divide {
    background: linear-gradient(135deg, var(--divide-start), var(--divide-end));
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.3);
}

.operation-card.op-divide:hover {
    box-shadow: 0 16px 48px rgba(255, 149, 0, 0.4);
}

.operation-card.op-roots {
    background: linear-gradient(135deg, #AF52DE, #FF2D55);
    box-shadow: 0 8px 32px rgba(175, 82, 222, 0.3);
}

.operation-card.op-roots:hover {
    box-shadow: 0 16px 48px rgba(175, 82, 222, 0.4);
}

.operation-card.op-remember {
    background: linear-gradient(135deg, #F98C17, #FC5E3A);
    box-shadow: 0 8px 32px rgba(249, 140, 23, 0.3);
}

.operation-card.op-remember:hover {
    box-shadow: 0 16px 48px rgba(249, 140, 23, 0.4);
}

.operation-card.op-reverse {
    background: linear-gradient(135deg, #34C7A5, #1A9688);
    box-shadow: 0 8px 32px rgba(52, 199, 165, 0.3);
}

.operation-card.op-reverse:hover {
    box-shadow: 0 16px 48px rgba(52, 199, 165, 0.4);
}

.operation-card.op-sequence {
    background: linear-gradient(135deg, #00B3B8, #0080D9);
    box-shadow: 0 8px 32px rgba(0, 179, 184, 0.3);
}

.operation-card.op-sequence:hover {
    box-shadow: 0 16px 48px rgba(0, 179, 184, 0.4);
}

.operation-symbol {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: white;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    position: relative;
}

.operation-symbol-svg {
    background: none !important;
    backdrop-filter: none !important;
}

.operation-symbol-svg svg {
    width: 34px;
    height: 34px;
}

.operation-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
}

.operation-card p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
    position: relative;
}

/* ---- Download ---- */

.download {
    padding: 100px 0;
    background: var(--bg-white);
}

.download-card {
    background: linear-gradient(135deg, var(--multiply-start), var(--multiply-end));
    border-radius: var(--radius-xl);
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(52,199,89,0.2) 0%, transparent 40%);
}

.download-card h2 {
    font-size: 38px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    position: relative;
}

.download-card p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.download-app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.download-card .appstore-badge-link {
    position: relative;
}

.download-card .appstore-badge {
    height: 60px;
}

/* ---- Footer ---- */

.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border-light);
}

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

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

.footer-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.footer-copy {
    font-size: 14px;
    color: var(--text-muted);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .hero h1 {
        font-size: 40px;
    }

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

    .operations-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .operations-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        display: flex;
        justify-content: center;
    }

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

    .hero-visual {
        order: -1;
    }

    .screenshot-carousel {
        width: 240px;
    }

    .carousel-track {
        border-radius: 18px;
    }

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

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

    .operations-grid-5,
    .operations-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .download-card {
        padding: 48px 24px;
    }

    .download-card h2 {
        font-size: 28px;
    }

    .footer-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .operations-grid-5,
    .operations-grid-3 {
        grid-template-columns: 1fr;
    }

    .mode-card {
        padding: 32px 24px;
    }
}

/* ---- Animations ---- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.mode-card,
.operation-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.feature-card:nth-child(1), .operation-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2), .operation-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3), .operation-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4), .operation-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.mode-card:nth-child(1) { animation-delay: 0.1s; }
.mode-card:nth-child(2) { animation-delay: 0.2s; }
