/* Basic Reset & Defaults */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Fallback for non-JS */
    font-size: 16px;
    /* Base font size */
}

/* Lenis requires this to hide the native scrollbar */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body {
    font-family: "Electrolize", sans-serif;
    line-height: 1.6;
    color: #e7d5d5;
    background-color: #2c2d30;
    /* Light background */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #007bff;
    /* Primary link color */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    /* Darker link color on hover */
}

/* Container */
.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    font-weight: 700;
    font-size: 1.5rem;
    color: #333;
}


/* Sections General Styling */
.content-section {
    padding: 6rem 0;
    /* Adjust padding */
}

.content-section:nth-child(odd) {
    /* Alternate background for contrast */
    background-color: #1f2025;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: #d2dae2;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    /* Full viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* background-color: #1a1c26; */
    /* Different background for hero */
    padding-top: 80px;
    /* Account for fixed header */
    position: relative;
    overflow: hidden;
    /* Important for reveal animations */
    border-radius: 0px 0px 32px 32px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    /* Responsive font size */
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #d2dae2;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    color: #939ba3;
}

.cta-button {
    display: inline-block;
    background-color: #0f0f0f;
    color: #d2dae2;
    padding: 0.8rem 2rem;
    border-radius: 16px;
    /* Pill shape */
    font-weight: 600;
    transition: background-color 0.8s ease, transform 0.8s ease;
    box-shadow: 0px 6px 7px 1px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: #3b3b3b;
    transform: translateY(-3px);
    color: #d2dae2;
    box-shadow: 0px 6px 7px 1px rgba(0, 0, 0, 0.2);
}

.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0;
    /* Initially hidden for animation */
}

.scroll-down-indicator svg {
    margin-top: 5px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}


/* About Section */
.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    justify-content: space-between;
}

.about-text p {
    margin-bottom: 1rem;
    color: #d2dae2;
    font-size: x-large;
}

.about-text {
    max-width: 50%;
    margin-left: 4rem;
}

.about-image img {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 600px;
}

.about-image {
    margin-right: 4rem;
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    perspective: 1200px;
}

.project-item {
    cursor: pointer;
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    display: flex;
    /* Use flexbox for better layout */
    flex-direction: column;
    /* --- Optional: Enhance 3D layering --- */
    transform-style: preserve-3d;
    /* --- Ensure transform starts at origin --- */
    transform: none;
    min-height: 400px;
}

.project-card__flipper {
    position: relative;
    /* Changed from absolute for easier layout */
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    /* Transition for CSS-based flip fallback (optional) */
    /* transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); */
}

.project-card__face {
    position: absolute;
    /* Position faces absolutely within flipper */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    /* Hide back face when facing away */
    backface-visibility: hidden;
    display: flex;
    /* Use flex for content layout */
    flex-direction: column;
    background-color: #fff;
    /* Ensure faces have background */
    border-radius: 8px;
    /* Apply border-radius to faces */
    overflow: hidden;
    /* Hide overflow on individual faces */
    z-index: 1;
}

.project-card__face--front {
    z-index: 2;
    /* Front is initially on top */
    /* transform: rotateY(0deg); // GSAP handles this */
    /* Keep existing layout for front face content */
}

.project-card__face--front .project-image {
    /* Reset any hover transforms on image */
    transform: none !important;
    max-height: 100%;
    height: 100%;
    transition: 0.8s;
}

.project-card__face--front .project-image:hover {
    /* Reset any hover transforms on image */
    transition: 0.8s;
    transform: scale(1.05) translateY(-5px) !important;
    /* Optional: Slight zoom on hover */
}

.project-card__face--back .project-image {
    /* Reset any hover transforms on image */
    transform: none !important;
    border-radius: 12px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    align-self: center;
}

.project-card__face--back {
    transform: rotateY(180deg);
    /* make it face the camera after flip */
    z-index: 1;
    padding: 1.5rem;
    background-color: #2c2d30f3;
    color: #f8f9fa;
    /* darker text so it’s visible */
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(6.9px);
    backdrop-filter: blur(6.9px);
}

