/**
 * CQ Premium Vitality — patterns UI partagés
 * Factorisés depuis page-qcm-hub-premium.css pour réutilisation sur toutes les pages clés
 * (homepage, premium, à propos, équipe, méthodologie...)
 *
 * Patterns inclus :
 * - Eyebrow numéroté pour H2 ("01 — ...")
 * - Aurora conic-gradient (overlay décoratif sur sections)
 * - Grain texture overlay
 * - Mesh hero (blobs flottants)
 * - Tilt 3D card hover
 * - Magnetic CTA shimmer
 * - Counter animé (consommé par cq-premium-vitality.js)
 * - Reveal staggered respectueux de prefers-reduced-motion
 */

/* ──────────────────────────────────────────────────────────
 * EYEBROW — surtitre numéroté pour H2
 * Usage : <span class="cq-eyebrow"><span>01 — Section</span></span>
 * ──────────────────────────────────────────────────────── */
.cq-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .85rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #4f46e5;
    position: relative;
    padding-left: 1.6rem;
}
.cq-eyebrow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
    border-radius: 2px;
}
.cq-eyebrow > span {
    background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 60%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
[data-theme="dark"] .cq-eyebrow,
body.qcm-dark .cq-eyebrow {
    color: #a5b4fc;
}
[data-theme="dark"] .cq-eyebrow > span,
body.qcm-dark .cq-eyebrow > span {
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ──────────────────────────────────────────────────────────
 * AURORA — overlay conic gradient décoratif
 * Usage : ajoute .cq-aurora à une section position:relative
 * ──────────────────────────────────────────────────────── */
.cq-aurora {
    position: relative;
    isolation: isolate;
}
.cq-aurora::before {
    content: '';
    position: absolute;
    inset: -10% -5%;
    z-index: -1;
    background:
        radial-gradient(60% 40% at 20% 10%, rgba(99,102,241,.18), transparent 70%),
        radial-gradient(50% 35% at 85% 90%, rgba(139,92,246,.14), transparent 70%),
        radial-gradient(40% 30% at 70% 20%, rgba(6,182,212,.12), transparent 70%);
    filter: blur(40px);
    opacity: .85;
    pointer-events: none;
    animation: cq-aurora-drift 22s ease-in-out infinite alternate;
}
@keyframes cq-aurora-drift {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
    100% { transform: translate3d(2%, 1%, 0) scale(1.05); }
}
[data-theme="dark"] .cq-aurora::before,
body.qcm-dark .cq-aurora::before {
    opacity: .55;
    background:
        radial-gradient(60% 40% at 20% 10%, rgba(129,140,248,.22), transparent 70%),
        radial-gradient(50% 35% at 85% 90%, rgba(167,139,250,.18), transparent 70%),
        radial-gradient(40% 30% at 70% 20%, rgba(34,211,238,.16), transparent 70%);
}

/* ──────────────────────────────────────────────────────────
 * GRAIN — texture noise overlay subtil (premium feel)
 * Usage : .cq-grain sur un container
 * ──────────────────────────────────────────────────────── */
.cq-grain {
    position: relative;
}
.cq-grain::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    opacity: .035;
    mix-blend-mode: overlay;
    z-index: 1;
}
[data-theme="dark"] .cq-grain::after,
body.qcm-dark .cq-grain::after {
    opacity: .055;
}

/* ──────────────────────────────────────────────────────────
 * HERO MESH — blobs flottants pour overlay hero existant
 * Usage : <div class="cq-hero-mesh" aria-hidden="true">
 *           <span class="cq-hero-mesh__blob cq-hero-mesh__blob--a"></span>
 *           <span class="cq-hero-mesh__blob cq-hero-mesh__blob--b"></span>
 *           <span class="cq-hero-mesh__blob cq-hero-mesh__blob--c"></span>
 *         </div>
 * ──────────────────────────────────────────────────────── */
.cq-hero-mesh {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.cq-hero-mesh__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    will-change: transform;
}
.cq-hero-mesh__blob--a {
    width: 480px;
    height: 480px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, #6366f1 0%, transparent 65%);
    animation: cq-blob-float-a 18s ease-in-out infinite;
}
.cq-hero-mesh__blob--b {
    width: 380px;
    height: 380px;
    top: 30%;
    right: -100px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 65%);
    animation: cq-blob-float-b 22s ease-in-out infinite;
}
.cq-hero-mesh__blob--c {
    width: 320px;
    height: 320px;
    bottom: -80px;
    left: 35%;
    background: radial-gradient(circle, #06b6d4 0%, transparent 65%);
    animation: cq-blob-float-c 26s ease-in-out infinite;
}
@keyframes cq-blob-float-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(40px, 60px, 0) scale(1.08); }
}
@keyframes cq-blob-float-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-50px, 30px, 0) scale(1.1); }
}
@keyframes cq-blob-float-c {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(30px, -40px, 0) scale(1.06); }
}
[data-theme="dark"] .cq-hero-mesh__blob,
body.qcm-dark .cq-hero-mesh__blob {
    opacity: .35;
}
@media (max-width: 768px) {
    .cq-hero-mesh__blob { filter: blur(60px); opacity: .4; }
    .cq-hero-mesh__blob--a { width: 320px; height: 320px; }
    .cq-hero-mesh__blob--b { width: 260px; height: 260px; }
    .cq-hero-mesh__blob--c { width: 220px; height: 220px; }
}

