/* Landing layout -------------------------------------------------- */
.site-header {
    --header-surface: rgba(255, 255, 255, 0.9);
    --header-border-color: rgba(106, 88, 255, 0.24);
    --header-shadow: 0 22px 55px rgba(25, 34, 80, 0.12);
    --header-text-color: var(--text, #0a0f1c);
    --header-muted-color: var(--muted, rgba(74, 87, 117, 0.85));
    --header-focus-ring: rgba(19, 184, 255, 0.45);
    --header-cta-primary-bg: linear-gradient(135deg, #7c5dff, #1ac6ff);
    --header-cta-primary-color: #ffffff;
    --header-cta-secondary-bg: rgba(255, 255, 255, 0.35);
    --header-cta-secondary-color: var(--header-text-color);
    --header-cta-secondary-border: rgba(106, 88, 255, 0.35);
    --header-dropdown-shadow: 0 30px 80px rgba(8, 12, 30, 0.35);

    width: min(100%, 1200px);
    margin: 0 auto clamp(1.2rem, 4vw, 2.6rem);
    position: sticky;
    top: clamp(6px, 1vw, 18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.75rem, 2.5vw, 1.6rem);
    padding: clamp(0.85rem, 2vw, 1.15rem) clamp(1rem, 3vw, 2.3rem);
    border-radius: clamp(26px, 6vw, 40px);
    backdrop-filter: blur(18px);
    background: var(--header-surface);
    border: 1px solid var(--header-border-color);
    box-shadow: var(--header-shadow);
    color: var(--header-text-color);
    z-index: 40;
    isolation: isolate;
    font-family: var(--font-sans);
}

/* Fallback si pas de backdrop-filter (vieux navigateurs) */
@supports not (backdrop-filter: blur(18px)) {
    .site-header {
        background: color-mix(in srgb, var(--header-surface) 80%, #000000 0%);
    }
}
/* Bloc logo */
.landing-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    white-space: nowrap;
}

.landing-logo__img {
    height: 32px;
    width: auto;
    max-height: 40px;
    display: block;
    flex-shrink: 0;
}

.landing-logo__text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    color: rgba(249, 250, 251, 0.95);
}

@media (min-width: 1024px) {
    .landing-logo__img {
        height: 36px;
    }
    .landing-logo__text {
        font-size: 1.15rem;
    }
}

/* Landing + Search : même style EXACT */
.site-header[data-variant="landing"],
.site-header[data-variant="search"] {
    --header-surface: var(
        --landing-header-bg,
        linear-gradient(135deg, rgba(7, 10, 26, 0.9), rgba(26, 32, 65, 0.76))
    );
    --header-border-color: var(
        --landing-header-border,
        rgba(124, 247, 212, 0.2)
    );
    --header-shadow: var(
        --landing-header-shadow,
        0 30px 70px rgba(4, 7, 20, 0.55)
    );
    --header-text-color: var(--landing-header-text, rgba(255, 255, 255, 0.95));
    --header-muted-color: var(
        --landing-header-muted,
        rgba(226, 232, 255, 0.78)
    );
    --header-focus-ring: rgba(124, 247, 212, 0.5);
    --header-cta-secondary-bg: rgba(255, 255, 255, 0.08);
    --header-cta-secondary-color: rgba(255, 255, 255, 0.9);
    --header-cta-secondary-border: rgba(255, 255, 255, 0.22);
    --header-dropdown-shadow: 0 32px 80px rgba(1, 5, 16, 0.6);
}

/* Exemple futur : autre style possible pour une nouvelle page
.site-header[data-variant="dashboard"] {
    --header-surface: #ffffff;
    --header-border-color: rgba(15, 23, 42, 0.08);
    --header-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    --header-text-color: #0f172a;
    --header-muted-color: #64748b;
}
*/

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

body.landing > .site-header {
    z-index: 60;
}

.hero-demo__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.hero-demo__header h3 {
    margin: 0.2rem 0;
}

.hero-demo__header p {
    margin: 0;
    color: var(--muted);
}

.selector-inline__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.selector-inline__header .ghost {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.header-menu {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.4rem);
    position: relative;
    z-index: 45;
}

/* Meta / badge support */

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--header-muted-color);
    margin-right: clamp(0.5rem, 2vw, 2.4rem);
    min-width: 0;
    justify-self: flex-start;
}

.header-meta__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: inherit;
    white-space: nowrap;
}

.site-header[data-variant="search"] .header-meta__badge {
    /* même style, juste on laisse ce petit override si tu veux garder */
    border-color: rgba(124, 247, 212, 0.22);
    background: rgba(255, 255, 255, 0.12);
}

.header-meta__copy {
    margin: 0;
    line-height: 1.2;
    font-weight: 500;
    color: var(--header-text-color);
}

.header-meta__contact {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.header-meta__contact:hover,
.header-meta__contact:focus-visible {
    color: var(--header-text-color);
    text-decoration: underline;
}

/* Navigation principale (desktop : dropdown) */

.site-nav-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    justify-self: center;
    flex-shrink: 0;
}

.site-nav__label {
    margin-right: 20px;
    align-items: center;
    white-space: nowrap;
    gap: 0.35rem;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--header-border-color);
    background: rgba(255, 255, 255, 0.15);
    color: var(--header-text-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-smooth, ease),
        background 0.2s var(--ease-smooth, ease),
        box-shadow 0.2s var(--ease-smooth, ease);
}

