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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: radial-gradient(
        ellipse at center,
        #0d1220 0%,
        #080b15 50%,
        #05070f 100%
    );
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    animation:
        backgroundPulse 15s ease-in-out infinite,
        brightnessVariation 20s ease-in-out infinite;
}

/* Pulsation lente très subtile de l'arrière-plan */
@keyframes backgroundPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.05);
    }
}

/* Micro-variations de luminosité */
@keyframes brightnessVariation {
    0%, 100% {
        opacity: 1;
    }
    33% {
        opacity: 0.98;
    }
    66% {
        opacity: 1.02;
    }
}

/* Effet de grain/noise sur le fond */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* PLAN 3 (FOND) - Très grandes phrases, très floues, presque illisibles */
.far-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.far-phrase {
    position: absolute;
    color: rgba(180, 180, 200, 0.6);
    font-size: 5rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 12s ease-in-out;
    pointer-events: none;
    font-weight: 200;
    filter: blur(4px);
    letter-spacing: 3px;
}

/* Phrases fantômes en arrière-plan */
.background-phrases {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Avant-plan - Fragments */
.foreground-fragments {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.fragment {
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
    font-weight: 300;
    filter: blur(0.5px);
}

/* Phrase fixe centrale - Gravité émotionnelle */
.fixed-phrase {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(180, 180, 200, 0.08);
    font-size: 2.5rem;
    font-weight: 200;
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
    letter-spacing: 2px;
}

/* PLAN 2 (MILIEU) - Plus de phrases, opacité réduite, un peu floues */
.ghost-phrase {
    position: absolute;
    color: rgba(160, 160, 180, 0.25);
    font-size: 1.3rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    pointer-events: none;
    font-weight: 300;
    letter-spacing: 0.5px;
    filter: blur(2px);
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 95vh;
    width: 100vw;
    padding: 2.5vh 0;
    gap: 3.5rem;
    position: relative;
    z-index: 2;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.marquee-row {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    flex-shrink: 0;
    transform-style: preserve-3d;
}

.marquee-row[data-direction="left"] {
    animation-name: scrollLeft;
    animation-duration: 86s;
    animation-timing-function: linear;
}

.marquee-row[data-direction="right"] {
    animation-name: scrollRight;
    animation-duration: 86s;
    animation-timing-function: linear;
}

/* Vitesses irrégulières - Pensée hésitante (ralenti de 50% au total) */
.marquee-row:nth-child(6n+1) {
    animation-duration: 81s;
}

.marquee-row:nth-child(6n+2) {
    animation-duration: 106s;
}

.marquee-row:nth-child(6n+3) {
    animation-duration: 74s;
}

.marquee-row:nth-child(6n+4) {
    animation-duration: 95s;
}

.marquee-row:nth-child(6n+5) {
    animation-duration: 91s;
}

.marquee-row:nth-child(6n) {
    animation-duration: 114s;
}

/* Micro-décalages verticaux subtils */
.marquee-row:nth-child(odd) {
    transform: translateY(2px);
}

.marquee-row:nth-child(3n) {
    transform: translateY(-1px);
}

@keyframes scrollLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    from {
        transform: translateX(-50%);
    }
    to {
        transform: translateX(0);
    }
}

.phrase-button {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    /* Bords légèrement irréguliers */
    border-radius: 2.5rem 2.3rem 2.6rem 2.4rem;
    padding: 1rem 2rem;
    color: #c8c8c8;
    font-size: 1.1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px) saturate(180%);
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.12),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

/* PLAN 1 (AVANT) - Phrases nettes, contrastées, lisibles immédiatement */
.phrase-button.weight-heavy {
    color: #e8e8e8;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    filter: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Variation de taille des boutons - Hiérarchie émotionnelle */
.phrase-button.size-tiny {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

.phrase-button.size-small {
    padding: 0.85rem 1.7rem;
    font-size: 1rem;
    opacity: 0.75;
}

.phrase-button.size-large {
    padding: 1.15rem 2.3rem;
    font-size: 1.2rem;
}

.phrase-button.size-huge {
    padding: 1.3rem 2.6rem;
    font-size: 1.35rem;
}

/* Variations d'opacité - Poids émotionnel EXTRÊMES */
.phrase-button.weight-ghost {
    opacity: 0.25;
    color: rgba(200, 200, 200, 0.4);
}

.phrase-button.weight-light {
    opacity: 0.5;
    color: rgba(200, 200, 200, 0.7);
}

.phrase-button.weight-medium {
    opacity: 0.75;
    color: #c8c8c8;
}

.phrase-button.weight-heavy {
    opacity: 1;
    color: #f0f0f0;
}

.phrase-button:hover {
    opacity: 1 !important;
    filter: none !important;
}

.phrase-button:hover {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    backdrop-filter: blur(4px) saturate(180%);
    -webkit-backdrop-filter: blur(4px) saturate(180%);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(255, 255, 255, 0.08),
        0 0 60px rgba(200, 200, 255, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.phrase-button:active {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
}

.phrase-button .text {
    flex: 1;
    color: #c8c8c8;
}

.phrase-button .counter {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    font-weight: 300;
    font-style: italic;
    min-width: 2rem;
    text-align: right;
    transition: color 0.2s ease;
    transform: translateY(2px) rotate(-2deg);
    letter-spacing: 0.5px;
}

.phrase-button:hover .counter {
    color: rgba(255, 255, 255, 0.4);
}

.phrase-button.clicked {
    animation: symbolicClick 1.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    z-index: 100;
}

.phrase-button.fading {
    opacity: 0.4 !important;
    filter: blur(0.5px) !important;
    transition: all 2s ease-out;
}

.phrase-button.clicked .counter {
    color: rgba(255, 255, 255, 0.7);
    animation: counterPulse 0.4s ease;
}

/* Micro-vibration subtile pour l'interface vivante */
@keyframes subtleVibration {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(0.3px, -0.2px); }
    50% { transform: translate(-0.2px, 0.3px); }
    75% { transform: translate(0.2px, 0.1px); }
}

body {
    animation: subtleVibration 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    75% {
        transform: scale(0.98);
    }
}

/* Clic symbolique - La phrase passe au premier plan puis perd son pouvoir */
@keyframes symbolicClick {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0px) brightness(1);
    }
    15% {
        transform: scale(1.15) translateY(-10px);
        opacity: 1;
        filter: blur(0px) brightness(1.3);
    }
    30% {
        transform: scale(1.1) translateY(-8px);
        opacity: 1;
        filter: blur(0px) brightness(1.2);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 0.6;
        filter: blur(0.3px) brightness(0.9);
    }
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes ghostFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        gap: 1.2rem;
        padding: 3vh 0;
    }

    .marquee-row {
        gap: 0.7rem;
    }

    .phrase-button {
        padding: 0.7rem 1.3rem;
        font-size: 0.9rem;
    }

    .phrase-button.size-small {
        padding: 0.6rem 1.1rem;
        font-size: 0.85rem;
    }

    .phrase-button.size-large {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .phrase-button .counter {
        font-size: 0.75rem;
    }
}
