/* -------------------------------------------------------------
   SYSTEME DE DESIGN & CONSTANTES (CSS VARIABLES)
   ------------------------------------------------------------- */
:root {
    --bg-dark: #060814;
    --bg-card: rgba(13, 17, 39, 0.7);
    --bg-card-hover: rgba(22, 28, 62, 0.85);
    
    --color-primary: #7c3aed; /* Violet magique (magie sombre, Soli) */
    --color-primary-light: #a78bfa;
    --color-secondary: #06b6d4; /* Cyan temporel (Lune, figer le temps) */
    --color-secondary-light: #22d3ee;
    --color-gold: #dfb260; /* Or des Médaillons du Déclin */
    --color-gold-light: #f59e0b;
    --color-danger: #ef4444; /* Pour les Ombres/Spectre */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow-gold: rgba(223, 178, 96, 0.35);
    --border-glow-purple: rgba(124, 58, 237, 0.45);
    
    --font-heading: 'Cinzel', Georgia, serif;
    --font-body: 'Outfit', 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --glow-shadow-gold: 0 0 15px rgba(223, 178, 96, 0.4);
    --glow-shadow-purple: 0 0 20px rgba(124, 58, 237, 0.5);
    --glow-shadow-cyan: 0 0 20px rgba(6, 182, 212, 0.5);
}

/* -------------------------------------------------------------
   STYLISATION GENERALE & RESET
   ------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-dark);
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-dark);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    max-width: 100vw;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 8rem 0;
}

/* -------------------------------------------------------------
   EFFETS D'ARRIERE-PLAN MAGIQUES (ORBS & STARS)
   ------------------------------------------------------------- */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.stars-layer {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    will-change: transform, opacity, background-position;
}

.stars-layer-1 {
    background-image: 
        radial-gradient(3px 3px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(4px 4px at 150px 120px, var(--color-gold), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 190px, #ffffff, rgba(0,0,0,0));
    background-size: 350px 350px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
    animation: floatUp 90s linear infinite, sway 15s ease-in-out infinite alternate, starsTwinkle 4s ease-in-out infinite alternate;
}

.stars-layer-2 {
    background-image: 
        radial-gradient(2px 2px at 60px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 220px 80px, var(--color-secondary-light), rgba(0,0,0,0)),
        radial-gradient(4px 4px at 120px 240px, var(--color-gold), rgba(0,0,0,0));
    background-size: 450px 450px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
    animation: floatUp 140s linear infinite, sway 22s ease-in-out infinite alternate-reverse, starsTwinkle 6s ease-in-out infinite alternate;
    opacity: 0.8;
}

.stars-layer-3 {
    background-image: 
        radial-gradient(2px 2px at 90px 10px, var(--color-primary-light), rgba(0,0,0,0)),
        radial-gradient(4px 4px at 280px 40px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 10px 180px, var(--color-gold), rgba(0,0,0,0));
    background-size: 550px 550px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
    animation: floatUp 200s linear infinite, sway 30s ease-in-out infinite alternate, starsTwinkle 8s ease-in-out infinite alternate;
    opacity: 0.6;
}

@keyframes floatUp {
    from { background-position: 0 0; }
    to { background-position: 0 -1500px; }
}

@keyframes sway {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(30px); }
}

@keyframes starsTwinkle {
    0% { opacity: 0.3; filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2)); }
    100% { opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9)); }
}

.glowing-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    animation: floatOrb 20s infinite ease-in-out alternate;
    will-change: transform;
}

.glowing-orb.purple {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    top: -10%;
    right: -10%;
}

.glowing-orb.gold {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
    bottom: -15%;
    left: -15%;
    animation-delay: -5s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 10%) scale(1.15); }
}

