body {
    font-family: sans-serif;
    margin: 0;
    background-color: #fdfdfd;
    color: #ff340a;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: transparent;
    border-bottom: 1px solid #eee;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    margin-right: 20px;
}

nav a {
    text-decoration: none;
    color: #ff340a;
    font-weight: bold;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
}

.hero {
    text-align: center;
    padding: 0 20px;
}

.hero h2 {
    font-size: 48px;
    margin: 0 0 10px;
}

.scaled-text h2 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(2rem, 10vw, 6rem);
    margin: 0;
}

.hero p {
    font-size: 18px;
    color: #ff340a;
}

.gallery {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 80px; /* Space between lanes */
}

.gallery-lane {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: stretch; /* Stretch items to fill the lane height */
    min-height: 70vh; /* Make lanes much taller */
    width: 100%;
    box-sizing: border-box;
}

.grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.grid-item.show {
    opacity: 1;
    transform: translateY(0);
}

.grid-item:nth-child(1) { transition-delay: 0.1s; }
.grid-item:nth-child(2) { transition-delay: 0.2s; }
.grid-item:nth-child(3) { transition-delay: 0.3s; }
.grid-item:nth-child(4) { transition-delay: 0.4s; }
.grid-item:nth-child(5) { transition-delay: 0.5s; }
.grid-item:nth-child(6) { transition-delay: 0.6s; }
.grid-item:nth-child(7) { transition-delay: 0.7s; }
.grid-item:nth-child(8) { transition-delay: 0.8s; }
.grid-item:nth-child(9) { transition-delay: 0.9s; }
.grid-item:nth-child(10) { transition-delay: 1.0s; }
.grid-item:nth-child(11) { transition-delay: 1.1s; }
.grid-item:nth-child(12) { transition-delay: 1.2s; }

.grid-item iframe {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px; /* This will curve the corners */
    -webkit-mask-image: -webkit-radial-gradient(center, ellipse farthest-corner, white, black);
    mask-image: radial-gradient(ellipse farthest-corner at center, white, black);
}

.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px; /* This will curve the corners */
    -webkit-mask-image: -webkit-radial-gradient(center, ellipse farthest-corner, white, black);
    mask-image: radial-gradient(ellipse farthest-corner at center, white, black);
}

.grid-row-special {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    grid-column: 1 / -1;
    align-items: start;
}

.text-item {
    padding: 40px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 20px;
}

footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    border-top: 1px solid #eee;
}

.fluid-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    z-index: -1;
}

.layout-section {
    padding: 80px 40px;
}

#layout-1 {
    background-color: transparent;
}

#layout-2 {
    background-color: #f0f0f0;
    overflow: hidden;
}

#layout-3 {
    background-color: #f0f0f0;
}

.portfolio-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px 40px; /* Reduced padding */
    background-color: #ffffff;
    overflow: hidden; /* To contain the overlapping elements */
}

.portfolio-main-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    position: relative; /* Needed for z-index stacking */
    z-index: 2; /* Ensure content is above the background title */
}

.about-me-text {
    max-width: 400px;
    text-align: left;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2rem; /* Increased font size as requested */
}

