/* ===================================
   FOOTER STYLE (LANDO - REFINED V2)
   =================================== */

.footer {
    position: relative;
    z-index: 10;
    padding: 0;
    background: transparent;
    /* allow global body/main background to show */
    /* Ensure it matches the bottom of the page */
    margin-top: 0;
    /* Changed from -60px to prevent overlapping contact section */
    overflow: hidden;
}

[data-theme="dark"] .footer {
    background: transparent;
}

/* The Container using the user's SVG */
/* ENLARGED to match user request */
.footer-container {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 900px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    color: var(--footer-text);
    background: transparent;

    /* UNIVERSAL MASK (Clips everything inside to the shape) */
    -webkit-mask-image: var(--footer-mask);
    mask-image: var(--footer-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center bottom;
    mask-position: center bottom;

    /* CRITICAL: Clips carousel and all content to container boundaries */
    overflow: hidden;
    transform-style: preserve-3d;
    backface-visibility: hidden;

    /* Drop shadow for the whole shape - Softened to prevent 'trait noir' look */
    filter: drop-shadow(0 -5px 15px rgba(0, 0, 0, 0.2));
    isolation: isolate;
    /* Force a clear stacking context for children z-indexes */
}

/* Light Mode: SVG Background via ::before */
.footer-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--footer-bg-image);
    background-size: 100% 100%;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-color: transparent;
    /* Transparent to let body gradient show through */
    z-index: 1;
    transform: translateZ(0);
    /* Base layer */
    pointer-events: none;
}

/* Dark Mode: Pure background color change (Shape is handled by mask above) */
[data-theme="dark"] .footer-container {
    background: transparent;
}

/* Background image for dark mode container shape */
[data-theme="dark"] .footer-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100.1%;
    /* Slight overlap to prevent sub-pixel gaps */
    height: 100.1%;
    background-image: url('../img/containerfooterblanc.svg');
    background-size: 100% 100%;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 1;
    transform: translateZ(0);
    filter: brightness(0) invert(1);
    /* Force le SVG en blanc pur */
}

.footer-content-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    /* Increased center space */
    width: 100%;
    height: 100%;
    padding-bottom: 20px;
    padding-top: 15vh;
    padding-left: 2rem;
    padding-right: 2rem;
    z-index: 100;
    transform: translateZ(0px);
    /* Above Marquee */
}

/* ===================================
   COLUMNS
   =================================== */
.footer-col {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    height: 100%;
}

/* LEFT (Navigation) - CENTERED VERTICALLY */
.footer-col.left {
    justify-content: center;
    /* Center vertically */
    align-items: center;
    /* Center horizontally */
    padding-bottom: 0;
    /* True center */
}

.footer-col.left .footer-nav {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* Tighter spacing between links */
}

/* RIGHT (Socials) - CENTERED VERTICALLY */
.footer-col.right {
    justify-content: center;
    /* Center vertically */
    align-items: center;
    /* Center horizontally */
    padding-bottom: 0;
    /* True center */
}

.footer-col.right .footer-nav {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Section Titles (PAGES / FOLLOW ON) */
/* Hidden or very subtle based on Lando's minimal v2 look? Keeping consistent but subtle */
.footer-col-title {
    font-family: var(--font-primary, sans-serif);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--footer-title-color);
    /* Updated to use theme-aware variable */
    margin-bottom: 0.8rem;
    font-weight: 700;
    display: block;
}

/* High-End Staggered Hover Effect */
.footer-link-premium {
    font-family: var(--font-display, sans-serif);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--footer-text);
    text-decoration: none;
    text-transform: uppercase;
    line-height: 1.2;
    display: inline-block;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
}

.premium-link-wrapper {
    position: relative;
    display: block;
    height: 1em;
    width: 7em;
    /* Slightly increased to show full text like LINKEDIN */
    overflow: hidden;
}

