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

/* CSS Variables for consistent navbar height */
:root {
    --nav-h: 80px;
}

@media (max-width: 480px) {
    :root {
        --nav-h: 70px;
    }
}

/* Ensure no gaps between sections */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Remove any default spacing */
section, div, article, aside, header, footer, nav, main {
    margin: 0;
    padding: 0;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Hide content while loading */
body:not(.loaded) .hero,
body:not(.loaded) .portfolio,
body:not(.loaded) .services,
body:not(.loaded) .contact,
body:not(.loaded) .all-games,
body:not(.loaded) .games-header,
body:not(.loaded) .back-to-home,
body:not(.loaded) footer {
    opacity: 0;
}

/* Fade in content after loading */
body.loaded .hero,
body.loaded .portfolio,
body.loaded .services,
body.loaded .contact,
body.loaded .all-games,
body.loaded .games-header,
body.loaded .back-to-home,
body.loaded footer {
    opacity: 1;
    animation: fadeInContent 0.8s ease forwards;
}

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

.loading-content {
    text-align: center;
    position: relative;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: logoFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

/* Mobile loading logo */
@media (max-width: 768px) {
    .loading-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.loading-spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #a0a0a0;
    font-size: 1.1rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Mobile loading text */
@media (max-width: 768px) {
    .loading-text {
        font-size: 0.95rem;
    }
    
    .loading-spinner-ring {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 0.85rem;
    }
    
    .loading-spinner-ring {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding-top: var(--nav-h);
}

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

/* Section Reset */
section {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    vertical-align: baseline;
}

/* Remove any gaps between sections */
.hero + .portfolio {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Prevent anchor links from hiding under the fixed navbar */
section, [id] {
    scroll-margin-top: calc(var(--nav-h) + 10px);
}

/* Optional: Override body offset for pages without fixed nav */
body.page-no-nav {
    padding-top: 0;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(25px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-h);
}

.nav-logo {
    display: flex;
    align-items: left;
}

/* fix the nav menu offset */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
    align-items: center;
  }

.nav-logo a {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.nav-logo a:hover {
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.nav-logo-img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
    margin-right: 10px;
}

.nav-logo a:hover .nav-logo-img {
    transform: scale(1.1);
}


.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 80%;
}

/* Contact Us Button in Nav */
.nav-menu li:last-child .nav-link {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    border: 2px solid transparent;
}

.nav-menu li:last-child .nav-link:hover {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.nav-menu li:last-child .nav-link::after {
    display: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section - Collage Background Design */
.hero {
    min-height: calc(100vh - var(--nav-h)); /* Fallback for older browsers */
    height: auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    will-change: transform;
    transform: translateZ(0);
}

/* Modern override for browsers that support dvh */
@supports (height: 100dvh) {
    .hero {
        min-height: calc(100dvh - var(--nav-h));
    }
}

/* Hero Background Image */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-image: url('Images/bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.game-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.icon-1 { top: 15%; left: 8%; animation-delay: 0s; }
.icon-2 { top: 25%; right: 12%; animation-delay: 1.5s; }
.icon-3 { top: 65%; left: 15%; animation-delay: 3s; }
.icon-4 { top: 75%; right: 20%; animation-delay: 4.5s; }
.icon-5 { top: 35%; left: 3%; animation-delay: 6s; }
.icon-6 { top: 45%; right: 3%; animation-delay: 7.5s; }

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.hero-container {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    padding: 0 20px;
    width: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2rem;
}

.hero-title {
    font-size: 4.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.6rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.2s both;
    color: #ffffff;
    font-weight: 400;
    line-height: 1.5;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Clear CTAs */
.hero-ctas {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem 0;
    animation: fadeInUp 1s ease 0.4s both;
}

.cta-primary {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #ffffff;
    padding: 18px 36px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, #a855f7, #c084fc);
}

.cta-secondary {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 18px 36px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 200px;
    text-align: center;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Supporting Stats */
.hero-stats {
    display: flex;
    gap: 4rem;
    justify-content: center;
    margin-top: 3rem;
    animation: fadeInUp 1s ease 0.8s both;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 2rem 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-item:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes backgroundMove {
    0% { background-position: 0 0, 100px 100px, 200px 200px; }
    100% { background-position: 200px 200px, 300px 300px, 400px 400px; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Portfolio Section */
.portfolio {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 60px 0 100px 0;
    position: relative;
    overflow: hidden;
    margin: 0;
    will-change: transform;
    transform: translateZ(0);
}

.portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-size: 200px 200px, 300px 300px;
    background-position: 0 0, 100px 100px;
    background-repeat: repeat;
    opacity: 0.2;
    animation: backgroundMove 25s linear infinite;
}

.portfolio h2 {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
}

.portfolio .container {
    position: relative;
    z-index: 2;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Placeholder */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border-radius: 15px;
    border: 1px solid #333;
}

/* Mobile loading placeholder */
@media (max-width: 768px) {
    .loading-placeholder {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .loading-placeholder {
        padding: 2.5rem 1rem;
        border-radius: 12px;
    }
    
    .loading-placeholder p {
        font-size: 1rem;
    }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-placeholder p {
    color: #b0b0b0;
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.portfolio-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(139, 92, 246, 0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.portfolio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.portfolio-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
}

.portfolio-card:hover::before {
    opacity: 1;
}

.portfolio-image {
    height: 200px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 1.2rem;
    font-weight: 400;
    position: relative;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #a0a0a0;
    font-size: 1.2rem;
    font-weight: 400;
}

/* Portfolio hover overlay */
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.overlay-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #8b5cf6;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    position: relative;
    z-index: 2;
}

.portfolio-info p {
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
    opacity: 0.9;
}

.game-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Services Section */
.services {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-size: 250px 250px, 350px 350px;
    background-position: 0 0, 125px 125px;
    background-repeat: repeat;
    opacity: 0.15;
    animation: backgroundMove 30s linear infinite;
}

.services h2 {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
}

.services .container {
    position: relative;
    z-index: 2;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.4s ease;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.4));
    position: relative;
    z-index: 2;
}

.service-card h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #8b5cf6;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    position: relative;
    z-index: 2;
}

.service-card p {
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
    opacity: 0.9;
}

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

.service-features li {
    color: #ffffff;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.service-features li::before {
    content: '▶';
    color: #ffffff;
    position: absolute;
    left: 0;
    font-size: 0.8rem;
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-size: 300px 300px, 400px 400px;
    background-position: 0 0, 150px 150px;
    background-repeat: repeat;
    opacity: 0.1;
    animation: backgroundMove 35s linear infinite;
}

.contact h2 {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
}

.contact .container {
    position: relative;
    z-index: 2;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    font-size: 1.1rem;
    color: #ffffff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

/* Fix dropdown option visibility */
.form-group select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 12px;
}

.submit-button {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #ffffff;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-button:hover {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    color: #ffffff;
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect width="200" height="200" fill="%2316203e"/><circle cx="50" cy="50" r="20" fill="%23a855f7" opacity="0.2"/><circle cx="150" cy="80" r="15" fill="%23c084fc" opacity="0.1"/><rect x="100" y="120" width="40" height="40" fill="%23feca57" opacity="0.1"/></svg>');
    background-size: 200px 200px;
    background-position: 0 0;
    background-repeat: repeat;
    opacity: 0.05;
    animation: backgroundMove 40s linear infinite;
}

.footer .container {
    position: relative;
    z-index: 2;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: #8b5cf6;
    margin-bottom: 1.5rem;
    font-weight: 800;
    font-size: 1.4rem;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    opacity: 0.8;
}

.footer-section ul li a:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transform: translateX(5px);
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    color: #ffffff;
    font-size: 1rem;
    opacity: 0.8;
}

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

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

/* Responsive Design - Mobile First Approach */

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .portfolio h2,
    .services h2,
    .contact h2 {
        font-size: 3rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    /* Navigation */
    .hamburger {
        display: flex;
    }

    .nav-container {
        height: 80px;
        padding: 0 20px;
    }
    
    .nav-logo {
        margin-left: 0;
    }
    
    .nav-logo a {
        font-size: 1.5rem;
    }
    
    .nav-logo-img {
        height: 60px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--nav-h);
        flex-direction: column;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(25px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.5);
        padding: 2rem 0;
        border-top: 1px solid rgba(0, 212, 255, 0.2);
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        padding: 12px 20px;
        margin: 5px 0;
        font-size: 1.1rem;
    }

    /* Hero Section */
    .hero-title {
        font-size: 3rem;
        line-height: 1.2;
        padding: 0 10px;
    }

    .hero-subtitle {
        font-size: 1.15rem;
        max-width: 90%;
        padding: 0 15px;
    }
    
    .hero-ctas {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .cta-primary,
    .cta-secondary {
        min-width: 200px;
        padding: 14px 28px;
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .stat-item {
        min-width: 200px;
        padding: 1.2rem 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }

    /* Floating Icons - Reduce on mobile */
    .game-icon {
        font-size: 2rem;
        opacity: 0.4;
    }

    /* Section Headers */
    .portfolio h2,
    .services h2,
    .contact h2 {
        font-size: 2.8rem;
        margin-bottom: 2rem;
    }

    /* Portfolio */
    .portfolio {
        padding: 80px 0;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-card {
        margin: 0 auto;
        max-width: 400px;
    }

    /* Services */
    .services {
        padding: 80px 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    .service-card h3 {
        font-size: 1.6rem;
    }
    
    .service-icon {
        font-size: 3rem;
    }

    /* Contact */
    .contact {
        padding: 80px 0;
    }
    
    .contact-form {
        padding: 2rem;
        margin: 0 10px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .submit-button {
        padding: 16px 30px;
        font-size: 1.1rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* Navigation */
    .nav-container {
        height: 70px;
        padding: 0 15px;
    }
    
    .nav-logo a {
        font-size: 1.3rem;
    }
    
    .nav-logo-img {
        height: 50px;
    }
    
    .nav-menu {
        top: 70px;
        padding: 1.5rem 0;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.15;
        padding: 0 15px;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        max-width: 95%;
        margin-bottom: 1.5rem;
        padding: 0 15px;
    }
    
    .hero-ctas {
        margin: 1.5rem 0;
    }
    
    .cta-primary,
    .cta-secondary {
        min-width: 100%;
        max-width: 280px;
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .hero-content {
        padding: 0 10px;
    }

    .hero-stats {
        margin-top: 1.5rem;
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 160px;
        padding: 1rem 1.2rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }

    /* Floating Icons - Minimal on small mobile */
    .game-icon {
        font-size: 1.5rem;
        opacity: 0.3;
    }

    /* Section Headers */
    .portfolio h2,
    .services h2,
    .contact h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        padding: 0 15px;
        word-wrap: break-word;
    }
    
    /* Ensure containers don't overflow */
    .container {
        padding: 0 15px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Portfolio */
    .portfolio {
        padding: 60px 0;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 10px;
    }
    
    .portfolio-card {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .portfolio-image {
        height: 180px;
    }
    
    .portfolio-info {
        padding: 1.2rem;
    }
    
    .portfolio-info h3 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .portfolio-info p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .game-stats {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .stat {
        font-size: 0.85rem;
        padding: 0.25rem 0.6rem;
    }

    /* Services */
    .services {
        padding: 60px 0;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-card h3 {
        font-size: 1.4rem;
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .service-card p {
        font-size: 1rem;
    }

    /* Contact */
    .contact {
        padding: 60px 0;
    }
    
    .contact-form {
        padding: 1.5rem;
        margin: 0 5px;
        max-width: 100%;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 14px 16px;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    .submit-button {
        padding: 16px 30px;
        font-size: 1rem;
        width: 100%;
    }

    /* Footer */
    .footer {
        padding: 2.5rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding: 0 10px;
    }
    
    .footer-section {
        padding: 0 10px;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .footer-section p,
    .footer-section ul li {
        font-size: 0.95rem;
    }
    
    .footer-bottom {
        padding: 1.5rem 10px 0;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 2rem;
        padding: 0 10px;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .cta-primary,
    .cta-secondary {
        min-width: 95%;
        max-width: 260px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .stat-item {
        min-width: 150px;
        padding: 1rem 1.2rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .portfolio h2,
    .services h2,
    .contact h2 {
        font-size: 1.8rem;
        padding: 0 10px;
    }
    
    .contact-form {
        padding: 1.2rem;
        margin: 0;
    }
    
    .games-title {
        font-size: 1.8rem;
    }
    
    .games-subtitle {
        font-size: 0.9rem;
    }
    
    .portfolio-card,
    .service-card {
        margin: 0 5px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .hero-content {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-ctas {
        margin: 1rem 0;
    }
    
    .hero-stats {
        margin-top: 1rem;
        flex-direction: row;
        gap: 2rem;
    }
    
    .stat-item {
        min-width: 120px;
        padding: 0.8rem 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Games Page Styles */
.games-header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 120px 0 80px;
    text-align: center;
}

.games-title {
    font-size: 3.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.games-subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
    opacity: 0.8;
}

.all-games {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 80px 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive grid for games page */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 10px;
    }
    
    .games-header {
        padding: 100px 0 60px;
    }
    
    .games-title {
        font-size: 2.5rem;
        padding: 0 15px;
    }
    
    .games-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .all-games {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 5px;
    }
    
    .games-header {
        padding: 90px 0 50px;
    }
    
    .games-title {
        font-size: 2rem;
        padding: 0 15px;
        line-height: 1.2;
    }
    
    .games-subtitle {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    
    .all-games {
        padding: 50px 0;
    }
}

.back-to-home {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a0a 100%);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Mobile back button */
@media (max-width: 480px) {
    .back-to-home {
        padding: 30px 0;
    }
    
    .back-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Portfolio Actions */
.portfolio-actions {
    text-align: center;
    margin-top: 3rem;
}

.view-all-btn {
    display: inline-block;
    padding: 18px 40px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-all-btn:hover {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6);
}

/* Mobile portfolio actions */
@media (max-width: 768px) {
    .portfolio-actions {
        margin-top: 2rem;
    }
    
    .view-all-btn {
        padding: 16px 32px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .portfolio-actions {
        margin-top: 1.5rem;
        padding: 0 10px;
    }
    
    .view-all-btn {
        padding: 14px 28px;
        font-size: 1rem;
        width: 90%;
        max-width: 300px;
    }
}

/* --- Section seam killer --- */

/* 0) Give every big section its own stacking/painting context */
.hero, .portfolio, .services, .contact, .footer {
    position: relative;
    z-index: 0;         /* anchor the section */
    isolation: isolate; /* keep children from escaping */
    contain: paint;     /* prevent cross-section repaint artifacts */
    transform: none;    /* no GPU layer forcing */
    will-change: auto;
  }
  
  /* 1) Ensure the decorative ::before layers sit *under* content */
  .portfolio::before,
  .services::before,
  .contact::before,
  .footer::before {
    z-index: -1;            /* was 1 */
    pointer-events: none;
  }
  
  /* 2) Kill any sub-pixel gap outright by overlapping 1px */
  .hero { margin-bottom: -1px; }
  .portfolio, .services, .contact, .footer { margin-top: 0; }
  
  /* 3) Avoid background bleed at edges during scroll */
  .hero, .portfolio, .services, .contact, .footer {
    background-clip: padding-box;
  }
  
  /* 4) If the band appears only while animating, limit GPU churn */
  .hero-background,
  .portfolio::before,
  .services::before,
  .contact::before,
  .footer::before {
    will-change: background-position; /* not transform */
    transform: none !important;
    backface-visibility: hidden;
  }
  
  /* 5) Safer anchor offset */
  html { scroll-padding-top: calc(var(--nav-h) + 10px); }
  section,[id] { scroll-margin-top: 0; } /* neutralize earlier rule */
  
  /* 6) Optional: if your navbar's backdrop-filter is triggering a repaint bug */
  .navbar {
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    transform: translateZ(0); /* isolate just the navbar */
  }
  
  /* put this at the very end of your CSS */
.hero { 
    transform: none !important;   /* overrides the inline style */
    translate: none !important;   /* covers newer shorthand */
    will-change: auto !important;
    overflow: visible !important;
  }
  