/* ==========================================================================
   ERADONE 2.0 — Phase 1 : Fondations, Header & Hero
   Direction artistique : Corporate éditorial, grille suisse, asymétrie maîtrisée
   ========================================================================== */

:root {
    /* Palette officielle */
    --e-blue: #0178B7;
    --e-blue-deep: #015E90;
    --e-green: #3AB04A;
    --e-navy: #0D1B2A;
    --e-navy-2: #15283C;
    --e-gold: #D4AF37;
    --e-ivory: #F4F1E8;
    --e-white: #FFFFFF;

    /* Neutres dérivés */
    --e-ink: #0D1B2A;
    --e-text: #2F3E4E;
    --e-muted: #5E6C7B;
    --e-line: rgba(13, 27, 42, 0.11);
    --e-line-light: rgba(255, 255, 255, 0.14);

    /* Typographie officielle : Montserrat */
    --e-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Rythme & transitions */
    --e-radius: 2px;
    --e-ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* Alignement des variables héritées sur la charte officielle */
    --color-navy: var(--e-navy);
    --color-navy-dark: #08121D;
    --color-blue: var(--e-blue);
    --color-blue-dark: var(--e-blue-deep);
    --color-green: var(--e-green);
    --color-gold: var(--e-gold);
    --font-primary: var(--e-font);
}

html {
    overflow-x: clip;
}

body {
    font-family: var(--e-font);
    color: var(--e-text);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.section-title, .btn, .nav-link {
    font-family: var(--e-font);
}

::selection {
    background: var(--e-gold);
    color: var(--e-navy);
}

:focus-visible {
    outline: 2px solid var(--e-blue);
    outline-offset: 3px;
}

/* ==========================================================================
   Topbar institutionnelle
   ========================================================================== */
.topbar {
    background: var(--e-navy);
    font-size: 0.72rem;
    padding: 0.48rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    letter-spacing: 0.03em;
}

.topbar-info {
    margin: 0;
    color: rgba(244, 241, 232, 0.72);
    font-weight: 500;
}

.topbar-info sup {
    font-size: 0.65em;
}

.topbar-contact {
    gap: 1.5rem;
}

.topbar-contact a {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 500;
}

.topbar-contact a:hover {
    color: var(--e-gold);
}

.topbar i {
    color: var(--e-gold);
    font-size: 0.7rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: sticky;
    top: 0;
    background: var(--e-white);
    border-bottom: 1px solid var(--e-line);
    z-index: 1000;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(13, 27, 42, 0.14);
    box-shadow: 0 6px 24px -18px rgba(13, 27, 42, 0.28);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 1.5rem;
    transition: height 0.25s var(--e-ease);
}

.header.scrolled .navbar {
    height: 66px;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
    transition: height 0.25s var(--e-ease);
}

.header.scrolled .logo-img {
    height: 38px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 1.35rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.79rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    color: var(--e-navy);
    padding: 0.5rem 0.2rem;
    border: 0;
    border-radius: 0;
    background: none !important;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link::after {
    display: block;
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.15rem;
    width: 100%;
    height: 1.5px;
    background: var(--e-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--e-ease);
}

.nav-link:hover,
.nav-link.active,
.nav-dropdown-trigger[aria-expanded="true"] {
    color: var(--e-blue);
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-dropdown-trigger[aria-expanded="true"]::after {
    transform: scaleX(1);
}

.nav-chevron {
    transition: transform 0.25s var(--e-ease);
    margin-top: 1px;
}

.nav-dropdown-trigger[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.mobile-divisions-list,
.nav-mobile-cta,
.nav-mobile-footer {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--e-font);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--e-white);
    background: var(--e-navy);
    padding: 0.8rem 1.35rem;
    border-radius: var(--e-radius);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--e-navy);
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, gap 0.25s var(--e-ease);
}

.btn-contact:hover {
    background: var(--e-blue);
    border-color: var(--e-blue);
    color: var(--e-white);
    gap: 0.85rem;
}

.hamburger .bar {
    background: var(--e-navy);
    height: 2px;
    border-radius: 0;
}

/* Panneau architectural des 5 divisions (Desktop) */
.divisions-mega-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--e-white);
    border-top: 1px solid var(--e-line);
    border-bottom: 1px solid rgba(13, 27, 42, 0.16);
    box-shadow: 0 22px 40px -28px rgba(13, 27, 42, 0.35);
    z-index: 995;
    padding: 2rem 0 1.5rem;
    animation: e-panel-in 0.22s var(--e-ease) both;
}

.divisions-mega-panel[hidden] {
    display: none;
}

@keyframes e-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--e-line);
    border-bottom: 1px solid var(--e-line);
}

.mega-item {
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.25rem;
    text-decoration: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.mega-item + .mega-item {
    border-left: 1px solid var(--e-line);
}

.mega-item::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--e-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--e-ease);
}

