/* ==========================================================================
   STAGE: the narrated home hero and the use-case strips.
   Loaded after agenda.css; the hero keeps the agenda world (navy cover, gold
   foil, ledger page) and adds kinetic words, captions and an optional voice.
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Stage frame ----------------------------------------------------------- */
.hero-stage {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 112px;
    padding-bottom: 30px;
    background-color: var(--cover-deep);
}

.stage-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 56px;
    align-items: center;
}

.stage-title {
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: var(--text-on-dark-sec);
    max-width: 36ch;
    margin-bottom: 18px;
}

/* --- Kinetic words --------------------------------------------------------- */
.stage-words {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 2.95em;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.7rem, 1rem + 5.6vw, 6.6rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    color: #fff;
}

.k-line {
    display: block;
    overflow: hidden;
    padding: 0.02em 0 0.06em;
}

.k-in {
    display: inline-block;
}

.is-gold {
    color: var(--primary);
}

.stage-words.is-pre .k-in {
    transform: translateY(110%);
    transition: none;
}

.stage-words.is-entering .k-in {
    transform: none;
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i, 0) * 80ms);
}

.stage-words.is-leaving .k-in {
    transform: translateY(-110%);
    transition: transform 0.32s cubic-bezier(0.7, 0, 0.84, 0);
}

.stage-caption {
    max-width: 42ch;
    min-height: 3.2em;
    margin: 22px 0 28px;
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--text-on-dark-sec);
    transition: opacity 0.3s ease;
}

.stage-caption.is-swapping {
    opacity: 0;
}

.hero-stage .hero-ctas {
    margin-bottom: 16px;
}

.hero-stage .hero-ctas .btn {
    text-align: center;
}

/* --- The visual follows the story: message, reply, booking ---------------- */
.hero-stage .hero-visual {
    min-height: 680px;
}

.hero-stage .agenda-page {
    width: 84%;
}

.hero-stage .hero-visual .whatsapp-mock {
    width: 62%;
    height: 440px;
}

.hero-stage .whatsapp-mock-bubble {
    animation: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-stage .whatsapp-mock-bubble:nth-child(1) {
    opacity: 1;
    transform: none;
}

.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(2),
.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(3),
.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(4) {
    opacity: 1;
    transform: none;
}

.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(2) { transition-delay: 0.3s; }
.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(3) { transition-delay: 1.1s; }
.hero-stage.has-reply .whatsapp-mock-bubble:nth-child(4) { transition-delay: 1.9s; }

.hero-stage .agenda-rows li.is-new .agenda-entry {
    animation: none;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.hero-stage.has-booking .agenda-rows li.is-new .agenda-entry {
    clip-path: inset(0 0 0 0);
}

/* --- Progress + controls --------------------------------------------------- */
.stage-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 30px;
}

.stage-track {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 640px;
}

.stage-count {
    min-width: 6ch;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}

.stage-progress {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.stage-progress button {
    position: relative;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.stage-progress button::before,
.stage-progress button::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
}

.stage-progress button::before {
    background: rgba(255, 255, 255, 0.22);
    transition: background 0.2s;
}

.stage-progress button:hover::before {
    background: rgba(255, 255, 255, 0.45);
}

.stage-progress button::after {
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left center;
}

.stage-progress button.is-done::after {
    transform: scaleX(1);
}

.stage-progress button.is-current::after {
    animation: stage-fill var(--dur, 3600ms) linear forwards;
}

.hero-stage.is-paused .stage-progress button.is-current::after {
    animation-play-state: paused;
}

@keyframes stage-fill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.stage-controls {
    display: flex;
    gap: 10px;
}

.stage-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: 600 0.9rem/1 var(--font-main);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.stage-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.stage-btn:active {
    transform: scale(0.98);
}

.stage-btn svg {
    fill: currentColor;
    flex-shrink: 0;
}

.stage-btn .icon-play,
.stage-btn[aria-pressed="true"] .icon-pause {
    display: none;
}

.stage-btn[aria-pressed="true"] .icon-play {
    display: block;
}

/* The voice is the invitation: gold until it plays. */
.stage-sound {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--cover);
}

.stage-sound:hover {
    background: #e0bd47;
    border-color: #e0bd47;
    color: var(--cover);
}

.stage-sound[aria-pressed="true"] {
    background: transparent;
    color: var(--primary);
}

.stage-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.stage-eq i {
    width: 3px;
    height: 100%;
    border-radius: 1px;
    background: currentColor;
    transform-origin: bottom center;
    transform: scaleY(0.45);
}

.stage-eq i:nth-child(2) { transform: scaleY(0.85); }
.stage-eq i:nth-child(3) { transform: scaleY(0.6); }
.stage-eq i:nth-child(4) { transform: scaleY(0.3); }

/* Bars move only while the voice is actually playing. */
.hero-stage.is-speaking:not(.is-paused) .stage-eq i {
    animation: stage-eq 0.9s ease-in-out infinite alternate;
}

.hero-stage.is-speaking:not(.is-paused) .stage-eq i:nth-child(2) { animation-delay: -0.3s; }
.hero-stage.is-speaking:not(.is-paused) .stage-eq i:nth-child(3) { animation-delay: -0.6s; }
.hero-stage.is-speaking:not(.is-paused) .stage-eq i:nth-child(4) { animation-delay: -0.15s; }

@keyframes stage-eq {
    from { transform: scaleY(0.3); }
    to { transform: scaleY(1); }
}

/* --- Use-case strips ------------------------------------------------------- */
.usecases-head {
    max-width: 680px;
    margin-bottom: 36px;
}

.usecases {
    display: flex;
    gap: 12px;
    height: clamp(420px, 58vh, 560px);
}

.usecase {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--cover);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: flex-grow 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.usecase.is-active {
    flex-grow: 4.2;
    cursor: default;
}

.usecase-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.78) contrast(1.05);
    transition: filter 0.7s ease;
}