.premium-link-top,
.premium-link-bottom {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    white-space: nowrap;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.premium-link-bottom {
    color: var(--accent-color);
    transform: translateY(0);
    /* Bottom container is ready at 0 */
}

/* Base state for all spans */
.premium-link-top span,
.premium-link-bottom span {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: calc(var(--char-index) * 0.02s);
    will-change: transform;
    pointer-events: none;
}

.premium-link-top span {
    transform: translateY(0);
}

.premium-link-bottom span {
    transform: translateY(100%);
    /* Bottom spans start hidden below */
}

/* Hover state: top text slides UP and OUT, bottom text slides UP and IN */
.footer-link-premium:hover .premium-link-top span {
    transform: translateY(-100%);
}

.footer-link-premium:hover .premium-link-bottom span {
    transform: translateY(0);
}

/* CENTER (Head + Text + CTA) */
.footer-col.center {
    align-items: center;
    justify-content: flex-end;
    /* Align elements to bottom/portrait */
    padding-bottom: 0;
    position: relative;
}

/* Main Background Text - Lando Norris Proportions */
/* Main Background Text - Lando Norris Proportions */
.footer-statement-text {
    font-family: var(--font-display, sans-serif);
    font-size: clamp(1.8rem, 5vw, 4rem);
    /* Reduced to prevent cutting 'S' in LIMITS */
    font-weight: 900;
    line-height: 1.0;
    /* Increased from 0.9 to prevent cutting letters */
    text-transform: uppercase;
    text-align: center;
    color: var(--footer-text);
    position: absolute;
    top: 13%;
    /* Raised from 13% to 8% to clear the head */
    /* Positioned to appear behind portrait */
    left: 50%;
    transform: translateX(-50%);
    width: 110%;
    /* Allow slight overflow of the center grid cell to prevent clipping */
    max-width: 1200px;
    z-index: 50;
    /* Raised from 2 to ensure it stays behind portrait but above other layers */
    letter-spacing: -0.02em;
    pointer-events: none;
    overflow: visible;
    /* Ensure text is not clipped */
}

/* Container for the highlight effect */
.highlight-reveal-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: inherit;
    padding-right: 0.15em;
    /* Prevent italic 'S' from being clipped */
    margin-right: -0.15em;
    /* Compensate for the padding */
}

.highlight-content {
    display: inline-block;
}

.highlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 5;
    will-change: transform;
}

.highlight-content.statement-accent {
    color: var(--accent-color);
    font-style: italic;
    display: inline-block;
}

.highlight-content {
    color: var(--footer-text);
}

/* Portrait Image Styles */
/* Portrait Image Styles */
.footer-portrait-img {
    height: 96%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.5));
    position: relative;
    /* Lowered head significantly for desktop */
    bottom: -50px;
    /* Was -20px */
    z-index: 200;
    /* Above statement text - face covers text */
    transform: translateZ(20px);
}

.footer-link-premium:hover .premium-link-top {
    transform: translateY(-100%);
}

.footer-link-premium:hover .premium-link-bottom {
    transform: translateY(0);
}

.premium-link-top span,
.premium-link-bottom span {
    display: inline-block;
}

/* Portrait Wrapper */
.footer-portrait-wrapper {
    position: relative;
    width: 85%;
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 100;
    /* Above statement text - portrait in front */
    margin-bottom: -30px;
    pointer-events: none;
    transform: translateZ(0);
}

.portrait-reveal-clip {
    z-index: 1;
    /* Within portrait wrapper stacking context */
    position: relative;
}

/* CTA Button - Floating over portrait */
.footer-cta-btn {
    bottom: 15%;
    /* Responsive positioning */
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    /* Increased to be above portrait (200) */
    background: var(--accent-color);
    color: #ffffff;
    padding: 14px 32px;
    font-family: var(--font-display, sans-serif);
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 15px 45px rgba(var(--accent-rgb), 0.5);
    position: absolute;
}

