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

figure {
    margin: 0;
    padding: 0;
}

figcaption {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: #1a1a1a;
    background-color: #ffffff;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    /* Center the container */
}

.container {
    display: flex;
    width: 100%;
    max-width: 1600px;
    /* Limit max width */
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 250px;
    height: 100vh;
    position: sticky;
    /* change from fixed to sticky */
    top: 0;
    left: 0;
    padding: 40px;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    /* Ensure it stays white */
    z-index: 10;
    flex-shrink: 0;
    /* Prevent sidebar from shrinking */
}

.logo {
    margin-bottom: 60px;
    text-align: center;
    /* Centers the inline image */
}

nav ul {
    list-style: none;
}

nav li {
    margin-bottom: 20px;
}

nav a {
    text-decoration: none;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: block;
}

.submenu {
    margin-top: 20px;
    margin-left: 20px;
}

.submenu li {
    margin-bottom: 20px;
}

nav a:hover,
nav a.active {
    color: #000;
}

/* Hamburger & Mobile Overlay Defaults */
.hamburger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: #000;
    border-radius: 2px;
}

.mobile-nav-overlay {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0s linear 0.4s;
    visibility: hidden;
}

.mobile-nav-overlay.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0s linear 0s;
}

.closebtn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    text-decoration: none;
    color: #000;
}

.mobile-nav-content {
    text-align: center;
    display: flex;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-nav-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #181818;
    margin-bottom: 10px;
    display: block;
}

.mobile-nav-content a {
    text-decoration: none;
    color: #999;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    text-transform: uppercase;
}

.mobile-nav-content a.active {
    color: #000;
    font-weight: 600;
    /* As per desktop active style */
}


/* Main Content */
.content {
    /* removed margin-left and width calc */
    padding: 60px 60px 100px 60px;
    flex: 1;
    /* Take remaining space */
    width: auto;
    max-width: none;
    /* Remove wrapper constraint */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center children */
}

header,
section,
.back-to-top-container {
    max-width: 1000px;
    width: 100%;
}

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

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    /* Scaled up from 24px */
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2px;
    color: #181818;
}

.subtitle {
    font-size: 20px;
    /* Scaled up from 14px */
    color: #888;
    font-weight: 400;
    max-width: none;
    padding-left: 0;
    /* Remove inherited padding */
}

section {
    margin-bottom: 80px;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    /* Scaled up from 18px */
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: #181818;
    padding-left: 40px;
    /* Increased padding */
}

h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    /* Scaled up from 14px */
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 30px;
    color: #181818;
    padding-left: 40px;
    /* Increased padding */
}

p {
    font-size: 16px;
    color: #787878;
    margin-bottom: 20px;
    max-width: 900px;
    /* Increased to reduce right whitespace */
    padding-left: 40px;
    /* Increased padding */
}

/* Overview Specifics */
.action-button-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-button-container a {
    text-decoration: none;
}

.coming-soon {
    background-color: #1b1b1b;
    color: #fff;
    border: none;
    padding: 12px 30px;
    /* Slightly larger button */
    border-radius: 24px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;

    transition: background-color 0.4s ease, transform 0.2s ease;

    /* Ensures the link looks clean if using an <a> tag */
    text-decoration: none;
    display: inline-block;
}

/* This block handles the hover state */
.coming-soon:hover {
    background-color: #525252;
    color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.gallery-grid.six-cols {
    grid-template-columns: repeat(6, 1fr);
}

.gallery-grid img {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ideation */
/* Ideation */
.ideation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 images in one line */
    gap: 20px;
}

.ideation-grid img {
    width: 100%;
    aspect-ratio: 9 / 16;
    /* Enforce uniform vertical shape */
    object-fit: cover;
    /* Crop excess height to fit */
    border-radius: 8px;
    display: block;
}

/* Production & General Images */
.full-width-img {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 30px;
}

.full-width-img img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.medium-width-grid,
.medium-width-img {
    width: 75%;
    margin: 10px auto 30px auto;
}

.medium-width-img img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.mediumsmall-width-grid,
.mediumsmall-width-img {
    width: 65%;
    margin: 10px auto 30px auto;
}

.mediumsmall-width-img img {
    width: 100%;
    border-radius: 8px;
    display: block;
}


.small-width-grid,
.small-width-img {
    width: 55%;
    margin: 10px auto 30px auto;
}

.small-width-img img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.subsection {
    margin-bottom: 40px;
}

/* Appeal Test Specifics */
#appeal-test-subsection .appeal-content {
    display: flex;
    align-items: flex-start;
    /* Align top */
    gap: 40px;
    /* Space between text and video */
}