.mega-item:hover {
    background: var(--e-ivory);
}

.mega-item:hover::before {
    transform: scaleX(1);
}

.mega-num {
    font-family: var(--e-font);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--e-gold);
    margin-bottom: 0.65rem;
}

.mega-title {
    font-family: var(--e-font);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--e-navy);
    margin-bottom: 0.45rem;
}

.mega-desc {
    font-size: 0.77rem;
    line-height: 1.55;
    color: var(--e-muted);
    font-weight: 400;
}

.mega-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.1rem;
    font-size: 0.78rem;
}

.mega-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--e-blue);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.mega-all-link:hover {
    color: var(--e-navy);
    gap: 0.75rem;
}

.mega-quick-links {
    display: flex;
    gap: 1.5rem;
}

.mega-quick-links a {
    color: var(--e-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mega-quick-links a:hover {
    color: var(--e-navy);
}

/* ==========================================================================
   Hero — Composition éditoriale asymétrique
   ========================================================================== */
.hero-editorial {
    position: relative;
    background: var(--e-ivory);
    padding: 0;
    overflow: hidden;
}

.hero-editorial::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(13, 27, 42, 0.04) 1px, transparent 1px);
    background-size: calc(100% / 12) 100%;
    pointer-events: none;
}

.hero-stage {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
    align-items: stretch;
    min-height: clamp(480px, 66vh, 595px);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.5rem, 4.5vw, 4rem) clamp(1.75rem, 3.2vw, 3.25rem) clamp(2.5rem, 4.5vw, 4rem) max(1.5rem, calc((min(100vw, 1600px) - 1240px) / 2 + 1.5rem));
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0 0 1.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--e-blue);
}

.hero-eyebrow-rule {
    width: 34px;
    height: 1.5px;
    background: var(--e-gold);
    flex-shrink: 0;
}

.hero-heading {
    font-size: clamp(2.05rem, 3.05vw, 3.1rem);
    font-weight: 800;
    line-height: 1.09;
    letter-spacing: -0.028em;
    color: var(--e-navy);
    margin: 0 0 1.5rem;
    text-wrap: balance;
}

.hero-heading-line {
    display: block;
    color: var(--e-blue);
}

.hero-heading-sub {
    display: block;
    font-weight: 600;
    color: var(--e-navy);
    letter-spacing: -0.022em;
}

.hero-dot {
    color: var(--e-green);
}

.hero-lead {
    max-width: 44ch;
    font-size: clamp(0.96rem, 1.08vw, 1.04rem);
    font-weight: 400;
    line-height: 1.78;
    color: var(--e-text);
    margin: 0 0 2.5rem;
    padding-left: 1.25rem;
    border-left: 2px solid var(--e-green);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--e-font);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    color: var(--e-white);
    background: var(--e-blue);
    padding: 1.08rem 1.85rem;
    border-radius: var(--e-radius);
    text-decoration: none;
    transition: background-color 0.25s ease, gap 0.3s var(--e-ease);
}

.btn-hero-primary:hover {
    background: var(--e-navy);
    color: var(--e-white);
    gap: 1.05rem;
}

.btn-hero-link {
    font-family: var(--e-font);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--e-navy);
    text-decoration: none;
    padding: 0.35rem 0;
    border-bottom: 1.5px solid var(--e-gold);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-hero-link:hover {
    color: var(--e-blue);
    border-bottom-color: var(--e-blue);
}

/* Photographie grand format asymétrique */
.hero-media {
    position: relative;
    background: var(--e-navy);
    overflow: hidden;
    min-height: 480px;
}

.hero-identity-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    z-index: 3;
    display: flex;
    flex-direction: column;
}

.hero-identity-seam .seam-blue {
    flex: 1.2;
    background: var(--e-blue);
}

.hero-identity-seam .seam-green {
    flex: 1;
    background: var(--e-green);
}

.hero-identity-seam .seam-gold {
    flex: 0.8;
    background: var(--e-gold);
}

.hero-picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 56% 24%;
    display: block;
    border-radius: 0;
}

/* Rail institutionnel bas de Hero */
.hero-colophon {
    position: relative;
    z-index: 2;
    background: var(--e-navy);
    border-top: 1px solid rgba(212, 175, 55, 0.28);
    padding: 1rem 0;
}

.hero-colophon-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-colophon-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 241, 232, 0.78);
    white-space: nowrap;
}

.colophon-dot {
    width: 6px;
    height: 6px;
    background: var(--e-gold);
    flex-shrink: 0;
}

.hero-colophon-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.hero-colophon-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-colophon-nav a span {
    color: var(--e-gold);
    font-weight: 700;
}

.hero-colophon-nav a:hover {
    color: var(--e-white);
}

