/* NovaRide cinematic hero typewriter */
.hero-typewriter-headline {
    display: grid;
    justify-items: center;
    gap: 0.03em;
    letter-spacing: 0;
}

.hero-typewriter-base {
    display: block;
    max-width: 12ch;
    letter-spacing: 0;
}

.hero-typewriter-line {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 1.18em;
    font-size: clamp(2.5rem, 7.1vw, 4.9rem);
    line-height: 1.14;
    letter-spacing: 0;
    white-space: nowrap;
}

.hero-typewriter-word {
    position: relative;
    display: inline-block;
}

.hero-typewriter-text {
    display: inline-block;
    min-height: 1em;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
    line-height: 1.14;
    will-change: opacity, filter, transform;
}

.hero-typewriter-text.is-revealing {
    animation: heroTypeReveal 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-typewriter-caret {
    --type-caret-color: #10b981;
    position: absolute;
    left: calc(100% + 0.09em);
    top: 50%;
    display: block;
    width: 0.24em;
    height: 0.86em;
    color: var(--type-caret-color);
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.36));
    transform: translateY(-42%);
    transition: opacity 180ms ease;
}

.hero-typewriter-line.is-editing .hero-typewriter-caret {
    opacity: 1;
    animation: heroTypeCaret 1.08s ease-in-out infinite;
}

.hero-typewriter-caret::before,
.hero-typewriter-caret::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.hero-typewriter-caret::before {
    top: 0;
    bottom: 0;
    width: 0.034em;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(110, 231, 183, 0.2), currentColor 22%, currentColor 78%, rgba(110, 231, 183, 0.2));
}

.hero-typewriter-caret::after {
    inset-block: 0;
    width: 0.22em;
    background:
        linear-gradient(currentColor, currentColor) top center / 100% 0.034em no-repeat,
        linear-gradient(currentColor, currentColor) bottom center / 100% 0.034em no-repeat;
    opacity: 0.96;
}

@keyframes heroTypeReveal {
    from {
        opacity: 0.22;
        filter: blur(10px);
        transform: translateY(0.08em);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes heroTypeCaret {
    0%,
    42% {
        opacity: 1;
    }

    62%,
    100% {
        opacity: 0.18;
    }
}

@media (max-width: 767px) {
    .hero-typewriter-headline {
        gap: 0.05em;
    }

    .hero-typewriter-base {
        max-width: 11ch;
    }

    .hero-typewriter-line {
        width: 100%;
        max-width: 100%;
        font-size: clamp(1.55rem, 7vw, 2.25rem);
        line-height: 1.16;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-typewriter-text,
    .hero-typewriter-caret {
        animation: none !important;
        transition: none !important;
    }

    .hero-typewriter-caret {
        opacity: 0;
    }
}