/* ──────────────────────────────────────────────────────────
 * TILT — micro-perspective hover sur cards
 * Usage : ajouter [data-cq-tilt] sur une card
 * (Le JS ajoute la classe .is-tilting et les vars --tx/--ty)
 * ──────────────────────────────────────────────────────── */
[data-cq-tilt] {
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease;
    will-change: transform;
}
[data-cq-tilt].is-tilting {
    transform: perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)) translateZ(0);
}

/* ──────────────────────────────────────────────────────────
 * MAGNETIC CTA — shimmer + glow au hover
 * Usage : ajouter .cq-magnetic à un bouton/lien CTA
 * ──────────────────────────────────────────────────────── */
.cq-magnetic {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease;
}
.cq-magnetic::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform .65s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
    z-index: 1;
}
.cq-magnetic:hover::before,
.cq-magnetic:focus-visible::before {
    transform: translateX(110%);
}
.cq-magnetic:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -12px rgba(99,102,241,.45);
}

/* ──────────────────────────────────────────────────────────
 * COUNTER — animation décompte (consommée par JS)
 * Usage : <span class="cq-counter" data-target="500">0</span>
 * ──────────────────────────────────────────────────────── */
.cq-counter {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    transition: color .3s ease;
}
.cq-counter.is-counting {
    color: #4f46e5;
}

/* ──────────────────────────────────────────────────────────
 * SECTION FRAME — encadrement décoratif optionnel
 * Usage : .cq-section-frame
 * ──────────────────────────────────────────────────────── */
.cq-section-frame {
    position: relative;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(99,102,241,.04), transparent 40%);
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 3vw, 2.5rem);
}
[data-theme="dark"] .cq-section-frame,
body.qcm-dark .cq-section-frame {
    background: linear-gradient(180deg, rgba(99,102,241,.08), transparent 45%);
}

/* ══════════════════════════════════════════════════════════
 * PUNCH UP — Auto-vitality sur cards/sections existantes
 * Cible les classes natives sans modifier le HTML.
 * ════════════════════════════════════════════════════════ */

/* ─── Cards "valeurs / seo" : gradient border + lift hover ─── */
.qcm-seo-card,
.cq-expertise-card {
    position: relative;
    overflow: hidden;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease, border-color .3s ease;
    isolation: isolate;
}
.qcm-seo-card::before,
.cq-expertise-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 0% 0%, rgba(99,102,241,.10), transparent 55%),
                radial-gradient(80% 60% at 100% 100%, rgba(139,92,246,.08), transparent 60%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    z-index: 0;
}
.qcm-seo-card > *,
.cq-expertise-card > * { position: relative; z-index: 1; }
.qcm-seo-card:hover,
.cq-expertise-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 55px -18px rgba(99,102,241,.35);
    border-color: rgba(99,102,241,.35) !important;
}
.qcm-seo-card:hover::before,
.cq-expertise-card:hover::before { opacity: 1; }

.qcm-seo-card__icon,
.cq-expertise-card__icon-wrap {
    transition: transform .35s cubic-bezier(.16,1,.3,1), color .3s ease;
}
.qcm-seo-card:hover .qcm-seo-card__icon,
.cq-expertise-card:hover .cq-expertise-card__icon-wrap {
    transform: scale(1.12) rotate(-4deg);
    color: #6366f1;
}

