/* --- Reset/Normalize --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- General Styles --- */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #eceff1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    scroll-snap-type: y mandatory; /* Enable vertical scroll snapping */
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

html {
    scroll-behavior: smooth; /* Smooth scrolling */
}
a { color: #c380ff; text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #9a58cc; }

/* --- Scrollbar Styling --- */
/* Webkit (Chrome, Safari, newer Edge) */
::-webkit-scrollbar {
  width: 12px; /* Width of the scrollbar */
}

::-webkit-scrollbar-track {
  background: #0d0d0d; /* Dark background for the track */
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #330867, #bcff80, #c380ff); /*  Gradient */
  border-radius: 6px; /* Rounded corners */
  border: 2px solid #0d0d0d; /* Border same color as track */
  background-clip: padding-box;  /*  Important for border to work correctly */
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg,  #bcff80, #c380ff, #330867); /* Slightly different hover gradient */
   border: 2px solid #0d0d0d;
}

/* Firefox */
html {
  scrollbar-width: thin; /* 'thin' or 'auto' or 'none' */
  scrollbar-color: #c380ff #0d0d0d; /* thumb and track color */
}

/* --- Header --- */
.header-container { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1200px; padding: 30px 40px; position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 100; background-color: transparent; }
.logo-link{ display: flex; align-items: center;}
.logo { max-width: 45px; height: auto; margin-right: 15px; flex-shrink: 0; }
.site-title { font-family: 'Roboto Mono', monospace; font-size: 2em; font-weight: 700; letter-spacing: 1px; color: #fff; text-transform: uppercase; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6); }


/* --- Navigation --- */
nav {
    position: relative;
    z-index: 1001;
}

#menu-toggle {
    background-color: transparent;
    color: #fff;
    border: 2px solid #000;
    padding: 10px;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s ease, border-color 0.3s ease, background-color 0.3s ease;
    display: block;
}

#menu-toggle:hover {
    transform: scale(1.1);
    border-color: #fff;
    background-color: var(--tertiary-color);
    color: #000;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    display: none;  /* Initially hide */
    position: fixed;  /* Fixed positioning */
    top: 50%;       /* Center vertically */
    left: 50%;      /* Center horizontally */
    transform: translate(-50%, -50%); /* Center precisely */
    width: auto;    /* Allow width to be determined by content */
    min-width: 200px; /* Minimum width */
    max-width: 80%;  /* Maximum width */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border-radius: 8px;
    overflow: auto; /* Add scroll for overflow */
    max-height: 80vh; /* Limit height and enable scroll */
}

nav ul.show {
    display: block;
}

/*Close button styles - only for mobile*/
.close-nav {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5em;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.3s ease, color 0.3s ease;
    display: none; /* Hidden by default */
}

