html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- Common UI Elements --- */
.btn-custom {
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-green {
    background-color: var(--text-primary);
    color: white;
    border: 1px solid var(--text-primary);
}

.btn-green:hover {
    background-color: #3e4b2e;
    color: white;
}

.btn-white {
    color: #4F5F3A;
    border: 1px solid #4F5F3A
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #333;
    color: #333;
}

/* ================= HERO SECTION ================= */
.portfolio-hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 20px;
    padding: 60px 8%;
    align-items: center;
    min-height: 90vh;
}

/* Col 1: Title */
.main-heading {
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.mini-img-wrapper {
    margin-top: 30px;
    width: 305px;
    height: 138px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #F6F3EC;
    box-shadow: -2px 3px 9px 0px #0000001A,
        -7px 14px 15px 0px #00000017,
        -15px 31px 21px 0px #0000000D,
        -27px 56px 25px 0px #00000003,
        -42px 87px 27px 0px #00000000;
    background: rgba(0, 0, 0, 0.4);
}

.mini-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Col 2: Center Image */
.center-img-frame {
    width: 100%;
    height: 550px;
    border-radius: 20px;
    /* Top rounded */
    overflow: hidden;
    border: 3px solid #F6F3EC;
    box-shadow: -2px 3px 9px 0px #0000001A,
        -7px 14px 15px 0px #00000017,
        -15px 31px 21px 0px #0000000D,
        -27px 56px 25px 0px #00000003,
        -42px 87px 27px 0px #00000000;
}

.center-img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Col 3: Right Side */
.hero-col-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.right-top-img {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #F6F3EC;
    box-shadow: -2px 3px 9px 0px #0000001A,
        -7px 14px 15px 0px #00000017,
        -15px 31px 21px 0px #0000000D,
        -27px 56px 25px 0px #00000003,
        -42px 87px 27px 0px #00000000;
}

.right-top-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-text-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* ================= EXPLORE SECTION ================= */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.explore-main-content {
    flex: 1;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    /* Stack filters on top of the grid */
}

/* Filter Tabs */
.work-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    width: 100%;
}

.filter-btn {
    background: transparent;
    border: 1px solid #ccc;
    padding: 8px 25px;
    border-radius: 15px;
    font-family: var(--font-body);
    color: #2B2B2B;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active {
    background: #4F5F3A2E;
    border: 1px solid #4F5F3A;
}

.filter-btn:hover {
    background: #8c9d762e;
}

/* Content Grid */
.explore-content-grid {
    display: flex;
    align-items: flex-start;
    gap: 50px;
    width: 100%;
}

/* Image Stack Logic */
.image-stack-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stack-nav {
    display: flex;
    gap: 15px;
}

/* Work Details */
.social-icon {
    margin-top: -1px;
    margin-left: -10px;
}

.social-icon a {
    color: var(--text-primary);
}

.svg-social-icons {
    width: 22px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(33%) sepia(14%) saturate(774%) hue-rotate(47deg);
}

.work-details {
    flex: 1;
    text-align: right;
}

.work-title {
    font-size: 2.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 500;
}

.work-desc {
    color: #575757;
    line-height: 1.7;
    min-height: 100px;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.work-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: flex-end;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    justify-content: flex-end;
}

.explore-container {
    display: flex;
    border-radius: 30px;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    /* height: 100vh;  */
    background: #E0E2D9;
    padding: 40px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0 40px 40px 0 !important;
    position: sticky;
    top: 0;
}

/* Navigation Links */
.side-link {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-family: var(--font-body), sans-serif;
    font-size: 1.1rem;
    color: #4F5F3A;
    /* Darker olive color from image */
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
}

/* Active State - Creating the "inset" look from Image 2 */
.side-link.active {
    background-color: #F6F3EC;
    color: #4F5F3A;
    /* This shadow creates the subtle depth seen in the 2nd image */
    box-shadow: inset 4px 0px 8px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.05);
    border-left: 3px solid #4F5F3A;
}

