/* ============================================
   FEY COMPONENTS - Design System
   ============================================ */

/* ============================================
   CSS VARIABLES - THEME
   ============================================ */

:root {
    /* Colors */
    --cyan-light: #38bdf8;
    --cyan-secondary: #06b6d4;
    --cyan-light-rgb: 56, 189, 248;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    
    /* Glow effects */
    --glow-cyan: 0 0 20px rgba(56, 189, 248, 0.3);
    
    /* Transitions */
    --transition-base: 0.3s;
    --transition-slow: 0.5s;
    --transition-slower: 0.8s;
    --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
    
    /* Text sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;
    --text-8xl: 6rem;
    --text-9xl: 8rem;
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 20px;
    --section-padding-y: 100px;
    --section-padding-mobile: 60px;
    
    /* Z-index scale */
    --z-base: 1;
    --z-elevated: 10;
    --z-header: 100;
    --z-overlay: 1000;
    --z-modal: 10000;
}

/* ============================================
   BUTTONS FEY STYLE
   ============================================ */

.btn-fey {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 1rem 2rem;
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out-cubic);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-fey-primary {
    background: linear-gradient(135deg, var(--cyan-light), var(--cyan-secondary));
    color: #000000;
    box-shadow: var(--shadow-md);
}

.btn-fey-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--glow-cyan);
}

.btn-fey-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-fey-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--cyan-light);
    box-shadow: var(--glow-cyan);
}

.btn-fey-ghost {
    background: transparent;
    color: #ffffff;
    border: 2px solid var(--cyan-light);
}

.btn-fey-ghost:hover {
    background: rgba(var(--cyan-light-rgb), 0.1);
    box-shadow: var(--glow-cyan);
}

/* Magnetic button effect */
.btn-magnetic {
    transition: transform var(--transition-base) var(--ease-out-cubic);
}

/* Button sizes */
.btn-fey-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
}

.btn-fey-lg {
    padding: 1.25rem 2.5rem;
    font-size: var(--text-lg);
}

.btn-fey-xl {
    padding: 1.5rem 3rem;
    font-size: var(--text-xl);
}

/* ============================================
   CARDS FEY STYLE
   ============================================ */

.card-fey {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base) var(--ease-out-cubic);
    position: relative;
    overflow: hidden;
}

.card-fey::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(var(--cyan-light-rgb), 0.05), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.card-fey:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl), var(--glow-cyan);
    border-color: rgba(var(--cyan-light-rgb), 0.3);
}

.card-fey:hover::before {
    opacity: 1;
}

.card-fey-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--cyan-light-rgb), 0.1), rgba(var(--cyan-light-rgb), 0.05));
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    font-size: var(--text-3xl);
    color: var(--cyan-light);
    transition: all var(--transition-base) var(--ease-out-cubic);
}

.card-fey:hover .card-fey-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--glow-cyan);
}

.card-fey-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: #ffffff;
    transition: all var(--transition-base);
}

.card-fey:hover .card-fey-title {
    background: linear-gradient(135deg, #ffffff, var(--cyan-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-fey-description {
    font-size: var(--text-base);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-md);
}

.card-fey-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--cyan-light);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
}

.card-fey-link:hover {
    gap: var(--space-sm);
    text-shadow: var(--glow-cyan);
}

.card-fey-link .arrow-icon {
    transition: transform var(--transition-base);
}

.card-fey-link:hover .arrow-icon {
    transform: translateX(4px);
}

/* ============================================
   SECTIONS FEY STYLE
   ============================================ */

.section-fey {
    padding: var(--section-padding-y) 0;
    position: relative;
    overflow: hidden;
}

.container-fey {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: var(--z-base);
}

.section-header-fey {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-tagline {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cyan-light);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.section-title-fey {
    font-size: var(--text-7xl);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    color: #ffffff;
    letter-spacing: -0.02em;
}

.section-description {
    font-size: var(--text-xl);
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   GRIDS FEY STYLE
   ============================================ */

.grid-fey {
    display: grid;
    gap: var(--space-lg);
}

.grid-fey-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-fey-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-fey-4 {
    grid-template-columns: repeat(4, 1fr);
}

.cards-grid-fey {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

/* ============================================
   HERO FEY STYLE
   ============================================ */

.hero-fey {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-3xl) 0;
    overflow: visible; /* Permet au globe de dépasser */
    /* Autoriser le débordement horizontal pour le globe */
}

.hero-fey-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    align-items: center;
    position: relative;
    z-index: var(--z-base);
    overflow: visible; /* Permet au globe de déborder */
}

.hero-fey-content {
    position: relative;
    z-index: 10; /* Au-dessus du globe pour effet de profondeur */
}

.hero-fey-title {
    font-size: var(--text-9xl);
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 10;
    transition: all var(--transition-slower);
}

.hero-fey-title:hover {
    text-shadow: 0 0 40px rgba(var(--cyan-light-rgb), 0.3);
}

.hero-fey-title-line {
    display: block;
    background: linear-gradient(135deg, #ffffff, var(--cyan-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-fey-subtitle {
    font-size: var(--text-2xl);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-xl);
    font-weight: 400;
    position: relative;
    z-index: 10;
}

.hero-fey-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.hero-fey-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 800px; /* Plus de hauteur pour un globe plus grand */
    z-index: 5; /* Légèrement derrière le contenu */
    margin-top: -100px; /* Remonter le globe pour l'aligner avec le titre */
}