.site-nav__label:hover,
.site-nav__label:focus-visible {
    border-color: var(--header-cta-secondary-border);
    box-shadow: 0 0 0 3px var(--header-focus-ring);
    outline: none;
}

.site-nav__chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    display: inline-block;
    transition: transform 0.2s var(--ease-smooth, ease);
}

.site-nav-wrapper[data-open="true"] .site-nav__chevron {
    transform: rotate(45deg);
}

.site-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0;
    padding: 0.75rem 0;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: var(--header-surface);
    border-radius: clamp(16px, 4vw, 24px);
    border: 1px solid var(--header-border-color);
    box-shadow: var(--header-dropdown-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--ease-smooth, ease),
        transform 0.2s var(--ease-smooth, ease);
    z-index: 60;
}

.site-nav-wrapper[data-open="true"] .site-nav,
.site-nav-wrapper:hover .site-nav,
.site-nav-wrapper:focus-within .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Liens de la nav */

.landing-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--header-muted-color);
    text-decoration: none;
    padding: 0.45rem 0.95rem;
    border-radius: 0.9rem;
    transition: color 0.2s var(--ease-smooth, ease),
        background 0.2s var(--ease-smooth, ease);
}

.landing-link:hover,
.landing-link:focus-visible {
    color: var(--header-text-color);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.landing-link--active {
    color: var(--header-text-color);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
}

/* CTAs */

.header-cta-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    justify-self: flex-end;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform 0.2s var(--ease-smooth, ease),
        box-shadow 0.2s var(--ease-smooth, ease),
        background 0.2s var(--ease-smooth, ease);
    white-space: nowrap;
}

.header-cta--primary {
    background: var(--header-cta-primary-bg);
    color: var(--header-cta-primary-color);
    box-shadow: 0 12px 30px rgba(26, 30, 65, 0.25);
}

.header-cta--secondary {
    background: var(--header-cta-secondary-bg);
    color: var(--header-cta-secondary-color);
    border-color: var(--header-cta-secondary-border);
}

.header-cta:hover,
.header-cta:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(26, 30, 65, 0.28);
    outline: none;
}

/* Bouton burger */

.header-toggle {
    display: none;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--header-border-color);
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: border-color 0.2s var(--ease-smooth, ease),
        background 0.2s var(--ease-smooth, ease),
        box-shadow 0.2s var(--ease-smooth, ease);
    flex-direction: column;
    gap: 5px;
}

.header-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--header-text-color);
    border-radius: 999px;
    transition: transform 0.25s var(--ease-smooth, ease),
        opacity 0.25s var(--ease-smooth, ease);
}

.site-header[data-menu-open="true"] .header-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header[data-menu-open="true"] .header-toggle__bar:nth-child(2) {
    opacity: 0;
}

.site-header[data-menu-open="true"] .header-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-header[data-menu-open="true"] .header-toggle {
    background: rgba(255, 255, 255, 0.25);
}

/* Focus global sur les éléments interactifs du header */

.site-nav a:focus-visible,
.site-nav__label:focus-visible,
.header-cta:focus-visible,
.header-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--header-focus-ring);
}

/* -------------------------------------------------- */
/* Responsive                                         */
/* -------------------------------------------------- */

@media (max-width: 1080px) {
    .header-menu {
        gap: 0.75rem;
    }
}

@media (max-width: 900px) {
    .site-header {
        flex-wrap: wrap;
        padding: 0.85rem 1.25rem;
    }

    .site-nav-wrapper {
        width: 100%;
        align-items: stretch;
        gap: 0;
    }

    .site-nav__label {
        display: none;
    }

    .site-nav {
        position: static;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        min-width: 0;
        gap: 0.5rem;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .landing-link {
        width: 100%;
    }

    .header-menu {
        position: absolute;
        top: calc(100% + 12px);
        left: clamp(0px, 3vw, 18px);
        right: clamp(0px, 3vw, 18px);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background: var(--header-surface);
        border-radius: clamp(22px, 5vw, 32px);
        padding: 1.4rem;
        box-shadow: var(--header-dropdown-shadow);
        border: 1px solid var(--header-border-color);
        opacity: 0;
        pointer-events: none;
        transform: translate3d(0, -12px, 0);
        transition: opacity 0.2s var(--ease-smooth, ease),
            transform 0.2s var(--ease-smooth, ease);
        gap: 1.1rem;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        z-index: 50;
    }

    .site-header[data-menu-open="true"] .header-menu {
        opacity: 1;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .header-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .header-meta {
        width: 100%;
        justify-content: space-between;
        gap: 0.25rem 0.5rem;
        font-size: 0.78rem;
        margin-right: 0;
    }

    .header-meta__badge {
        font-size: 0.68rem;
    }

    .landing-link {
        padding: 0.75rem 0.35rem;
    }

    .header-cta-group {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        justify-self: stretch;
    }

    .header-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-meta__copy {
        display: none;
    }

    .landing-logo__text {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .site-header {
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .header-menu {
        gap: 0.85rem;
    }

    .header-meta {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .header-cta-group {
        gap: 0.6rem;
    }

    .header-toggle {
        width: 42px;
        height: 42px;
    }
}

/* -------------------------------------------------- */
/* Motion / accessibilité                             */
/* -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .header-menu,
    .site-nav,
    .header-cta,
    .header-toggle,
    .header-toggle__bar,
    .landing-link,
    .site-nav__label,
    .site-nav__chevron {
        transition: none !important;
        transform: none !important;
    }

    .header-cta:hover,
    .header-cta:focus-visible {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
}
