/* ── Grace Theme ─────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Georgia', 'Garamond', serif;
    overflow-x: hidden;
}

/* ── Background rose avec dégradé subtil ──────────────────── */

body {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: backgroundShift 15s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%); }
    50% { background: linear-gradient(225deg, #f9a8d4 0%, #fbcfe8 50%, #fce7f3 100%); }
}

/* ── Conteneur principal ─────────────────────────────────── */

.grace-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    padding: 60px 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(236, 72, 153, 0.15);
    margin: 20px;
    z-index: 10;
    animation: containerPulse 6s ease-in-out infinite, containerGlow 4s ease-in-out infinite;
    border: 2px solid rgba(236, 72, 153, 0.2);
}

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

@keyframes containerGlow {
    0%, 100% { 
        box-shadow: 0 20px 60px rgba(236, 72, 153, 0.15);
        border-color: rgba(236, 72, 153, 0.2);
    }
    50% { 
        box-shadow: 0 20px 80px rgba(236, 72, 153, 0.3);
        border-color: rgba(236, 72, 153, 0.4);
    }
}

/* ── Titre principal ─────────────────────────────────────── */

.grace-title {
    font-size: 4rem;
    color: #ec4899;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(236, 72, 153, 0.1);
    animation: titleGlow 3s ease-in-out infinite, titleFloat 4s ease-in-out infinite;
    background: linear-gradient(90deg, #ec4899, #f472b6, #ec4899);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(236, 72, 153, 0.3); }
    50% { text-shadow: 0 0 30px rgba(236, 72, 153, 0.8); }
}

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

/* ── Poème ───────────────────────────────────────────────── */

.grace-poem {
    margin: 40px 0;
    line-height: 2.2;
}

.grace-poem .line {
    font-size: 1.2rem;
    color: #6b4867;
    margin: 12px 0;
    animation: fadeInUp 0.8s ease-out forwards, textShimmer 3s ease-in-out infinite;
    opacity: 0;
    position: relative;
    display: inline-block;
    width: 100%;
}

.grace-poem .line:nth-child(1) { animation-delay: 0.1s, 0.5s; }
.grace-poem .line:nth-child(2) { animation-delay: 0.2s, 0.6s; }
.grace-poem .line:nth-child(3) { animation-delay: 0.3s, 0.7s; }
.grace-poem .line:nth-child(4) { animation-delay: 0.4s, 0.8s; }
.grace-poem .line:nth-child(5) { animation-delay: 0.5s, 0.9s; }
.grace-poem .line:nth-child(6) { animation-delay: 0.6s, 1s; }
.grace-poem .line:nth-child(7) { animation-delay: 0.7s, 1.1s; }
.grace-poem .line:nth-child(8) { animation-delay: 0.8s, 1.2s; }
.grace-poem .line:nth-child(9) { animation-delay: 0.9s, 1.3s; }
.grace-poem .line:nth-child(10) { animation-delay: 1s, 1.4s; }
.grace-poem .line:nth-child(11) { animation-delay: 1.1s, 1.5s; }
.grace-poem .line:nth-child(12) { animation-delay: 1.2s, 1.6s; }
.grace-poem .line:nth-child(13) { animation-delay: 1.3s, 1.7s; }
.grace-poem .line:nth-child(14) { animation-delay: 1.4s, 1.8s; }
.grace-poem .line:nth-child(15) { animation-delay: 1.5s, 1.9s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(90deg);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes textShimmer {
    0%, 100% { color: #6b4867; text-shadow: none; }
    50% { color: #ec4899; text-shadow: 0 0 10px rgba(236, 72, 153, 0.5); }
}

/* ── Footer ──────────────────────────────────────────────── */

.grace-footer {
    margin-top: 50px;
    font-size: 0.95rem;
    color: #a855f7;
    font-style: italic;
    animation: footerFadeIn 1s ease-out 3s forwards;
    opacity: 0;
}

.grace-footer p {
    margin: 8px 0;
}

.signature {
    font-size: 2rem;
    margin-top: 12px;
    animation: float 3s ease-in-out infinite, spin 4s linear infinite, sparkle 0.6s ease-in-out infinite;
    display: inline-block;
}

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

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.7; filter: brightness(1.5); }
}

/* ── Fleurs décoratives (CSS) ────────────────────────────── */

.flowers {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.flower {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.3), transparent 60%);
    border-radius: 50%;
    opacity: 0.6;
    animation: float-flower 6s ease-in-out infinite, flowerSpin 8s linear infinite, flowerPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.4));
}

