@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

        /* MASTER DESIGN: Swiss Gridding & Golden Ratio */
        :root {
            --scale-xs: 8px;
            --scale-sm: 13px;
            --scale-md: 21px;
            --scale-lg: 34px;
            --scale-xl: 55px;
            --scale-xxl: 89px;
            
            --color-text-main: #212529;
            --color-text-muted: #5f6b7a;
            --color-link: rgb(75, 85, 99);
            
            /* Swiss Graphite Variables */
            --color-graphite: #121212;
            --color-graphite-light: #1e1e1e;
            --color-text-light: #ffffff;
            --color-text-light-muted: #bdc3c7;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: #ffffff;
            padding: var(--scale-xxl) 0;
            color: var(--color-text-main);
            overflow-x: hidden;
            transition: background-color 0.8s ease;
        }

        /* Detail State Body Class */
        body.detail-mode {
            background-color: var(--color-graphite) !important;
            overflow: hidden; /* Prevent scrolling during detail view focus */
        }

        .profile-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
            row-gap: 48px;
            column-gap: 24px;
            justify-content: center;
            align-items: stretch; /* Forces equal heights perfectly */
        }

        /* The Card Frame */
        .profile-card {
            background-image: url("../assets/images/bgnoise_lg.webp");
            background-size: 100px auto;
            box-shadow: 0px 8px 21px rgba(108, 117, 125, 0.2);
            border-radius: 4px;
            position: relative;
            display: flex;
            flex-direction: column;
            cursor: pointer; /* Signal interactivity */
            will-change: transform, width, height;
            transition: box-shadow 0.4s ease;
            height: 100%;
        }
        
        .profile-card:hover {
            box-shadow: 0px 13px 34px rgba(108, 117, 125, 0.4);
        }

        /* Image Mask for the FLIP transition */
        .profile-img-wrapper {
            padding: var(--scale-md) var(--scale-md) var(--scale-sm) var(--scale-md); 
            margin: 0;
            display: flex;
            justify-content: center;
            will-change: padding, width, height;
        }

        .profile-img {
            width: 100%;
            height: auto;
            aspect-ratio: 1.618 / 1; /* Landscape Golden Ratio to eliminate scrollbars */
            object-fit: cover;
            object-position: center 15%; /* Keep focus on faces */
            border-radius: 4px;
            will-change: transform, border-radius;
        }

        .profile-img-andreas {
            filter: brightness(1.1);
        }

        .profile-img-fernando {
            filter: grayscale(100%) contrast(1.15);
        }

        /* Text Body inside card */
        .profile-card-body {
            padding: 0 var(--scale-md) var(--scale-lg) var(--scale-md);
            display: flex;
            flex-direction: column;
            will-change: opacity, transform;
            flex: 1; /* Take up remaining height equally across cards */
        }

        .profile-title {
            text-align: center;
            font-weight: 600;
            font-size: 1.618rem; 
            line-height: 1.2;
            margin: 0 0 var(--scale-xs) 0;
            letter-spacing: -0.01em; 
            transition: color 0.4s ease;
        }

        .profile-role {
            text-align: center;
            font-size: 1rem;
            font-weight: 500;
            color: var(--color-text-muted);
            margin: 0 0 var(--scale-sm) 0;
            transition: color 0.4s ease;
        }

        .profile-skills {
            text-align: center;
            font-size: 1rem; 
            font-style: italic;
            color: var(--color-text-main);
            margin: 0 0 var(--scale-md) 0;
            line-height: 1.618;
            transition: color 0.4s ease;
        }

        .profile-bio {
            text-align: left;
            font-weight: 600;
            font-size: 1rem;
            line-height: 1.618;
            color: var(--color-text-main);
            margin: 0 0 var(--scale-md) 0;
            transition: color 0.4s ease;
        }

        /* Read Full Profile Button - Minimalist Swiss Typography Link */
        .btn-swiss-primary {
            align-self: flex-start;
            background: transparent;
            border: none;
            border-bottom: 1px solid currentColor;
            color: var(--color-text-main);
            font-weight: 500;
            font-family: 'Inter', sans-serif;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 0 0 2px 0;
            font-size: 0.618rem;
            border-radius: 0;
            margin-top: auto; /* Pushes button to bottom aligned on all cards */
            transition: opacity 0.3s ease;
            cursor: pointer;
        }
        .btn-swiss-primary i {
            margin-left: 4px;
            transition: transform 0.3s ease;
        }
        .btn-swiss-primary:hover {
            background: transparent;
            color: var(--color-text-main);
            opacity: 0.6;
        }
        .btn-swiss-primary:hover i {
            transform: translateX(3px);
        }

        /* The hidden extended text */
        .full-bio-content {
            display: none;
            opacity: 0;
            font-weight: 400;
            font-size: 1.1rem;
            line-height: 1.618;
            color: var(--color-text-light);
            margin-top: var(--scale-lg);
        }

        .full-bio-content p {
            margin-bottom: var(--scale-md);
        }

        /* Nav controls in detail view */
        .detail-controls {
            display: none;
            opacity: 0;
            margin-top: var(--scale-xl);
            gap: var(--scale-lg); /* Golden proportioned gap */
        }

        .btn-swiss-dark {
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--color-text-light-muted);
            color: var(--color-text-light);
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 0 0 2px 0;
            font-size: 0.618rem;
            border-radius: 0;
            cursor: pointer;
            transition: opacity 0.3s ease;
        }
        .btn-swiss-dark i {
            transition: transform 0.3s ease;
        }
        .btn-swiss-dark:nth-child(1) i {
            margin-right: 4px;
        }
        .btn-swiss-dark:nth-child(2) i {
            margin-left: 4px;
        }
        .btn-swiss-dark:hover {
            opacity: 0.6;
            border-color: var(--color-text-light);
            background: transparent; /* No background on hover */
        }
        .btn-swiss-dark:nth-child(1):hover i {
            transform: translateX(-3px);
        }
        .btn-swiss-dark:nth-child(2):hover i {
            transform: translateX(3px);
        }

        .profile-linkedin {
            align-self: flex-start;
            text-align: left;
            font-weight: 600;
            font-size: 0.618rem;
            text-transform: uppercase;
            color: var(--color-link);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            transition: color 0.2s ease;
            margin-top: var(--scale-md);
        }

        .profile-linkedin i {
            margin-right: var(--scale-xs);
            font-size: 1.1em;
        }

        /* ----- ACTIVE / DETAIL STATE CLASSES ----- */
        
        .profile-card.active {
            /* Full screen absolute overlay */
            position: fixed;
            top: 0; 
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 100;
            background-image: none;
            background-color: transparent;
            box-shadow: none;
            border-radius: 0;
            
            /* CSS Grid Golden Ratio 1 : 1.618 */
            display: grid;
            grid-template-columns: 1fr 1.618fr;
            gap: 0; /* padding handles space */
        }

        .profile-card.active .profile-img-wrapper {
            padding: 0; /* Image touches boundaries or minimal padding */
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: var(--color-graphite-light);
        }

        .profile-card.active .profile-img {
            width: 100%;
            height: 100%;
            border-radius: 0; /* Sharp corners in swiss mode */
            filter: grayscale(100%) contrast(1.1); /* Dramatize all images in showdown */
        }

        .profile-card.active .profile-card-body {
            padding: var(--scale-xl) var(--scale-xxl) var(--scale-xl) var(--scale-xxl);
            justify-content: center; /* Center text vertically */
            background-color: var(--color-graphite);
            overflow-y: auto; /* Scroll if content is very long */
        }

        .profile-card.active .profile-title {
            text-align: left;
            color: var(--color-text-light);
            font-size: 3rem; /* Massive title */
            margin-bottom: var(--scale-sm);
        }

        .profile-card.active .profile-role {
            text-align: left;
            color: var(--color-text-light-muted);
            font-size: 1.2rem;
            margin-bottom: var(--scale-lg);
        }

        .profile-card.active .profile-skills,
        .profile-card.active .profile-bio, 
        .profile-card.active .btn-swiss-primary {
            display: none !important; /* Hide small card content */
        }

        /* Reveal extended content */
        .profile-card.active .full-bio-content,
        .profile-card.active .detail-controls {
            display: flex;
        }

        /* Fade out non-active cards */
        .profile-card.hidden {
            pointer-events: none;
            opacity: 0 !important; /* Managed by GSAP but fallback */
        }


        /* ----- RESPONSIVE 1 COL FOR MOBILE DETAIL ----- */
        @media (max-width: 992px) {
            .profile-card.active {
                grid-template-columns: 1fr;
                grid-template-rows: 40vh 1fr;
                overflow-y: auto;
            }
            .profile-card.active .profile-img-wrapper {
                height: 40vh;
            }
            .profile-card.active .profile-card-body {
                padding: var(--scale-lg);
                justify-content: start;
                height: auto;
            }
            .profile-card.active .profile-title {
                font-size: 2rem;
            }
        }