*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
body, html { font-size: 100%; padding: 0; margin: 0;}
.clearfix:before, .clearfix:after { content: " "; display: table; }
.clearfix:after { clear: both; }

body {
    font-family: 'Inter', sans-serif;
}
html.no-scroll,
body.no-scroll {
    height: 100%;
    overflow: hidden;
}

/* --- GENERAL STYLES & ANIMATIONS --- */

@font-face {
  font-family: 'daffy'; /* This is the name you'll use in your CSS */
  src: url('font/Daffiys.otf') format('opentype'), /* Primary choice */
       url('font/Daffiys.ttf') format('truetype');  /* Fallback choice */
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Very important for performance! */
}

#category-title {
  font-family: 'daffy', sans-serif; /* Use 'daffy' and provide a fallback */
}

.back-button span {
  transition: transform 0.3s ease-out;
}
.back-button:hover span {
  transform: translateX(-4px);
}

.daffy {
	font-family: daffy;
}

.animate-btn {
  position: relative;
  text-decoration: none;
  display: inline-block;
  padding-bottom: 4px;
}
.animate-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}
.animate-btn:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.social-icon {
  display: inline-block;
  transition: transform 0.5s ease-in-out;
}
.social-icon:hover {
  transform: translateY(-4px);
}

/* Spinner for loading state */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #555;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
#scroll-indicator svg {
    animation: gentle-float 2s infinite ease-in-out;
}
#scroll-indicator svg:last-child {
    animation-delay: -0.3s;
}

/* --- WORK CARDS SECTION --- */
.project-slider-container {
    height: 20rem;
    overflow: hidden;
    position: relative;
    cursor: grab;
}
.project-slider-container:active {
    cursor: grabbing;
}
.project-slider-track {
    height: 100%;
    display: flex;
}
.project-slide {
    height: 100%;
    flex: 0 0 100%;
    position: relative;
}
.project-info-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 20%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
    pointer-events: none;
    opacity: 1;
    transform: translateY(0);
}

#work-grid .pagination-dots {
  /* Reset positioning to place it in the normal document flow */
  position: static;
  transform: none; /* Explicitly remove the old horizontal transform */
  
  /* Use Flexbox to center the dots horizontally */
  display: flex;
  justify-content: center;
  gap: 8px;

  /* Add space between the card and the dots */
  padding-top: 0.75rem; /* 12px */

  /* Make the dots clickable */
  pointer-events: auto;
}

.pagination-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s ease;
}

.pagination-dots .dot.active {
    background-color: #3b82f6;
}
.carousel-arrow {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

	#work-grid h3 {
	  min-height: 3.5rem; /* Corresponds to Tailwind's min-h-14 */
	  display: -webkit-box;
	  -webkit-line-clamp: 2;
	  -webkit-box-orient: vertical;
	  overflow: hidden;
	}


/* --- GALLERY SECTION (MASONRY) --- */
/* Use the unique ID #grid to target only the gallery container */
#grid {
    max-width: 80%;
    list-style: none;
    margin: 30px auto;
    padding: 0;
    display: grid;  /* Add this */
}

/* Use the child selector '>' to target ONLY the direct children <li> of #grid */
#grid > li {
    display: block;
	padding: 5px;
    width: 20%;
    opacity: 0;
}

#grid > li a {
    position: relative;
    display: block;
}

#grid figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none;
}

#grid > li a:hover figcaption {
    opacity: 1;
    transform: translateY(0);
}

/* Also update these selectors to be specific to #grid */
#grid > li.shown,
.no-js #grid > li,
.no-cssanimations #grid > li {
    opacity: 1;
}

#grid img {
    transition: transform 0.4s ease-in-out;
}

#grid > li a,
#grid > li img {
    outline: none;
    border: none;
    display: block;
    max-width: 100%;
}

#grid a:hover img {
    transform: scale(1.05);
}

/* Gallery Animation Effects */
#grid.effect-3 > li.animate {
    -webkit-transform: scale(0.6);
    transform: scale(0.6);
    -webkit-animation: scaleUp 0.65s ease-in-out forwards;
    animation: scaleUp 0.65s ease-in-out forwards;
}

@-webkit-keyframes scaleUp {
    to { -webkit-transform: scale(1); opacity: 1; }
}
@keyframes scaleUp {
    to { transform: scale(1); opacity: 1; }
}

