/*
 * Number Puzzle Website Styles
 */

:root {
    /* Colors - Medical/Blue Clean Theme */
    --primary: #007AFF;
    /* Bright Blue */
    --primary-dark: #0056B3;
    --secondary: #5AC8FA;
    /* Light Blue */
    --bg-main: #F2F2F7;
    --bg-white: #FFFFFF;
    --text-main: #1C1C1E;
    --text-muted: #8E8E93;
    --tile-bg: #E5E5EA;
    --tile-text: #000;

    /* Layout */
    --container: 1100px;
    --nav-height: 70px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-blue: 0 10px 20px rgba(0, 122, 255, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Friendly but geometric */
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-weight: 600;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-main);
}

.logo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--primary);
    padding: 2px;
    border-radius: 4px;
}

.logo-grid span {
    width: 12px;
    height: 12px;
    background: white;
    font-size: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
}

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

.nav-links a:not(.btn-nav) {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}

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

.btn-nav {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.btn-nav:hover {
    background: var(--primary-dark);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
}

/* Hero */
.hero {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 80px;
    overflow: hidden;
}

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

.tag {
    display: inline-block;
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 480px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-blue);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 122, 255, 0.35);
}

.play-icon {
    width: 24px;
    height: 24px;
}

.hero-stats {
    margin-top: 50px;
    display: flex;
    align-items: center;
    gap: 30px;
}

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

.stat-num {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-main);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-sep {
    width: 1px;
    height: 40px;
    background: #D1D1D6;
}

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

.puzzle-board {
    width: 340px;
    height: 340px;
    background: var(--bg-white);
    border-radius: 20px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
    transform: rotateX(20deg) rotateY(-10deg);
    /* 3D effect */
    transition: transform 0.5s ease;
}

.hero-visual:hover .puzzle-board {
    transform: rotateX(0deg) rotateY(0deg);
}

.tile {
    background: var(--bg-main);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.tile:not(:empty):hover {
    background: #E1E1E6;
}

/* Animation simulation */
.tile.t8 {
    animation: slideRight 3s infinite 2s;
}

@keyframes slideRight {

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

    10%,
    90% {
        transform: translateX(110%);
    }

    /* Slide into empty spot */
}

.floating-num {
    position: absolute;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.2;
    animation: float 6s infinite ease-in-out;
}

.n1 {
    font-size: 120px;
    top: 0;
    right: -20px;
    z-index: 1;
}

.n2 {
    font-size: 80px;
    bottom: 40px;
    left: -40px;
    z-index: 1;
    animation-delay: 1s;
}

.n3 {
    font-size: 60px;
    top: 20%;
    left: 0;
    z-index: 1;
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Section */
.section {
    padding: 100px 0;
}

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

.section-header h2 {
    font-size: 40px;
    margin-bottom: 16px;
}

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

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

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

.f-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 15px;
}

/* How to Play */
.how-to {
    background: white;
}

.how-to-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.phone-frame {
    width: 280px;
    height: 580px;
    background: #1C1C1E;
    border-radius: 40px;
    margin: 0 auto;
    padding: 10px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    position: relative;
}

.screen {
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    font-family: 'Roboto Mono';
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-muted);
}

.screen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    aspect-ratio: 1;
}

.s-tile {
    background: white;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-family: 'Roboto Mono';
    color: var(--primary-dark);
}

.s-tile.empty {
    background: transparent;
}

.finger-indicator {
    position: absolute;
    font-size: 40px;
    top: 60%;
    left: 60%;
    animation: tapMove 2s infinite;
    pointer-events: none;
}

@keyframes tapMove {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(0.9) translate(-50px, 0);
        opacity: 1;
    }

    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0;
    }
}

.steps-list {
    list-style: none;
}

.steps-list li {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.step-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Roboto Mono';
    padding-top: 4px;
}

.step-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.step-info p {
    color: var(--text-muted);
}

/* CTA */
.cta {
    padding-bottom: 100px;
}

.cta-box {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 80px 20px;
    border-radius: 30px;
    box-shadow: var(--shadow-blue);
}

.cta-box h2 {
    color: white;
    font-size: 42px;
    margin-bottom: 20px;
}

.cta-box p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.store-badge {
    background: black;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: 0.3s;
}

.store-badge:hover {
    background: #333;
    transform: scale(1.05);
}

.store-badge svg {
    width: 32px;
    height: 32px;
}

.store-badge .text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.store-badge .text span {
    font-size: 10px;
    text-transform: uppercase;
}

.store-badge .text strong {
    font-size: 18px;
}

/* Footer */
footer {
    background: white;
    padding: 60px 0;
    border-top: 1px solid #E5E5EA;
}

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

.footer-logo {
    margin-bottom: 10px;
}

.col.links {
    display: flex;
    gap: 30px;
}

.col.links a {
    font-size: 14px;
    color: var(--text-muted);
}

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

.col.copyright p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Mobile */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

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

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

    .how-to-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .steps-list li {
        flex-direction: column;
        gap: 10px;
    }

    .phone-frame {
        order: -1;
    }

    .footer-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Add JS toggle later */
    }

    .mobile-toggle {
        display: flex;
    }

    /* Mobile Menu Active State */
    .nav-links.active {
        display: flex;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 30px;
        box-shadow: var(--shadow-sm);
        border-bottom: 1px solid #eee;
    }

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