.close-nav:hover {
    transform: scale(1.2);
    color: #c380ff;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    15% {
        background-position: 50% 100%;
    }
     30% {
        background-position: 100% 50%;
    }
    45% {
        background-position: 50% 0%;
    }
    60%{
        background-position: 0% 50%;
    }
    75%{
        background-position: 50% 100%;
    }
    90%{
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

nav li {
    display: block; /* Ensure each li is on a new line */
    margin: 0;
}

nav a {
    display: block; /* Make the links block-level */
    padding: 12px;
    font-weight: 500;
    transition: color 0.3s ease, background-color 0.3s ease;
    color: #fff;
    text-decoration: none; /* Remove underlines */
}

nav a:hover {
    color: #c380ff;
    background-color: rgba(255, 255, 255, 0.1);
}

nav a.active {
    background-color: #c380ff;
    color: white;
    border: 2px solid #000;
    font-weight: bold;
    padding: 10px;
}

/* --- Animation Keyframes --- */
        @keyframes fadeInUp { /* (Existing) */
          from { opacity: 0; transform: translateY(20px); }
          to { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeIn { /* (Existing) */
          from { opacity: 0; }
          to { opacity: 1; }
        }
        @keyframes scaleIn { /* (Existing) */
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        @keyframes growWidth { /* (Existing) */
            from { width: 0; }
            to { width: 70px; }
        }
        @keyframes darkGradientShift { /* (Existing - for #about) */
          0% { background-position: 50% 0%; }
          50% { background-position: 50% 100%; }
          100% { background-position: 50% 0%; }
        }
        /* New Keyframe for default button background animation */
        @keyframes buttonGradientShift {
          0% { background-position: 0% 50%; }
          50% { background-position: 100% 50%; }
          100% { background-position: 0% 50%; }
        }
        /* New Keyframe for hover button background animation */
        @keyframes buttonHoverGradientShift {
          0% { background-position: 0% 50%; }
          50% { background-position: 100% 50%; }
          100% { background-position: 0% 50%; }
        }


        /* --- Hero Section --- */
        #hero {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center; /* Center content horizontally */
            justify-content: center;
            padding: 150px 20px 60px;
            /* IMPORTANT: Replace with your actual image path */
            background-image: url('img/bon.jpg'); /* Make sure this path is correct */
            background-size: cover; /* Keep cover */
            background-position: center center; /* Keep center */
            background-repeat: no-repeat;
            min-height: 100vh;
            width: 100%;
            /* Add perspective for 3D effect */
            perspective: 1000px;
            overflow: hidden; /* Hide parts of background that move out */
            /* Smooth transition for background movement */
            transition: transform 0.1s linear;
        }
        #hero::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(4, 0, 5, 0.6); /* Existing overlay */
            z-index: 1;
        }
        .hero-content {
            position: relative;
            z-index: 2;
            width: 90%;
            max-width: 1200px;
            padding: 0 20px;
            display: flex;
            flex-direction: column;
            align-items: flex-start; /* Keep original alignment */
            text-align: left; /* Keep original text align */
            /* Smooth transition for text movement */
            transition: transform 0.1s linear;
            /* Ensure content stays within perspective */
            transform-style: preserve-3d;
        }
        .hero-content h2 {
            font-size: 3em; /* Use desktop font size */
            font-weight: 700;
            margin-bottom: 10px;
            font-family: 'Roboto Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #fff;
            text-shadow: none;
              -webkit-text-stroke: 1px #000;
              text-stroke: 1px #000;
            width: 100%;
            max-width: 600px; /* Use desktop max-width */
            text-align: Left; /* Use desktop text align */
            /* Adjusted margin for centering based on max-width */
            margin-left: calc((100% - min(100%, 600px)) / 2);
            margin-right: auto;
            animation: fadeInUp 0.8s ease-out 0.3s backwards;
        }
        .hero-content p {
            font-size: 1.2em; /* Use desktop font size */
            line-height: 1.6;
            margin-bottom: 20px;
            color: #eee;
            text-shadow: 1px 1px 2px rgba(255 255 255 / 22%);
                -webkit-text-stroke: unset;
            text-stroke: unset;
            width: 100%;
            max-width: 600px; /* Use desktop max-width */
            /* Adjusted margin for centering based on max-width */
             margin-left: calc((100% - min(100%, 600px)) / 2);
            animation: fadeInUp 0.8s ease-out 0.6s backwards;
        }
        .button {
           background-color: rgba(255, 255, 255, 0.05);
            color: #e0e0e0;
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 10px 20px; /* Use desktop padding */
            border-radius: 5px;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            transition: all 0.3s ease;
            font-size: 0.95rem; /* Use desktop font size */
            text-transform: uppercase;
              width: auto; /* Let button size naturally */
            max-width: 600px; /* Constrain width */
            /* Adjusted margin for centering based on max-width */
            margin-left: calc((100% - min(100%, 600px)) / 2);
            animation: fadeInUp 0.8s ease-out 0.9s backwards;
        }
        .button:hover {
            background: linear-gradient(90deg, #3a0ca3 0%, #7209b7 100%);
            color: #fff;
            border-color: transparent;
            box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3);
            transform: translateY(-2px); /* Keep existing hover effect */
        }
@media (max-width: 768px) {
    .hero-content {
        padding: 0;
        align-items: flex-start;
        text-align: left;
    }
    .hero-content h2,
    .hero-content p,
    .button{
      margin-left: 0;
      text-align: left;
    }
}

/* --- Sections (General) --- */
/* (General section styles remain the same) */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
    scroll-snap-align: start;
}
#hero{
   padding-top: 0;
}
.container {
    justify-content: center;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}
section h2 {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #000; /* Default dark color */
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: Left;
    font-size: 2em;
    text-shadow: none;
}

/* --- About Section - Animated Dark Background Design --- */