.hero-scroll-cue {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--e-gold);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.hero-scroll-cue:hover {
    color: var(--e-white);
}

/* Révélation discrète à l'ouverture */
@media (prefers-reduced-motion: no-preference) {
    .hero-copy > * {
        animation: e-rise 0.75s var(--e-ease) both;
    }
    .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
    .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
    .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
    .hero-photo {
        animation: e-fade-in 0.9s var(--e-ease) 0.08s both;
    }
}

@keyframes e-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes e-fade-in {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* ==========================================================================
   Responsive — Tablette & Mobile (Conception dédiée)
   ========================================================================== */
@media (max-width: 1180px) {
    .nav-list {
        gap: 1rem;
    }
    .nav-link {
        font-size: 0.76rem;
    }
    .hero-colophon-nav {
        gap: 1.05rem;
    }
}

@media (max-width: 1024px) {
    .topbar {
        display: none;
    }

    .navbar {
        height: 68px;
        gap: 1rem;
    }

    .header.scrolled .navbar {
        height: 62px;
    }

    .divisions-mega-panel {
        display: none !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(88vw, 390px);
        height: 100dvh;
        background: var(--e-navy);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 5.25rem 1.75rem 2rem;
        transition: right 0.4s var(--e-ease);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-list > li {
        border-bottom: 1px solid var(--e-line-light);
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        color: var(--e-white);
        font-size: 1rem;
        font-weight: 600;
        padding: 0.95rem 0;
        min-height: 48px;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover,
    .nav-link.active,
    .nav-dropdown-trigger[aria-expanded="true"] {
        color: var(--e-gold);
    }

    .mobile-only-link {
        display: flex;
    }

    /* Accordéon des 5 divisions dans le menu mobile */
    .mobile-divisions-list {
        display: none;
        list-style: none;
        margin: 0 0 0.75rem;
        padding: 0 0 0.5rem 0.75rem;
        border-left: 1.5px solid rgba(212, 175, 55, 0.45);
    }

    .mobile-divisions-list.is-open {
        display: block;
    }

    .mobile-division-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.65rem 0.5rem;
        min-height: 44px;
        font-size: 0.84rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: rgba(244, 241, 232, 0.86);
        text-decoration: none;
    }

    .mobile-division-link:hover {
        color: var(--e-gold);
    }

    .m-div-num {
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--e-gold);
    }

    .nav-mobile-cta {
        display: block;
        margin-top: 1.75rem;
    }

    .btn-mobile-primary {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
        width: 100%;
        min-height: 50px;
        background: var(--e-blue);
        color: var(--e-white);
        font-size: 0.9rem;
        font-weight: 700;
        text-decoration: none;
        border-radius: var(--e-radius);
    }

    .nav-mobile-footer {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: auto;
        padding-top: 2rem;
        border-top: 1px solid var(--e-line-light);
    }

    .nav-mobile-footer a {
        color: rgba(244, 241, 232, 0.74);
        font-size: 0.84rem;
        font-weight: 500;
        text-decoration: none;
    }

    .hamburger {
        display: flex;
        position: relative;
        z-index: 1001;
    }

    .hamburger.active .bar {
        background: var(--e-white);
    }

    .nav-overlay.active {
        display: block;
    }

    /* Hero Tablette */
    .hero-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-copy {
        padding: 3.25rem 1.5rem 2.75rem;
        max-width: 720px;
    }

    .hero-media {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .hero-identity-seam {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 4px;
        flex-direction: row;
    }

    .hero-colophon-nav {
        display: none;
    }
}

@media (max-width: 640px) {
    .btn-contact {
        display: none;
    }

    .logo-img {
        height: 38px;
    }

    .hero-copy {
        padding: 2.25rem 1.25rem 2rem;
    }

    .hero-eyebrow {
        font-size: 0.64rem;
        letter-spacing: 0.16em;
        margin-bottom: 1.15rem;
    }

    .hero-eyebrow-rule {
        width: 22px;
    }

    .hero-heading {
        font-size: clamp(1.85rem, 7.6vw, 2.35rem);
        line-height: 1.12;
        margin-bottom: 1.25rem;
    }

    .hero-lead {
        font-size: 0.94rem;
        line-height: 1.65;
        margin-bottom: 1.75rem;
        padding-left: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
    }

    .btn-hero-primary {
        justify-content: center;
        min-height: 50px;
        padding: 0.95rem 1.4rem;
    }

    .btn-hero-link {
        align-self: center;
        padding: 0.55rem 0.25rem;
    }

    .hero-media {
        aspect-ratio: 4 / 3;
    }

    .hero-photo {
        object-position: 58% 20%;
    }

    .hero-colophon {
        padding: 0.85rem 0;
    }

    .hero-colophon-tag {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }
}