/* --- FOOTER STYLES --- */
footer ul li .flex-shrink-0 {
    width: 20px;
    height: 20px;
}
footer iframe {
    filter: invert(90%) hue-rotate(180deg);
    transition: filter 0.3s ease-in-out;
}
footer iframe:hover {
    filter: invert(0%) hue-rotate(0deg);
}

	/* --- HERO TITLE ANIMATION --- */
	#hero-title span {
		display: inline-block;
		opacity: 0;
		transform: translateY(25px);
		transition: opacity 0.5s ease-out, transform 0.5s ease-out;
	}
	#hero-title.animate span {
		opacity: 1;
		transform: translateY(0);
	}

    #about-title-mobile {
		    opacity: 0;
	}
	
	#about {
		height: 100%;
	}


    #about-image-container´{
		min-height:1690px;
		min-width:350px;
		z-index:-150;
	}

/* 3. Make the image fill its new container perfectly */
    #about-image-container img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center top; 
        transform: scale(1.2); /* <-- ADD THIS LINE */
		}
    
	@media (max-width: 1536px) {
	#grid {
		max-width: 80%;
		list-style: none;
		margin: 30px auto;
		padding: 0;
		display: grid;  /* Add this */
		}
	}

	/* Use the child selector '>' to target ONLY the direct children <li> of #grid */
	#grid > li {
		display: block;
		padding: 5px;
		width: 20%;
		opacity: 0;
	}

	@media (max-width: 1280px) {
	#grid {
		max-width: 85%;
		list-style: none;
		margin: 30px auto;
		padding: 0;
		display: grid;  /* Add this */
		}
	}

	/* Use the child selector '>' to target ONLY the direct children <li> of #grid */
	#grid > li {
		display: block;
		padding: 5px;
		width: 20%;
		opacity: 0;
	}



/* --- DESKTOP-SPECIFIC STYLES (min-width: 1024px) --- */
@media (max-width: 1024px) {

	
	#grid > li {
		display: block;
		width: 33%;
		opacity: 0;
	}
    .project-info-overlay {
        opacity: 0;
        transform: translateY(100%);
        transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    }
    .group.card-is-hovered .project-info-overlay {
        opacity: 1;
        transform: translateY(0);
    }
    .carousel-arrow {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    .group.card-is-hovered .carousel-arrow {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@media (max-width: 767px) {
 	
	#about-title-desktop {
        display: none !important;
    }

    #about-title-mobile {
        display: block !important;
        text-align: center;
        font-size: 1.875rem;
        margin-bottom: 0.5rem;
        padding-top: 0;
        opacity: 1;
    }

    /* 1. Make the #about section a positioning context and ensure content is visible */
    #about {
        position: relative; /* Crucial for z-index to work on child elements */
        padding: 25rem 0;  /* Adjust padding as needed for spacing */
        overflow: hidden;   /* Prevents the background from spilling out */
        z-index: 0;         /* Establishes a stacking context */
    }

    /* 2. Create a dedicated pseudo-element for the background image */
    #about::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('../img/thomas.avif');
        background-size: cover; /* 'cover' usually works better for backgrounds */
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center 2.5rem;
        z-index: -1; /* This is the key: it sends this layer behind the content */
        opacity: 0.7; /* Optional: adds a nice fade effect */
    }

    #about-image-container {
        display: none !important;
    }

    /* 3. Simplify the text container styling */
    #about-text-container {
        width: 90%;
        margin: 0 auto;
        padding: 1.5rem;
        background-color: rgba(17, 24, 39, 0.85); /* Made slightly more opaque */
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-radius: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* No more negative margin needed! */
    }

    #about-text-container p {
        text-align: left !important;
        font-size: 1rem;
    }

    #about .container > .grid {
        display: block;
    }
}

@media (max-width: 640px) {
			
	#grid > li {
		display: block;
		padding: 2px;
		width: 49%;
		opacity: 0;
	}
		}

/* --- SMALL MOBILE STYLES (max-width: 420px) --- */
@media (max-width: 420px) {
    .grid li {
        width: 95%;
	  }
	
    #hero-title { /* Target the ID, not a class */
        font-size: 2rem; /* Adjusted for better visibility */
    }
    #header {
        padding: 0.5rem 1rem;
    }
    #header a > img {
        height: 1.75rem;
    }
    #header .md\\:hidden.flex {
        gap: 0.75rem;
    }
    #header .language-switcher img,
   
   #mobile-menu-button svg {
        width: 22px;
        height: 22px;
    }
}