/* STYLE GLOBAL - assets/css/styles.css */

/* ================================================
   DESIGN SYSTEM — VARIABLES
   ================================================ */
:root {
    /* Couleurs primaires */
    --cpw-primary:       #1a6fff;
    --cpw-primary-dark:  #0048d9;
    --cpw-primary-light: #e8f0ff;
    --cpw-accent:        #7c3aed;
    --cpw-accent-soft:   rgba(124, 58, 237, 0.08);
    --cpw-gold:          #c9a84c;
    --cpw-gold-light:    rgba(201, 168, 76, 0.12);

    /* Glows */
    --cpw-glow-blue:     0 0 36px rgba(26, 111, 255, 0.32);
    --cpw-glow-purple:   0 0 36px rgba(124, 58, 237, 0.22);
    --cpw-glow-gold:     0 0 36px rgba(201, 168, 76, 0.25);

    /* Typographie */
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-expo:   cubic-bezier(0.16, 1, 0.3, 1);

    /* Theme clair */
    --cpw-bg:           #fafbfd;
    --cpw-bg-alt:       #f3f4f8;
    --cpw-text:         #0f1729;
    --cpw-text-light:   #2d3a52;
    --cpw-muted:        #6b7a99;
    --cpw-surface:      rgba(255, 255, 255, 0.94);

    /* Glass */
    --glass-bg:         rgba(255, 255, 255, 0.72);
    --glass-border:     rgba(26, 111, 255, 0.09);
    --glass-highlight:  rgba(255, 255, 255, 0.95);

    /* Shadows */
    --shadow-xs:        0 2px 8px -2px rgba(15, 23, 41, 0.06);
    --shadow-sm:        0 4px 16px -4px rgba(15, 23, 41, 0.08);
    --shadow-md:        0 8px 30px -6px rgba(15, 23, 41, 0.10);
    --shadow-lg:        0 20px 50px -12px rgba(15, 23, 41, 0.14);
    --shadow-glow:      0 10px 28px -4px rgba(26, 111, 255, 0.38);

    /* Panel & borders */
    --panel-bg:         rgba(255, 255, 255, 0.88);
    --border-light:     rgba(26, 111, 255, 0.07);
    --hover-bg:         rgba(26, 111, 255, 0.035);

    /* Blog */
    --blog-text:        #2d3a52;
    --blog-heading:     #0f1729;
    --blog-link:        #1a6fff;
    --blog-cta-bg:      rgba(248, 250, 255, 0.85);

    /* Radius */
    --radius-sm:   0.75rem;
    --radius-md:   1.25rem;
    --radius-lg:   2rem;
    --radius-full: 9999px;

/* Espacement — systeme base 4px */
    --space-1:  0.25rem;   /*  4px */
    --space-2:  0.5rem;    /*  8px */
    --space-3:  0.75rem;   /* 12px */
    --space-4:  1rem;      /* 16px */
    --space-5:  1.25rem;   /* 20px */
    --space-6:  1.5rem;    /* 24px */
    --space-8:  2rem;      /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
}

[data-theme="dark"] {
    --cpw-primary:      #4d8eff;
    --cpw-primary-dark: #1a6fff;
    --cpw-primary-light:#0d1f3c;
    --cpw-gold:         #e2b966;
    --cpw-gold-light:   rgba(226, 185, 102, 0.10);

    --cpw-bg:           #060a14;
    --cpw-bg-alt:       #0d1220;
    --cpw-text:         #eef2ff;
    --cpw-text-light:   #c8d3f0;
    --cpw-muted:        #7e8fba;
    --cpw-surface:      rgba(13, 18, 32, 0.96);

    --glass-bg:         rgba(13, 18, 32, 0.65);
    --glass-border:     rgba(77, 142, 255, 0.12);
    --glass-highlight:  rgba(255, 255, 255, 0.07);

    --shadow-xs:        0 2px 8px -2px rgba(0, 0, 0, 0.35);
    --shadow-sm:        0 4px 16px -4px rgba(0, 0, 0, 0.45);
    --shadow-md:        0 8px 30px -6px rgba(0, 0, 0, 0.50);
    --shadow-lg:        0 20px 50px -12px rgba(0, 0, 0, 0.60);

    --panel-bg:         rgba(13, 18, 32, 0.92);
    --border-light:     rgba(77, 142, 255, 0.10);
    --hover-bg:         rgba(77, 142, 255, 0.06);

    --blog-text:        #c8d3f0;
    --blog-heading:     #eef2ff;
    --blog-link:        #6ba3ff;
    --blog-cta-bg:      rgba(13, 18, 32, 0.70);
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    background-color: var(--cpw-bg);
    color: var(--cpw-text);
    width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.5s var(--transition-smooth), color 0.5s var(--transition-smooth);
    padding-bottom: 5rem;

    /* Fond premium — orbes lumineux */
    background-image:
        radial-gradient(ellipse 90% 55% at 10% -5%,  rgba(26, 111, 255, 0.065) 0%, transparent 62%),
        radial-gradient(ellipse 65% 45% at 92% 8%,   rgba(124, 58, 237, 0.045) 0%, transparent 58%),
        radial-gradient(ellipse 55% 40% at 50% 105%, rgba(6, 182, 212, 0.038)  0%, transparent 52%);
    background-attachment: fixed;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse 90% 55% at 10% -5%,  rgba(77, 142, 255, 0.085) 0%, transparent 62%),
        radial-gradient(ellipse 65% 45% at 92% 8%,   rgba(167, 108, 255, 0.065) 0%, transparent 58%),
        radial-gradient(ellipse 55% 40% at 50% 105%, rgba(34, 211, 238, 0.045)  0%, transparent 52%);
    background-attachment: fixed;
}

