/* Dimensional lettering, liquid gold calligraphy, and passing highlights. */
.bf-hero-title[data-cinematic-title] .bf-hero-title__line {
    display: block;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    background-image: none;
    will-change: auto;
    perspective: 900px;
    perspective-origin: 50% 60%;
}

.bf-hero-title[data-cinematic-title] .bf-hero-title__line::after { content: none; }

.bf-hero-title[data-cinematic-title] .bf-title-ink {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    transform-origin: left center;
    perspective: 900px;
}

.bf-hero-title[data-cinematic-title] .bf-title-letter {
    display: inline-block;
    transform-origin: 50% 85%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.bf-hero-title[data-cinematic-title].is-title-waiting .bf-title-letter,
.bf-hero-title[data-cinematic-title].is-title-waiting .bf-hero-title__line--gold .bf-title-ink {
    opacity: 0;
}

/* The outer lines assemble from depth in opposite reading directions. */
.bf-hero-title[data-cinematic-title].is-title-revealing .bf-title-letter {
    animation: bfTitleSculpture 2700ms cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--bf-line-delay) + var(--bf-letter-delay));
}

/* Preserve the joined script while a diagonal mask uncovers the phrase. */
.bf-hero-title[data-cinematic-title].is-title-revealing .bf-hero-title__line--gold .bf-title-ink {
    animation: bfTitleCalligraphy 3600ms cubic-bezier(.65, 0, .2, 1) 650ms both;
}

.bf-hero-title[data-cinematic-title] .bf-title-ink::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #fff2d7;
    -webkit-text-fill-color: #fff2d7;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 12px rgba(231, 189, 123, .65);
    clip-path: polygon(-35% 0, -18% 0, -35% 100%, -52% 100%);
}

.bf-hero-title[data-cinematic-title].is-title-revealing .bf-title-ink::before {
    animation: bfTitleLightBlade 3000ms cubic-bezier(.4, 0, .2, 1) both;
    animation-delay: calc(var(--bf-line-delay) + 2200ms);
}

.bf-hero-title[data-cinematic-title] .bf-hero-title__line--gold .bf-title-ink::after {
    content: '';
    position: absolute;
    left: 1%;
    bottom: -.06em;
    width: 98%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c79559 25%, #fff2d7 65%, transparent);
    box-shadow: 0 2px 10px rgba(199, 149, 89, .2);
    transform: scaleX(0);
    transform-origin: left;
}

.bf-hero-title[data-cinematic-title].is-title-revealing .bf-hero-title__line--gold .bf-title-ink::after {
    animation: bfTitleSignatureRule 2500ms cubic-bezier(.22, 1, .36, 1) 2400ms both;
}

.bf-hero-title[data-cinematic-title].is-title-complete .bf-hero-title__line--gold .bf-title-ink::after {
    transform: scaleX(1);
    opacity: .65;
}

/* A travelling glint returns between long, quiet pauses. */
.bf-hero-title[data-cinematic-title].is-title-complete .bf-title-letter {
    animation: bfTitleLetterGlint 14000ms ease-in-out infinite;
    animation-delay: var(--bf-letter-delay);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .bf-hero-title[data-cinematic-title] .bf-hero-title__line--gold .bf-title-ink {
        color: #e6d0b6;
        -webkit-text-fill-color: transparent !important;
        background-image: linear-gradient(110deg, #b88b52 0%, #e5c99e 25%, #fff7e8 43%, #d7ae74 55%, #f3ddbc 75%, #b88b52 100%);
        background-size: 240% 100%;
        background-position: 100% 50%;
        -webkit-background-clip: text;
        background-clip: text;
    }

    .bf-hero-title[data-cinematic-title].is-title-revealing .bf-hero-title__line--gold .bf-title-ink {
        animation: bfTitleCalligraphy 3600ms cubic-bezier(.65, 0, .2, 1) 650ms both,
            bfTitleLiquidGold 4100ms cubic-bezier(.4, 0, .2, 1) 1350ms both;
    }

    .bf-hero-title[data-cinematic-title].is-title-complete .bf-hero-title__line--gold .bf-title-ink {
        animation: bfTitleGoldReflection 14000ms ease-in-out infinite;
    }
}

@keyframes bfTitleSculpture {
    0% {
        opacity: 0;
        transform: translate3d(var(--bf-letter-drift), .72em, -80px) rotateX(85deg) rotateY(-16deg);
        filter: blur(5px);
    }
    48% { opacity: 1; filter: blur(0); }
    74% { transform: translate3d(0, -.035em, 0) rotateX(-5deg) rotateY(0); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0) rotateY(0); filter: blur(0); }
}

@keyframes bfTitleCalligraphy {
    0% {
        opacity: 0;
        clip-path: polygon(-20% -30%, -15% -30%, -35% 130%, -40% 130%);
        transform: translate3d(-.12em, .1em, 0) rotate(-2deg) scale(1.035);
    }
    18% { opacity: 1; }
    100% {
        opacity: 1;
        clip-path: polygon(-20% -30%, 140% -30%, 120% 130%, -40% 130%);
        transform: translate3d(0, 0, 0) rotate(0) scale(1);
    }
}

@keyframes bfTitleLightBlade {
    0% { opacity: 0; clip-path: polygon(-35% -20%, -18% -20%, -35% 120%, -52% 120%); }
    20%, 65% { opacity: .75; }
    100% { opacity: 0; clip-path: polygon(150% -20%, 167% -20%, 150% 120%, 133% 120%); }
}

@keyframes bfTitleLiquidGold {
    from { background-position: 100% 50%; }
    to { background-position: 0% 50%; }
}

@keyframes bfTitleSignatureRule {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: .65; }
}

@keyframes bfTitleLetterGlint {
    0%, 68%, 88%, 100% { text-shadow: 0 0 0 transparent; transform: translateY(0); }
    76% { text-shadow: 0 0 15px rgba(255, 223, 175, .5), 0 0 2px rgba(255, 244, 226, .8); transform: translateY(-.025em); }
}

@keyframes bfTitleGoldReflection {
    0%, 65%, 100% { background-position: 0% 50%; }
    85% { background-position: 100% 50%; }
}

.bf-hero-title[data-cinematic-title].is-title-paused .bf-title-letter,
.bf-hero-title[data-cinematic-title].is-title-paused .bf-title-ink,
.bf-hero-title[data-cinematic-title].is-title-paused .bf-title-ink::before,
.bf-hero-title[data-cinematic-title].is-title-paused .bf-title-ink::after {
    animation-play-state: paused !important;
}

@media (max-width: 700px) {
    @keyframes bfTitleSculpture {
        0% { opacity: 0; transform: translate3d(var(--bf-letter-drift), .5em, 0) rotateX(70deg); }
        65% { opacity: 1; transform: translate3d(0, -.025em, 0) rotateX(-4deg); }
        100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-hero-title[data-cinematic-title] .bf-title-letter,
    .bf-hero-title[data-cinematic-title] .bf-title-ink,
    .bf-hero-title[data-cinematic-title] .bf-title-ink::after {
        animation: none !important;
        transform: none !important;
        clip-path: none !important;
        opacity: 1 !important;
    }

    .bf-hero-title[data-cinematic-title] .bf-title-ink::before {
        content: none;
        animation: none !important;
    }
}
