* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    background: #000;
    color: #fff;
    scroll-behavior: smooth;
}

/* Pages */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* Page d'accueil */
#home-page {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0a 50%, #000000 100%);
    position: relative;
    min-height: 400vh;
    overflow: hidden;
}

#home-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Conteneur du miroir intact */
#mirror-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#mirror-intact {
    width: 600px;
    height: 600px;
    object-fit: contain;
    filter: drop-shadow(0 0 80px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 40px rgba(99, 102, 241, 0.4));
    animation: float 3s ease-in-out infinite, pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 80px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 40px rgba(99, 102, 241, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 120px rgba(139, 92, 246, 0.8)) drop-shadow(0 0 60px rgba(99, 102, 241, 0.6));
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Conteneur des fragments */
#fragments-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 5;
}

#fragments-container.hidden {
    display: none;
}

.fragment {
    position: absolute;
    cursor: pointer;
    transition: opacity 0.5s ease;
    opacity: 0;
    overflow: hidden;
    will-change: opacity;
}

.fragment img {
    width: 600px;
    height: 600px;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
    transition: filter 0.3s ease;
}

.fragment:hover {
    z-index: 10;
}

.fragment:hover img {
    filter: drop-shadow(0 0 80px rgba(139, 92, 246, 0.9)) drop-shadow(0 0 40px rgba(99, 102, 241, 0.7)) brightness(1.2);
    transform: translateZ(50px) scale(1.05);
}

/* Fragment 1 - Gauche (forme irrégulière) */
.fragment-1 {
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.fragment-1 img {
    clip-path: polygon(
        0% 0%,
        0% 100%,
        38% 100%,
        42% 75%,
        48% 50%,
        42% 25%,
        38% 0%
    );
    transform: translateZ(50px);
}

/* Fragment 2 - Haut droite (forme irrégulière) */
.fragment-2 {
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.fragment-2 img {
    clip-path: polygon(
        48% 0%,
        42% 25%,
        48% 50%,
        58% 50%,
        62% 25%,
        100% 0%,
        100% 58%,
        58% 58%,
        58% 50%
    );
    transform: translateZ(50px);
}

/* Fragment 3 - Bas droite (forme irrégulière) */
.fragment-3 {
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.fragment-3 img {
    clip-path: polygon(
        48% 50%,
        42% 75%,
        38% 100%,
        100% 100%,
        100% 58%,
        58% 58%,
        58% 50%
    );
    transform: translateZ(50px);
}

/* Animation d'apparition des fragments */
.fragment.show {
    opacity: 1;
    animation: fragmentFadeIn 0.8s ease-out forwards;
}

.fragment.hide {
    opacity: 0;
}

/* Animation spécifique pour chaque fragment */
.fragment-1.show {
    transform: translate(-50%, -50%) rotate(-15deg) rotateY(20deg);
}

.fragment-2.show {
    transform: translate(-50%, -50%) rotate(12deg) rotateY(-25deg);
}

.fragment-3.show {
    transform: translate(-50%, -50%) rotate(-8deg) rotateY(15deg);
}

@keyframes fragmentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(45deg, #fff, #aaa, #fff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #ccc;
    letter-spacing: 0.05em;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Pages d'articles */
.article-page {
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0f0f1e 50%, #000000 100%);
    overflow-y: auto;
    position: relative;
}

.article-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    animation: fadeInUp 0.8s ease;
}

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

.back-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: #fff;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
    transition: left 0.5s ease;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateX(-5px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

article h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.article-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ddd;
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-content blockquote {
    border-left: 4px solid rgba(139, 92, 246, 0.6);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.article-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: rgba(139, 92, 246, 0.3);
    font-family: Georgia, serif;
}

/* Indicateur de scroll */
.scroll-indicator {
    font-size: 3rem;
    color: #fff;
    margin-top: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

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

/* Espace pour permettre le scroll */
.scroll-spacer {
    height: 100vh;
    width: 100%;
    position: relative;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .scroll-indicator {
        font-size: 2rem;
    }
    
    article h1 {
        font-size: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content blockquote {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
    
    .article-container {
        padding: 2rem 1rem;
    }
}