/* -------------------------------------------------------------
   HEADER & NAVIGATION
   ------------------------------------------------------------- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(6, 8, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.main-header.scrolled {
    background: rgba(4, 5, 13, 0.9);
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    transition: var(--transition-normal);
}

.main-header.scrolled .nav-container {
    padding: 0.8rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-magie {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(223, 178, 96, 0.8));
    animation: pulseMedallion 4s infinite ease-in-out;
}

@keyframes pulseMedallion {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(223, 178, 96, 0.8)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 15px rgba(223, 178, 96, 1)); }
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition-normal);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.3rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    transition: var(--transition-normal);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.cta-nav {
    background: linear-gradient(135deg, var(--color-gold) 0%, #b28a3d 100%);
    color: var(--bg-dark) !important;
    padding: 0.6rem 1.4rem !important;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: var(--glow-shadow-gold);
    border: none;
}

.cta-nav::after {
    display: none;
}

.cta-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(223, 178, 96, 0.7);
    color: #000 !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* -------------------------------------------------------------
   BOUTONS ET COMPOSANTS PARTAGÉS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-gold) 0%, #a87e30 100%);
    color: var(--bg-dark);
    box-shadow: var(--glow-shadow-gold);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(223, 178, 96, 0.7);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-secondary);
    box-shadow: var(--glow-shadow-cyan);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--color-primary-light);
    background: rgba(124, 58, 237, 0.1);
    box-shadow: var(--glow-shadow-purple);
    transform: translateY(-2px);
}

.btn-block {
    display: flex;
    width: 100%;
    margin-bottom: 0.8rem;
}

.section-header {
    margin-bottom: 5rem;
    position: relative;
    z-index: 1;
}

.section-tagline {
    font-family: var(--font-body);
    color: var(--color-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 8px rgba(223, 178, 96, 0.3);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    margin: 1.5rem auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

/* -------------------------------------------------------------
   HERO SECTION
   ------------------------------------------------------------- */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 30%;
    z-index: -1;
    transform: scale(1.02);
    animation: zoomSlow 30s infinite alternate ease-in-out;
}

@keyframes zoomSlow {
    from { transform: scale(1.02); }
    to { transform: scale(1.08); }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 2;
    position: relative;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--color-primary-light);
    color: var(--color-primary-light);
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.2);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffffff 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.scroll-indicator:hover {
    color: var(--text-primary);
}

.mouse-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.scroll-indicator:hover .mouse-icon {
    border-color: var(--color-secondary);
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.8s infinite;
}

.scroll-indicator:hover .wheel {
    background-color: var(--color-secondary);
}

@keyframes scrollWheel {
    0% { top: 8px; opacity: 1; }
    50% { top: 16px; opacity: 0; }
    100% { top: 8px; opacity: 0; }
}

/* -------------------------------------------------------------
   SYNOPSIS INTERACTIF
   ------------------------------------------------------------- */
.synopsis-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4.5rem;
    align-items: center;
}

.intro-p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    border-left: 3px solid var(--color-primary);
    padding-left: 1.5rem;
}

.timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-step {
    display: flex;
    gap: 2rem;
    padding: 1.8rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.timeline-step:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(6, 182, 212, 0.2);
}

.timeline-step.active {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: inset 0 0 15px rgba(124, 58, 237, 0.1);
}

.step-num {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-muted);
    line-height: 1;
    transition: var(--transition-normal);
}

.timeline-step.active .step-num {
    color: var(--color-gold);
    text-shadow: var(--glow-shadow-gold);
}

.step-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-normal);
}

.timeline-step.active .step-content h3 {
    color: var(--color-gold);
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Magic Frame Visualizer */
.magic-frame {
    position: relative;
    padding: 10px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 12px;
    box-shadow: var(--glow-shadow-purple);
}

.magic-frame-inner {
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    position: relative;
}

.synopsis-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.synopsis-img.active {
    opacity: 1;
    position: relative;
}

.image-reflection {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(6, 8, 20, 0.9), transparent);
    pointer-events: none;
}

/* -------------------------------------------------------------
   PERSONNAGES SECTION (3D FLIP CARDS)
   ------------------------------------------------------------- */
.filters-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.6rem 1.6rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--color-secondary-light);
    background: rgba(6, 182, 212, 0.05);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, rgba(124, 58, 237, 0.6) 100%);
    border-color: var(--color-primary-light);
    color: var(--text-primary);
    box-shadow: var(--glow-shadow-purple);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.character-card {
    background-color: transparent;
    perspective: 1000px;
    height: 380px;
    display: none; /* Controlled by JS filters */
}

