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

:root {
    /* Light mode - Professional blue/indigo palette */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --accent-color: #8b5cf6;
    --accent-dark: #7c3aed;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;

    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Gradient presets */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-hero: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1) 0%, transparent 70%);

    --border-radius: 12px;
    --border-radius-lg: 16px;
}

[data-theme="dark"] {
    /* Dark mode - Refined deep purple/indigo palette */
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --accent-color: #a78bfa;
    --accent-dark: #8b5cf6;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);

    /* Gradient presets for dark mode */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-hero: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-light);
}

.navbar.scrolled {
    padding: 0.75rem 0;
    box-shadow: var(--shadow);
    border-bottom-color: var(--border-medium);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

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

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

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

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

/* Dark Mode Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-medium);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: rotate(15deg) scale(1.05);
}

.theme-toggle:active {
    transform: rotate(15deg) scale(0.95);
}

.theme-icon {
    transition: all 0.3s ease;
    position: absolute;
}

.theme-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon.moon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Hero Section */
.hero {
    padding: 140px 0 100px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--border-light);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: var(--gradient-hero);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-30px, 30px) scale(1.1);
    }
}

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

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -2px;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 540px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

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

.btn {
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Game Preview */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInScale 1s ease-out 0.4s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-preview {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    position: relative;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    position: relative;
}

.preview-tile {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: tileAppear 0.5s ease-out both;
}

.preview-tile:nth-child(1) { animation-delay: 0.1s; }
.preview-tile:nth-child(2) { animation-delay: 0.15s; }
.preview-tile:nth-child(3) { animation-delay: 0.2s; }
.preview-tile:nth-child(4) { animation-delay: 0.25s; }
.preview-tile:nth-child(5) { animation-delay: 0.3s; }
.preview-tile:nth-child(6) { animation-delay: 0.35s; }
.preview-tile:nth-child(7) { animation-delay: 0.4s; }
.preview-tile:nth-child(8) { animation-delay: 0.45s; }
.preview-tile:nth-child(9) { animation-delay: 0.5s; }

@keyframes tileAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.preview-tile:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Cyberpunk Tile Colors */
.tile-2 {
    background: linear-gradient(135deg, rgb(51, 204, 229), rgb(31, 184, 209));
    box-shadow: 0 4px 15px rgba(51, 204, 229, 0.4);
}
.tile-4 {
    background: linear-gradient(135deg, rgb(204, 51, 229), rgb(184, 31, 209));
    box-shadow: 0 4px 15px rgba(204, 51, 229, 0.4);
}
.tile-8 {
    background: linear-gradient(135deg, rgb(51, 229, 77), rgb(31, 209, 57));
    box-shadow: 0 4px 15px rgba(51, 229, 77, 0.4);
}
.tile-16 {
    background: linear-gradient(135deg, rgb(255, 51, 128), rgb(235, 31, 108));
    box-shadow: 0 4px 15px rgba(255, 51, 128, 0.4);
}
.tile-32 {
    background: linear-gradient(135deg, rgb(255, 204, 0), rgb(235, 184, 0));
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
}
.tile-64 {
    background: linear-gradient(135deg, rgb(0, 153, 255), rgb(0, 133, 235));
    box-shadow: 0 4px 15px rgba(0, 153, 255, 0.4);
}
.tile-128 {
    background: linear-gradient(135deg, rgb(255, 102, 0), rgb(235, 82, 0));
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
}
.tile-256 {
    background: linear-gradient(135deg, rgb(153, 0, 255), rgb(133, 0, 235));
    box-shadow: 0 4px 15px rgba(153, 0, 255, 0.4);
}
.tile-512 {
    background: linear-gradient(135deg, rgb(0, 255, 153), rgb(0, 235, 133));
    box-shadow: 0 4px 15px rgba(0, 255, 153, 0.4);
}

/* Features Section */
.features {
    padding: 100px 0;
    background: var(--bg-secondary);
    position: relative;
    border-bottom: 2px solid var(--border-light);
}

.section-title {
    font-size: 2.75rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.feature-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-light);
    position: relative;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.2);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* Scoring Section */
.scoring {
    padding: 100px 0;
    position: relative;
    border-bottom: 2px solid var(--border-light);
}

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

[data-theme="dark"] .scoring-gradient {
    background: var(--gradient-primary);
}

.scoring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.scoring-title {
    color: white !important;
}

.scoring-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.scoring-description {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.highlight-gold {
    color: #ffd700;
}

.combo-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.combo-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    min-width: 150px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.combo-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.combo-multiplier {
    font-size: 2em;
    font-weight: bold;
    color: #ffd700;
}

.combo-label {
    color: white;
}

.btn-guide {
    background: #ffd700;
    color: #333;
    padding: 15px 30px;
    border-radius: 25px;
}

.btn-guide:hover {
    background: #ffed4e;
    color: #333;
}

/* Gameplay Section */
.gameplay {
    padding: 100px 0;
    background: var(--bg-secondary);
    position: relative;
    border-bottom: 2px solid var(--border-light);
}

.gameplay-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
    position: relative;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    background: var(--bg-secondary);
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    background: var(--primary-dark);
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* Download Section */
.download {
    padding: 100px 0;
    background: var(--bg-primary);
    text-align: center;
    position: relative;
}

.download-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.download-buttons {
    margin-bottom: 1.5rem;
}

.app-store-badge {
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(var(--shadow));
}

.app-store-badge:hover {
    transform: scale(1.05) translateY(-3px);
    filter: drop-shadow(var(--shadow-lg));
}

.app-store-badge svg {
    display: block;
}

.app-store-badge svg rect:first-child {
    transition: fill 0.3s ease;
}

[data-theme="dark"] .app-store-badge svg rect:first-child {
    fill: #1e293b;
}

.download-note {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #0f172a;
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    border-top: 3px solid var(--primary-color);
}

[data-theme="dark"] .footer {
    background: #020617;
    color: #f1f5f9;
}

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

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.7;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

[data-theme="dark"] .footer-links a {
    color: #f1f5f9;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-light);
}

/* Scroll animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section Decorations */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 0;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        width: 100%;
        height: 100vh;
        padding: 100px 20px 20px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        gap: 0;
        align-items: center;
        justify-content: start;
        border-left: 1px solid var(--border-light);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    }

    [data-theme="dark"] .nav-links {
        background: rgba(15, 23, 42, 0.98);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--border-light);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.125rem;
        padding: 1.25rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links a:hover {
        background: var(--bg-secondary);
        color: var(--primary-color);
    }

    .theme-toggle {
        margin-top: 2rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 100px 0 60px;
    }

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

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
        max-width: 100%;
    }

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

    .nav-brand {
        font-size: 1.25rem;
    }

    .features {
        padding: 60px 0;
    }

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

    .gameplay {
        padding: 60px 0;
    }

    .gameplay-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .download {
        padding: 60px 0;
    }

    .footer .container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .tile-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .preview-tile {
        width: 70px;
        height: 70px;
        font-size: 1.1rem;
    }

    .game-preview {
        padding: 2rem;
    }

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

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

    .step {
        padding: 1.5rem;
    }

    .combo-cards {
        flex-direction: column;
    }

    .combo-card {
        min-width: 100%;
    }

    .scoring {
        padding: 60px 0;
    }

    .scoring-description {
        font-size: 1rem;
    }
}

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

    .preview-tile {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }

    .tile-grid {
        gap: 0.5rem;
    }

    .game-preview {
        padding: 1.5rem;
    }
}