.footer-cta-btn:hover {
    transform: translateX(-50%) translateY(-8px) scale(1.05);
    /* Maintain centering */
    background: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 25px 60px rgba(255, 255, 255, 0.3);
}

/* ===================================
   NEW CAROUSEL IMPLEMENTATION
   =================================== */
.footer-marquee {
    position: absolute;
    bottom: 60px;
    left: 3.8%;
    transform: translateX(-50%);
    width: 100%;
    /* Significantly narrower to fit inside container lines */
    max-width: 1350px;
    height: 50px;
    z-index: 5;
    /* Lower than content wrapper (100) and portrait (200) */
    /* Behind portrait */
    overflow: hidden;
    /* Clips overflowing logos at container edges */
    pointer-events: none;
    opacity: 1;
}

.marquee-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    width: max-content;
    will-change: transform;
}

.marquee-item {
    padding: 0 3rem;
    height: 30px;
    display: flex;
    align-items: center;
}

.marquee-item img {
    height: 100%;
    width: auto;
    filter: var(--footer-logo-filter);
    /* Force le noir ou blanc selon le mode */
    opacity: 1;
    /* Pas de transparence */
}



/* ===================================
   BOTTOM CREDITS (Absolute Bottom)
   =================================== */
.footer-bottom-credits {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 24px 2rem;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: center;
    /* Center horizontally */
    gap: 12px;
    font-family: var(--font-primary, sans-serif);
    font-size: 0.5rem;
    /* Match links */
    color: var(--footer-text);
    background: transparent;
    z-index: 50;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .footer-bottom-credits {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: none;
        left: 0;
        transform: none;
        padding-left: 4vw;
        padding-right: 4vw;
        bottom: -5px;
    }
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 500;
}

.copyright-year {
    font-weight: 800;
}

.footer-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.legal-link {
    color: var(--footer-text);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.5rem;
    /* Reduced from 0.55rem */
    position: relative;
    padding: 2px 0;
    transition: color 0.3s ease;
}

/* Specific adjustment for French (longer words) */
html[lang="fr"] .legal-link {
    font-size: 0.4rem;
    letter-spacing: 0.05em;
}

.legal-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.legal-link:hover {
    color: var(--accent-color);
    opacity: 1;
}

.legal-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.legal-separator {
    font-size: 0.6em;
    opacity: 0.3;
}

/* ===================================
   RESPONSIVE DESIGN - Lando Norris Style
   =================================== */