a { text-decoration: none; color: inherit; transition: all 0.3s var(--transition-smooth); }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }

::selection { background-color: var(--cpw-primary); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================
   TYPOGRAPHIE — Titres avec DM Serif Display
   ================================================ */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--cpw-text);
}

h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--cpw-text);
}

/* Dégradé de texte */
.text-gradient {
    background: linear-gradient(135deg, var(--cpw-primary) 0%, #60a5fa 50%, var(--cpw-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, var(--cpw-gold) 0%, #f0d080 50%, var(--cpw-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================================
   HEADER — full width, pas de pill
   ================================================ */
.header-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 !important;
    z-index: 1000;
    pointer-events: auto;
    background-color: var(--glass-bg);
    backdrop-filter: blur(52px) saturate(220%);
    -webkit-backdrop-filter: blur(52px) saturate(220%);
    border-bottom: 1px solid var(--glass-border);
    /* Suppression de box-shadow pour éliminer la lueur sous le header */
    box-shadow: none;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.header-main.shadow-lg {
    /* Ombre légère uniquement au scroll, sans lueur colorée */
    box-shadow: 0 1px 0 var(--glass-border);
    background-color: var(--cpw-surface);
}

.header-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Supprime les styles de .header-glass (pill CreaplusWeb) */
.header-glass {
    all: unset;
    display: contents;
}

/* ================================================
   LOGO — taille réduite
   ================================================ */
.header-main .brand-logo img {
    height: 52px !important;
    max-width: 90px !important;
    width: auto;
}


/* ================================================
   HERO
   ================================================ */
.ab-hero {
    padding-top: 2.5rem !important;
    padding-bottom: 3.5rem;
    /* Supprimer le fond radial gradient du hero
       qui crée l'effet de lueur visible */
    background-image: none !important;
}

.ab-hero .ab-hero-orb {
    /* Réduire l'opacité des orbes du hero */
    opacity: 0.4;
}

@media (min-width: 1024px) {
    .ab-hero {
        padding-top: 3.5rem !important;
        padding-bottom: 4rem;
    }
}

/* ================================================
   FOOTER
   ================================================ */
body {
    padding-bottom: 0 !important;
}

.footer-main {
    margin-top: 4rem;
}

/* ================================================
   NAVIGATION DESKTOP — DROPDOWNS
   ================================================ */
.nav-desktop {
    display: none;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cpw-text);
    opacity: 0.82;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
    opacity: 1;
    color: var(--cpw-primary);
    background-color: rgba(26, 111, 255, 0.06);
}

.nav-arrow {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
    margin-top: 1px;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 8px;
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1100;
}

.nav-dropdown-menu-inner {
    background-color: var(--panel-bg);
    backdrop-filter: blur(52px) saturate(220%);
    -webkit-backdrop-filter: blur(52px) saturate(220%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.nav-dropdown-menu-inner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: var(--panel-bg);
    border-left: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
}

.nav-dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cpw-text);
    opacity: 0.78;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    opacity: 1;
    color: var(--cpw-primary);
    background-color: rgba(26, 111, 255, 0.06);
    transform: translateX(3px);
}

/* ================================================
   MENU MOBILE — ACCORDION
   ================================================ */
.mobile-group {
    display: flex;
    flex-direction: column;
}

.mobile-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    color: var(--cpw-text);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: left;
    transition: all 0.3s ease;
    width: 100%;
}

.mobile-group-toggle:hover,
.mobile-group-toggle[aria-expanded="true"] {
    color: var(--cpw-primary);
    background-color: rgba(26, 111, 255, 0.05);
}

.mobile-group-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--cpw-muted);
    transition: transform 0.3s ease;
}

.mobile-group-toggle[aria-expanded="true"] .mobile-group-arrow {
    transform: rotate(180deg);
    color: var(--cpw-primary);
}

.mobile-submenu {
    display: none;
    flex-direction: column;
    padding: 0.25rem 0 0.5rem 3.5rem;
    gap: 0.1rem;
}

.mobile-submenu.is-open {
    display: flex;
}

.mobile-sublink {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cpw-text);
    opacity: 0.72;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.mobile-sublink:hover {
    opacity: 1;
    color: var(--cpw-primary);
    background-color: rgba(26, 111, 255, 0.05);
    transform: translateX(4px);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (min-width: 1024px) {
    .nav-desktop          { display: flex; }
    .btn-menu-mobile      { display: none !important; }
    .btn-project          { display: flex !important; }
    .nav-login            { display: flex !important; }
    .header-inner         { height: 65px; }
}

@media (max-width: 1023px) {
    .header-inner  { padding: 0 1.25rem; }
    #top-bar-inner { padding: 7px 1.25rem; }
}