/* ---------------------------------------------------------------
   AIDM — POLISH LAYER
   Couche de finition « niveau grandes plateformes » :
   typographie, profondeur, micro-interactions, révélations au défilement.
   Additive : se superpose à style.css sans en modifier la structure.
   Tout mouvement est désactivé si prefers-reduced-motion.
   --------------------------------------------------------------- */

:root {
    --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);
    --ring: 0 0 0 3px rgba(57, 108, 255, 0.45);
}

/* -- Finitions globales ---------------------------------------- */
::selection {
    background: rgba(57, 108, 255, 0.35);
    color: #fff;
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

/* Barre de défilement discrète et moderne */
@supports (scrollbar-width: thin) {
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(123, 141, 168, 0.4) transparent;
    }
}
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(57, 108, 255, 0.5), rgba(123, 77, 255, 0.5));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* -- Typographie : plus assurée, plus « premium » -------------- */
h1, h2, h3 {
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.hero h1 {
    font-size: clamp(2.3rem, 5.2vw, 4rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
}
.hero-description {
    text-wrap: pretty;
    max-width: 34rem;
}
.section-heading h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    line-height: 1.1;
}
.section-heading p {
    text-wrap: pretty;
}

/* Dégradé animé sur l'accent du hero */
.hero-highlight {
    background: linear-gradient(100deg, var(--primary) 0%, var(--secondary) 45%, #4fd0ff 90%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: aidm-sheen 7s var(--ease-in-out-soft) infinite;
}
@keyframes aidm-sheen {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* -- En-tête : condensation élégante au défilement ------------- */
.site-header {
    transition:
        transform 0.4s var(--ease-out-soft),
        background 0.3s ease,
        box-shadow 0.3s ease,
        padding 0.3s ease;
}
.site-header.header-scrolled {
    background: rgba(5, 11, 25, 0.96);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    border-bottom-color: rgba(111, 150, 255, 0.18);
}
.site-header.header-scrolled .site-nav {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}
.site-nav {
    transition: padding 0.3s var(--ease-out-soft);
}

/* Soulignement animé des liens de navigation */
.site-nav-links > li > a:not(.nav-cta) {
    position: relative;
}
.site-nav-links > li > a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out-soft);
}
.site-nav-links > li > a:not(.nav-cta):hover::after {
    transform: scaleX(1);
}

/* -- Boutons : relief, légère montée, reflet -------------------- */
.button {
    transition:
        transform 0.25s var(--ease-out-soft),
        box-shadow 0.25s var(--ease-out-soft),
        background 0.25s ease,
        border-color 0.25s ease;
    will-change: transform;
}
.button-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.button-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.25) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease-out-soft);
}
.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 60px rgba(57, 108, 255, 0.45);
}
.button-primary:hover::before {
    transform: translateX(120%);
}
.button-primary:active {
    transform: translateY(0);
}
.button-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--surface-border-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

/* -- Cartes : élévation et halo au survol ---------------------- */
.application-card,
.showcase-card,
.ai-feature-card,
.download-card {
    transition:
        transform 0.35s var(--ease-out-soft),
        box-shadow 0.35s var(--ease-out-soft),
        border-color 0.35s ease,
        background 0.35s ease;
}
.application-card:hover,
.showcase-card:hover,
.download-card:hover {
    transform: translateY(-6px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--shadow-lg);
}
.application-card .application-icon {
    transition: transform 0.35s var(--ease-out-soft);
}
.application-card:hover .application-icon {
    transform: scale(1.06) rotate(-2deg);
}

/* Filet lumineux supérieur sur la carte mise en avant */
.featured-card {
    position: relative;
}
.featured-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    opacity: 0.7;
}

/* Puces statistiques du hero */
.hero-stats .stat-item {
    transition: transform 0.3s var(--ease-out-soft);
}
.hero-stats .stat-item:hover {
    transform: translateY(-3px);
}

/* -- Révélations au défilement (progressive enhancement) ------- */
/* Appliquées par polish.js uniquement si le mouvement est permis. */
.pro-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.7s var(--ease-out-soft),
        transform 0.7s var(--ease-out-soft);
    transition-delay: calc(var(--pro-i, 0) * 80ms);
    will-change: opacity, transform;
}
.pro-reveal.pro-in {
    opacity: 1;
    transform: none;
}

/* -- Respect absolu de la préférence « moins d'animations » ---- */
@media (prefers-reduced-motion: reduce) {
    .hero-highlight { animation: none; }
    .pro-reveal,
    .pro-reveal.pro-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .button,
    .application-card,
    .showcase-card,
    .download-card {
        transition: none !important;
    }
}

/* ===============================================================
   FINITION — passe finale (site « terminé », niveau premium)
   Additive : uniquement cosmétique, ne change pas la structure.
   =============================================================== */

/* -- Hero : fond plus riche et profondeur ---------------------- */
.hero {
    position: relative;
    isolation: isolate;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 50% at 18% 12%, rgba(57, 108, 255, 0.16), transparent 70%),
        radial-gradient(55% 45% at 85% 25%, rgba(123, 77, 255, 0.14), transparent 70%);
    pointer-events: none;
}
.hero-badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(111, 150, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hero-glow {
    filter: blur(8px);
    opacity: 0.9;
}

/* Noyau de l'orbite : respiration très lente (désactivée si reduced-motion) */
.ecosystem-core {
    box-shadow:
        0 0 0 1px rgba(111, 150, 255, 0.25),
        0 20px 60px rgba(57, 108, 255, 0.3);
    animation: aidm-breathe 6s var(--ease-in-out-soft) infinite;
}
@keyframes aidm-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* -- Cartes applications : filet dégradé et profondeur --------- */
.application-card {
    position: relative;
    background-clip: padding-box;
}
.application-card .application-icon {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border-radius: 16px;
}
.application-card h3 {
    letter-spacing: -0.01em;
}
.status-badge {
    letter-spacing: 0.02em;
    font-weight: 700;
}

/* -- Barre de confiance : séparation plus nette ---------------- */
.trust-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.trust-item a {
    transition: color 0.2s ease;
}

/* -- Champs de saisie (contact, recherche) : focus premium ----- */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea,
select {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--surface-border-hover) !important;
    box-shadow: 0 0 0 4px rgba(57, 108, 255, 0.16) !important;
    outline: none;
}

/* -- Pied de page : filet lumineux et liens vivants ------------ */
.official-footer {
    position: relative;
}
.official-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(111, 150, 255, 0.4), transparent);
}
.official-footer a {
    transition: color 0.2s ease, opacity 0.2s ease;
}
.official-footer a:hover {
    color: #cdd9ff;
}

/* -- Rythme vertical homogène entre sections ------------------- */
.section + .section {
    padding-top: clamp(2.5rem, 6vw, 5rem);
}

/* -- Liens de contenu : soulignement doux --------------------- */
.legal-card a:not(.button),
main p a:not(.button):not(.card-link) {
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}

/* -- Respect de la préférence « moins d'animations » ---------- */
@media (prefers-reduced-motion: reduce) {
    .ecosystem-core { animation: none; }
}