/* ─── Link cards (domaines) : glow + arrow shift ─── */
.qcm-seo-link-card {
    position: relative;
    overflow: hidden;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease;
    isolation: isolate;
}
.qcm-seo-link-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity .4s ease;
    filter: blur(14px);
}
.qcm-seo-link-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 24px 55px -18px rgba(99,102,241,.45);
}
.qcm-seo-link-card:hover::after { opacity: .55; }
.qcm-seo-link-card__icon {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.qcm-seo-link-card:hover .qcm-seo-link-card__icon {
    transform: translateY(-3px) scale(1.08);
}

/* ─── Stats showcase : cartes + chiffres lisibles sur fond violet ─── */
.cq-stats-showcase__card {
    position: relative;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease;
}
.cq-stats-showcase__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px -16px rgba(99,102,241,.4);
}
.cq-stats-showcase__value {
    /* Évite background-clip: text + transparent : faible contraste sur cartes sombres */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #f8fafc;
    text-shadow:
        0 1px 0 rgba(15, 23, 42, 0.45),
        0 2px 12px rgba(15, 23, 42, 0.5);
    letter-spacing: -0.02em;
}
.cq-stats-showcase__card:hover .cq-stats-showcase__value {
    color: #ffffff;
    text-shadow:
        0 1px 0 rgba(15, 23, 42, 0.35),
        0 2px 14px rgba(15, 23, 42, 0.45),
        0 0 20px rgba(226, 232, 240, 0.18);
}
.cq-stats-showcase__icon {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.cq-stats-showcase__card:hover .cq-stats-showcase__icon {
    transform: scale(1.15) rotate(6deg);
}

/* ─── Blockquote enrichie ─── */
.about-content blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1.6rem 1.5rem 1.6rem 3.2rem;
    background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(139,92,246,.04));
    border-left: 4px solid #6366f1;
    border-radius: 14px;
    font-style: italic;
    color: #334155;
    box-shadow: 0 4px 16px -8px rgba(99,102,241,.2);
}
.about-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -.4rem;
    left: .8rem;
    font-size: 4rem;
    line-height: 1;
    color: rgba(99,102,241,.35);
    font-family: Georgia, serif;
    font-style: normal;
    font-weight: 700;
}
[data-theme="dark"] .about-content blockquote,
body.qcm-dark .about-content blockquote {
    background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(139,92,246,.10));
    color: #cbd5e1;
}

/* ─── Mission storytelling : lede + signature quote ─── */
.about-mission__lede {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    color: #1e293b;
    padding: 1rem 1.25rem;
    border-left: 3px solid #6366f1;
    background: linear-gradient(90deg, rgba(99,102,241,.05), transparent 80%);
    border-radius: 0 10px 10px 0;
    margin-bottom: 1.4rem;
}
[data-theme="dark"] .about-mission__lede,
body.qcm-dark .about-mission__lede {
    color: #e2e8f0;
    background: linear-gradient(90deg, rgba(99,102,241,.12), transparent 80%);
}
.about-mission__quote cite {
    display: block;
    margin-top: .9rem;
    font-style: normal;
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .02em;
    color: #6366f1;
}
[data-theme="dark"] .about-mission__quote cite,
body.qcm-dark .about-mission__quote cite {
    color: #a5b4fc;
}

/* ─── Tags expertise : pills indigo subtiles ─── */
.cq-expertise-card__tags {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
}
.cq-expertise-card__tags li {
    padding: .3rem .7rem;
    background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(139,92,246,.08));
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    color: #4f46e5;
    transition: transform .3s ease, background .3s ease, border-color .3s ease;
}
.cq-expertise-card:hover .cq-expertise-card__tags li {
    background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.14));
    border-color: rgba(99,102,241,.4);
}