.about-me-signature {
    width: 150px; /* Or a size that you prefer */
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-image-container {
    width: 450px; /* Increased size */
    text-align: center;
}

.portfolio-overlay-image {
    width: 100%;
    height: auto;
    border-radius: 20px; /* This will curve the corners */
}

.signature {
    margin-top: 15px;
}

.signature .name {
    font-weight: bold;
    margin: 0;
}

.signature .title {
    margin: 0;
    font-size: 0.9em;
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
    padding: 40px 0;
    background-color: #ffffff;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.1rem, 10.5vw, 7rem); /* 30% smaller */
    line-height: 1;
    font-weight: bold;
    text-align: center;
}

.marquee-content {
    display: inline-block;
}

.portfolio-title-mobile {
    display: none; /* Hidden by default */
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 15vw, 10rem);
    line-height: 1;
    font-weight: bold;
    text-align: center;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.portfolio-section h1.portfolio-title-desktop {
    position: absolute;
    top: 50%;
    left: 40px; /* Align to the left with padding */
    transform: translateY(-50%);
    font-size: clamp(3rem, 20vw, 15rem);
    margin: 0;
    line-height: 1;
    text-align: left; /* Align text to the left */
    z-index: 1;
    color: rgba(0, 0, 0, 0.05); /* Make it light to act as a background */
    pointer-events: none; /* Prevent it from interfering with mouse events */
}

.accent-text {
    color: #ff340a;
}

.portfolio-title-mobile {
    display: none;
}

.logo {
    order: -1;
    margin-bottom: 20px;
}

.desktop-nav {
    width: 100%;
}

.desktop-nav ul {
    justify-content: space-around;
}

.desktop-nav li {
    margin-right: 0;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
}

.mobile-menu-overlay {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .marquee-desktop {
        display: none; /* Hide marquee on mobile */
    }

    .desktop-nav {
        display: none; /* Hide desktop nav on mobile */
    }

    .menu-toggle {
        display: block; /* Show hamburger menu on mobile */
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        background: none;
        border: none;
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: #ff340a;
        margin: 5px 0;
        transition: all 0.3s ease;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        transform: rotate(-45deg);
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.95);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
    }

    .mobile-nav li {
        margin: 30px 0;
    }

    .mobile-nav a {
        font-size: 2rem;
        color: #ff340a;
        text-decoration: none;
    }

    .social-links {
        text-align: center;
        margin-top: 20px;
    }

    .social-links ul {
        list-style: none;
        padding: 0;
    }

    .social-links li {
        margin: 10px 0;
    }

    .social-links a {
        display: inline-flex;
        align-items: center;
        margin: 0 15px;
        font-size: 1.2rem;
        color: #ff340a;
        text-decoration: none;
        font-weight: bold;
    }

    .social-links i {
        margin-right: 10px;
        font-size: 1.5rem;
    }


    .layout-section {
        padding: 40px 20px;
    }

    header {
        flex-direction: column;
    }

    .logo {
        order: -1;
        margin-bottom: 20px;
    }

    nav {
        width: 100%;
    }

    nav ul {
        justify-content: space-around;
    }

    nav li {
        margin-right: 0;
    }

    .hero h2 {
        font-size: 36px;
    }

    .gallery {
        padding: 0 20px;
    }
    
    .portfolio-section {
        padding: 40px 20px;
        flex-direction: column; /* Ensure it's a column for ordering */
        gap: 0; /* Reduced gap for mobile view */
    }

    .portfolio-main-content {
        flex-direction: column;
        order: 2; /* This will be overridden by individual orders */
        display: contents; /* This allows children to be flex items of the parent */
    }

    .about-me-text {
        text-align: center;
        order: 4; /* Move to the end */
        margin-top: 20px;
        font-size: 1.5rem; /* Adjust font size for mobile */
    }

    .portfolio-title-desktop {
        display: none;
    }

    .portfolio-title-mobile {
        display: block;
    }

    .portfolio-title-before {
        order: 1; /* Title comes first */
    }

    .portfolio-image-container {
        width: 100%;
        margin-top: 20px;
        order: 2; /* Image comes second */
    }

    .portfolio-title-after {
        order: 3; /* Title comes third */
    }

    #social-media h2 {
        text-align: center;
    }
}

#collaborations-gallery {
    align-items: start;
    min-height: auto;
}

#collaborations-gallery .grid-item {
    aspect-ratio: 1 / 1;
}

#collaborations-gallery .grid-item {
    animation: scroll 20s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

#logo-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content; /* 🔑 key fix */
    gap: 10px;
    align-items: center;
    width: 100%;
    overflow-x: auto;              /* allow horizontal scroll if needed */
    --logoHeight: clamp(36px, 8vw, 90px);
}


#logo-gallery .grid-item {
    height: var(--logoHeight); /* consistent row height that scales with viewport */
}

#logo-gallery .grid-item img {
    /* Override global image styling for logos */
    width: 100%;
    height: 100%;
    object-fit: contain;      /* keep logo proportions */
    border-radius: 0;         /* logos typically without rounded corners */
}