#appeal-test-subsection p {
    flex: 1;
    /* Text takes available space */
    max-width: none;
    /* Override general p max-width if needed */
}

.appeal-video {
    width: 300px;
    /* Smaller video size */
    height: auto;
    /* Maintain aspect ratio */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Core Game Loop Specifics */
#core-game-loop-subsection .core-loop-content {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

#core-game-loop-subsection p {
    flex: 1;
    max-width: none;
}

.core-loop-img {
    width: 450px;
    /* Slightly bigger */
}

.core-loop-img img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    height: auto;
}

/* Tutorial Specifics */
.tutorial-content {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.tutorial-content p {
    flex: 1;
}

.tutorial-video {
    width: 220px;
    /* Smaller width */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Level Planning Specifics */
.waves-img {
    width: 40%;
    /* Much smaller */
    margin: 10px auto 30px auto;
    /* Centered */
}

.waves-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.pools-img {
    width: 70%;
    /* Smaller width */
    margin: 10px auto 30px auto;
    /* Centered */
}

.pools-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Playtests */
.playtest-grid {
    display: flex;
    /* Flexbox for side-by-side with varying aspect ratios */
    gap: 20px;
    align-items: flex-start;
}

.playtest-grid img {
    height: 450px;
    /* Fixed larger height to equalize */
    width: auto;
    /* Maintain aspect ratio */
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

/* Responsive */
@media (max-width: 900px) {

    .gallery-grid,
    .ideation-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid.six-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        /* Remove flex-direction column from body as container handles it */
        display: block;
        /* Reset necessary for mobile overflow handling in some cases, but sticking to flex is fine usually. Let's keep flex column on container */
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px 30px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        z-index: 1001;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    .logo {
        margin-bottom: 0;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 40px 20px;
    }

    header {
        margin-bottom: 40px;
    }

    h1 {
        font-size: 32px;
    }

    h2,
    h3,
    p {
        padding-left: 0;
    }

    /* Shared Responsive Classes */
    .split-content,
    .appeal-content,
    .core-loop-content,
    .tutorial-content,
    .playtest-grid,
    .puzzle-layout,
    .about-grid,
    .comparison-grid {
        flex-direction: column !important;
        display: flex !important;
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 0 !important;
    }

    .responsive-media,
    .appeal-video,
    .core-loop-img,
    .tutorial-video,
    .waves-img,
    .pools-img,
    .playtest-grid img,
    .puzzle-images,
    .about-image img,
    .full-width-img img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .projects-grid,
    .three-cols-grid,
    .two-cols-grid,
    .gallery-grid,
    .ideation-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 0 !important;
    }

    .back-to-top-container {
        margin-top: 60px;
    }
}


/* Projects Grid (Landing Page) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
    margin-top: 20px;
}

.project-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 8px;
    /* Slight rounded edges */
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.project-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #181818;
}

.project-year {
    font-size: 14px;
    color: #999;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px 15px;
    }
}

/* Back to Top */
.back-to-top-container {
    text-align: center;
    margin-top: 40px;
}

.back-to-top {
    color: #999;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.back-to-top:hover {
    color: #000;
}

/* Salto & Drogo Specifics */
.three-cols-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 40px;
}

.two-cols-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 40px;
}

.two-cols-grid.large-gap {
    gap: 40px;
}

.grid-item img {
    width: 100%;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {

    .three-cols-grid,
    .two-cols-grid {
        grid-template-columns: 1fr;
        padding: 0;
    }
}

/* Ingame Studio Specifics */
.puzzle-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 0 0px;
}

.puzzle-text {
    flex: 1;
}

.puzzle-images {
    width: 40%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.puzzle-images img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Medusims Specifics */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.comparison-col h3 {
    text-align: center;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 20px;
}

.comparison-col .grid-item {
    margin-bottom: 20px;
}

.comparison-col .grid-item img {
    width: 100%;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .puzzle-layout {
        flex-direction: column;
        padding: 0;
    }

    .puzzle-images {
        width: 100%;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.open {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 32px;
    height: 32px;
    background-color: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2010;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
}


/* Make images in content look clickable */
.content img:not(.logo img):not(.no-lightbox) {
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.content img:not(.logo img):not(.no-lightbox):hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* About Page Specifics */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    margin-top: 40px;
}

.about-text h2 {
    font-size: 24px;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

.about-text p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 15px;
}

.about-image img {
    width: 100%;
    border-radius: 4px;
    display: block;
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}