/* Large Tablet (1024px - 1280px) - Slight adjustments */
@media (max-width: 1280px) {
    .footer-container {
        height: 80vh;
        min-height: 750px;
    }

    .footer-content-wrapper {
        padding-top: 12vh;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .footer-statement-text {
        font-size: clamp(2.5rem, 7vw, 5rem);
    }

    .footer-link-premium {
        font-size: 1rem;
    }
}

/* Tablet Portrait (768px - 1024px) - Scale down but keep structure */
@media (max-width: 1024px) {
    .footer {
        margin-top: -60px;
    }

    .footer-container {
        height: 75vh;
        min-height: 650px;
    }

    .footer-content-wrapper {
        grid-template-columns: 1fr 2fr 1fr;
        padding-top: 10vh;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .footer-statement-text {
        font-size: clamp(2rem, 6vw, 4rem);
        top: 15%;
    }

    .footer-portrait-wrapper {
        height: 60vh;
    }

    .footer-portrait-img {
        max-height: 450px;
    }

    .footer-link-premium {
        font-size: 0.95rem;
    }

    .footer-col-title {
        font-size: 0.65rem;
    }

    .footer-cta-btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   From largest to smallest
   =================================== */

/* Laptop / Small Desktop (max-width: 1440px) */
@media (max-width: 1440px) {
    .footer-container {
        height: 80vh;
        min-height: 750px;
    }

    .footer-portrait-img {
        max-height: 550px;
    }

    .footer-statement-text {
        font-size: clamp(2rem, 5vw, 3.5rem);
        z-index: 2;
        /* Behind portrait */
        top: 18%;
    }

    .footer-marquee {
        bottom: 80px;
    }

    .footer-bottom-credits {
        bottom: 50px;
    }
}

/* Tablet Landscape / Large Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .footer-container {
        height: 75vh;
        min-height: 650px;
    }

    .footer-content-wrapper {
        padding-top: 12vh;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .footer-portrait-wrapper {
        height: 70vh;
    }

    .footer-portrait-img {
        max-height: 450px;
        padding-bottom: 100px;
    }

    .footer-statement-text {
        font-size: clamp(1.8rem, 4.5vw, 2.8rem);
        top: 22%;
        /* Higher to prevent overlap */
        z-index: 2;
        /* Behind portrait */
    }

    .footer-link-premium {
        font-size: 0.7rem;
        padding: 4px 0;
    }

    .footer-col-title {
        font-size: 0.65rem;
    }

    .footer-marquee {
        bottom: 90px;
        height: 35px;
    }

    .footer-bottom-credits {
        bottom: 50px;
        font-size: 0.6rem;
    }

    .footer-cta-btn {
        padding: 10px 24px;
        font-size: 0.85rem;
    }
}

/* Tablet Portrait / iPad (max-width: 900px) */
@media (max-width: 900px) {
    .footer {
        margin-top: -100px;
    }

    .footer-container {
        height: 72vh;
        min-height: 600px;
    }

    .footer-content-wrapper {
        padding-top: 10vh;
    }

    .footer-portrait-wrapper {
        height: 65vh;
        margin-top: -5vh;
    }

    .footer-portrait-img {
        max-height: 380px;
        padding-bottom: 90px;
    }

    .footer-statement-text {
        font-size: clamp(1.5rem, 4vw, 2.3rem);
        top: 25%;
        /* Raised */
        z-index: 2;
        /* Behind portrait */
    }

    .footer-link-premium {
        font-size: 0.6rem;
    }

    .footer-marquee {
        bottom: 110px;
        height: 32px;
    }

    .footer-bottom-credits {
        bottom: 50px;
        /* Raised */
        font-size: 0.55rem;
    }
}

/* Moved mobile styles to bottom of file for correct cascade */

@media (max-width: 768px) {
    .footer {
        margin-top: -60px;
        /* Reduced from -130px to match desktop and preserve content */
    }

    .footer-container {
        height: 80vh;
        min-height: 550px;
    }

    .footer-content-wrapper {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        padding: 5vh 0.5rem 1rem;
        /* Less top padding */
        gap: 0.2rem;
    }

    /* Keep same positioning as desktop but scale down */
    .footer-col.center {
        order: 0;
        /* Reset mobile override */
    }

    .footer-statement-text {
        position: absolute;
        top: 32%;
        /* Moved even higher from 25% */
        font-size: clamp(1rem, 4.2vw, 1.8rem);
        /* Slightly smaller */
        line-height: 0.95;
        width: 100%;
        margin-bottom: 0;
        text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        z-index: 50;
        /* Elevated visibility */
    }

    .footer-portrait-wrapper {
        height: 80vh;
        width: 100%;
        margin-bottom: 0px;
        align-items: flex-end;
        margin-top: -10vh;
        /* Less aggressive pull up */
    }

    .footer-portrait-img {
        height: auto;
        max-height: 380px;
        /* Increased from 300px */
        width: auto;
        padding-bottom: 40px;
        /* Reduced to raise portrait */
    }

    .footer-cta-btn {
        position: absolute;
        bottom: 35%;
        /* Raised with portrait */
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 8px 18px;
        /* Tighter button */
        font-size: 0.7rem;
        /* Smaller button text */
        margin: 0;
    }

    .footer-col.left,
    .footer-col.right {
        padding: 0;
        justify-content: center;
    }

    .footer-link-premium {
        font-size: 0.5rem;
        /* Tiny to avoid truncation like LinkedIn */
        padding: 2px 0;
        min-height: auto;
        white-space: nowrap;
    }

    .footer-col-title {
        font-size: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .footer-marquee {
        display: block;
        bottom: 190px;
        /* Raised from 150px */
        height: 30px;
    }

    .marquee-item {
        padding: 0 1rem;
        height: 18px;
    }

    .footer-bottom-credits {
        position: absolute;
        left: 50% !important;
        transform: translateX(-50%);
        width: 100%;
        text-align: center;
        padding: 5px 0;
        font-size: 0.45rem;
        bottom: 50px;
        /* Raised */
    }

    .legal-link {
        min-height: auto;
        padding: 4px 8px;
    }
}

/* Very Small Mobile (max 480px) - Extra compactness */
@media (max-width: 480px) {
    .footer-container {
        height: 60vh;
        min-height: 420px;
    }

    .footer-content-wrapper {
        padding-top: 8vh;
        gap: 0.2rem;
    }

    .footer-statement-text {
        font-size: 1.25rem;
        /* Increased size */
        top: 25%;
        z-index: 50;
    }

    .footer-portrait-wrapper {
        height: 85vh;
        margin-top: -35vh;
    }

    .footer-portrait-img {
        max-height: 190px;
        /* Reduced from 220px */
        padding-bottom: 20px;
        bottom: 100px;
    }

    .footer-link-premium {
        font-size: 0.45rem;
    }

    .footer-cta-btn {
        padding: 6px 14px;
        font-size: 0.6rem;
        bottom: 30%;
    }

    .footer-marquee {
        bottom: 150px;
    }

    .footer-bottom-credits {
        bottom: 80px;
        /* Raised */
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {

    .footer-link-premium,
    .premium-link-top span,
    .premium-link-bottom span,
    .footer-cta-btn,
    .marquee-track {
        transition: none !important;
        animation: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .footer-statement-text {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 1);
    }

    .footer-link-premium {
        text-decoration: underline;
    }

    .footer-cta-btn {
        border: 2px solid currentColor;
    }
}

/* Large Mobile / Phablet (max-width: 600px) - Authoritative Overlay */
@media (max-width: 600px) {
    .footer {
        margin-top: -120px;
    }

    .footer-container {
        height: 75vh;
        min-height: 550px;
    }

    .footer-content-wrapper {
        padding: 6vh 0.8rem 1rem;
        gap: 0.3rem;
    }

    .footer-portrait-wrapper {
        height: 55vh;
        /* Reduced height to give space */
        margin-top: 0vh;
        /* Fixed: Head touching top. Was -8vh */
        align-items: flex-end;
        /* Ensure image sits at bottom */
    }

    .footer-portrait-img {
        max-height: 300px;
        /* Slightly smaller to fit */
        padding-bottom: 90px;
    }

    .footer-statement-text {
        font-size: 1.4rem;
        top: 20%;
        /* Adjusted position */
        line-height: 1.1;
        width: 100%;
        z-index: 50;
        /* Fixed: Text visibility */
        opacity: 1;
        text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
        /* Improved contrast */
        pointer-events: none;
        /* Let clicks pass through to portrait if needed */
    }

    .footer-link-premium {
        font-size: 0.55rem;
        padding: 3px 0;
    }

    .footer-col-title {
        font-size: 0.55rem;
    }

    .footer-marquee {
        bottom: 130px;
        height: 30px;
    }

    .footer-bottom-credits {
        bottom: 50px;
        font-size: 0.5rem;
    }

    /* Fixed Button Size and Position */
    .footer-cta-btn {
        padding: 8px 16px !important;
        /* Force smaller padding */
        font-size: 0.70rem !important;
        /* Smaller text */
        bottom: 25% !important;
        /* Adjusted position */
        width: auto !important;
        /* Don't stretch if not needed */
        min-width: 180px;
        max-width: 220px;
    }
}