.flower::before,
.flower::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.25), transparent 70%);
    border-radius: 50%;
    animation: petalSpin 6s linear infinite;
}

.flower::before {
    transform: rotate(45deg);
    animation-delay: 0s;
}

.flower::after {
    transform: rotate(-45deg);
    animation-delay: 3s;
}

/* Positions et animations des fleurs */

.flower-1 {
    top: 10%;
    left: 5%;
    width: 60px;
    height: 60px;
    animation: float-flower 8s ease-in-out infinite, flowerSpin 12s linear infinite, flowerPulse 2.5s ease-in-out infinite;
}

.flower-2 {
    top: 20%;
    right: 8%;
    width: 70px;
    height: 70px;
    animation: float-flower 7s ease-in-out infinite, flowerSpin 10s linear infinite, flowerPulse 2.2s ease-in-out infinite;
    animation-delay: 1s, 1s, 1s;
}

.flower-3 {
    top: 60%;
    left: 10%;
    width: 50px;
    height: 50px;
    animation: float-flower 9s ease-in-out infinite, flowerSpin 14s linear infinite, flowerPulse 2.8s ease-in-out infinite;
    animation-delay: 2s, 2s, 2s;
}

.flower-4 {
    bottom: 15%;
    right: 12%;
    width: 65px;
    height: 65px;
    animation: float-flower 7.5s ease-in-out infinite, flowerSpin 11s linear infinite, flowerPulse 2.4s ease-in-out infinite;
    animation-delay: 1.5s, 1.5s, 1.5s;
}

.flower-5 {
    bottom: 20%;
    left: 15%;
    width: 55px;
    height: 55px;
    animation: float-flower 8.5s ease-in-out infinite, flowerSpin 13s linear infinite, flowerPulse 2.6s ease-in-out infinite;
    animation-delay: 2.5s, 2.5s, 2.5s;
}

@keyframes float-flower {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.4; }
    25% { transform: translateY(-25px) translateX(10px); opacity: 0.8; }
    50% { transform: translateY(-35px) translateX(-5px); opacity: 0.9; }
    75% { transform: translateY(-20px) translateX(15px); opacity: 0.7; }
}

@keyframes flowerSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes petalSpin {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

@keyframes flowerPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.4));
        opacity: 0.6;
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(236, 72, 153, 0.8));
        opacity: 0.95;
    }
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
    .grace-container {
        padding: 40px 25px;
        border-radius: 20px;
        max-width: 100%;
    }

    .grace-title {
        font-size: 2.5rem;
        letter-spacing: 4px;
        margin-bottom: 30px;
    }

    .grace-poem .line {
        font-size: 1rem;
        line-height: 1.8;
    }

    .flower {
        width: 50px;
        height: 50px;
    }

    .flower-1 { width: 40px; height: 40px; }
    .flower-2 { width: 45px; height: 45px; }
    .flower-3 { width: 35px; height: 35px; }
    .flower-4 { width: 45px; height: 45px; }
    .flower-5 { width: 40px; height: 40px; }
}

/* ── Préférence mouvement réduit ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
    }

    .grace-poem .line {
        opacity: 1;
    }
    
    .grace-title {
        -webkit-text-fill-color: #ec4899;
    }
}