/* The Green Left Accent Bar */
/* .side-link.active::before {
    content: '';
    width: 5px;
    height: 100%;
    background: #4F5F3A;
    position: absolute;
    left: 4px;
    border-radius: 16px 0 0 16px;
} */

/* Logo Section */
.sidebar-logo {
    text-align: center;
    padding-bottom: 20px;
}

.sidebar-logo img {
    max-width: 140px;
    height: auto;
}

/* ================= TRUSTED BY ================= */
.title-wrapper {
    text-align: center;
}

.title-inner {
    display: inline-block;
}

.section-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 700;
}

.divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg,
            rgba(192, 132, 61, 0) 0%,
            #C0843D 48.56%,
            rgba(192, 132, 61, 0) 100%);
}

/* ================= TRUSTED BY (UPDATED) ================= */
.logos-carousel {
    position: relative;
    margin: 0px 60px 60px 60px ;
    display: flex;
    align-items: center;
}

.logos-track {
    display: flex;
    gap: 100px;
    align-items: center;
    padding: 40px 0;

    overflow: visible;
    white-space: nowrap;
    width: max-content;

    /* 40s is the speed - change to 20s for faster, 60s for slower */
    animation: infiniteScroll 40s linear infinite;
}

/* The Animation */
@keyframes infiniteScroll {
    from {
        transform: translateX(0);
    }

    to {
        /* This moves the track by exactly half (since you have 2 sets of logos) */
        transform: translateX(-50%);
    }
}

/* STOP animation on hover OR when clicking arrows */
.logos-carousel:hover .logos-track,
.logos-carousel:active .logos-track {
    animation-play-state: paused;
}