/* ─── HOME : Bento cards punch ─── */
.home-bento-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease;
}
.home-bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, rgba(99,102,241,.12), transparent 55%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    z-index: 0;
}
.home-bento-card:hover::before { opacity: 1; }
.home-bento-card > * { position: relative; z-index: 1; }
.home-bento-card:hover {
    box-shadow: 0 28px 60px -22px rgba(99,102,241,.45);
}
.home-bento-card__icon-img {
    transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.home-bento-card:hover .home-bento-card__icon-img {
    transform: scale(1.08) rotate(-3deg);
}
.home-bento-card__title-link {
    background-image: linear-gradient(90deg, #6366f1, #8b5cf6);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .4s cubic-bezier(.16,1,.3,1);
}
.home-bento-card:hover .home-bento-card__title-link {
    background-size: 100% 2px;
}

/* ─── HOME : Method cards (numérotées) ─── */
.home-method-card {
    position: relative;
    overflow: hidden;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease, border-color .3s ease;
    isolation: isolate;
}
.home-method-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 50px -18px rgba(99,102,241,.4);
    border-color: rgba(99,102,241,.35);
}
.home-method-card__number {
    transition: transform .35s cubic-bezier(.16,1,.3,1), color .3s ease, background .3s ease;
    background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}
.home-method-card:hover .home-method-card__number {
    transform: scale(1.15) translateY(-2px);
}

/* ─── HOME : Level slide cards (rail) ─── */
.home-level-slide {
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease, border-color .3s ease;
}
.home-level-slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px -16px rgba(99,102,241,.4);
    border-color: rgba(99,102,241,.3);
}
.home-level-slide__pill {
    background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.5);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.home-level-slide:hover .home-level-slide__pill {
    transform: scale(1.08) rotate(-3deg);
}

/* ─── HOME : Featured cards (QCM populaires) ─── */
.home-featured-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease;
}
.home-featured-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform .8s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
    z-index: 1;
}
.home-featured-card:hover::before { transform: translateX(110%); }
.home-featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 28px 60px -22px rgba(99,102,241,.5);
}
.home-featured-card__icon {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.home-featured-card:hover .home-featured-card__icon {
    transform: scale(1.12) rotate(-5deg);
}

/* ─── HOME : Mini QCM cards ─── */
.home-qcm-mini {
    position: relative;
    overflow: hidden;
    transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease, border-color .3s ease;
}
.home-qcm-mini:hover {
    transform: translateX(4px);
    border-color: rgba(99,102,241,.4);
    box-shadow: 0 14px 32px -12px rgba(99,102,241,.35);
}
.home-qcm-mini__icon {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.home-qcm-mini:hover .home-qcm-mini__icon {
    transform: scale(1.18) rotate(-6deg);
    color: #6366f1;
}

/* ─── HOME : Editorial features ─── */
.home-editorial-feature {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.home-editorial-feature:hover {
    transform: translateX(6px);
}
.home-editorial-feature__icon {
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.home-editorial-feature:hover .home-editorial-feature__icon {
    transform: scale(1.18) rotate(-6deg);
}

/* ─── REDUCED MOTION pour ce bloc ─── */
@media (prefers-reduced-motion: reduce) {
    .qcm-seo-card,
    .cq-expertise-card,
    .qcm-seo-link-card,
    .cq-stats-showcase__card,
    .home-bento-card,
    .home-method-card,
    .home-level-slide,
    .home-featured-card,
    .home-qcm-mini,
    .home-editorial-feature,
    .qcm-seo-card__icon,
    .cq-expertise-card__icon-wrap,
    .qcm-seo-link-card__icon,
    .cq-stats-showcase__icon,
    .home-bento-card__icon-img,
    .home-method-card__number,
    .home-level-slide__pill,
    .home-featured-card__icon,
    .home-qcm-mini__icon,
    .home-editorial-feature__icon {
        transition: none !important;
    }
    .qcm-seo-card:hover,
    .cq-expertise-card:hover,
    .qcm-seo-link-card:hover,
    .cq-stats-showcase__card:hover,
    .home-bento-card:hover,
    .home-method-card:hover,
    .home-level-slide:hover,
    .home-featured-card:hover,
    .home-qcm-mini:hover {
        transform: none !important;
    }
}

/* ──────────────────────────────────────────────────────────
 * REDUCED MOTION — respect strict
 * ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cq-aurora::before,
    .cq-hero-mesh__blob,
    .cq-magnetic::before,
    [data-cq-tilt] {
        animation: none !important;
        transition: none !important;
    }
    [data-cq-tilt].is-tilting {
        transform: none;
    }
}