#about {
    padding: 100px 20px;
    /* Dark gradient background using your colors */
    /* Added a middle stop repeating the first color for smoother vertical animation loop */
    background: linear-gradient(180deg, #1a112a 0%, #0d0d0d 50%, #1a112a 100%);
    background-size: 100% 300%; /* Height is 3x for vertical animation */
    color: #ced4da; /* Light grey text for dark background */
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    overflow: hidden;
    /* --- Dark Background Animation Added --- */
    animation: darkGradientShift s ease-in-out infinite;
}

/* Container for the main content within #about */
.about-content-wrapper {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

/* Flex container for image and text columns */
.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

/* Image column */
.about-image {
    flex: 1 1 350px;
    min-width: 300px;
    text-align: center;
}

.about-image img {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    /* Subtle light border for dark background */
    border: 2px solid rgba(255, 255, 255, 0.1);
    /* Optional: subtle glow instead of shadow */
    box-shadow: 0 0 15px rgba(171, 140, 215, 0.15); /* Light purple glow */
    margin: 0 auto;
    animation: fadeIn 1.2s ease-out 0.5s backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(171, 140, 215, 0.25); /* Brighter glow on hover */
}

/* Text column */
.about-text {
    flex: 2 1 480px;
}

.about-text h2 {
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5em;
    color: #f8f9fa; /* Brighter white heading */
    margin-bottom: 25px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Subtle shadow for depth */
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
    animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

/* Decorative underline */
.about-text h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 70px;
    height: 4px;
    /* Bright gradient for dark background */
    background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(171, 140, 215, 0.8)); /* White to light purple */
    border-radius: 2px;
    animation: growWidth 0.6s ease-out 1s backwards;
}

.about-text p {
    font-family: 'Inter', sans-serif;
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #adb5bd; /* Slightly dimmer light grey for paragraphs */
    text-align: left;
    animation: fadeInUp 0.8s ease-out 1.0s backwards;
}

/* Optional: Style for links within the text */
.about-text a.about-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 22px;
    /* Style for dark background */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle light background */
    color: #f0eaff; /* Light purple/white text */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease-out 1.3s backwards;
}

.about-text a.about-link:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Brighter on hover */
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}


/* Responsive Adjustments */
/* (Media queries remain largely the same, affecting layout more than color) */
@media (max-width: 850px) {
    #about {
        padding: 80px 20px;
    }
    .about-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
    .about-image {
       flex-basis: auto;
       width: 100%;
       order: -1;
    }
     .about-image img {
        max-width: 300px;
        margin-bottom: 0;
    }
    .about-text {
        flex-basis: auto;
    }
    .about-text h2 {
        font-size: 2.1em;
        display: block;
        text-align: center;
    }
     .about-text h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .about-text p {
        font-size: 1em;
        text-align: center;
    }
    .about-text a.about-link {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 500px) {
    #about {
        padding: 60px 15px;
    }
     .about-image img {
        max-width: 260px;
    }
     .about-text h2 {
        font-size: 1.9em;
    }
}


/* --- Accessibility: Reduce motion --- */
@media (prefers-reduced-motion: reduce) {
  /* Disable animations */
  #hero h2, #hero p, .button,
  .about-content-wrapper,
  .about-image img,
  .about-text h2, .about-text h2::after, .about-text p, .about-text a.about-link,
  #about /* Disable background animation */ {
    animation: none !important;
    transition: none !important;
  }

  /* Reset hover states if transitions are disabled */
   .button:hover {
        background: linear-gradient(90deg, #3a0ca3 0%, #7209b7 100%);
        color: #fff; border-color: transparent; box-shadow: none; transform: none;
    }
   .about-image img:hover {
        transform: none; box-shadow: 0 0 15px rgba(171, 140, 215, 0.15); /* Base glow */
   }
   .about-text a.about-link:hover {
        background-color: rgba(255, 255, 255, 0.1); color: #f0eaff;
        border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none;
   }
}

/* --- Works Section --- */
#works {
    /* Dark gradient background - Adjust colors if you like */
    background: linear-gradient(180deg, #1a112a 0%, #0d0d0d 100%); /* Dark Purple to Black */
    color: #fff;
    padding: 80px 0; /* Generous padding (adjust 0 if side padding needed) */
    overflow: hidden;
    min-height: auto; /* Override general section height if needed */
    scroll-snap-align: start;
}