.character-card.show {
    display: block;
    animation: scaleIn 0.4s ease forwards;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

.character-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.card-front {
    background-color: #111;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.character-card:hover .card-front img {
    transform: scale(1.05);
}

.card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.2rem 1.2rem;
    background: linear-gradient(to top, rgba(6, 8, 20, 0.95) 0%, rgba(6, 8, 20, 0.7) 50%, transparent 100%);
    text-align: left;
}

.card-info-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    letter-spacing: 1px;
}

.character-role {
    font-size: 0.8rem;
    color: var(--color-gold);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-back {
    background: linear-gradient(135deg, #0b0f24 0%, #161c3e 100%);
    transform: rotateY(180deg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.card-back:hover {
    box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.15);
}

.card-back h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.6rem;
}

.faction-label {
    display: inline-block;
    align-self: flex-start;
    padding: 0.25rem 0.8rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -0.5rem;
}

.faction-humain { background: rgba(6, 182, 212, 0.2); color: var(--color-secondary-light); border: 1px solid var(--color-secondary-light); }
.faction-elfe { background: rgba(167, 139, 250, 0.2); color: var(--color-primary-light); border: 1px solid var(--color-primary-light); }
.faction-nain { background: rgba(223, 178, 96, 0.2); color: var(--color-gold); border: 1px solid var(--color-gold); }
.faction-demon { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #f87171; }
.faction-creature { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid #4ade80; }

.character-bio {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    margin: 1.2rem 0;
}

.character-stats {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 0.8rem;
}

.character-stats strong {
    color: var(--text-secondary);
}

/* -------------------------------------------------------------
   GALERIE INTERACTIVE (LIEUX)
   ------------------------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.gallery-item-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover {
    border-color: var(--color-gold);
    box-shadow: var(--glow-shadow-gold);
    transform: translateY(-4px);
}

.gallery-hover-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(6, 8, 20, 0.9) 0%, rgba(6, 8, 20, 0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-hover-info {
    opacity: 1;
}

.gallery-hover-info h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.view-btn {
    font-size: 0.8rem;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Extras sketches styles */
.extras-section {
    margin-top: 6rem;
    text-align: center;
    border-top: 1px dashed var(--border-light);
    padding-top: 4rem;
}

.extras-section h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.extras-section p {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-item.mini {
    aspect-ratio: 1 / 1;
}

/* -------------------------------------------------------------
   LIGHTBOX MODALE
   ------------------------------------------------------------- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 5, 12, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.lightbox-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 3.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.lightbox-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    max-width: 1100px;
    width: 100%;
    background: rgba(13, 17, 39, 0.85);
    border: 1px solid var(--border-glow-purple);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-modal.show .lightbox-content {
    transform: scale(1);
}

.lightbox-img-container {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-text {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--border-light);
}

.lightbox-text h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-gold);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.lightbox-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* -------------------------------------------------------------
   LIVRE / ACHAT SECTION (3D BOOK EFFECT)
   ------------------------------------------------------------- */
.purchase-section {
    position: relative;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #080c21 50%, var(--bg-dark) 100%);
}

.books-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

.book-card-col {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 3.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-normal);
}

.book-card-col:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

.book-visual-box {
    margin-bottom: 2rem;
    perspective: 1000px;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.book-container {
    position: relative;
    width: 230px;
    height: 350px;
    transition: var(--transition-slow);
    transform-style: preserve-3d;
}

.book-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-20deg) rotateX(10deg);
    transition: transform 0.5s ease;
}

.book-container:hover .book-3d {
    transform: rotateY(5deg) rotateX(5deg) translateY(-10px);
}

.book-front, .book-back, .book-spine {
    position: absolute;
    height: 100%;
    border-radius: 2px 6px 6px 2px;
}

.book-front {
    width: 100%;
    background-size: cover;
    background-position: center;
    z-index: 5;
    transform: rotateY(0deg) translateZ(15px);
    box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.book-spine {
    width: 30px;
    background: #0c0e1a;
    left: 0;
    transform: rotateY(-90deg) translateZ(15px);
    z-index: 4;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(0,0,0,0.4);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spine-text {
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    transform: rotate(90deg);
    letter-spacing: 1.5px;
}

.book-back {
    width: 100%;
    background: #0d0f20;
    transform: rotateY(180deg) translateZ(15px);
    z-index: 3;
    box-shadow: -5px 10px 20px rgba(0, 0, 0, 0.3);
}

.book-shadow {
    position: absolute;
    bottom: -15px;
    left: 10%;
    width: 80%;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    filter: blur(8px);
    border-radius: 50%;
    z-index: 1;
    transition: var(--transition-slow);
}

.book-container:hover .book-shadow {
    transform: scale(1.1);
    opacity: 0.4;
}

.book-details-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.volume-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-gold);
    background: rgba(223, 178, 96, 0.1);
    border: 1px solid var(--color-gold);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.volume-badge.highlight {
    color: var(--color-secondary-light);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--color-secondary-light);
}

.book-details-box h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.book-description {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    min-height: 120px;
    text-align: justify;
}

.book-info-list {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.price-tags-box {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 0.8rem 0;
    width: 100%;
    justify-content: center;
}

.price-item-val {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.price-item-val strong {
    color: var(--color-gold);
    font-size: 1.2rem;
    margin-left: 0.3rem;
    text-shadow: var(--glow-shadow-gold);
}

.purchase-links {
    width: 100%;
}

/* BIOGRAPHIE AUTEUR */
.author-bio-block {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    margin: 5rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(13, 17, 39, 0.85) 0%, rgba(22, 28, 62, 0.9) 100%);
    border: 1px solid var(--border-glow-purple);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.author-bio-photo {
    flex-shrink: 0;
}

.author-bio-photo img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-gold);
    box-shadow: 0 0 25px rgba(223, 178, 96, 0.4);
}

.author-bio-text h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-gold);
    margin: 0.5rem 0 1.5rem;
}

.author-bio-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.author-bio-cta {
    margin-top: 1.5rem !important;
    color: var(--text-primary) !important;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

@media (max-width: 768px) {
    .author-bio-block {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        text-align: center;
    }
    .author-bio-cta {
        justify-content: center;
    }
}

/* BLOC NEWSLETTER CENTRAL */
.newsletter-block {
    margin: 6rem 0;
    background: linear-gradient(135deg, rgba(13, 17, 39, 0.85) 0%, rgba(22, 28, 62, 0.9) 100%);
    border: 1px solid var(--border-glow-purple);
    border-radius: 12px;
    padding: 4rem 3rem;
    text-align: center;
    box-shadow: var(--glow-shadow-purple);
    position: relative;
    overflow: hidden;
}

.newsletter-block::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.newsletter-block-inner {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 0 auto;
}

.badge-accent {
    color: var(--color-secondary-light);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 0.8rem;
}

.newsletter-block h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.newsletter-block p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.newsletter-block-form .form-inputs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.newsletter-block-form input {
    background: rgba(6, 8, 20, 0.6);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    min-width: 240px;
    transition: var(--transition-fast);
}

.newsletter-block-form input:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: rgba(6, 8, 20, 0.8);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.btn-newsletter-submit {
    background: linear-gradient(135deg, var(--color-gold) 0%, #a87e30 100%);
    color: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--glow-shadow-gold);
    padding: 1rem 2.5rem;
}

.btn-newsletter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(223, 178, 96, 0.6);
}

.success-message-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    color: #a7f3d0;
    animation: scaleIn 0.4s ease forwards;
}