/* Optimization for the mask to stay fixed while logos move */
.logos-carousel {
    overflow: hidden;
    /* Important: masks the logos outside the container */
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

/* Ensure arrows sit on top of the moving track */
.carousel-arrow {
    /* z-index: 101; */
}

.logos-track img {
    height: 100px;
    /* MUCH BIGGER LOGO SIZE */
    width: auto;
    flex-shrink: 0;
    filter: none;
    /* Keeps original brand colors */
    opacity: 1;
    transition: transform 0.3s ease;
}

.logos-track img:hover {
    transform: scale(1.1);
    /* Subtle grow effect on hover */
}

/* Big, Round Floating Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    /* Big circular button */
    height: 40px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    /* Soft shadow to make it pop like your 2nd image */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.carousel-arrow i {
    font-size: 1.5rem;
    /* Larger arrow icon */
    color: #333;
}

.carousel-arrow:hover {
    background-color: #a1ad91;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow.left {
    left: 0;
}

.carousel-arrow.right {
    right: 0;
}

/* Completely hide the scrollbar */
.logos-track::-webkit-scrollbar {
    display: none;
}

.logos-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ================= MOBILE RESPONSIVE (Matches Mobile Portfolio.jpg) ================= */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .mobile-only {
        display: block;
    }

    /* Hero Changes */
    .portfolio-hero {
        display: flex;
        flex-direction: column;
        padding: 30px 5%;
        gap: 30px;
        text-align: center;
    }

    .main-heading {
        font-family: var(--font-heading);
        font-size: 2.8rem;
        margin-bottom: 10px;
    }

    /* In mobile design, Image is in center, overlays somewhat */
    .center-img-frame {
        height: 400px;
        width: 80%;
        margin: 0 auto;
        border: 4px solid white;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 2;
    }

    .hero-col-center {
        position: relative;
        /* Create the background images effect seen in mobile design using pseudo elements or hidden divs */
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Simulate the side images in mobile hero */
    .hero-col-center::before,
    .hero-col-center::after {
        content: '';
        position: absolute;
        top: 20px;
        width: 60%;
        height: 80%;
        background-color: #ddd;
        /* Placeholder for side images */
        border-radius: 15px;
        background-size: cover;
    }

    .hero-col-center::before {
        left: 0;
        transform: rotate(-5deg);
        z-index: 1;
        background-image: url('../assets/images/portfolio/toast-plate.png');
    }

    .hero-col-center::after {
        right: 0;
        transform: rotate(5deg);
        z-index: 1;
        background-image: url('../assets/images/portfolio/toast-hero.png');
    }


    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Explore Section Mobile */
    .explore-content-grid {
        flex-direction: column;
        gap: 30px;
    }

    .work-filters {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }

    /* Mobile Header Row for Work Details */
    .mobile-header-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .work-title {
        font-size: 1.8rem;
        margin: 0;
    }

    .filter-icon,
    .share-icon {
        font-size: 1.2rem;
        color: #333;
    }

    .work-actions {
        flex-direction: column;
    }

    .btn-custom {
        justify-content: center;
        width: 100%;
    }

    .logos-track {
        flex-wrap: nowrap;
    }
}

/* Mobile View Styles */
@media (max-width: 768px) {
    /* Hide desktop sidebar by default and make it an overlay */
    .sidebar {
        position: fixed;
        left: -100%; /* Hidden off-screen */
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        width: 280px !important;
        background: #F6F3EC;
    }

    .sidebar.active {
        left: 0;
    }

    .btn-icon {
        background: #E0E2D9;
        border: none;
        padding: 10px 15px;
        border-radius: 10px;
        color: #4F5F3A;
        font-size: 1.2rem;
    }

    /* The Share Popup (Frame 261 style) */
    .share-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        display: none; /* Hidden */
        justify-content: center;
        align-items: center;
        z-index: 2000;
    }

    .share-overlay.active {
        display: flex;
    }

    .share-card {
        background: white;
        padding: 25px;
        border-radius: 20px;
        width: 90%;
        max-width: 320px;
        text-align: center;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }

    .share-icons-grid {
        display: flex;
        justify-content: space-around;
        font-size: 1.5rem;
        margin: 20px 0;
    }
    
    .share-icons-grid a { color: #4F5F3A; }

    .btn-copy-link {
        width: 100%;
        border: 1px solid #ddd;
        background: none;
        padding: 8px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .explore-container {
        display: block; /* Stack on mobile */
    }

    .desc-container{
        text-align: center;
        margin-bottom: -10px;
    }
.card-stack {
        width: 176px !important;   /* Adjust this to your preferred width */
        height: 220px !important;  /* Adjust this to your preferred height */
        margin-left: 80px !important; 
        perspective: 1000px !important;
        align-items: center;

    }

    /* 2. Force the images to fit inside the smaller container */
    .stack-img {
        width: 100% !important;
        height: 100% !important;
        border-width: 4px !important; /* Thinner border for small screens */
    }


    /* 4. Ensure navigation is visible and close to the stack */
    .stack-nav {
        margin-top: 10px !important;
        gap: 10px !important;
    }

    .nav-circle {
        width: 40px !important;
        height: 40px !important;
    }

   /* Drawer Header Spacing */
    .drawer-header {
        padding-bottom: 20px;
        border-bottom: 1px solid #eee;
        margin-bottom: 15px;
    }

    #filter-container {
        display: none !important;
    }
    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        padding: 15px 20px;
    }

    .icon-box {
        background: #E0E2D9;
        border: none;
        border-radius: 12px;
        width: 45px;
        height: 45px;
        color: #4F5F3A;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Horizontal Pill Nav (image_8e4c40.png) */
    .portfolio-nav-pill {
        padding: 10px 20px;
        display: flex;
        justify-content: center;
    }

    .pill-container {
        display: flex;
        background: white;
        border: 1px solid #ccc;
        border-radius: 50px; /* Makes it a pill */
        padding: 5px;
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
    }

    .pill-link {
        border: none;
        background: transparent;
        padding: 8px 15px;
        border-radius: 40px;
        font-size: 0.85rem;
        white-space: nowrap;
        color: #333;
        transition: 0.3s;
    }

    .pill-link.active {
        background: #DDE2D5; /* Light green from image */
        font-weight: bold;
        border: 1px solid #4F5F3A;
    }

    /* Left Drawer (image_8ea27d.png) */
    .category-drawer {
        position: fixed;
        left: -100%;
        top: 20%; /* Appears in the middle-left like your image */
        width: 250px;
        background: #F6F3EC;
        border-radius: 0 20px 20px 0;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        z-index: 1050;
        transition: 0.3s ease-in-out;
        padding: 20px;
    }

    .category-drawer.active {
        left: 0;
    }

    .sub-link {
        display: block;
        width: 100%;
        text-align: left;
        background: transparent;
        border: none;
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 5px;
    }

    .sub-link.active {
        background: white;
        border-left: 4px solid #4F5F3A;
    }
}

/* -------------------------------------------ANIMAION----------------------------------------------------------- */
/* Container sizing */
.card-stack {
    position: relative;
    width: 300px;
    height: 350px;
    perspective: 1200px;
    margin: 0 auto;
}

.stack-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    border: 6px solid white;
    /* Thick white border like video */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* Cinematic timing: prevents flickering or jumping */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.8s ease,
        z-index 0.8s step-end;
}