.works-title {
    text-align: center;
    margin-bottom: 40px; /* More space */
    font-size: 2.8rem; /* Larger title */
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 50px; /* More space */
    flex-wrap: wrap;
    gap: 15px; /* Slightly larger gap */
    padding: 0 20px;
}

.filter-button {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background */
    color: #e0e0e0; /* Light grey text */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
    padding: 10px 20px; /* Adjust padding */
    border-radius: 5px; /* Slightly rounded */
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease; /* Smooth transition */
    font-size: 0.95rem;
}

.filter-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: translateY(-2px);
}

.filter-button.active {
    /* Use accent gradient - matches About section */
    background: linear-gradient(90deg, #3a0ca3 0%, #7209b7 100%);
    color: #fff;
    border-color: transparent; /* Hide border when gradient is active */
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3); /* Glow effect */
    transform: translateY(-2px);
}
/* --- Swiper Container --- */
.swiper-container {
    /* width: 100%; */        /* Removed */
    max-width: 1400px;      /* ADDED: Limit maximum width (adjust as needed) */
    margin-left: auto;      /* ADDED: Center the container */
    margin-right: auto;     /* ADDED: Center the container */
    padding: 0 50px 30px 50px; /* Keep internal padding for arrows */
    box-sizing: border-box;
    position: relative;       /* ADDED: Needed for absolutely positioned arrows */
}

/* Adjustments when grid is active */
.swiper-container.desktop-grid-active {
     padding: 0 20px 30px 20px; /* Keep adjusted internal padding */
     /* max-width and margin:auto are inherited, ensuring grid is also centered */
}

/* --- Gallery Item Redesign --- */
.gallery-item {
    border-radius: 8px;
    overflow: hidden; /* Clip image and overlay */
    background-color: #1f1f1f; /* Slightly lighter dark item background */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Ensure item fills slide height */
    display: flex;
    flex-direction: column;
    position: relative; /* Needed for overlay positioning context */
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02); /* Lift and slightly scale on hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Slightly stronger shadow */
}

/* Link covers the entire item */
.gallery-item .project-link {
    display: block; /* Changed to block */
    height: 100%;
    color: inherit;
    text-decoration: none;
    position: relative; /* Position context for overlay within link */
    overflow: hidden; /* Clip overlay */
    display: flex; /* Use flex to manage inner structure */
    flex-direction: column;
}

/* Image/Video container */
.gallery-item-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* Default 4:3 aspect ratio - ADJUST AS NEEDED */
    height: 0;
    overflow: hidden;
    background-color: #2a2a2a; /* Darker fallback */
    flex-shrink: 0; /* Prevent shrinking */
}

.gallery-item-image img,
.gallery-item-image .video-container, /* Target nested video container */
.gallery-item-image iframe { /* Target iframe directly */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area */
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease; /* Smoother transition */
    filter: brightness(1); /* Start at normal brightness */
}

/* Ensure nested video container fills the space */
.gallery-item-image .video-container {
    padding-bottom: 0; /* Override aspect ratio hack if nested */
    background-color: transparent; /* Don't show container background */
    box-shadow: none; /* Remove shadow if nested */
    border-radius: 0; /* Remove radius if nested */
    margin: 0; /* Remove margin if nested */
}


.gallery-item:hover .gallery-item-image img,
.gallery-item:hover .gallery-item-image iframe,
.gallery-item:hover .gallery-item-image .video-container video { /* Target video too */
    transform: scale(1.1); /* Zoom image/video on hover */
    filter: brightness(0.8); /* Slightly dim image/video on hover to make overlay pop */
}

/* Hover Overlay */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Gradient overlay from bottom */
    background: linear-gradient(0deg, rgba(13, 13, 13, 0.95) 0%, rgba(13, 13, 13, 0.7) 60%, rgba(13, 13, 13, 0) 100%);
    padding: 50px 20px 20px 20px; /* More padding at bottom/top */
    opacity: 0; /* Hidden by default */
    transform: translateY(100%); /* Start below item */
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    text-align: center; /* Center text in overlay */
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1; /* Show on hover */
    transform: translateY(0); /* Slide up */
}

