/* ============================================
   FLIPPED CAT - INDIE GAME STUDIO
   Light Theme - Enhanced
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent-primary: #ff6b35;
    --accent-secondary: #ff8c61;
    --border-light: #e5e5e5;
    --border-medium: #d4d4d4;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Spacing */
    --container-max: 900px;
    
    /* Animation */
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    background: #fafafa;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    
    /* Halftone dots + grain texture */
    background-image: 
        /* Grain layer */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.03'/%3E%3C/svg%3E"),
        /* Halftone dots */
        radial-gradient(circle, rgba(0, 0, 0, 0.08) 1px, transparent 1.5px);
    background-size: 200px 200px, 10px 10px;
    
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(250, 250, 250, 0.96) 100%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.8s var(--ease-out);
}

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

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cat-logo {
    width: 140px;
    height: auto;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.text-logo {
    width: 380px;
    height: auto;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.studio-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.social-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.social-links a:hover::before {
    left: 100%;
}

.social-links a:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-links a:active {
    transform: translateY(0);
}

/* Gallery */
.gallery {
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.gallery h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    position: relative;
}

.gallery h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.game-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-surface);
    padding: 1.25rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

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

.screenshot-wrapper {
    width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--bg-surface);
    transition: all 0.4s var(--ease-out);
    cursor: pointer;
}

.screenshot-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.screenshot-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.screenshot-wrapper:hover::after {
    opacity: 1;
}

.game-grid img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    transition: transform 0.4s var(--ease-out);
}

.screenshot-wrapper:hover img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 3rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.875rem;
    animation: fadeInUp 0.8s var(--ease-out) 0.6s both;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-out);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s var(--ease-out);
}

.lightbox.active img {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 48px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Lightbox navigation arrows */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    padding: 1.5rem;
    transition: all 0.3s ease;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: 40px;
}

.nav-btn.next {
    right: 40px;
}

/* Scroll reveal animations */
@media (prefers-reduced-motion: no-preference) {
    .gallery h2,
    .game-description,
    .game-grid,
    .cta,
    .footer {
        opacity: 0;
        animation: fadeInUp 0.8s var(--ease-out) both;
    }
    
    .gallery h2 { animation-delay: 0.4s; }
    .game-description { animation-delay: 0.5s; }
    .game-grid { animation-delay: 0.6s; }
    .cta { animation-delay: 0.8s; }
    .footer { animation-delay: 1s; }
    
    .screenshot-wrapper {
        opacity: 0;
        animation: fadeInUp 0.6s var(--ease-out) both;
    }
    
    .screenshot-wrapper:nth-child(1) { animation-delay: 0.7s; }
    .screenshot-wrapper:nth-child(2) { animation-delay: 0.8s; }
    .screenshot-wrapper:nth-child(3) { animation-delay: 0.9s; }
    .screenshot-wrapper:nth-child(4) { animation-delay: 1.0s; }
    .screenshot-wrapper:nth-child(5) { animation-delay: 1.1s; }
    .screenshot-wrapper:nth-child(6) { animation-delay: 1.2s; }
}

/* Responsive */
@media (max-width: 1200px) {
    .text-logo {
        width: 320px;
    }

    .logo-wrapper {
        gap: 1.25rem;
    }
}

@media (max-width: 900px) {
    .text-logo {
        width: 280px;
    }

    .logo-wrapper {
        gap: 1rem;
    }
    
    .nav-btn {
        font-size: 36px;
        padding: 1rem;
    }
    
    .nav-btn.prev {
        left: 20px;
    }
    
    .nav-btn.next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }
    
    .hero {
        margin-bottom: 2rem;
        padding: 1.5rem;
    }
    
    .logo-wrapper {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .cat-logo {
        width: 120px;
    }
    
    .text-logo {
        width: 350px;
    }
    
    .tagline {
        font-size: 0.875rem;
        margin-top: 1rem;
        letter-spacing: 1px;
    }
    
    .studio-description {
        font-size: 0.875rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .social-links a {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .gallery h2 {
        font-size: 1.25rem;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .lightbox img {
        max-width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .hero {
        padding: 1.25rem;
    }
    
    .cat-logo {
        width: 100px;
    }
    
    .text-logo {
        width: 300px;
    }
    
    .social-links {
        gap: 0.5rem;
    }
    
    .social-links a {
        font-size: 0.8rem;
        padding: 0.5rem 0.875rem;
    }
    
    .gallery h2::after {
        width: 40px;
    }
    
    .cta {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Accessibility - Focus styles */
a:focus, button:focus, .close-btn:focus, .nav-btn:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .screenshot-wrapper {
        opacity: 1;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        background-image: none;
    }
    
    .social-links,
    .lightbox,
    .nav-btn {
        display: none !important;
    }
    
    .container {
        padding: 0;
    }
    
    .screenshot-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
