@charset "utf-8";
/* CSS Document */
/* ==========================================================================
   FAMMED — Styles complémentaires (au-delà des utilitaires Tailwind)
   ========================================================================== */

/* Masque les éléments Alpine avant leur initialisation */
[x-cloak] { display: none !important; }

/* Sélection & accessibilité clavier */
::selection { background: #2B4FA3; color: #fff; }
:focus-visible {
    outline: 2px solid #2B4FA3;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Barre de déroulement discrète (navigateurs WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #F8FAFC; }
::-webkit-scrollbar-thumb { background: #BACDF0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #8FADE5; }

/* --------------------------------------------------------------------------
   Motifs de fond
   -------------------------------------------------------------------------- */
/* Petites croix médicales très pâles (hero) */
.cross-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M20 15h4v5h5v4h-5v5h-4v-5h-5v-4h5z' fill='%232B4FA3' fill-opacity='.055'/%3E%3C/svg%3E");
}
/* Pointillé clair sur fond marine (bandeau chiffres) */
.dots-pattern {
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* --------------------------------------------------------------------------
   Soulignement animé des liens de navigation
   -------------------------------------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -9px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #2B4FA3, #0EA5E9);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Signature : tracé ECG animé
   Le segment lumineux (170px) parcourt le tracé en boucle parfaitement continue.
   -------------------------------------------------------------------------- */
.ecg-path {
    stroke-dasharray: 170 1400;
    stroke-dashoffset: 1570;
    animation: ecg-run 4.5s linear infinite;
}
@keyframes ecg-run { to { stroke-dashoffset: 0; } }

/* --------------------------------------------------------------------------
   Badges flottants du hero
   -------------------------------------------------------------------------- */
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.floaty    { animation: floaty 5.5s ease-in-out infinite; }
.floaty-2  { animation-delay: 1.4s; }
.floaty-3  { animation-delay: 2.6s; }

/* --------------------------------------------------------------------------
   Scroll reveal (activé uniquement si JS est disponible)
   -------------------------------------------------------------------------- */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-delay-1 { transition-delay: .12s; }
.js .reveal-delay-2 { transition-delay: .24s; }
.js .reveal-delay-3 { transition-delay: .36s; }

/* --------------------------------------------------------------------------
   Carte OpenStreetMap adoucie (n&b → couleur au survol)
   -------------------------------------------------------------------------- */
.map-soft iframe { filter: grayscale(1) contrast(1.05); opacity: .92; transition: filter .4s ease, opacity .4s ease; }
.map-soft:hover iframe { filter: none; opacity: 1; }

/* --------------------------------------------------------------------------
   Respect des préférences utilisateur : animations réduites
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ecg-path, .floaty { animation: none; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}


/* --------------------------------------------------------------------------
   Correctifs lisibilité (texte blanc sur fond de marque)
   Ces règles garantissent le fond même si Tailwind (CDN) ne charge pas.
   -------------------------------------------------------------------------- */
.grad-fammed { background-image: linear-gradient(90deg, #2B4FA3, #0EA5E9); color: #fff; }
.grad-fammed.bg-gradient-to-br { background-image: linear-gradient(135deg, #2B4FA3, #0EA5E9); }
.bg-navy { background-color: #0F1B3D; }

/* Bandeau CTA : texte toujours lisible */
.cta-band, .cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.88); }

/* Sécurité : si le JS ne s'exécute pas, le contenu .reveal reste visible */
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }
.js .reveal:not(.in) { animation: reveal-failsafe .01s linear 2.5s forwards; }

/* Cartes produit : bordure fine bleu ciel + ombre douce et large */
.card-glow {
  background: #fff !important;
  border: 1px solid #7DD3FC !important;
  border-radius: 1rem;
  box-shadow: 0 6px 24px -4px rgba(56,189,248,.28) !important;
  transition: box-shadow .3s ease, transform .3s ease, opacity .7s ease, border-color .3s ease !important;
}
.card-glow:hover {
  transform: translateY(-3px);
  border-color: #38BDF8 !important;
  box-shadow: 0 12px 34px -4px rgba(56,189,248,.42) !important;
}
.js .card-glow.reveal:not(.in) { transform: translateY(26px); }
.js .card-glow.reveal.in:hover { transform: translateY(-3px); }


/* ==========================================================================
   MINDMAP 3D — accueil (hero produits vedettes + gammes)
   Structure : .mm (perspective) > .mm-tilt (rotation pilotée par le JS)
   > anneau, lignes SVG, nœuds, cœur. Profondeur via translateZ.
   Les tailles utilisent des unités de conteneur (cqw) : tout s'adapte au mobile.
   ========================================================================== */
.mm { position: relative; width: 100%; margin-inline: auto; container-type: inline-size; perspective: 1200px; touch-action: pan-y; }
.mm-hero { max-width: 620px; aspect-ratio: 1 / 1; --c: 38cqw; }
.mm-gammes { max-width: 920px; aspect-ratio: 100 / 88; perspective: 1700px; }
.mm-tilt { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }

/* Orbite pointillée */
.mm-ring { position: absolute; border: 1.5px dashed rgba(43, 79, 163, .22); border-radius: 50%; pointer-events: none; }
.mm-hero .mm-ring    { left: 12%; right: 12%; top: 17%; bottom: 17%; }
.mm-gammes .mm-ring  { left: 11%; right: 11%; top: 15%; bottom: 15%; }

/* Lignes centre → nœuds */
.mm-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; transform: translateZ(10px); }
.mm-line { fill: none; stroke: rgba(43, 79, 163, .24); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: stroke .3s ease, stroke-width .3s ease; }
.mm-flow { fill: none; stroke: #0EA5E9; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 5 15; opacity: .5; vector-effect: non-scaling-stroke; animation: mm-flow 2.6s linear infinite; transition: opacity .3s ease, stroke-width .3s ease; }
.mm-flow.on { opacity: 1; stroke-width: 3; }
@keyframes mm-flow { to { stroke-dashoffset: -20; } }

/* Nœuds (produits / gammes) */
.mm-node { position: absolute; left: var(--x); top: var(--y); width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); display: block; text-decoration: none; transform: translateZ(48px); transition: opacity .3s ease; }
.mm-hero .mm-node   { --d: clamp(58px, 17cqw, 106px); }
.mm-gammes .mm-node { --d: clamp(60px, 11.5cqw, 104px); }
.mm-node.dim { opacity: .5; }
.mm-bob { position: relative; width: 100%; height: 100%; animation: mm-bob 6s ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes mm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.mm-disc { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #fff; border: 2px solid #E5E7EB; box-shadow: 0 12px 30px -10px rgba(15, 27, 61, .28); transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .3s ease; }
.mm-disc img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.mm-disc svg { width: 38%; height: 38%; stroke-width: 1.6; color: #9CA3AF; transition: color .3s ease; }
.mm-node.on .mm-disc, .mm-node:focus-visible .mm-disc { transform: scale(1.12); border-color: #38BDF8; box-shadow: 0 18px 40px -10px rgba(14, 165, 233, .5); }
.mm-node.on .mm-disc svg { color: #2B4FA3; }

/* Étiquettes */
.mm-tag { position: absolute; top: calc(100% + 8px); left: 50%; width: max-content; max-width: clamp(86px, 25cqw, 156px); transform: translateX(-50%); padding: .45em .85em; border: 1px solid #E5E7EB; border-radius: 4px; background: #fff; box-shadow: 0 8px 22px -12px rgba(15, 27, 61, .35); font: 600 clamp(9.5px, 1.9cqw, 12px)/1.35 'Plus Jakarta Sans', sans-serif; text-align: center; color: #475569; transition: color .3s ease, border-color .3s ease; }
.mm-tag small { display: block; margin-top: .15em; font-weight: 500; letter-spacing: 0; text-transform: none; color: #94A3B8; }
.mm-gammes .mm-tag { font-size: clamp(9px, 1.5cqw, 12px); letter-spacing: .1em; text-transform: uppercase; }
.mm-node.on .mm-tag { color: #2B4FA3; border-color: #7DD3FC; }

/* Cœur — hero : le tampon FAMMED en relief (couches extrudées) */
.mm-core { position: absolute; left: 50%; top: 50%; width: var(--c); aspect-ratio: 10 / 9; margin-left: calc(var(--c) / -2); transform: translate3d(0, -50%, 80px); transform-style: preserve-3d; }
.mm-core-in { position: absolute; inset: 0; transform-style: preserve-3d; animation: mm-bob 7s ease-in-out infinite; }
.mm-core-in > img, .mm-core-in > .mm-shine { position: absolute; inset: 0; width: 100%; height: 100%; }
.mm-core-in > .mm-seal { position: absolute; left: 9.5%; top: 5%; width: 81%; height: 90%; border-radius: 50%; background: #fff; box-shadow: 0 34px 60px -22px rgba(15, 27, 61, .45), 0 0 0 1px rgba(43, 79, 163, .08); transform: translateZ(-18px); }
.mm-core-in > img.mm-ext { filter: brightness(.45) saturate(1.4); }
.mm-core-in > .mm-shine {
    pointer-events: none; transform: translateZ(1px);
    background: radial-gradient(circle at var(--mx, 40%) var(--my, 25%), rgba(255, 255, 255, .6), transparent 42%);
    -webkit-mask: url("../img/logo-fammed-tampon.png") center / 100% 100% no-repeat;
            mask: url("../img/logo-fammed-tampon.png") center / 100% 100% no-repeat;
}

/* Cœur — gammes : pastille blanche « FAMMED » */
.mm-hub { --c: clamp(112px, 22cqw, 204px); position: absolute; left: 50%; top: 50%; width: var(--c); aspect-ratio: 1; display: grid; place-content: center; border-radius: 50%; background: #fff; border: 2px solid #E5E7EB; box-shadow: 0 24px 50px -20px rgba(15, 27, 61, .4), inset 0 0 0 10px #fff, inset 0 0 0 11px #DCE6F7; text-align: center; transform: translate3d(-50%, -50%, 80px); }
.mm-hub strong { font: 800 clamp(15px, 3.4cqw, 30px)/1 'Plus Jakarta Sans', sans-serif; letter-spacing: -.01em; color: #0F1B3D; }
.mm-hub strong em { font-style: normal; color: #2B4FA3; }
.mm-hub span { margin-top: .5em; font: 700 clamp(8px, 1.4cqw, 12px)/1 'Plus Jakarta Sans', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #0EA5E9; }

/* Halo pulsé autour du cœur */
.mm-pulse { position: absolute; left: 50%; top: 50%; width: var(--c, 22cqw); aspect-ratio: 1; border: 1.5px solid rgba(14, 165, 233, .4); border-radius: 50%; pointer-events: none; transform: translate3d(-50%, -50%, 20px); animation: mm-pulse 3.6s ease-out infinite; }
.mm-pulse + .mm-pulse { animation-delay: 1.8s; }
@keyframes mm-pulse { from { transform: translate3d(-50%, -50%, 20px) scale(.82); opacity: .9; } to { transform: translate3d(-50%, -50%, 20px) scale(1.55); opacity: 0; } }
.mm-gammes { --c: clamp(112px, 22cqw, 204px); }

@media (prefers-reduced-motion: reduce) {
    .mm-bob, .mm-core-in, .mm-flow { animation: none; }
    .mm-pulse { display: none; }
}

/* Mindmap « À propos » : tampon plus petit, orbite plus large → les traits restent visibles */
.mm-about { max-width: 580px; aspect-ratio: 1 / 1.05; --c: 29cqw; }
.mm-about .mm-ring { left: 8%; right: 8%; top: 13%; bottom: 13%; }
.mm-about .mm-node { --d: clamp(54px, 14.5cqw, 90px); }
.mm-about .mm-tag  { font-size: clamp(9px, 1.8cqw, 11.5px); }