/* --- Project Title Bar Styling (Hover Effect) --- */
.project-title {
    background-color: rgba(26, 26, 26, 0.9); /* Semi-transparent dark background */
    backdrop-filter: blur(3px); /* Subtle blur */
    -webkit-backdrop-filter: blur(3px);
    color: #fff;
    /* --- ADDED Padding --- */
    padding: 12px 20px; /* Vertical and Horizontal padding */
    margin: 0;
    font-size: 1rem; /* Adjusted size */
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
    text-align: left; /* Align text left */
    width: 100%;
    box-sizing: border-box;
    position: absolute; /* Position at the bottom */
    bottom: 0;
    left: 0;
    /* --- Hide by default --- */
    opacity: 0;
    transform: translateY(100%); /* Start below */
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 2; /* Above image */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Subtle top border */
}

/* Show title on gallery item hover */
.gallery-item:hover .project-title {
    opacity: 1;
    transform: translateY(0); /* Slide into view */
}

/* --- Swiper Navigation Arrows --- */
.swiper-button-next,
.swiper-button-prev {
    color: #c380ff;
    transition: color 0.3s ease;
     --swiper-navigation-size: 30px; /* Reduce arrow size */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    color: #fff;
}
/* --- Project Details Modal Redesign --- */

/* Modal Backdrop/Overlay */
.project-details {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 5, 20, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s 0.4s;
}