.case-study-content {
    width: 100%;
    height: calc(100% - 40px);
    /* Adjust based on close button size/pos */
    overflow-y: auto;
    /* Allow scrolling for long case studies */
    padding-right: 10px;
    /* Space for scrollbar */
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}

.case-study-content h2 {
    margin-bottom: 1rem;
}

.case-study-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.case-study-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/*.case-study-content img { max-width: 100%; height: auto; border-radius: 4px; margin-bottom: 1rem; }*/

.project-card__close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    /* Above case study content */
    transition: color 0.3s ease;
}

.project-card__close-btn:hover {
    color: #333;
}

.project-item.is-enlarged {
    position: fixed !important;
    /* Use important to override inline styles during animation */
    top: 5vh !important;
    left: 5vw !important;
    width: 90vw !important;
    height: 90vh !important;
    z-index: 3000 !important;
    cursor: default;
    /* No pointer cursor when enlarged */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(6.9px);
    backdrop-filter: blur(6.9px);
    /* Ensure no stray transforms from hover interfere */
    transform: none !important;
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    /* Darker overlay */
    -webkit-backdrop-filter: blur(5px);
    /* Optional: Blur effect */
    backdrop-filter: blur(5px);
    z-index: 1900;
    /* Below enlarged card */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Prevent hover effects when a card is open */
body.card-open .project-item:not(.is-enlarged):hover {
    /* Disable hover effects on other cards */
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    /* Reset shadow */
}

/* Optional: Prevent 3D tilt when card is enlarged */
.project-item.is-enlarged {
    transition: none;
    /* Disable transition during enlarged state if needed */
}

.project-item:hover {
    /*transform: translateY(-5px);*/
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.project-image {
    display: block;
    width: 100%;
    max-height: 360px;
    /* Fixed height for consistency */
    object-fit: cover;
    /* Cover the area nicely */
    transform: translate(0, 0) scale(1);
}

.project-image-zoom-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Above the original image */

    /* --- IMPORTANT: Set the background image to match the original --- */
    /* background-image: url('path/to/your/image.jpg'); */
    /* Needs to be set dynamically or match */
    background-size: cover;
    background-position: center center;

    /* --- Initial State --- */
    opacity: var(--zoom-opacity);
    /* Controlled by JS */
    transform: scale(1.5);
    /* The zoom factor - adjust as needed */
    pointer-events: none;
    /* Prevent mouse interactions */
    will-change: transform, clip-path, opacity;
    /* Performance hint */

    /* --- The Circular Reveal --- */
    /* Use CSS variables updated by JS */
    clip-path: circle(var(--zoom-radius) at var(--mouse-x) var(--mouse-y));

    /* Smooth transitions handled by GSAP are often better, but CSS fallback: */
    /* transition: opacity 0.3s ease, clip-path 0.3s ease; */
}

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    /* Allow info to take remaining space */
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #343a40;
}

.project-description {
    margin-bottom: 1rem;
    color: #6c757d;
    flex-grow: 1;
    /* Push link to the bottom */
}

.project-link {
    font-weight: 600;
    align-self: flex-start;
    /* Align link to the start */
}

.projects-section {
    border-radius: 32px 32px 0px 0px;
}

/* Contact Section */
.contact-section {
    text-align: center;
    background-color: #2c2d30;
    /* Dark background */
    color: #f8f9fa;
    /* Light text */
}

.contact-section .section-title {
    color: #fff;
}

.contact-text {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: #adb5bd;
    /* Lighter text color */
}



.social-links {
    margin-top: 2.5rem;
}

.social-links a {
    color: #adb5bd;
    margin: 0 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #fff;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 0;
    background-color: #e9ecef;
    color: #3a3a3b;
    font-size: 0.9rem;
}


/* Animation Helper Classes (Initial States) */
.anim-reveal,
.anim-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
}

.anim-fade-in {
    opacity: 0;
}

/* Add delays using helper classes if needed */
.anim-delay-11 {
    transition-delay: 0.2s !important;
}

/* Example delay */
.anim-delay-21 {
    transition-delay: 0.4s !important;
}