/* Globe container pour le positionner correctement */
#globe-container {
    width: 220%; /* Plus large pour éviter la coupure */
    height: 800px; /* Container plus grand */
    position: relative;
    /* Le globe peut déborder légèrement à droite pour effet immersif */
    transform: translateX(-10%) scale(1.4); /* Globe beaucoup plus gros, centré */
    overflow: visible;
    margin: 0 -10%; /* Marge négative pour compenser le translateX et permettre débordement */
}

/* Canvas du globe */
#globe-container canvas {
    max-width: none !important; /* Permet au canvas de dépasser */
}

/* Effet de profondeur : le globe passe légèrement derrière le contenu sur grand écran */
@media (min-width: 1024px) {
    .hero-fey-container {
        gap: 0; /* Réduire le gap pour que le globe se rapproche du contenu */
        overflow: visible;
    }
    
    .hero-fey-visual {
        transform: translateX(-5%); /* Rapprocher le globe du contenu */
        margin-top: -150px; /* Encore plus remonté sur desktop */
        overflow: visible;
    }
    
    #globe-container {
        transform: translateX(-5%) scale(1.6); /* Globe encore plus gros sur desktop, légèrement à gauche */
        height: 900px;
        width: 230%; /* Encore plus large */
        margin: 0 -15%; /* Marge négative plus importante */
    }
}

/* Pour les très grands écrans */
@media (min-width: 1280px) {
    #globe-container {
        transform: translateX(-5%) scale(1.8); /* Globe très gros et légèrement à gauche */
        height: 1000px;
        width: 240%;
        margin: 0 -20%;
    }
    
    .hero-fey-visual {
        min-height: 900px;
        margin-top: -120px;
    }
}

/* Mobile : globe sous le contenu */
@media (max-width: 1023px) {
    .hero-fey-container {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .hero-fey-visual {
        order: 2; /* Globe après le contenu */
        min-height: 400px;
    }
    
    #globe-container {
        height: 400px;
        transform: translateX(0);
    }
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all var(--transition-base);
}

.scroll-indicator:hover {
    color: var(--cyan-light);
}

.scroll-icon {
    width: 24px;
    height: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* ============================================
   REFRACTION EFFECT (style Fey)
   ============================================ */

.refraction-element {
    position: relative;
    overflow: hidden;
}

.refraction-element::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out-cubic);
}

.refraction-element:hover::before {
    transform: translateX(100%);
}

/* ============================================
   RESPONSIVE DESIGN (breakpoints Fey)
   ============================================ */

@media (max-width: 1280px) {
    .section-title-fey {
        font-size: var(--text-6xl);
    }
    
    .hero-fey-title {
        font-size: var(--text-8xl);
    }
}

@media (max-width: 1024px) {
    .section-title-fey {
        font-size: var(--text-5xl);
    }
    
    .hero-fey-title {
        font-size: var(--text-7xl);
    }
    
    .hero-fey-container {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .grid-fey-2,
    .grid-fey-3,
    .grid-fey-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section-fey {
        padding: var(--section-padding-mobile) 0;
    }
    
    .section-title-fey {
        font-size: var(--text-4xl);
    }
    
    .section-description {
        font-size: var(--text-lg);
    }
    
    .hero-fey-title {
        font-size: var(--text-5xl);
    }
    
    .hero-fey-subtitle {
        font-size: var(--text-xl);
    }
    
    .cards-grid-fey {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .card-fey {
        padding: var(--space-md);
    }
    
    .btn-fey {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .hero-fey-title {
        font-size: var(--text-4xl);
    }
    
    .section-title-fey {
        font-size: var(--text-3xl);
    }
    
    .hero-fey-cta {
        flex-direction: column;
    }
}
