/*
 * SedaSend Hero Section
 * Every selector is scoped to .sedasend-hero to keep this module isolated.
 */

/* Section variables and outer canvas */
.sedasend-hero {
    --hero-orange: #e25541;
    --hero-orange-dark: #c94735;
    --hero-black: #000000;
    --hero-white: #ffffff;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(620px, calc(100svh - 82px), 900px);
    display: grid;
    align-items: center;
    padding: clamp(64px, 8vw, 120px) 20px;
    background: var(--hero-white);
}

/* Full-section background image; replace hero-truck.png while keeping its filename */
.sedasend-hero__background {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transform: scale(1.025);
    transition: opacity 700ms ease, transform 1000ms ease;
}

/* Light overlay keeps animated black and orange text readable */
.sedasend-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgba(255, 255, 255, 0.62);
    pointer-events: none;
}

/* Main constrained content wrapper */
.sedasend-hero__container {
    width: min(1280px, 100%);
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Scalable copy layered above the background artwork */
.sedasend-hero__intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

/* Hero copy block */
.sedasend-hero__content {
    min-width: 0;
    width: min(1100px, 100%);
    max-width: 100%;
    margin: 0 auto;
}

/* Bold animated headline */
.sedasend-hero__title {
    margin: 0;
    color: var(--hero-black);
    font-size: clamp(3rem, 7vw, 7.4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
    text-align: center;
    text-wrap: balance;
    transition: opacity 2s ease, transform 2s ease, filter 2s ease;
}

/* JavaScript-created whole words appear fully at once */
.sedasend-hero__word {
    display: inline-block;
    color: var(--hero-black);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(0.18em);
    transition: opacity 320ms ease, color 420ms ease, transform 320ms ease, text-shadow 420ms ease;
}

.sedasend-hero__word.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sequential orange letter effect within the current word */
.sedasend-hero__word-letter {
    display: inline-block;
    color: inherit;
    transition: color 180ms ease, text-shadow 180ms ease;
}

.sedasend-hero__word-letter.is-active {
    color: var(--hero-orange);
    text-shadow: 0 0 15px rgba(226, 85, 65, 0.48);
}

.sedasend-hero__word-space {
    display: inline-block;
    width: 0.27em;
}

/* Full-headline orange effect after every word has appeared */
.sedasend-hero__title.is-complete .sedasend-hero__word {
    opacity: 1;
    color: var(--hero-orange);
    text-shadow: 0 0 20px rgba(226, 85, 65, 0.34);
    transform: translateY(0);
}

/* Two-second full-headline fade before the cycle repeats */
.sedasend-hero__title.is-erasing {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(-10px);
}

/* Bold supporting text with a subtle readability glow */
.sedasend-hero__subtitle {
    max-width: 590px;
    margin: 28px auto 0;
    color: var(--hero-black);
    font-size: clamp(1.08rem, 1.5vw, 1.32rem);
    font-weight: 800;
    line-height: 1.55;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.98), 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Centered CTA row on every layout */
.sedasend-hero__actions {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/* Orange download button */
.sedasend-hero__button {
    position: relative;
    isolation: isolate;
    min-width: 178px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px 26px;
    color: var(--hero-white);
    background: transparent;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(226, 85, 65, 0.3);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

/* Bright highlight travels around the border path without rotation */
.sedasend-hero__button::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: -2px;
    border-radius: inherit;
    background:
        linear-gradient(90deg, transparent 0 35%, #ffffff 48%, #ffd3cc 52%, transparent 65%) top / 220% 3px no-repeat,
        linear-gradient(180deg, transparent 0 35%, #ffffff 48%, #ffd3cc 52%, transparent 65%) right / 3px 220% no-repeat,
        linear-gradient(270deg, transparent 0 35%, #ffffff 48%, #ffd3cc 52%, transparent 65%) bottom / 220% 3px no-repeat,
        linear-gradient(0deg, transparent 0 35%, #ffffff 48%, #ffd3cc 52%, transparent 65%) left / 3px 220% no-repeat;
    animation: sedasend-hero-button-glow 2.4s linear infinite;
}

/* Solid inner button layer preserves the rounded orange face */
.sedasend-hero__button::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 2px;
    border-radius: 10px;
    background: var(--hero-orange);
}

.sedasend-hero__button:hover,
.sedasend-hero__button:focus-visible,
.sedasend-hero__button.is-glowing {
    color: var(--hero-white);
    box-shadow: 0 0 14px rgba(226, 85, 65, 0.72), 0 0 30px rgba(226, 85, 65, 0.46);
}

.sedasend-hero__button:hover,
.sedasend-hero__button:focus-visible {
    transform: translateY(-3px);
}

@keyframes sedasend-hero-button-glow {
    0% {
        background-position: 200% top, right 200%, -100% bottom, left -100%;
    }
    50% {
        background-position: -100% top, right 200%, -100% bottom, left -100%;
    }
    50.01% {
        background-position: -100% top, right -100%, 200% bottom, left 200%;
    }
    100% {
        background-position: -100% top, right -100%, -100% bottom, left -100%;
    }
}

.sedasend-hero__button:focus-visible {
    outline: 3px solid rgba(226, 85, 65, 0.32);
    outline-offset: 4px;
}

/* Reveal the supplied background image after loading */
.sedasend-hero.is-images-loaded .sedasend-hero__background {
    opacity: 1;
    transform: none;
}

/* Tablet scales the centered foreground copy */
@media (max-width: 1024px) {
    .sedasend-hero__title {
        font-size: clamp(2.75rem, 8vw, 5.2rem);
    }

    .sedasend-hero__content {
        width: min(900px, calc(100% - 32px));
    }
}

/* Mobile keeps centered scalable copy above the background image */
@media (max-width: 680px) {
    .sedasend-hero {
        min-height: 620px;
        padding: 54px 14px;
    }

    .sedasend-hero__background {
        object-position: 62% center;
    }

    .sedasend-hero__content {
        width: 100%;
    }

    .sedasend-hero__title {
        font-size: clamp(2.3rem, 11vw, 3.5rem);
        line-height: 1.03;
        text-align: center;
    }

    .sedasend-hero__subtitle {
        max-width: 330px;
        margin: 22px auto 0;
        text-align: center;
    }
}

/* Disable decorative motion when requested by the user */
@media (prefers-reduced-motion: reduce) {
    .sedasend-hero__button,
    .sedasend-hero__button::before,
    .sedasend-hero__background,
    .sedasend-hero__title,
    .sedasend-hero__word,
    .sedasend-hero__word-letter {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .sedasend-hero__word,
    .sedasend-hero__background {
        opacity: 1;
        transform: none;
    }
}