/* Front Image */
.stack-img.pos-0 {
    z-index: 3;
    transform: translate(0, 0) rotate(0deg);
}

/* Second Image (Leaning Left) */
.stack-img.pos-1 {
    z-index: 2;
    transform: translate(-95px, 10px) rotate(-10deg);
}

/* Third Image (Leaning Right) */
.stack-img.pos-2 {
    z-index: 1;
    transform: translate(45px, 5px) rotate(10deg);
}

/* THE FAN ANIMATION ON HOVER */
/* .card-stack:hover .stack-img.pos-1 {
    transform: translate(-100px, -20px) rotate(-15deg);
}

.card-stack:hover .stack-img.pos-2 {
    transform: translate(20px, 20px) rotate(15deg);
} */

/* Position Hidden: Smoothly fades out/in when shifting */
.pos-hidden {
    z-index: 1;
    transform: translate3d(0, 50px, -500px);
    opacity: 0;
}

/* Smooth "Swipe Away" transition for the card leaving the front */
.exit-right {
    transform: translate3d(150%, -40px, 200px) rotate(25deg) !important;
    opacity: 0 !important;
}

.exit-left {
    transform: translate3d(-150%, -40px, 200px) rotate(-25deg) !important;
    opacity: 0 !important;
}

.stack-nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.nav-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #f5f1f1;
    /* Light background */
    color: #4F5F3A;
    /* Theme green */
    transition: 0.3s ease;
    cursor: pointer;
}

.nav-circle:hover {
    background: #a7b792;
}

/* -------------------------------------------------------------------- */
@media (max-width: 768px) {
    .portfolio-actions {
        display: flex;
        flex-direction: column;
        /* Stacks buttons on top of each other */
        gap: 15px;
        margin-top: 20px;
    }

    .portfolio-actions .btn-main {
        margin-left: 0 !important;
        /* Removes the side margin on mobile */
        width: 100%;
        text-align: center;
    }
}

/* Modal Background */
.custom-modal-bg {
    background-color: #F9F7F2 !important;
    border: none;
}

/* Modal Arrows */
.carousel-control-prev i,
.carousel-control-next i {
    color: #000 !important;
    font-size: 1.5rem;
}

/* Mobile Fix: Distance between image and text */
@media (max-width: 991px) {
    body, html {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .portfolio-display {
        flex-direction: column !important;
        align-items: center;
        gap: 50px !important;
        /* Forces the text down away from the images */
    }

    .portfolio-info {
        margin-top: 30px;
    }
}

/* ----------------------------buttons---------------------------- */
.btn-main {
    background-color: var(--btn-bg);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    outline: none;
    box-shadow: none !important;
}

.btn-main:focus,
.btn-main:active {
    outline: none;
    box-shadow: none !important;
}

.btn-view-all-outline {
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #4F5F3A;
}