.anim-delay-31 {
    transition-delay: 0.8s !important;
}


/* Responsive Design */
@media (max-width: 800px) {
    html {
        font-size: 15px;
    }

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

    .about-content {
        grid-template-columns: 1fr;
        /* Stack elements */
        text-align: center;
        flex-direction: column;
    }

    .about-image {
        margin: 2rem auto 0 auto;
        /* Center image when stacked */
        max-width: 300px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        /* Stack projects */
    }
    .about-text {
        margin-left: 0;
        max-width: 65%;
    }
    .about-content {
        gap: 0.5rem;
    }
}

/* ——— Tablet (roughly 600 – 1023 px) ——— */
@media (min-width: 800px) and (max-width: 1080px) {

    /* keep two equal columns on tablets */
    .project-grid{
      grid-template-columns: repeat(2, minmax(320px,1fr));
      justify-content: center;
    }
  
    /* center the very last card */
    .project-grid > .project-item:last-child{
      grid-column: 1 / -1;   /* span both columns       */
      justify-self: center;  /* then center it visually */
      min-width: 320px;
      width: 50%;
    }
  }
  

/* ... (Keep existing CSS Reset, Body, Lenis, Container styles) ... */

/* Header & Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    z-index: 1003;
    /* Ensure header is above most content */
    background: rgba(207, 204, 204, 0.13);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(4.9px);
    backdrop-filter: blur(4.9px);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

/* --- Scrolled State (Fixed & Styled) --- */
.site-header.header-scrolled {
    position: absolute;
    top: 50%;
    animation: slideDownHeader 0.5s ease-out forwards;
}

/* Use flexbox on the container inside the header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-weight: 700;
    font-size: 1.5rem;
    color: #d7d7d7;
    z-index: 1002;
    /* Ensure logo is above mobile nav background */
    position: relative;
    /* Needed for z-index */
}

/* Hamburger Button */
.hamburger-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 60px;
    /* Adjust size as needed */
    height: 60px;
    /* Adjust size as needed */
    z-index: 1002;
    /* Ensure button is above mobile nav background */
    position: relative;
    /* Needed for z-index */
}

.lottie-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Ensure animation stays within bounds */
    margin-left: -1rem;
}

/* Mobile Navigation Overlay */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    background-color: rgba(40, 40, 40, 0.98);
    /* Dark background with slight transparency */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 1001;
    /* Below header items like logo/button but above main content */
    display: flex;
    justify-content: center;
    align-items: center;

    /* --- Initial Hidden State --- */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    /* Optional: Slight slide down effect */
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.mobile-nav.is-open {
    /* --- Visible State --- */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.mobile-nav li {
    margin: 2rem 0;
}

.mobile-nav a {
    color: #a7adb3;
    /* Light link color */
    font-size: 1.8rem;
    /* Larger font size for overlay */
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.mobile-nav a:hover {
    color: #fff;
    /* Accent color on hover */
}

/* Add a subtle underline effect on hover/focus */
.mobile-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #fff;
    transition: width 0.3s ease, left 0.3s ease;
}

.mobile-nav a:hover::after {
    width: 100%;
    left: 0;
}


/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
    /* Standard way, might conflict with Lenis */
}


/* ... (Keep rest of your CSS: Sections, Hero, About, Projects, Contact, Footer, Animations, Responsive) ... */

/* Adjust Hero padding top if needed based on final header height */
.hero-section {
    padding-top: 100px;
    }

.heading-container {
    text-align: center;
    /* Container */
    max-width: 1200px;
    /* margin: 0 auto; */
    padding: 0 20px;
}


/* Responsive Design Adjustments */
@media (max-width: 768px) {

    /* You might already have this, ensure hamburger logic fits */
    .logo a {
        font-size: 1.3rem;
    }

    .hamburger-button {
        width: 45px;
        height: 45px;
    }

    .mobile-nav a {
        font-size: 1.6rem;
    }
}

@media (max-width: 1024px) {
    .heading-container {
        text-align: center;
    }
}


.about-section {
    background-color: #2c2d30;
}

