/* === HOMEPAGE V2 SPECIFIC STYLES === */
html {
    scroll-behavior: smooth;
}

/* Mesh Background (Gradient) */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 40% 20%, hsla(210, 100%, 94%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(341, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(240, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(220, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(240, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(340, 100%, 96%, 1) 0px, transparent 50%);
    opacity: 1;
    transition: opacity 0.3s;
}

/* Remplacer le mesh-bg pour le thème light */
[data-theme="light"] .mesh-bg {
    background-color: #a8b9da; /* f8f9fa -> b8c9da */
    background-image:
        radial-gradient(at 40% 20%, hsla(210, 80%, 90%, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 80%, 92%, 0.3) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(241, 80%, 92%, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(240, 80%, 92%, 0.3) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(220, 80%, 92%, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(240, 80%, 92%, 0.3) 0px, transparent 50%);
}

/* Dark Mode Mesh Gradient */
[data-theme="dark"] .mesh-bg {
    background-color: #020617;
    /* Slate 950 */
    background-image:
        radial-gradient(at 40% 20%, hsla(220, 60%, 12%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(190, 50%, 10%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(260, 50%, 12%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(210, 60%, 10%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(200, 50%, 10%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(240, 50%, 12%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(220, 50%, 10%, 1) 0px, transparent 50%);
    opacity: 1;
}


/* --- Animations & Premium Motion --- */
@keyframes blitera-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes blitera-fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-blitera-fade-in {
    opacity: 0;
    animation-fill-mode: both;
}

.animate-blitera-fade-in:not(.reveal-on-scroll) {
    animation: blitera-fade-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-blitera-fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    animation-fill-mode: both;
}

.animate-blitera-fade-in-up:not(.reveal-on-scroll) {
    animation: blitera-fade-in-up 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Staggered Delays */
.delay-100 { animation-delay: 200ms; }
.delay-200 { animation-delay: 400ms; }
.delay-300 { animation-delay: 600ms; }
.delay-400 { animation-delay: 800ms; }
.delay-500 { animation-delay: 1000ms; }

/* --- Scroll-Driven Storytelling --- */
.reveal-on-scroll {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
}

/* Triggered animations */
.reveal-on-scroll.is-visible.animate-blitera-fade-in-up {
    animation: blitera-fade-in-up 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal-on-scroll.is-visible.animate-blitera-fade-in {
    animation: blitera-fade-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Homepage sections should be visible immediately, with a soft entrance polish. */
@keyframes homepage-section-entrance {
    0% {
        opacity: 0.88;
        transform: translateY(10px) scale(0.992);
        filter: blur(1.5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.homepage-entrance {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    animation: homepage-section-entrance 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform, filter;
}

.homepage-entrance-delay-1 { animation-delay: 40ms; }
.homepage-entrance-delay-2 { animation-delay: 90ms; }
.homepage-entrance-delay-3 { animation-delay: 140ms; }
.homepage-entrance-delay-4 { animation-delay: 190ms; }
.homepage-entrance-delay-5 { animation-delay: 230ms; }

@media (prefers-reduced-motion: reduce) {
    .homepage-entrance,
    .homepage-entrance-delay-1,
    .homepage-entrance-delay-2,
    .homepage-entrance-delay-3,
    .homepage-entrance-delay-4,
    .homepage-entrance-delay-5 {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* Governance Progression Bar (Vertical Progress) */
.governance-progress-nav {
    position: fixed;
    /* On wide screens (>1500px), it stays at ~860px from center. On smaller screens, at 2rem from edge. */
    right: max(2rem, calc(50% - 860px));
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 150px;
    background: rgba(var(--primary-rgb), 0.2);
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

[data-theme="dark"] .governance-progress-nav {
    background: rgba(255, 255, 255, 0.05);
}

.progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: height 0.3s ease;
}

.progress-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(var(--text-rgb), 0.2);
    margin-left: -5px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

[data-theme="dark"] .progress-step {
    background: rgba(255, 255, 255, 0.2);
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    transition: transform 0.3s ease;
}

.progress-step.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: rgba(var(--primary-rgb), 0.5);
    transform: scale(1.3);
}

.progress-step.active::after {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 10px var(--primary-color);
}

.progress-step:hover {
     background: rgba(var(--primary-rgb), 0.2);
}

.progress-step-label {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    background: var(--bg-main);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(var(--text-rgb), 0.1);
}

.progress-step:hover .progress-step-label,
.progress-step.active .progress-step-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 1024px) {
    .governance-progress-nav {
        display: none;
    }
}
.glass-v3 {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

:global([data-theme="light"]) .glass-v3 {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Border Shimmer Effect */
.glass-v3::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 300% 300%;
    background-position: 100% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: background-position 0.6s ease;
}

.glass-v3:hover::after {
    background-position: 0% 0%;
}

/* Grain / Noise Overlay */
.glass-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2003/04/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Hero Letter Animation Styles */
.hero-letter {
    display: inline-block;
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    will-change: opacity, filter, transform;
    transition-property: opacity, filter, transform;

    /* FIX: Inherit text-fill-color to allow gradient clipping to work with opacity */
    -webkit-text-fill-color: inherit;
}

.hero-letter--hidden {
    opacity: 0;
    /* Defaults - can be overridden by JS dynamic styles */
    filter: blur(8px);
    transform: translateY(10px);
}



/* Features Section */
.features-section {
    padding: 3rem 0;
    background: transparent;
    /* Transparent to let the mesh gradient show through */
    transition: background-color 0.3s;
}

/* Ajouter un arrière-plan au features-section pour le thème light */
[data-theme="light"] .features-section {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .features-section {
    /* background: transparent; */
    /* Let the dark bg show through */
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);

}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem; /* Slightly tighter from 4rem */
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    background-color: var(--bg-feature);
}

/* Ajouter un effet de verre aux cartes de fonctionnalités */
[data-theme="light"] .feature-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.feature-item:hover {
    box-shadow: 0 4px 20px -2px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .feature-item:hover {
    background: rgba(255, 255, 255, 0.95);
    /* transform: translateY(-5px); */
    box-shadow: 0 10px 30px -5px rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
}

/* Dark Theme Overrides */
[data-theme="dark"] .feature-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .feature-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG Icon styling */
.feature-svg {
    width: 100%;
    height: 100%;
}

/* Update SVG circle fill for dark mode */
[data-theme="dark"] .feature-svg circle {
    fill: rgba(59, 130, 246, 0.1);
}

.feature-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    transition: color 0.3s;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
    transition: color 0.3s;
    opacity: 0.9;
}

/* Global Section Spacing & Typography Polish */
h2 {
    letter-spacing: -0.025em !important;
}

.section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* Background Glow Utilities */
.glow-blur {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

.glow-primary {
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
}

.glow-secondary {
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); /* Violet/Indigo */
}
