/**
 * Home splash + first-paint transition (index only).
 * Does not define global theme variables; uses existing brand hex where needed.
 */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Ethiopic:wght@500;700&display=swap");

html.tb-splash-phase .tb-splash-shell {
    visibility: hidden;
}

html.tb-splash-phase #tb-home-splash {
    visibility: visible;
}

#tb-home-splash {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 48%, #e8f2ff 100%);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.7s;
}

#tb-home-splash.tb-home-splash--exiting {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.tb-home-splash__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    max-width: min(22rem, 92vw);
    text-align: center;
}

.tb-home-splash__mark {
    width: min(200px, 52vw);
    filter: drop-shadow(0 18px 40px rgba(0, 106, 255, 0.12));
}

.tb-home-splash__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.tb-home-splash__buildings {
    transform: translateY(6px);
}

.tb-home-splash__b {
    transform: translate3d(0, 110%, 0);
    transform-box: fill-box;
    transform-origin: 50% 100%;
    opacity: 0;
}

@keyframes tb-splash-rise {
    from {
        opacity: 0;
        transform: translate3d(0, 110%, 0) scaleY(0.25);
    }
    55% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scaleY(1);
    }
}

@keyframes tb-splash-title-in {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes tb-splash-soft-pulse {
    0%,
    100% {
        filter: drop-shadow(0 18px 40px rgba(0, 106, 255, 0.12));
    }
    50% {
        filter: drop-shadow(0 22px 48px rgba(0, 106, 255, 0.18));
    }
}

html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__b1 {
    animation: tb-splash-rise 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}
html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__b2 {
    animation: tb-splash-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}
html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__b3 {
    animation: tb-splash-rise 0.92s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__b4 {
    animation: tb-splash-rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}
html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__b5 {
    animation: tb-splash-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.36s forwards;
}

html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__mark {
    animation: tb-splash-soft-pulse 2.8s ease-in-out 0.4s infinite;
}

.tb-home-splash__titles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.tb-home-splash__title-am {
    margin: 0;
    font-family: "Noto Sans Ethiopic", "Inter", system-ui, sans-serif;
    font-size: clamp(1.65rem, 5.5vw, 2.15rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f172a;
    line-height: 1.2;
    opacity: 0;
}

.tb-home-splash__title-en {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(0.95rem, 3.2vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #64748b;
    opacity: 0;
}

html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__title-am {
    animation: tb-splash-title-in 0.75s ease-out 0.2s forwards;
}
html:not(.tb-splash-reduced) .tb-home-splash:not(.tb-home-splash--exiting) .tb-home-splash__title-en {
    animation: tb-splash-title-in 0.75s ease-out 0.38s forwards;
}

/* Bilingual emphasis from language preference */
.tb-splash-emphasis-am .tb-home-splash__title-am {
    color: #0f172a;
}
.tb-splash-emphasis-am .tb-home-splash__title-en {
    color: #94a3b8;
    font-weight: 500;
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
}

.tb-splash-emphasis-en .tb-home-splash__title-en {
    font-size: clamp(1.15rem, 3.6vw, 1.35rem);
    font-weight: 700;
    color: #0f172a;
}
.tb-splash-emphasis-en .tb-home-splash__title-am {
    font-size: clamp(1.2rem, 4vw, 1.45rem);
    font-weight: 600;
    color: #475569;
}

/* Post-splash cascade (no layout change; opacity/transform only) */
html.tb-splash-active .tb-splash-cascade-target {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    will-change: opacity, transform;
}

html.tb-splash-ended .tb-splash-cascade-target {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition:
        opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--tb-cd, 0) * 65ms);
}

@media (prefers-reduced-motion: reduce) {
    html.tb-splash-phase .tb-splash-shell {
        visibility: visible;
    }

    #tb-home-splash {
        transition:
            opacity 0.26s ease,
            visibility 0s linear 0.29s;
    }

    .tb-home-splash__b,
    .tb-home-splash__title-am,
    .tb-home-splash__title-en {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .tb-home-splash__mark {
        animation: none !important;
    }

    html.tb-splash-active .tb-splash-cascade-target {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