.project-details.show {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* Modal Content Box */
.project-details-content {
    background: linear-gradient(145deg, #231e34 0%, #161223 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5);
    padding: 50px 55px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    color: #e8e8e8;
    position: relative;
    box-sizing: border-box;

    /* --- Vertical Stack & Center Content --- */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center items horizontally */
    /* --- End Stack & Center --- */

    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.project-details.show .project-details-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Custom Scrollbar for Modal --- */
.project-details-content::-webkit-scrollbar { width: 10px; }
.project-details-content::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.project-details-content::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #4a0ca3, #7209b7); border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.05); background-clip: padding-box; }
.project-details-content::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #7209b7, #4a0ca3); }
.project-details-content { scrollbar-width: thin; scrollbar-color: #7209b7 rgba(255, 255, 255, 0.05); }


/* --- Content Styling within Modal --- */

/* General spacing for direct children */
.project-details-content > * {
    max-width: 100%;
    margin-bottom: 30px;
    box-sizing: border-box;
}
.project-details-content > *:last-child { margin-bottom: 0; }

/* Main Title (H3) */
.project-details-content h3 {
    color: #c380ff;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 35px;
    width: 100%;
    position: relative;
    padding-bottom: 15px;
    letter-spacing: 1px;
}
.project-details-content h3::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 4px; background: linear-gradient(90deg, #4a0ca3, #7209b7); border-radius: 2px; opacity: 0.8; }

/* Sub-Headings (H4) */
.project-details-content h4 {
    color: #fff;
    font-weight: 600;
    font-size: 1.4em;
    margin-top: 40px;
    margin-bottom: 15px;
    text-align: left;
    width: 100%;
    max-width: 75ch;
    border-left: 4px solid #c380ff;
    padding-left: 18px;
    letter-spacing: 0.5px;
}

/* Paragraphs */
.project-details-content p {
    line-height: 1.75;
    color: #d8d8d8;
    text-align: left;
    width: 100%;
    max-width: 75ch;
    font-size: 1.1em;
}
.project-details-content p strong, .project-details-content p b { color: #fff; font-weight: 600; }
.project-details-content p a { color: #c380ff; text-decoration: none; border-bottom: 1px solid rgba(195, 128, 255, 0.5); transition: color 0.3s ease, border-color 0.3s ease; }
.project-details-content p a:hover { color: #fff; border-color: rgba(255, 255, 255, 0.8); }

/* Images */
.project-details-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.project-details-content img:hover { transform: scale(1.03); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }

/* --- Video Container (Revised) --- */
.project-details-content video {
    /* --- CHANGED --- */
    display: block;         /* Change back to block */
    width: fit-content;     /* Try to make block shrink to content */
    /* --- END CHANGED --- */
    max-width: 100%;        /* Still prevent overflow */
    margin-left: auto;      /* Center the block container (might be redundant with align-items: center) */
    margin-right: auto;     /* Center the block container (might be redundant with align-items: center) */
    /* vertical-align: middle; */ /* Removed */
    overflow: hidden;
    border-radius: 10px; /* Match image radius */
    /* margin-top/bottom handled by general rule */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Match image shadow */
    background-color: #000;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
/* Video hover effect */
.project-details-content .video-container:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Video/Iframe element */
.project-details-content .video-container iframe,
.project-details-content .video-container video {
    display: block;
    /* --- CHANGED --- */
    width: 100%; /* Fill the container (which should be fit-content width) */
    /* --- END CHANGED --- */
    max-width: 100%; /* Ensure video doesn't exceed container */
    height: auto;
    max-height: 75vh; /* Keep height limit */
    border: none;
    border-radius: inherit; /* Inherit radius */
}


/* Close Button Redesign */
.close-details {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4a0ca3, #7209b7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    line-height: 1;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-details:hover {
    transform: scale(1.15) rotate(180deg);
    background: linear-gradient(135deg, #7209b7, #4a0ca3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    color: #fff;
}

/* === Works Section Mobile Swiper Redesign === */
@media (max-width: 767px) { /* Match JS breakpoint */

    #works {
        padding-top: 60px;
        padding-bottom: 80px; /* More space for pagination */
    }

    /* Adjust container for mobile */
    .swiper-container {
        width: 100%; /* Full width on mobile */
        max-width: 100%; /* Override desktop max-width */
        /* --- Keep Horizontal Padding --- */
        padding: 0 25px 50px 25px; /* Keep L/R padding, keep bottom */
        /* --- Keep Overflow Visible --- */
        overflow: visible; /* Allow partial slides to potentially overflow */
        margin: 0;
        box-sizing: border-box;
    }

    /* Style individual slides */
    .swiper-slide {
        /* --- CHANGED: Adjusted Width --- */
        width: 70%; /* Adjusted width - try 70%, 80% etc. if needed */
        /* --- END CHANGED --- */
        height: auto; /* Let content define height */
        opacity: 0.4; /* Dim inactive slides */
        filter: grayscale(100%); /* Grayscale inactive slides */
        transform: scale(0.85); /* Scale down inactive slides */
        transition: transform 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
        box-sizing: border-box;
        flex-shrink: 0; /* Prevent slides from shrinking */
    }

    /* Style the active (centered) slide */
    .swiper-slide-active {
        opacity: 1;
        filter: grayscale(0%);
        transform: scale(1); /* Active slide is full size */
        z-index: 1; /* Ensure active slide is visually on top */
    }

    /* Adjust gallery item styles slightly for mobile focus */
    .swiper-slide .gallery-item {
        width: 100%;
        height: 100%;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        transition: box-shadow 0.4s ease;
    }
     .swiper-slide .gallery-item:hover {
         transform: none;
         box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
     }
     /* Title bar behavior on mobile */
     .swiper-slide .project-title {
         opacity: 0;
         transform: translateY(100%);
         transition: opacity 0.35s ease 0.1s, transform 0.35s ease 0.1s;
         text-align: center;
         padding: 10px 15px;
         font-size: 0.9rem;
     }
     .swiper-slide-active .project-title {
         opacity: 1;
         transform: translateY(0);
     }
     .swiper-slide:not(.swiper-slide-active):hover .project-title {
         opacity: 0;
         transform: translateY(100%);
     }


    /* --- Pagination Styling --- */
    .swiper-pagination {
        position: absolute;
        bottom: 15px; /* Position near the bottom */
        left: 0;
        width: 100%;
        text-align: center;
        z-index: 10;
        pointer-events: none;
    }

    .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        display: inline-block;
        border-radius: 50%;
        /* --- Keep Increased Opacity --- */
        background: rgba(255, 255, 255, 0.4); /* Keep increased opacity */
        opacity: 0.7;
        margin: 0 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        pointer-events: auto;
    }

    .swiper-pagination-bullet:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.5); /* Adjusted hover */
        transform: scale(1.1);
    }

    .swiper-pagination-bullet-active {
        background: #c380ff; /* Active bullet color */
        opacity: 1;
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(195, 128, 255, 0.5);
    }

    /* Hide desktop arrows on mobile */
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
} /* End mobile media query */

/* --- CSS Variables for Contact Section --- */
#contact {
  --contact-bg: #0d0d0d;        /* Dark background */
  --contact-text: #f0f0f0;      /* Light text (slightly off-white) */
  --input-bg: #1a1a1a;          /* Input field background */
  --input-border: #444;         /* Input field border */
  --input-text: #eee;           /* Input field text */
  --focus-border: #7c3aed;      /* Purple accent for focus */
  --button-grad-start: #4f46e5; /* Button gradient start (Indigo) */
  --button-grad-end: #7c3aed;   /* Button gradient end (Purple) */
  --button-hover-start: #5a50e6;/* Button hover gradient start */
  --button-hover-end: #8b49f0;  /* Button hover gradient end */
  --success-bg: rgba(110, 231, 183, 0.1); /* Lighter success background */
  --success-border: #6ee7b7;
  --success-text: #6ee7b7;
  --error-bg: rgba(248, 113, 113, 0.1);   /* Lighter error background */
  --error-border: #f87171;
  --error-text: #f87171;
}

/* --- CSS Variables for Contact Section --- */
#contact {
  --contact-bg: #0d0d0d;        /* Dark background */
  --contact-text: #f0f0f0;      /* Light text (slightly off-white) */
  --input-bg: #1a1a1a;          /* Input field background */
  --input-border: #444;         /* Input field border */
  --input-text: #eee;           /* Input field text */
  --focus-border: #7c3aed;      /* Purple accent for focus */
  --button-grad-start: #4f46e5; /* Button gradient start (Indigo) */
  --button-grad-end: #7c3aed;   /* Button gradient end (Purple) */
  --button-hover-start: #5a50e6;/* Button hover gradient start */
  --button-hover-end: #8b49f0;  /* Button hover gradient end */
  --success-bg: rgba(110, 231, 183, 0.1);
  --success-border: #6ee7b7;
  --success-text: #6ee7b7;
  --error-bg: rgba(248, 113, 113, 0.1);
  --error-border: #f87171;
  --error-text: #f87171;
  --pattern-color: rgba(255, 255, 255, 0.03); /* Color for subtle background pattern */
}

/* --- Contact Section --- */
#contact {
  padding: 60px 20px; /* Increased padding slightly */
  color: var(--contact-text);
  /* Subtle geometric background pattern */
  background-color: #0d0d0d;
  background-size: 20px 20px;
  position: relative; /* Needed for potential pseudo-elements if added later */
  overflow: hidden; /* Ensures pattern doesn't overflow weirdly */
}

/* Container for layout control within #contact */
.contact-container {
    max-width: 1200px; /* Max width for the overall content */
    margin: 0 auto; /* Center the container */
    display: flex; /* Default: stack vertically on mobile */
    flex-direction: column;
    gap: 40px; /* Space between intro/form on mobile */
    align-items: center; /* Center items on mobile */
}

/* --- Contact Intro Area (Left Column on Desktop) --- */
.contact-intro {
    text-align: center; /* Center text on mobile */
    max-width: 600px; /* Limit width on mobile */
    width: 100%;
}

#contact h2 {
  color: #fff;
  margin-bottom: 15px; /* Reduced margin */
  font-size: 2.5rem; /* Slightly larger */
  font-weight: 700; /* Bolder */
}

/* Add a paragraph style if you have intro text */
.contact-intro p {
    color: #ccc; /* Lighter gray for descriptive text */
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Placeholder for potential contact details */
.contact-details {
    margin-top: 20px;
    text-align: left; /* Align details left within the centered block */
    display: inline-block; /* Allows text-align:left */
}
.contact-details p {
    font-size: 1rem;
    color: var(--contact-text);
    margin-bottom: 10px;
    /* Add icons via <i> tags or pseudo-elements if desired */
}


/* --- Contact Form (Right Column on Desktop) --- */
#contact form {
  width: 100%;
  max-width: 600px; /* Max width on mobile */
  /* Removed margin: 0 auto - handled by flex/grid */
  display: grid;
  gap: 20px;
  padding: 30px; /* Add padding for visual separation */
  background-color: rgba(26, 26, 26, 0.7); /* Slightly transparent dark bg */
  backdrop-filter: blur(5px); /* Subtle blur */
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); /* Soft shadow */
}

#contact form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--contact-text);
}

