/* ============================================================
   HERO TITLE REVEAL
   ============================================================ */

:root {
    --accent-pale: #e0a89f;
}

.hero-title .line {
    display: block;
    position: relative;
    overflow: hidden;
    width: fit-content;
}

.hero-title .line .text {
    display: inline-block;
    opacity: 0;
}

.hero-title.revealed .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--accent);
    z-index: 11;
    animation:
        drawLTR 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards,
        wipeLTR 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.hero-title.revealed .line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--accent-pale);
    z-index: 10;
    animation:
        drawLTR 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards,
        wipeLTR 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.hero-title.revealed .line .text {
    animation: textFadeIn 0.01s forwards;
}

.hero-title.revealed .line:nth-child(1)::after {
    animation-delay: 0.2s, 0.65s;
}
.hero-title.revealed .line:nth-child(1)::before {
    animation-delay: 0.45s, 0.9s;
}
.hero-title.revealed .line:nth-child(1) .text {
    animation-delay: 0.9s;
}

.hero-title.revealed .line:nth-child(2)::after {
    animation-delay: 0.65s, 1.1s;
}
.hero-title.revealed .line:nth-child(2)::before {
    animation-delay: 0.9s, 1.35s;
}
.hero-title.revealed .line:nth-child(2) .text {
    animation-delay: 1.35s;
}

@keyframes drawLTR {
    0% {
        width: 0;
        left: 0;
    }
    100% {
        width: 100%;
        left: 0;
    }
}

@keyframes wipeLTR {
    0% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}

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