/* Animation du titre principal - Lettres qui sortent du masque fixe */
.animated-title {
    position: relative;
    display: block;
}

.title-line {
    display: block;
    position: relative;
    overflow: hidden;
    margin: 0.1em 0;
    height: 1.2em;
}

/* Masque fixe qui cache le bas de chaque ligne */
.title-line::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: #FAFAFA;
    z-index: 2;
    pointer-events: none;
}

/* Chaque lettre individuellement */
.letter {
    display: inline-block;
    transform: translateY(150%);
    animation: letterRise 0.2s ease-out forwards;
    white-space: pre;
    min-width: 0.2em;
}

/* Délais pour chaque lettre - effet de vague de gauche à droite */
.title-line:nth-child(1) .letter:nth-child(1) { animation-delay: 0.05s; }
.title-line:nth-child(1) .letter:nth-child(2) { animation-delay: 0.075s; }
.title-line:nth-child(1) .letter:nth-child(3) { animation-delay: 0.1s; }
.title-line:nth-child(1) .letter:nth-child(4) { animation-delay: 0.125s; }
.title-line:nth-child(1) .letter:nth-child(5) { animation-delay: 0.15s; }
.title-line:nth-child(1) .letter:nth-child(6) { animation-delay: 0.175s; }
.title-line:nth-child(1) .letter:nth-child(7) { animation-delay: 0.2s; }
.title-line:nth-child(1) .letter:nth-child(8) { animation-delay: 0.225s; }
.title-line:nth-child(1) .letter:nth-child(9) { animation-delay: 0.25s; }

.title-line:nth-child(2) .letter:nth-child(1) { animation-delay: 0.35s; }
.title-line:nth-child(2) .letter:nth-child(2) { animation-delay: 0.375s; }
.title-line:nth-child(2) .letter:nth-child(3) { animation-delay: 0.4s; }
.title-line:nth-child(2) .letter:nth-child(4) { animation-delay: 0.425s; }
.title-line:nth-child(2) .letter:nth-child(5) { animation-delay: 0.45s; }
.title-line:nth-child(2) .letter:nth-child(6) { animation-delay: 0.475s; }
.title-line:nth-child(2) .letter:nth-child(7) { animation-delay: 0.5s; }
.title-line:nth-child(2) .letter:nth-child(8) { animation-delay: 0.525s; }
.title-line:nth-child(2) .letter:nth-child(9) { animation-delay: 0.55s; }
.title-line:nth-child(2) .letter:nth-child(10) { animation-delay: 0.575s; }
.title-line:nth-child(2) .letter:nth-child(11) { animation-delay: 0.6s; }
.title-line:nth-child(2) .letter:nth-child(12) { animation-delay: 0.625s; }
.title-line:nth-child(2) .letter:nth-child(13) { animation-delay: 0.65s; }
.title-line:nth-child(2) .letter:nth-child(14) { animation-delay: 0.675s; }
.title-line:nth-child(2) .letter:nth-child(15) { animation-delay: 0.7s; }
.title-line:nth-child(2) .letter:nth-child(16) { animation-delay: 0.725s; }
.title-line:nth-child(2) .letter:nth-child(17) { animation-delay: 0.75s; }

.title-line:nth-child(3) .letter:nth-child(1) { animation-delay: 0.85s; }
.title-line:nth-child(3) .letter:nth-child(2) { animation-delay: 0.875s; }
.title-line:nth-child(3) .letter:nth-child(3) { animation-delay: 0.9s; }
.title-line:nth-child(3) .letter:nth-child(4) { animation-delay: 0.925s; }
.title-line:nth-child(3) .letter:nth-child(5) { animation-delay: 0.95s; }
.title-line:nth-child(3) .letter:nth-child(6) { animation-delay: 0.975s; }
.title-line:nth-child(3) .letter:nth-child(7) { animation-delay: 1.0s; }
.title-line:nth-child(3) .letter:nth-child(8) { animation-delay: 1.025s; }
.title-line:nth-child(3) .letter:nth-child(9) { animation-delay: 1.05s; }
.title-line:nth-child(3) .letter:nth-child(10) { animation-delay: 1.075s; }
.title-line:nth-child(3) .letter:nth-child(11) { animation-delay: 1.1s; }
.title-line:nth-child(3) .letter:nth-child(12) { animation-delay: 1.125s; }
.title-line:nth-child(3) .letter:nth-child(13) { animation-delay: 1.15s; }
.title-line:nth-child(3) .letter:nth-child(14) { animation-delay: 1.175s; }
.title-line:nth-child(3) .letter:nth-child(15) { animation-delay: 1.2s; }

/* Animation d'une lettre qui sort du masque */
@keyframes letterRise {
    0% {
        transform: translateY(150%);
    }
    100% {
        transform: translateY(-5%);
    }
}



/* Effet de typewriter optionnel */
.typewriter-effect .title-part {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typewriter 1.5s steps(40, end) forwards, fadeIn 0.1s ease-in forwards;
}

.typewriter-effect .title-part:nth-child(1) {
    animation-delay: 0.5s;
}

.typewriter-effect .title-part:nth-child(2) {
    animation-delay: 2.2s;
}

.typewriter-effect .title-part:nth-child(3) {
    animation-delay: 4.0s;
}

@keyframes typewriter {
    0% {
        width: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Effet de curseur clignotant */
.typewriter-effect .title-part::after {
    content: '|';
    position: absolute;
    right: 0;
    color: #C5A572;
    animation: blink 1s infinite;
    opacity: 0;
}

.typewriter-effect .title-part:last-child::after {
    animation: blink 1s infinite 6s;
}

@keyframes blink {
    0%, 50% {
        opacity: 0;
    }
    51%, 100% {
        opacity: 1;
    }
}

/* Animation alternative - Effet de glissement */
.slide-effect .title-part {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .title-part {
        display: block;
        margin-bottom: 0.2em;
    }
    
    .typewriter-effect .title-part {
        white-space: normal;
        width: auto;
        animation: fadeInUp 0.8s ease-out forwards;
    }
}



/* Animation continue pour maintenir l'attention */
.continuous-animation .title-part {
    animation: fadeInUp 0.8s ease-out forwards, pulse 3s ease-in-out infinite 2s;
}

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