#contact form input[type="text"],
#contact form input[type="email"],
#contact form textarea {
  width: 100%;
  padding: 14px; /* Increased padding */
  border: 1px solid var(--input-border);
  border-radius: 8px; /* Slightly larger radius */
  background-color: var(--input-bg);
  color: var(--input-text);
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

#contact form input[type="text"]:focus,
#contact form input[type="email"]:focus,
#contact form textarea:focus {
  outline: none;
  border-color: var(--focus-border);
  background-color: #2a2a2a; /* Slightly lighter on focus */
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3); /* Purple glow */
}

#contact form textarea {
  min-height: 150px; /* Increased height */
  resize: vertical;
}

/* --- Submit Button Styling --- */
#contact form button[type="submit"] {
   background-color: rgba(255, 255, 255, 0.05); /* Subtle background */
    color: #e0e0e0; /* Light grey text */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
    padding: 10px 20px; /* Adjust padding */
    border-radius: 5px; /* Slightly rounded */
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease; /* Smooth transition */
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
    justify-self: start; /* Align button left within grid cell */
    margin-top: 10px;
}

#contact form button[type="submit"]:hover {
    background: linear-gradient(90deg, #3a0ca3 0%, #7209b7 100%);
    color: #fff;
    border-color: transparent; /* Hide border when gradient is active */
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3); /* Glow effect */
    transform: translateY(-2px);
}

