:root {
            --color-background: #ffffff;
            --color-text: #333333;
            --color-text-light: #666666;
            --color-accent: #888888;
            --color-light: #f8f8f8;
            --spacing-xs: 0.5rem;
            --spacing-sm: 1rem;
            --spacing-md: 2rem;
            --spacing-lg: 4rem;
            --spacing-xl: 8rem;
            --font-sans: 'Poppins', sans-serif;
            --font-serif: 'Playfair Display', serif;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-sans);
            color: var(--color-text);
            line-height: 1.6;
            background-color: var(--color-background);
        }

        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 var(--spacing-md);
        }

        /* Header */
        .site-header {
            padding: var(--spacing-sm) 0;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 100;
            background-color: white;
            border-bottom: 1.25px solid rgba(0, 0, 0, 0.28);
        }

        .header-content {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            width: 100%;
        }

        .logo-container {
            flex: 0 0 auto;
            margin-right: auto;
        }

        .logo {
            font-family: var(--font-sans);
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--color-text);
            text-decoration: none;
            display: flex;
            align-items: center;
        }

        .logo-text {
            display: flex;
            align-items: center;
        }

        nav {
            margin-right: var(--spacing-md);
        }

        .nav-link {
            color: var(--color-text);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s ease;
            /* padding: 8px 0; */
        }

        .nav-link:hover,
        .nav-link.active {
            color: var(--color-accent);
        }

        /* Language Toggle */
        .language-toggle {
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: transform 0.3s ease;
            padding: 8px 0;
            color: var(--color-text);
            font-weight: 500;
        }

        .language-toggle:hover {
            transform: scale(1.1);
            color: var(--color-accent);
        }

        /* Hero Section */
        .hero {
            height: 100vh;
            display: flex;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        .hero-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--spacing-lg);
            align-items: center;
        }

        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.7);
        }

        .hero-content {
            position: relative;
            z-index: 1;
            max-width: 600px;
        }

        .hero-title {
            font-family: var(--font-serif);
            font-size: 2.5rem;
            line-height: 1.2;
            margin-bottom: var(--spacing-sm);
            color: var(--color-text);
            font-style: italic;
            font-weight: 700;
        }

        .hero-subtitle {
            font-family: var(--font-sans);
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: var(--spacing-sm);
            color: var(--color-text);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            word-spacing: 0.5em;
        }

        .btn {
            display: inline-block;
            padding: 0.8rem 2rem;
            background: none;
            color: black;
            text-decoration: none;
            border-radius: 2em;
            font-weight: 700;
            font-size: 1.1rem;
            border: 2px solid black;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            transition: background-color 0.3s, color 0.3s;
        }

        .btn.btn-outline {
            background: none;
            color: black;
            border: 2px solid black;
        }

        .btn.btn-outline:hover {
            background: black;
            color: white;
        }

        /* Projects Grid */
        .projects {
            padding: var(--spacing-s) 0;
        }

        .section-title {
            font-family: var(--font-serif);
            font-size: 2.5rem;
            font-style: italic;
            font-weight: 700;
            text-align: center;
            margin-bottom: var(--spacing-lg);
            margin-left: 0;
            width: 100vw;
            max-width: 1200px;
            margin-right: auto;
            margin-left: auto;
        }

        .projects-grid {
            display: flex;
            flex-direction: row;
            overflow-x: auto;
            gap: 1vw;
            padding: 0 0 2vw 0;
            scroll-snap-type: x mandatory;
            width: 100vw;
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
        }

        .projects-grid > .project-card:first-child {
            margin-left: 0 !important;
        }

        .project-card {
            min-width: 220px;
            max-width: 260px;
            background: none;
            border-radius: 0;
            box-shadow: none;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            scroll-snap-align: start;
            margin: 0;
            padding: 0;
            overflow: visible;
            transition: transform 0.3s ease;
            cursor: pointer;
        }

        .project-card a {
            text-decoration: none;
            color: inherit;
            display: block;
        }

        .project-card:hover {
            transform: translateY(-10px);
        }

        .project-image {
            width: 100%;
            height: 220px;
            background: none;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 0.5em;
        }

        .project-image picture {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        .project-image img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            border: none;
            box-shadow: none;
            transition: transform 0.3s ease;
            display: block;
            margin: 0 auto;
        }

        .project-card:hover .project-image img {
            transform: scale(1.05);
        }

        .project-info {
            padding: 0;
            margin-top: 0.5em;
            text-align: center;
            width: 100%;
        }

        .project-title {
            font-family: var(--font-sans);
            font-size: 1.1rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin: 0;
            color: var(--color-text);
            text-align: left;
        }

        .project-description {
            color: var(--color-text-light);
            margin-bottom: var(--spacing-sm);
        }

        /* Bio Section */
        .bio {
            padding: var(--spacing-md) 0;
            background-color: var(--color-light);
        }

        .bio-container {
            max-width: 1400px;
            width: 100%;
            margin: 0 auto;
            padding: 0 2rem;
        }

        .bio-content {
            display: grid;
            grid-template-columns: 1fr auto;
            align-items: start;
            gap: 2rem;
        }

        .bio-image {
            display: flex;
            align-items: stretch;
        }

        .bio-image picture {
            display: block;
        }

        .bio-image img {
            display: block;
            width: auto;
            object-fit: cover;
            max-height: 700px;

        }

        .bio-text {
            width: 100%;
            overflow: hidden;
        }

        .bio-text p {
            margin-bottom: var(--spacing-md);
            text-align: justify;
            text-align-last: left;
        }

        .bio-text strong {
            font-weight: 700;
        }

        .bio-text em {
            font-style: italic;
        }

        .bio-text h2 {
            font-family: var(--font-serif);
            font-size: 2.5rem;
            margin-bottom: var(--spacing-md);
        }

        .bio-extended {
            margin-top: 4.5rem;
        }

        .bio-extended-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2.75rem;
            align-items: start;
        }

        .bio-extended-column {
            min-width: 0;
        }

        .bio-extended-title {
            display: inline-block;
            margin: 0 0 1rem;
            padding: 0.5rem 1.35rem;
            border: 2px solid #222;
            border-radius: 999px;
            background: #fff;
            color: #222;
            font-family: var(--font-sans);
            font-size: 1.15rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }

        .bio-extended-list {
            margin: 0;
            padding-left: 1.2rem;
            list-style: disc;
        }

        .bio-extended-list li {
            margin-bottom: 0.65rem;
            color: #222;
            font-family: var(--font-sans);
            font-size: 0.95rem;
            line-height: 1.42;
            letter-spacing: 0.01em;
            text-transform: uppercase;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .site-header {
                padding: 0;
            }

            .hero {
                padding-top: 60px;
            }

            .hero-title {
                font-size: 2.5rem;
            }

            .hero-subtitle {
                font-size: 1.2rem;
            }

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

            .bio-content {
                grid-template-columns: 1fr;
            }

            .bio-extended-grid {
                grid-template-columns: 1fr;
                gap: 2rem;
            }

            .bio-image {
                order: -1;
                margin-bottom: var(--spacing-md);
            }

            .hero-container {
                grid-template-columns: 1fr;
            }

            .collage {
                height: 300px;
                margin-top: var(--spacing-md);
            }

            .popup-content {
                flex-direction: column;
                max-width: 95%;
                max-height: 95%;
            }

            .popup-img-container {
                max-height: 50vh;
            }

            .popup-img {
                max-height: 50vh;
            }

            .popup-details {
                max-height: 40vh;
            }

            .popup-close {
                top: -30px;
                right: 0;
            }

            .footer-content {
                flex-direction: column;
                text-align: center;
                gap: var(--spacing-md);
            }

            .footer-info {
                margin-bottom: var(--spacing-sm);
            }

            .footer-social {
                justify-content: center;
                margin-top: var(--spacing-sm);
            }

            .footer-bottom {
                margin-top: var(--spacing-md);
                padding-top: var(--spacing-md);
            }
        }

        /* Image Collage */
        .collage {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            grid-template-rows: repeat(4, 1fr);
            gap: 8px;
            height: 480px;
            position: relative;
            z-index: 2;
        }

        .collage-item {
            overflow: hidden;
            border-radius: 4px;
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .collage-item:hover {
            transform: scale(1.02);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
            z-index: 3;
        }

        .collage-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .collage-item:hover img {
            transform: scale(1.1);
        }

        /* Custom grid placements for a more dynamic look */
        .collage-item:nth-child(1) {
            grid-column: 1 / 3;
            grid-row: 1 / 3;
        }

        .collage-item:nth-child(2) {
            grid-column: 3 / 5;
            grid-row: 1 / 2;
        }

        .collage-item:nth-child(3) {
            grid-column: 3 / 4;
            grid-row: 2 / 3;
        }

        .collage-item:nth-child(4) {
            grid-column: 4 / 5;
            grid-row: 2 / 4;
        }

        .collage-item:nth-child(5) {
            grid-column: 1 / 2;
            grid-row: 3 / 5;
        }

        .collage-item:nth-child(6) {
            grid-column: 2 / 4;
            grid-row: 3 / 5;
        }

        .collage-item:nth-child(7) {
            grid-column: 4 / 5;
            grid-row: 4 / 5;
        }

        /* Image Popup */
        .popup {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
            transform: scale(0.95);
            backdrop-filter: blur(5px);
        }

        .popup.active {
            opacity: 1;
            pointer-events: auto;
            transform: scale(1);
        }

        .popup-content {
            position: relative;
            max-width: 90%;
            max-height: 90%;
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            transform: translateY(20px);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: row;
            background-color: white;
        }

        .popup.active .popup-content {
            transform: translateY(0);
        }

        .popup-img-container {
            flex: 1;
            background-color: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .popup-img {
            max-width: 100%;
            max-height: 80vh;
            display: block;
            object-fit: contain;
        }

        .popup-details {
            flex: 1;
            padding: var(--spacing-md);
            display: flex;
            flex-direction: column;
            background-color: white;
            color: var(--color-text);
            overflow-y: auto;
            max-height: 80vh;
        }

        .popup-title {
            font-family: var(--font-serif);
            font-size: 1.8rem;
            margin-bottom: var(--spacing-sm);
            color: var(--color-text);
        }

        .popup-description {
            margin-bottom: var(--spacing-md);
            line-height: 1.6;
        }

        .popup-price {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--color-accent);
            margin-bottom: var(--spacing-sm);
        }
        .popup-buy-btn {
            display: inline-block;
            padding: 0.8rem 1.8rem;
            background-color: var(--color-accent);
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-weight: 500;
            transition: background-color 0.3s ease;
            margin-top: auto;
            text-align: center;
        }

        .popup-buy-btn:hover {
            background-color: #8c1179;
        }

        .popup-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 36px;
            height: 36px;
            cursor: pointer;
            color: var(--color-text);
            font-size: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s ease, opacity 0.3s ease;
            opacity: 0.8;
            z-index: 1001;
            background-color: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
        }

        .popup-close:hover {
            transform: rotate(90deg);
            opacity: 1;
        }

        /* Popup Navigation */
        .popup-nav {
            position: absolute;
            top: 50%;
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 20px;
            transform: translateY(-50%);
            z-index: 1001;
            pointer-events: none; /* This ensures clicks pass through to background */
        }

        .popup-nav-btn {
            background: rgba(255, 255, 255, 0.2);
            color: var(--color-text);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.3s ease;
            opacity: 0.7;
            pointer-events: auto; /* This makes buttons clickable */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .popup-nav-btn:hover {
            background: rgba(255, 255, 255, 0.8);
            transform: scale(1.1);
            opacity: 1;
        }

        .popup-nav-btn.prev {
            margin-right: auto;
        }

        .popup-nav-btn.next {
            margin-left: auto;
        }

        /* Additional styles for better placeholder handling */
        .placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f5f5f5;
            color: #666;
            font-size: 1.2rem;
            text-align: center;
            padding: 2rem;
            min-height: 200px;
        }

        .popup-img-container.placeholder {
            min-height: 400px;
            background-color: #f8f8f8;
            flex: 1;
        }

        /* Image Carousel */
        .carousel {
            position: relative;
            width: 100%;
            padding-bottom: 100%; /* This creates a square aspect ratio */
            overflow: hidden;
            border-radius: 0;
            box-shadow: none;
            background: var(--color-background);
        }

        .carousel-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother easing */
            will-change: transform; /* Optimize for animations */
        }

        .carousel-item {
            flex: 0 0 100%;
            height: 100%;
            position: relative;
            overflow: hidden;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .carousel-item.active {
            opacity: 1;
        }

        @media (prefers-reduced-motion: reduce) {
            .carousel-container,
            .carousel-item {
                transition: none;
            }
        }

        .carousel-item picture {
            display: block;
            width: 100%;
            height: 100%;
        }

        .carousel-item img,
        .carousel-item video {
            width: 100%;
            height: 100%;
            object-fit: contain;
            transition: transform 0.3s ease;
            will-change: transform; /* Optimize for animations */
            backface-visibility: hidden; /* Reduce flickering */
            transform: translateZ(0); /* Force GPU acceleration */
        }

        .carousel-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.2);
            color: var(--color-text);
            border: none;
            padding: 1rem;
            cursor: pointer;
            font-size: 1.5rem;
            transition: background-color 0.3s ease;
            z-index: 10;
        }

        .carousel-nav:hover {
            background: rgba(255, 255, 255, 0.35);
        }

        .carousel-nav.prev {
            left: 0;
            border-radius: 0;
        }

        .carousel-nav.next {
            right: 0;
            border-radius: 0;
        }

        .carousel-dots {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 0.5rem;
            z-index: 10;
        }

        .carousel-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .carousel-dot.active {
            background: white;
        }

        @media (max-width: 768px) {
            .carousel {
                padding-bottom: 100%; /* Maintain square aspect ratio on mobile */
            }
        }

        /* Add styles for section-divider, about-btn, and about-name */
        .section-divider {
            width: 100vw;
            height: 1px;
            background: #ccc;
            margin: 0 0 2.5rem 0;
        }
        .about-header-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            margin-bottom: 1.5rem;
        }
        .about-btn {
            display: block;
            margin: 0rem auto 0 auto;
            padding: 0.6em 2.2em;
            border: 2px solid #222;
            border-radius: 2em;
            background: #fff;
            color: #222;
            font-family: var(--font-sans);
            font-size: 1.3rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            /* cursor: pointer; */
            /* transition: background 0.2s, color 0.2s; */
        }
        /* .about-btn:hover {
            background: #222;
            color: #fff;
        } */
        .about-name {
            font-family: var(--font-sans);
            font-size: 2rem;
            font-weight: 300;
            margin-bottom: 0.5rem;
            margin-top: 1.2rem;
            letter-spacing: 0.01em;
            text-transform: uppercase;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.3em;
        }
        .about-name .logo-carmen {
            font-family: var(--font-sans);
            font-size: 2rem;
            font-weight: 300;
            letter-spacing: 0.01em;
            text-transform: uppercase;
        }
        .about-name .logo-surname {
            font-family: var(--font-serif);
            font-size: 2rem;
            font-weight: 700;
            font-style: italic;
            margin-left: 0.2em;
        }

        @media (max-width: 900px) {
    .bio-container {
        width: 100vw;
        max-width: 100vw;
        padding: 0 0.5rem;
    }
    .bio-content {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .bio-image img {
        display: block;
        max-width: 95vw;
        width: 100%;
        margin: 0 auto;
        height: auto;           /* Let height scale naturally */
        max-height: none;       /* Remove any max-height restriction */
        border-radius: 8px;     /* Optional: for a softer look */
    }
	    .bio-text {
	        width: 100% !important;
	        min-width: 0;
	        box-sizing: border-box;
	        padding: 0 1rem;
	    }
	    .bio-text p {
	        text-align: justify !important;
	        text-align-last: left;
	    }

            .bio-extended {
                margin-top: 3rem;
                padding: 0 1rem;
            }

            .bio-extended-title {
                font-size: 1rem;
            }

            .bio-extended-list li {
                font-size: 0.88rem;
                line-height: 1.4;
            }
		}

        /* Compact the homepage section rhythm on phones only. */
        @media (max-width: 768px) {
            #projects + .section-divider {
                margin-bottom: 0;
            }

            .home-coverage.editorial-section {
                padding: 2rem 0 1.5rem;
            }

            .bio {
                padding-top: 1rem;
            }

            .bio .commissions.editorial-section {
                margin-bottom: 0;
            }

            .bio-extended {
                margin-top: 1.5rem;
            }
        }