/* Styles de base partagés — BMB Synapse Tech Web */
:root {
    --bmb-primary: #4f378a;
    --bmb-violet: #6750a4;
    --bmb-teal: #20bfc2;
    --bmb-scroll-gradient: linear-gradient(135deg, var(--bmb-teal) 0%, var(--bmb-violet) 55%, var(--bmb-primary) 100%);
}

@layer base {

    html,
    body {
        margin: 0;
        padding: 0;
    }

    body {
        overscroll-behavior: none;
    }

    main > :first-child {
        margin-top: 0 !important;
    }

    main > :last-child {
        margin-bottom: 0 !important;
    }
}

/* Barres de défilement personnalisées BMB : discrètes, puis colorées au survol */
/* Firefox : équivalent natif, sans écraser le rendu WebKit de Chrome */
@supports (-moz-appearance: none) {
    * {
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }

    *:hover,
    *:focus-within {
        scrollbar-color: var(--bmb-violet) transparent;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 7px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background-color: transparent;
    background-clip: padding-box;
}

*:hover::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb {
    background-color: var(--bmb-violet);
    background-image: var(--bmb-scroll-gradient);
    background-clip: padding-box;
}

::-webkit-scrollbar-button,
::-webkit-resizer {
    display: none;
    width: 0;
    height: 0;
}

/* Curseur pointeur sur tous les éléments interactifs */
a,
button,
select,
input[type="submit"],
input[type="button"],
[role="button"] {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
}

/* Navigation mobile */
.mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border: 0;
    border-radius: 0.75rem;
    background: #f2ecf4;
    color: #1d1b20;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #e6e0e9;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    background: rgba(253, 247, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(203, 196, 210, 0.5);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.mobile-menu.is-open {
    display: block;
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
}

.mobile-menu__link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #494551;
    font-size: 0.875rem;
    font-weight: 500;
}

.mobile-menu__link:hover {
    background: #f2ecf4;
    color: #1d1b20;
}

.mobile-menu__link[aria-current="page"] {
    background: #e1d4fd;
    color: #22005d;
    font-weight: 700;
}

@media (min-width: 1280px) {
    .mobile-menu-toggle,
    .mobile-menu {
        display: none !important;
    }
}

/* Pages juridiques */
.legal-nav {
    padding: 0.5rem;
    border: 1px solid rgba(203, 196, 210, 0.5);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.legal-nav a {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: 0.7rem;
    color: #494551;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.legal-nav a:hover {
    background: #f2ecf4;
    color: #1d1b20;
}

.legal-nav a[aria-current="page"] {
    background: #e1d4fd;
    color: #22005d;
    font-weight: 700;
}

.legal-content {
    color: #494551;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.legal-content section + section {
    margin-top: 2.25rem;
    padding-top: 2.25rem;
    border-top: 1px solid rgba(203, 196, 210, 0.45);
}

.legal-content h2 {
    margin: 0 0 1rem;
    color: #1d1b20;
    font-family: "Inter", sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.legal-content h3 {
    margin: 1.5rem 0 0.5rem;
    color: #1d1b20;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.legal-content p {
    margin: 0 0 1rem;
}

.legal-content ul,
.legal-content ol {
    margin: 0.4rem 0 1.15rem;
    padding-left: 1.25rem;
}

.legal-content ul {
    list-style: disc;
}

.legal-content ol {
    list-style: decimal;
}

.legal-content li {
    margin: 0.35rem 0;
    padding-left: 0.15rem;
}

.legal-content li::marker {
    color: #6750a4;
    font-weight: 700;
}

.legal-content strong {
    color: #1d1b20;
    font-weight: 700;
}

.legal-content a {
    color: #4f378a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: #20bfc2;
}

.legal-content .legal-note {
    margin: 1.25rem 0;
    padding: 1rem 1.15rem;
    border-left: 4px solid #20bfc2;
    border-radius: 0.75rem;
    background: #f2ecf4;
    font-size: 0.9rem;
}

.legal-content .legal-note p:last-child {
    margin-bottom: 0;
}

.legal-todo {
    display: inline-block;
    padding: 0 0.35rem;
    border: 1px dashed #c9a74d;
    border-radius: 0.35rem;
    background: #ffdf93;
    color: #503d00;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1.5;
}

.legal-meta {
    color: #7a7582;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .legal-content {
        font-size: 0.9rem;
    }

    .legal-content h2 {
        font-size: 1.2rem;
    }
}


/* Animations douces et révélations au défilement */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

/* Soulignement animé des liens de navigation */
header nav[data-active-classes] a {
    position: relative;
}

header nav[data-active-classes] a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.4rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bmb-teal), var(--bmb-violet));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
    pointer-events: none;
}

header nav[data-active-classes] a:hover::after,
header nav[data-active-classes] a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* Halos décoratifs en mouvement très lent */
html.js-anim main section .pointer-events-none.rounded-full {
    animation: bmb-glow 18s ease-in-out infinite alternate;
}

@keyframes bmb-glow {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, -18px, 0);
    }
}

/* Révélation des sections et des cartes */
html.js-anim [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

html.js-anim [data-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    html.js-anim [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html.js-anim main section .pointer-events-none.rounded-full {
        animation: none;
    }

    header nav[data-active-classes] a::after {
        transition: none;
    }
}

/* Entrée du hero au chargement de la page */
@media (prefers-reduced-motion: no-preference) {
    main > div > section:first-of-type,
    main > section:first-of-type {
        animation: bmb-enter 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }
}

@keyframes bmb-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Barre de progression de lecture */
.scroll-progress {
    position: fixed;
    top: 5rem;
    left: 0;
    right: 0;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, var(--bmb-teal), var(--bmb-violet));
    pointer-events: none;
    z-index: 40;
}

/* Cartes : révélation avec léger zoom */
html.js-anim [data-reveal="card"] {
    transform: translateY(24px) scale(0.97);
}

/* Chiffres : largeur stable pendant le comptage */
[data-count] {
    font-variant-numeric: tabular-nums;
}

/* Cartes interactives : léger soulèvement au survol */
main article {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

@media (hover: hover) {
    main article:hover {
        transform: translateY(-4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress {
        display: none;
    }

    main article {
        transition: none;
    }

    main article:hover {
        transform: none;
    }
}
