/* ============================================
   RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background-color: var(--bg-light);
    animation: pageLoadFade 0.8s ease-out;
}

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
    /* Primary Colors - Brand Identity */
    --primary-color: #2E2D2C;
    /* PANTONE BLACK C - Graphite */
    --secondary-blue: #003860;
    /* PANTONE 280 C - Eau */
    --secondary-green: #3BAE49;
    /* PANTONE 361 C - Bâtiments */
    --secondary-orange: #EF8137;
    /* PANTONE 144 C - Récréatif */

    /* Neutral Colors */
    --light-gray: #e5e7eb;
    --text-light: #ffffff;
    --bg-light: #ffffff;
    --bg-gray: #f8f9fa;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Fade-in Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 {
    transition-delay: 0.1s;
}

.fade-in-delay-2 {
    transition-delay: 0.2s;
}

/* Translation Effect Classes */
.translating {
    opacity: 1;
    transition: opacity 0.3s ease;
}

[data-translate] {
    transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.translating [data-translate] {
    opacity: 0;
    transform: scale(0.98);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: var(--bg-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Tricolor Brand Line */
.tricolor-line {
    height: 4px;
    background: linear-gradient(to right,
            var(--secondary-blue) 0% 33.33%,
            var(--secondary-green) 33.33% 66.66%,
            var(--secondary-orange) 66.66% 100%);
    transform: scaleX(0);
    transform-origin: left;
    animation: expandLine 1.5s ease-out forwards;
    animation-delay: 0.2s;
}

/* Logo */
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.header.scrolled .logo {
    opacity: 1;
    color: var(--primary-color);
}

.logo-360 {
    font-weight: 400;
    font-size: 1.2rem;
    vertical-align: top;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    align-items: center;
}

.language-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid;
    background: transparent;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.lang-btn:hover {
    background: var(--secondary-blue);
    border-color: var(--secondary-blue);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
    background: var(--primary-color);
}

.hero-content {
    color: var(--text-light);
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-light);
    opacity: 0;
    transform: translateX(-100px);
    animation: slideInFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.2s;
}

.hero h1 .logo-360 {
    font-weight: 300;
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 0.1em;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.6;
    color: var(--text-light);
    opacity: 0;
    transform: translateX(-80px);
    animation: slideInFromLeft 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.5s;
}

/* Hero Image Container */
.hero-image-container {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Alphanumeric Texture Background */
.hero-image-container::after {
    content: '11111100001100110011101110011110011111011111000000111011011111110000111001110000110011111010111100001100110001110000111111100011001100011101110011110011111011111000000111011011111110000111001110000110011111010111100001100110001100101011110001110011100011111001111000111111100001111111100011001100001110111001111001111101111100000011101101111111000011100111000011001111101011110000110011000111011001110001111100111100011111110000111111';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(0, 56, 96, 0.03);
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.1;
    padding: 20px;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    filter: blur(8px);
    transform: scale(1.05);
    animation: clearBlur 1.2s ease-out forwards;
    animation-delay: 0.2s;
}

.hero-image-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(100px);
    animation: slideInFromRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.8s;
}

.hero-image-content.fade-in {
    opacity: 0;
    transform: translateX(100px);
    transition: none;
    animation: slideInFromRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.8s;
}

.hero-image-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-image-content p {
    font-size: 1.2rem;
    opacity: 0.7;
    max-width: 300px;
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

.header.scrolled .portal-button {
    opacity: 1;
}

.portal-button {
    opacity: 0;
    display: inline-block;
    background: var(--secondary-blue);
    color: var(--text-light);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

.cta-button {
    display: inline-block;
    background: transparent;
    color: var(--text-light);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--text-light);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: 1s;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.3s ease,
        border-color 0.3s ease 0.3s,
        box-shadow 0.3s ease;
}

.cta-content .cta-button {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--secondary-blue);
    transition: left 0.3s ease;
    z-index: -1;
}

.cta-button:hover {
    border-color: var(--secondary-blue);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 56, 96, 0.3);
}

.cta-content .cta-button:hover {
    color: var(--text-light);
}

.cta-button:hover::before {
    left: 0;
}

/* ============================================
   MAIN CONTENT SECTIONS
   ============================================ */

.main-content {
    padding: 80px 0;
    background: var(--bg-light);
}

.sections-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.section {
    background: var(--bg-light);
    padding: 0;
}

.section h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible h2 {
    opacity: 1;
    transform: translateX(0);
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--secondary-blue);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0.3s;
}

.section.visible h2::after {
    width: 60px;
}

.section:nth-child(2) h2::after {
    background: var(--secondary-green);
}

.section:nth-child(3) h2::after {
    background: var(--secondary-orange);
}

.section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    text-align: left;
    font-weight: 400;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    align-items: start;
}

.service-item {
    background: var(--bg-light);
    max-width: 256px;
    min-height: 340px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
}

.service-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.service-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-blue);
}

.service-item:nth-child(1) {
    animation-delay: 0.1s;
}

.service-item:nth-child(2) {
    animation-delay: 0.2s;
}