#contact form button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

#contact form button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.4);
}


/* --- Form Messages --- */
#contact form #form-message {
  margin-top: 5px; /* Reduced margin, place right after button */
  padding: 12px;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  grid-column: 1 / -1; /* Span full width if needed */
}

#contact form #form-message.success {
  background-color: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

#contact form #form-message.error {
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}


/* --- Footer --- */
footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid var(--input-border);
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}

/* --- Desktop Layout (Two Columns) --- */
@media (min-width: 992px) {
    #contact {
        padding: 80px 40px; /* More padding on desktop */
    }

    .contact-container {
        flex-direction: row; /* Switch to horizontal layout */
        align-items: flex-start; /* Align items to the top */
        gap: 60px; /* Increase gap between columns */
    }

    .contact-intro {
        flex: 1; /* Allow intro to take available space */
        text-align: left; /* Align text left */
        max-width: none; /* Remove mobile max-width */
        padding-top: 10px; /* Align top with form visually */
    }

    #contact h2 {
        font-size: 3rem; /* Even larger heading */
    }

    #contact form {
        flex: 1; /* Allow form to take available space */
        max-width: none; /* Remove mobile max-width */
        padding: 40px; /* More padding inside form */
    }

    .contact-details {
        display: block; /* No longer need inline-block */
    }
}



/* --- End of Page!! --- */

.gallery-item,
.project-details-inner img,
.project-details-inner .video-container {
    animation: fadeIn 0.8s ease-out;
}

/* Desktop Grid Styles (Conditional, for filtering) */
@media (min-width: 768px) {
     .gallery.desktop-grid-active { /* Target only when grid is active */
        display: grid; /* Switch to grid on desktop */
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive columns */
        grid-auto-rows: 1fr; /* Ensure equal row heights */
        height: auto;       /* Allow height to be determined by content */
        overflow-y: auto; /* Enable vertical scroll if needed */
        gap: 20px;       /* Added a gap */
    }

     .swiper-container {
        height: auto; /* Reset height for grid layout */
        padding-left: 0;   /* Remove extra padding on desktop */
        padding-right: 0;
    }

     /* Style items specifically when in grid mode */
    .gallery.desktop-grid-active .gallery-item {
        height: 100%; /* Make items fill the grid row height */
        /* display: flex; is likely inherited or default, ensure it's correct */
        /* flex-direction: column; is likely inherited */
         width: auto !important; /* Override potential inline styles from Swiper */
         margin-right: 0 !important; /* Override potential inline styles from Swiper */

    }

    .gallery.desktop-grid-active .gallery-item .gallery-item-image{
        flex-grow: 1; /* Allow image container to take up remaining space */
         height: auto; /* Let flexbox determine height */
         padding-bottom: 0; /* Remove padding if used */
    }
     .gallery.desktop-grid-active .gallery-item .gallery-item-image img,
     .gallery.desktop-grid-active .gallery-item .gallery-item-image iframe {
         position: static; /* Important for flex layout */
         height: 100%;     /* Fill the container height */
         width: 100%;      /* Fill the container width */
         object-fit: cover;
     }

    /* Remove Swiper navigation on desktop when grid is active */
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
}