.usecase:hover:not(.is-active) .usecase-media {
    filter: grayscale(1) brightness(0.95) contrast(1.05);
}

.usecase.is-active .usecase-media {
    filter: grayscale(0.1) brightness(0.92);
}

.usecase-label {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
    max-width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--cover);
    color: #fff;
    font: 600 0.85rem/1.2 var(--font-main);
}

.usecase.is-active .usecase-label {
    background: var(--primary);
    color: var(--cover);
}

.usecase-chat {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.usecase.is-active .usecase-chat {
    opacity: 1;
    transform: none;
    transition-delay: 0.35s;
}

.usecase-bubble {
    max-width: min(78%, 340px);
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #101a2f;
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
}

.usecase-bubble.in {
    align-self: flex-start;
    background: #fff;
    border-bottom-left-radius: 3px;
}

.usecase-bubble.out {
    align-self: flex-end;
    background: #dcf8c6;
    border-bottom-right-radius: 3px;
}

.usecase-panel {
    max-width: 64ch;
    margin-top: 26px;
}

.usecase-panel h3 {
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.usecase-panel p {
    color: var(--text-sec);
}

.usecase-panel .usecase-note {
    margin-top: 10px;
    font-size: 0.82rem;
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 992px) {
    .stage-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-stage .hero-visual {
        min-height: 0;
    }

    .hero-stage .agenda-page,
    .hero-stage .hero-visual .whatsapp-mock {
        width: 100%;
    }

    .hero-stage .hero-visual .whatsapp-mock {
        height: auto;
    }

    .stage-bar {
        flex-wrap: wrap;
    }

    .stage-track {
        flex-basis: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .hero-stage {
        padding-top: 104px;
    }

    .hero-stage .stage-copy {
        text-align: left;
    }

    .stage-words {
        font-size: clamp(2.4rem, 11vw, 3.8rem);
    }

    .stage-caption {
        min-height: 4.6em;
        font-size: 1.05rem;
    }

    .usecases {
        flex-direction: column;
        height: auto;
        gap: 8px;
    }

    .usecase {
        flex: none;
        height: 58px;
        transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .usecase.is-active {
        height: 380px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage-words.is-entering .k-in,
    .stage-words.is-leaving .k-in,
    .stage-caption,
    .hero-stage .whatsapp-mock-bubble,
    .hero-stage .agenda-rows li.is-new .agenda-entry,
    .usecase,
    .usecase-media,
    .usecase-chat {
        transition: none;
    }

    .stage-words.is-leaving .k-in {
        transform: none;
    }

    .stage-progress button.is-current::after {
        animation: none;
        transform: scaleX(1);
    }

    .hero-stage.is-speaking .stage-eq i {
        animation: none;
    }
}
