/* ===== Welcome / pre-auth landing (Instagram-style) ===== */

html:has(body.welcome-page) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.welcome-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    background: #000;
    color: #fff;
    font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.welcome-shell {
    height: 100%;
    max-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding:
        calc(12px + env(safe-area-inset-top, 0px))
        20px
        calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.welcome-visual {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: min(14vh, 88px) 0 4px;
    overflow: hidden;
    animation: welcomeFadeUp 0.7s ease both;
}

.welcome-hero-img {
    width: min(100%, 420px);
    height: auto;
    max-height: min(50dvh, 480px);
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.55));
}

.welcome-copy {
    flex-shrink: 0;
    text-align: center;
    padding: 4px 8px 20px;
    animation: welcomeFadeUp 0.7s ease 0.08s both;
}

.welcome-title {
    margin: 0 0 12px;
    font-size: clamp(1.45rem, 5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.welcome-brand-name {
    font-weight: 800;
    background: linear-gradient(135deg, #e879f9 0%, #818cf8 50%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-tagline {
    margin: 0 auto;
    max-width: 28ch;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.welcome-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: welcomeFadeUp 0.7s ease 0.16s both;
}

.welcome-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.welcome-btn:active {
    transform: scale(0.985);
}

.welcome-btn-primary {
    background: linear-gradient(135deg, #e879f9 0%, #818cf8 50%, #67e8f9 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.welcome-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 32px rgba(129, 140, 248, 0.45);
}

.welcome-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
}

.welcome-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    animation: welcomeFadeUp 0.7s ease 0.24s both;
}

.welcome-footer-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.7;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

@keyframes welcomeFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .welcome-shell {
        justify-content: center;
        gap: 8px;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .welcome-visual {
        flex: 0 0 auto;
        padding: 0 0 8px;
    }

    .welcome-hero-img {
        max-height: min(46dvh, 440px);
        width: min(100%, 460px);
    }
}

@media (max-height: 720px) {
    .welcome-hero-img {
        max-height: min(38dvh, 320px);
    }

    .welcome-copy {
        padding-bottom: 12px;
    }

    .welcome-title {
        margin-bottom: 8px;
        font-size: 1.35rem;
    }

    .welcome-tagline {
        font-size: 0.9rem;
    }

    .welcome-footer {
        margin-top: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-visual,
    .welcome-copy,
    .welcome-actions,
    .welcome-footer {
        animation: none;
    }
}
