/* ==================== */
/* CSS Reset & Base */
/* ==================== */

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

:root {
    /* Color Palette */
    --color-primary: #3366ff;
    --color-primary-dark: #2952cc;
    --color-primary-light: #6b8fff;
    --color-secondary: #4CAF50;
    --color-secondary-dark: #388E3C;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3366ff 0%, #5a4fb4 100%);
    --gradient-secondary: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a33 0%, #332652 50%, #261a40 100%);
    --gradient-hero: linear-gradient(180deg, #1a1a33 0%, #2a1f4d 100%);
    
    /* Neutral Colors */
    --color-bg-dark: #0f0f1e;
    --color-bg-medium: #1a1a33;
    --color-bg-light: #252545;
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-muted: rgba(255, 255, 255, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 40px rgba(51, 102, 255, 0.4);
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

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

/* ==================== */
/* Navigation */
/* ==================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
}

.chess-icon {
    font-size: 2rem;
}

.logo-text {
    background: linear-gradient(135deg, #ffffff 0%, #b8b8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

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

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

/* ==================== */
/* Hero Section */
/* ==================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.05;
}

.chess-piece {
    position: absolute;
    font-size: 120px;
    color: var(--color-text-primary);
    animation: float 6s ease-in-out infinite;
}

.piece-1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.piece-2 {
    bottom: 20%;
    left: 5%;
    animation-delay: 2s;
}

.piece-3 {
    top: 50%;
    right: 5%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(15deg);
    }
    50% {
        transform: translateY(-30px) rotate(-15deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(51, 102, 255, 0.2);
    border: 1px solid rgba(51, 102, 255, 0.4);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary-light);
    margin-bottom: var(--spacing-lg);
    animation: slideDown 0.6s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    animation: slideUp 0.6s ease-out 0.2s both;
}

.gradient-text {
    display: block;
    background: linear-gradient(135deg, #3366ff 0%, #9b6bff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    animation: slideUp 0.6s ease-out 0.4s both;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    animation: slideUp 0.6s ease-out 0.6s both;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp 0.6s ease-out 0.8s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==================== */
/* Buttons */
/* ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(51, 102, 255, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* ==================== */
/* Section Styles */
/* ==================== */

section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
}

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

/* ==================== */
/* Features Section */
/* ==================== */

.features {
    background: var(--color-bg-medium);
    position: relative;
}

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

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

.feature-card {
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(51, 102, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.feature-icon svg {
    color: white;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

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

/* ==================== */
/* How to Play Section */
/* ==================== */

.how-to-play {
    background: var(--gradient-dark);
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.instruction-card {
    text-align: center;
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    position: relative;
    transition: all 0.3s ease;
}

.instruction-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.instruction-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

.instruction-icon {
    font-size: 4rem;
    margin: var(--spacing-md) 0;
}

.instruction-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

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

/* ==================== */
/* Screenshots Section */
/* ==================== */

/* Screenshots Section - Updated for Real Images */

.screenshots {
    background: var(--color-bg-medium);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.screenshot-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: transform 0.3s ease;
    max-width: 400px; /* Limit each screenshot to 400px wide */
    margin: 0 auto; /* Center the item if it's smaller than grid column */
}

.screenshot-item:hover {
    transform: translateY(-8px);
}

.screenshot-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.screenshot-image:hover {
    box-shadow: 0 20px 60px rgba(51, 102, 255, 0.4);
    border-color: rgba(51, 102, 255, 0.3);
    transform: scale(1.02);
}

.screenshot-caption {
    text-align: center;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* Hide old placeholder styles */
.screenshot-placeholder,
.screenshots-note {
    display: none;
}

/* Responsive layouts */
@media (max-width: 768px) {
    .screenshots-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .screenshot-item:hover {
        transform: translateY(-4px);
    }
}

/* Desktop: 3 columns for 7 images */
@media (min-width: 769px) and (max-width: 1199px) {
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Optional: Center the 7th item in the grid */
    .screenshot-item:nth-child(7) {
        grid-column: 2 / 3;
    }
}

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

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.placeholder-content p {
    color: var(--color-text-secondary);
    font-weight: 600;
}

.screenshots-note {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ==================== */
/* Download Section */
/* ==================== */

.download {
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
}

.download-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    position: relative;
    overflow: hidden;
}

.download-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
}

.download-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.7;
    font-size: 1.125rem;
}

.app-store-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 1rem 2rem;
    background: var(--color-text-primary);
    color: var(--color-bg-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-xl);
}

.app-store-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.apple-icon {
    width: 32px;
    height: 32px;
}

.app-store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.app-store-text .small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.app-store-text .large {
    font-size: 1.25rem;
    font-weight: 700;
}

.download-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.download-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-secondary);
}

.download-feature svg {
    color: var(--color-secondary);
}

.download-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-piece {
    position: absolute;
    font-size: 6rem;
    opacity: 0.2;
    animation: floatPiece 4s ease-in-out infinite;
}

.piece-king {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.piece-queen {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    opacity: 0.3;
    animation-delay: 1s;
}

.piece-knight {
    bottom: 10%;
    right: 20%;
    animation-delay: 2s;
}

@keyframes floatPiece {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* ==================== */
/* Footer */
/* ==================== */

.footer {
    background: var(--color-bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.footer-description {
    color: var(--color-text-secondary);
    margin-top: var(--spacing-sm);
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.social-links {
    display: flex;
    gap: var(--spacing-md);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--gradient-primary);
    transform: translateY(-4px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
}

/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 768px) {
    .nav-links {
        gap: var(--spacing-md);
        font-size: 0.875rem;
    }
    
    .hero {
        min-height: auto;
        padding: var(--spacing-3xl) 0;
    }
    
    .features-grid,
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .download-card {
        grid-template-columns: 1fr;
    }
    
    .download-visual {
        height: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== */
/* Utility Classes */
/* ==================== */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== */
/* Animations */
/* ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Smooth scrolling for all browsers */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