.success-message-box i {
    font-size: 2rem;
    color: #34d399;
}

.hidden {
    display: none !important;
}

/* TABLES D'ADMINISTRATION */
.admin-table-container table {
    border-collapse: collapse;
    width: 100%;
}

.admin-table-container th, .admin-table-container td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

.admin-table-container th {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-gold);
}

.admin-table-container tr:hover td {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.author-admin-link:hover {
    color: var(--color-gold) !important;
}

/* TESTIMONIALS */
.testimonials-container {
    border-top: 1px dashed var(--border-light);
    padding-top: 5rem;
}

.testimonials-container h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-normal);
}

.testimonial-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-5px);
}

.stars {
    color: var(--color-gold);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -------------------------------------------------------------
   FOOTER SECTION
   ------------------------------------------------------------- */
.main-footer {
    border-top: 1px solid var(--border-light);
    background-color: #03040a;
    padding: 5rem 0 2rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    margin-bottom: 4rem;
}

.footer-brand h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 450px;
    font-size: 0.95rem;
}

.footer-newsletter h5 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.footer-newsletter p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.newsletter-form input, .newsletter-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.newsletter-form textarea {
    resize: vertical;
    min-height: 80px;
}

.newsletter-form input:focus, .newsletter-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

.btn-newsletter {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    color: #fff;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    box-shadow: var(--glow-shadow-purple);
}

