/* ── Variables ── */
:root {
    --bg:      #0f1117;
    --surface: #1c2130;
    --text:    #e8eaed;
    --muted:   #8b92a0;
    --green:   #6aaa64;
    --yellow:  #c9b458;
    --border:  rgba(255, 255, 255, 0.08);
    --radius:  18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
    background-color: var(--bg);
    /* Gradient pinned to viewport top so it's always visible regardless of content height */
    background-image: radial-gradient(
        ellipse 80% 320px at 50% 0px,
        rgba(106, 170, 100, 0.16) 0%,
        transparent 100%
    );
    color: var(--text);
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ── */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 40px;
    text-align: center;
}

/* ── Logo wrapper — overflow:hidden ensures border-radius clips the image
       correctly on mobile (filter:drop-shadow + border-radius on the same
       element causes a visible rectangle bounding box in some mobile browsers) ── */
.logo-wrap {
    width: min(220px, 55vw);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(106, 170, 100, 0.22);
    margin-bottom: 28px;
    flex-shrink: 0;
    animation: fadeUp 0.65s ease both;
}

.logo {
    width: 100%;
    height: auto;
    display: block; /* removes inline-block bottom gap */
    object-fit: contain;
}

/* ── SEO text — visible but intentionally subtle so it doesn't dominate ── */
.app-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    animation: fadeUp 0.65s 0.08s ease both;
}

.app-name .fa {
    color: var(--green);
    opacity: 0.75;
    margin-left: 6px;
}

.tagline {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--muted);
    opacity: 0.55;
    letter-spacing: 0.04em;
    margin-bottom: 44px;
    animation: fadeUp 0.65s 0.13s ease both;
}

/* ── Download section ── */
.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: fadeUp 0.65s 0.2s ease both;
}

.btn-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Store button ── */
.store-btn {
    display: none; /* shown by JS */
    align-items: center;
    gap: 14px;
    padding: 15px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text);
    min-width: 210px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition:
        transform      0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow     0.25s ease,
        border-color   0.25s ease;
}

/* Shimmer sweep */
.store-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.06) 50%,
        transparent 70%
    );
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    pointer-events: none;
}
.store-btn:hover::after { transform: translateX(120%); }
.store-btn:hover        { transform: translateY(-3px) scale(1.025); }
.store-btn:active       { transform: scale(0.97); transition-duration: 0.1s; }

/* Android */
.store-btn.android {
    background: linear-gradient(145deg, rgba(106, 170, 100, 0.22) 0%, rgba(106, 170, 100, 0.10) 100%);
    border-color: rgba(106, 170, 100, 0.35);
}
.store-btn.android:hover {
    box-shadow: 0 14px 40px rgba(106, 170, 100, 0.22);
    border-color: rgba(106, 170, 100, 0.6);
}

/* iOS */
.store-btn.ios {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.store-btn.ios:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Icon */
.store-btn .icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    opacity: 0.9;
}
.store-btn.android .icon { color: var(--green); }
.store-btn.ios     .icon { color: var(--text);  }

/* Two-line label */
.store-btn .label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
.store-btn .sub {
    font-size: 0.66rem;
    font-weight: 300;
    opacity: 0.55;
    line-height: 1.2;
    letter-spacing: 0.02em;
}
.store-btn .main {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* "Also available on" — mobile only, no height when empty */
.also-on {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.5s 0.5s ease;
}
.also-on.visible { opacity: 1; }
.also-on a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.also-on a:hover { color: var(--yellow); }

/* ── Footer ── */
footer {
    padding: 18px 24px;
    border-top: 1px solid var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--yellow); }
.sep { opacity: 0.3; }

/* ── Smart App Banner ── */
.smart-banner {
    display: none; /* shown by JS on mobile */
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(28, 33, 48, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.banner-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background 0.15s;
}
.banner-close:hover { background: rgba(255,255,255,0.08); }

.banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    object-fit: cover;
    flex-shrink: 0;
}

.banner-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.banner-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-desc {
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-get {
    background: var(--green);
    color: #fff;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 7px 18px;
    border-radius: 20px;
    text-decoration: none;
    flex-shrink: 0;
    letter-spacing: 0.05em;
    transition: opacity 0.15s, transform 0.15s;
}
.banner-get:hover  { opacity: 0.88; }
.banner-get:active { transform: scale(0.96); }

/* ── Language Switcher — lives in the footer, inline ── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 3px;
    transition: color 0.15s;
}
.lang-btn:hover  { color: var(--text); }
.lang-btn.active { color: var(--green); }

.lang-sep {
    color: var(--muted);
    opacity: 0.3;
    font-size: 0.72rem;
    user-select: none;
    pointer-events: none;
    padding: 0 1px;
}

/* ── RTL overrides (Persian mode) ── */
/* Store buttons & smart banner always stay LTR by convention */
[dir="rtl"] .store-btn,
[dir="rtl"] .smart-banner { direction: ltr; }

/* fa span margin flips */
[dir="rtl"] .app-name .fa { margin-left: 0; margin-right: 6px; }

/* letter-spacing looks odd on RTL Farsi text */
[dir="rtl"] .tagline { letter-spacing: 0; }

/* ── Animation ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);    }
}