.service-item:nth-child(3) {
    animation-delay: 0.3s;
}

.service-item:nth-child(4) {
    animation-delay: 0.4s;
}

.service-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    line-height: 1.3;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

.service-item p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
    font-weight: 400;
    text-align: center;
}

/* Service Icons */
.service-icon {
    margin: 0 auto 20px;
    width: 48px;
    height: 48px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.1);
    border-color: inherit;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.service-item:nth-child(1) .service-icon {
    border-color: var(--secondary-blue);
    color: var(--secondary-blue);
}

.service-item:nth-child(1) .service-icon::before {
    -webkit-mask: url('../img/icon/icon_colibri.svg') no-repeat center;
    mask: url('../img/icon/icon_colibri.svg') no-repeat center;
}

.service-item:nth-child(2) .service-icon {
    border-color: var(--secondary-green);
    color: var(--secondary-green);
}

.service-item:nth-child(2) .service-icon::before {
    -webkit-mask: url('../img/icon/icon_chart.svg') no-repeat center;
    mask: url('../img/icon/icon_chart.svg') no-repeat center;
}

.service-item:nth-child(3) .service-icon {
    border-color: var(--secondary-orange);
    color: var(--secondary-orange);
}

.service-item:nth-child(3) .service-icon::before {
    -webkit-mask: url('../img/icon/icon_edit.svg') no-repeat center;
    mask: url('../img/icon/icon_edit.svg') no-repeat center;
}

.service-item:nth-child(4) .service-icon {
    border-color: var(--secondary-blue);
    color: var(--secondary-blue);
}

.service-item:nth-child(4) .service-icon::before {
    -webkit-mask: url('../img/icon/icon_agent.svg') no-repeat center;
    mask: url('../img/icon/icon_agent.svg') no-repeat center;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section h2,
.cta-section p,
.cta-section-button {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.cta-section-button {
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.cta-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-section {
    background: var(--bg-gray);
    padding: 80px 0;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.cta-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-section h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.cta-section p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 2.5rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   FLOATING CONTACT ELEMENT
   ============================================ */

.email-contact {
    background: var(--secondary-blue) url('../img/icon/icon_agent.svg') center/40px no-repeat;
    border-radius: 50%;
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    padding: 8px;
    z-index: 9;
    cursor: pointer;
    animation: floatBounce 3s ease-in-out infinite;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.email-contact:hover {
    transform: scale(1.15) translateY(-5px);
    animation-play-state: paused;
    box-shadow: 0 10px 25px rgba(0, 56, 96, 0.4);
}

.email-contact-text {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: var(--bg-light);
    border: 1px solid var(--light-gray);
    color: var(--primary-color);
    border-radius: 8px;
    padding: 4px 12px;
    white-space: nowrap;
    transform-origin: left bottom;
    opacity: 0;
    transform: scale(0.9) rotate(-20deg);
    pointer-events: none;
    transition: opacity 0.4s ease-out 0.2s,
        transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.1s;
}

.email-contact-text:after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 14px;
    width: 10px;
    height: 10px;
    background: var(--bg-light);
    border-right: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
    transform: rotate(45deg);
}

.email-contact:hover .email-contact-text {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: 0.1s all ease-in-out;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 40px 0;
    text-align: center;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right,
            var(--secondary-blue) 0% 33.33%,
            var(--secondary-green) 33.33% 66.66%,
            var(--secondary-orange) 66.66% 100%);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-direction: column;
}

.footer-logo {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}



/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large screens and above */
@media (min-width: 768px) {
    .hero {
        text-align: left;
    }

    .sections-container {
        gap: 60px;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

/* Tablet and below */
@media (max-width: 768px) {
    .header-content {
        padding: 0.8rem 0;
    }

    .hero {
        grid-template-columns: 1fr;
        padding-top: 80px;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        height: 80vh;
        display: flex;
        color: var(--text-light);
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-image-container {
        height: 50vh;
    }

    .main-content {
        padding: 60px 0;
    }

    .section {
        margin-bottom: 60px;
    }

    .lang-btn {
        border-color: var(--bg-light);
        color: var(--bg-light);
    }

    .lang-btn.active {
        background-color: var(--secondary-blue);
    }

    .scrolled .lang-btn:not(.active) {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .cta-section {
        padding: 60px 0;
    }

    .cta-section h2 {
        margin-bottom: 1rem;
    }

    .cta-section p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    /* Mobile-specific animations */
    .hero h1 {
        transform: translateY(-50px);
        animation: slideInFromTop 1s ease forwards;
        animation-delay: 0.3s;
    }

    .hero-subtitle {
        transform: translateY(-30px);
        animation: slideInFromTop 1s ease forwards;
        animation-delay: 0.6s;
    }

    .hero-image-content {
        transform: translateY(50px);
        animation: slideInFromBottom 1s ease forwards;
        animation-delay: 1s;
    }

    @keyframes slideInFromTop {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideInFromBottom {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    .service-item {
        text-align: center;
    }

    .service-item h3 {
        text-align: center;
    }

    .service-item p {
        text-align: center;
    }
}