.btn-newsletter:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.03);
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ------------------------------------------------------------- */
@media (max-width: 1024px) {
    .section-padding {
        padding: 5rem 0;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .synopsis-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .synopsis-visual-col {
        order: -1;
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }
    
    .books-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .book-visual-col {
        height: 380px;
    }
    
    .book-container {
        width: 230px;
        height: 350px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .extras-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lightbox-content {
        grid-template-columns: 1fr;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .lightbox-text {
        border-left: none;
        border-top: 1px solid var(--border-light);
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.2rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(6, 8, 20, 0.98);
        flex-direction: column;
        padding: 3rem 2rem;
        gap: 2rem;
        transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-top: 1px solid var(--border-light);
        /* Pas de backdrop-filter sur mobile = gain de perfs */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .cta-nav {
        width: 100%;
        text-align: center;
        margin-top: 1.5rem;
    }

    /* ---- HERO ---- */
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    .scroll-indicator {
        display: none; /* Évite la superposition avec le bouton sur les petits écrans */
    }

    /* ---- SYNOPSIS ---- */
    .synopsis-grid {
        grid-template-columns: 1fr;
    }

    .synopsis-visual-col {
        display: none; /* masque l'image décorative sur mobile */
    }

    .timeline-step {
        gap: 1rem;
        padding: 1.2rem;
    }

    .step-num {
        font-size: 1.8rem;
    }

    /* ---- PERSONNAGES ---- */
    .characters-grid {
        grid-template-columns: 1fr; /* 1 carte par ligne au lieu de 2 pour éviter la coupure du nom */
        gap: 1.5rem;
    }

    .character-card {
        height: 300px;
    }

    /* ---- GALERIE ---- */
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 image par ligne pour plus de visibilité */
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 2.5rem;
        width: 45px;
        height: 45px;
        background: rgba(0, 0, 0, 0.6); /* Fond semi-transparent pour bien voir la croix sur mobile */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    /* ---- AUTEUR ---- */
    .author-bio-block {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        text-align: center;
        padding: 2rem 1.2rem;
        width: 100%;
        box-sizing: border-box;
    }

    .author-bio-photo img {
        width: 140px;
        height: 140px;
    }

    /* ---- NEWSLETTER ---- */
    .newsletter-block {
        padding: 2rem 1.2rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* ---- LIVRES ---- */
    .books-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .book-visual-col {
        height: 320px;
    }

    .book-container {
        width: 200px;
        height: 300px;
    }

    /* ---- NEWSLETTER ---- */
    .form-inputs {
        flex-direction: column;
    }

    /* ---- TEMOIGNAGES ---- */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* ---- FOOTER ---- */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-brand h4 {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }
    
    .newsletter-form input, .newsletter-form textarea {
        width: 100%;
    }
    
    .btn-newsletter {
        width: 100%;
    }

    /* ---- PERFORMANCE : désactiver les effets GPU lourds ---- */
    .stars-layer {
        animation: none !important; /* étoiles fixes sur mobile */
        filter: none !important;
    }

    .stars-layer-2,
    .stars-layer-3 {
        display: none; /* garder 1 seule couche sur mobile */
    }

    .glowing-orb {
        display: none; /* orbes trop lourdes sur mobile */
    }

    .main-header {
        backdrop-filter: none;
        background: rgba(6, 8, 20, 0.97);
    }
    
    /* Désactiver les animations de fondu au chargement pour le LCP */
    .fade-in, .fade-in-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Préférence d'animations réduites (accessibilité) */
@media (prefers-reduced-motion: reduce) {
    .stars-layer,
    .stars-layer-1,
    .stars-layer-2,
    .stars-layer-3 {
        animation: none !important;
    }
    .logo-img {
        animation: none;
    }
}

/* -------------------------------------------------------------
   ANIMATIONS UTILS (SCROLL REVEAL CLASSES)
   ------------------------------------------------------------- */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