.image-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 1000px;
    margin-inline: auto;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.image-grid img:hover {
    cursor: pointer;
}

/* ── 2‑Button Grid ─────────────────────────── */
.btn-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* two equal columns */
    gap: 12px;
}

.btn-grid svg {
    cursor: pointer;
    justify-self: center;
}

.btn-grid svg:hover {
    opacity: .85;
}

@media (max-width: 500px) {

    .image-grid,
    .btn-grid {
        grid-template-columns: 1fr;
        /* stack vertically on phones */
    }
}

/* The Modal (background) */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 20000;
    /* Sit on top */
    padding-top: 100px;
    /* Location of the box */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgb(0, 0, 0);
    /* Fallback color */
    background-color: rgba(0, 0, 0, 0.9);
    /* Black w/ opacity */
}

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
}

/* Add Animation */
.modal-content,
#caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

@keyframes zoom {
    from {
        transform: scale(0.1)
    }

    to {
        transform: scale(1)
    }
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.hero-video {
    position: absolute;
    inset: 0;
    /* top:0 right:0 bottom:0 left:0  */
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* “background-size: cover” */
    z-index: -1;
    /* sit *behind* your headings/buttons */
    pointer-events: none;
    /* keep hero CTA clickable */
    filter: blur(6px);
    opacity: 0.1;
}

/* optional: darken for readability */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    /* tweak opacity to taste */
    z-index: -1;
    /* above video, below text */
}

.logo {
    margin-left: 4rem;
}

/* ─────────────  Slideshow  ───────────── */

#slideshow {
    margin-left: 4.5rem;
    margin-right: 4.5rem;
}

.slideshow-section {
    background: #1a1c26;
    /* keep theme */
    border-radius: 32px;
    padding: 1rem 0;
    margin-top: 1rem;
}

.slideshow-container {
    max-width: 1920px;
    margin-inline: auto;
    /* padding-inline: 20px; */
    display: flex;
    /* gap: 2rem; */
    /* align-items: center; */
}

.slideshow-static {
    flex: 0 0 22%;
    color: #d2dae2;
    padding-left: 2rem;
}

.rail-heading {
    font-size: 1.5rem;
    margin-bottom: .75rem;
    color: #e7d5d5;
    /* text-align: left; */
}

.rail-text {
    font-size: 1rem;
    line-height: 1.5;
}

.slideshow-dynamic {
    flex: 1 1 56%;
    overflow: hidden;
    position: relative;
    border-radius: 18px;
}

.slides {
    gap: 2rem;
    display: flex;
    width: max-content;
    /* JS updates final width  */
}

.slide {
    /* flex: 0 0 100%; */
    text-align: center;
}

.slide figcaption {
    margin-top: 0.5rem;
}

.slide img {
    width: 100%;
    max-height: 80px;
    /* adjust if needed */
    object-fit: cover;
    display: block;
}

.slideshow-left {
    border-right: solid;
}

.slideshow-right {
    border-left: solid;
}

/* responsive: stack on small screens */
@media(max-width:900px) {
    .slideshow-container {
        flex-direction: column;
    }

    .slideshow-static {
        flex: unset;
        text-align: center;
        padding-left: 0;
    }

    .slideshow-dynamic {
        width: 100%;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .slideshow-left {
        border-right: none;
        border-bottom: solid;
        padding-bottom: 0.5rem;
    }
    
    .slideshow-right {
        border-left: none;
        border-top: solid;
        padding-top: 0.5rem;
    }
}

#projects {
    background-color: #1f2025;
}

#contact {
    background-color: #2c2d30;
}

#fake {
    padding: 4rem;
}

.case-study-flex {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.case-study-flex-image {
    width: 47%;
    height: auto;
    border-radius: 12px;
}

.case-study-flex-text {
    flex: 1;
    font-size: 0.9rem;
    color: #f8f9fa;
}

@media (max-width: 768px) {
    .case-study-flex {
        flex-direction: column;
    }

    .case-study-flex-text {
        text-align: center;
    }
}

.case-study-flex-image img {
    width: 100%;
    height: auto;
}