/* =========================================================
   Tale3 (طالع) — shared styles for every page
   Brand tokens are taken from the logo (#31466B) and the app UI
   (ink tiles, blue→violet accent gradient, soft periwinkle canvas).

   Page styles live next to this file and load after it:
   home.css · panel.css (+ trip.css, reset-password.css)
   ========================================================= */

:root {
    --navy: #31466b;
    --ink: #0b1124;
    --ink-2: #1b2753;
    --blue: #5b8cff;
    --violet: #8b5cf6;
    --green: #22c55e;
    --grad: linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
    --grad-ink: linear-gradient(140deg, #0b1124 0%, #1b2753 100%);

    --bg: #eef1f8;
    --bg-tint: #e4e9f5;
    --surface: #ffffff;
    --surface-2: #f6f8fd;
    --text: #0b1124;
    --muted: #5a6382;
    --border: rgb(49 70 107 / 0.12);
    --glass: rgb(255 255 255 / 0.68);
    --glass-border: rgb(255 255 255 / 0.85);
    --shadow-sm: 0 1px 2px rgb(11 17 36 / 0.06), 0 2px 8px rgb(11 17 36 / 0.05);
    --shadow: 0 2px 6px rgb(11 17 36 / 0.05), 0 18px 40px -12px rgb(27 39 83 / 0.22);
    --shadow-lg: 0 40px 80px -24px rgb(27 39 83 / 0.45);

    --radius-sm: 14px;
    --radius: 24px;
    --radius-lg: 36px;
    --header-h: 76px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #070b18;
    --bg-tint: #0b1226;
    --surface: #0f1630;
    --surface-2: #141d3d;
    --text: #edf0fb;
    --muted: #9aa4c6;
    --border: rgb(255 255 255 / 0.08);
    --glass: rgb(15 22 48 / 0.62);
    --glass-border: rgb(255 255 255 / 0.1);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 18px 40px -16px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 40px 80px -24px rgb(0 0 0 / 0.8);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #070b18;
        --bg-tint: #0b1226;
        --surface: #0f1630;
        --surface-2: #141d3d;
        --text: #edf0fb;
        --muted: #9aa4c6;
        --border: rgb(255 255 255 / 0.08);
        --glass: rgb(15 22 48 / 0.62);
        --glass-border: rgb(255 255 255 / 0.1);
        --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
        --shadow: 0 18px 40px -16px rgb(0 0 0 / 0.7);
        --shadow-lg: 0 40px 80px -24px rgb(0 0 0 / 0.8);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    interpolate-size: allow-keywords;
}

body {
    margin: 0;
    font-family: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 10px;
}

::selection { background: var(--violet); color: #fff; }

.container {
    width: min(1200px, 100% - 32px);
    margin-inline: auto;
}
.container--narrow { width: min(820px, 100% - 32px); }

.skip-link {
    position: fixed;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    translate: 0 -200%;
    transition: translate 0.2s;
}
.skip-link:focus { translate: 0 0; }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}
.icon--xs { width: 0.95em; height: 0.95em; }

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Arabic letters need a little room so clipping doesn't cut descenders */
    padding-block: 0.08em;
}
.grad-text--light {
    background-image: linear-gradient(135deg, #8fb0ff, #c4a8ff);
}

/* ---------- Buttons & small UI ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}
.btn--sm { padding: 10px 18px; font-size: 0.92rem; }
.btn--primary {
    color: #fff;
    background: var(--grad-ink);
    box-shadow: 0 8px 20px -8px rgb(27 39 83 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgb(91 140 255 / 0.65); }

.icon-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.25s var(--ease);
}
.icon-btn:hover { transform: rotate(-12deg); }
.icon-btn .icon--moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon--sun { display: none; }
:root[data-theme="dark"] .icon-btn .icon--moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-btn .icon--sun { display: none; }
    :root:not([data-theme="light"]) .icon-btn .icon--moon { display: block; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 600;
}
:root[data-theme="dark"] .eyebrow { color: #b9c6f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #b9c6f0; } }
.eyebrow--light {
    color: #dfe6ff !important;
    background: rgb(255 255 255 / 0.08);
    border-color: rgb(255 255 255 / 0.16);
}

/* App-style icon tiles (the dark rounded squares from the app) */
.tile {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    color: #fff;
    font-size: 1.15rem;
}
.tile--ink { background: var(--grad-ink); box-shadow: 0 10px 22px -10px rgb(11 17 36 / 0.8); }
.tile--grad { background: var(--grad); box-shadow: 0 10px 22px -10px rgb(139 92 246 / 0.8); }
.tile--soft { background: var(--surface-2); color: var(--navy); border: 1px solid var(--border); }
:root[data-theme="dark"] .tile--soft { color: #b9c6f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile--soft { color: #b9c6f0; } }

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset-inline: 0;
    inset-block-start: 0;
    z-index: 50;
    height: var(--header-h);
    transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}
.site-header[data-scrolled] {
    background: var(--glass);
    backdrop-filter: saturate(1.6) blur(18px);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
}
.site-header__actions { display: flex; align-items: center; gap: 10px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgb(49 70 107 / 0.1);
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.brand__name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}
.brand__name small {
    font-size: 0.66rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.18em;
    color: var(--muted);
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.site-nav a {
    padding: 7px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.93rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); background: var(--surface); }

@media (max-width: 900px) {
    .site-nav { display: none; }
}
@media (max-width: 420px) {
    .site-header .btn--sm span { display: none; }
    .site-header .btn--sm { padding: 12px; }
}

/* ---------- Store badges ---------- */

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__copy .store-badges { justify-content: inherit; }
@media (max-width: 960px) { .hero__copy .store-badges { justify-content: center; } }

.store-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 186px;
    padding: 10px 20px 10px 22px;
    border: 1px solid rgb(255 255 255 / 0.06);
    border-radius: 18px;
    background: var(--grad-ink);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgb(11 17 36 / 0.7);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.store-badge:hover { transform: translateY(-3px); box-shadow: 0 18px 32px -14px rgb(91 140 255 / 0.7); }
.store-badge__icon { width: 26px; height: 26px; filter: invert(1); }
.store-badge__text { display: grid; line-height: 1.2; text-align: start; }
.store-badge__text small { font-size: 0.72rem; opacity: 0.75; }
.store-badge__text strong { font-size: 1.08rem; font-weight: 600; letter-spacing: 0.01em; }
.store-badge.is-preferred { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--violet), 0 14px 30px -12px rgb(139 92 246 / 0.7); }
.store-badge__tag {
    position: absolute;
    inset-block-start: -10px;
    inset-inline-end: 12px;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--grad);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

:root[data-theme="dark"] .store-badge { background: #141d3d; border-color: rgb(255 255 255 / 0.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .store-badge { background: #141d3d; border-color: rgb(255 255 255 / 0.1); } }

.store-badges--light .store-badge,
:root[data-theme="dark"] .store-badges--light .store-badge { background: #fff; color: var(--ink); border-color: transparent; }
.store-badges--light .store-badge__icon { filter: none; }
.store-badges--light .store-badge.is-preferred { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--violet); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .store-badges--light .store-badge { background: #fff; color: var(--ink); border-color: transparent; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 10vw, 128px); position: relative; }
.section--tinted { background: var(--bg-tint); }
.section__head {
    display: grid;
    justify-items: center;
    gap: 16px;
    max-width: 680px;
    margin: 0 auto clamp(40px, 6vw, 64px);
    text-align: center;
}
.section__head h2 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem); }
.section__head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Shared bits ---------- */

.blob {
    position: absolute;
    width: min(46vmax, 760px);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: drift 22s ease-in-out infinite alternate;
}
.blob--blue { background: var(--blue); inset-block-start: -260px; inset-inline-start: -180px; }
.blob--violet { background: var(--violet); inset-block-end: -320px; inset-inline-end: -200px; animation-delay: -8s; }
:root[data-theme="dark"] .blob { opacity: 0.28; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .blob { opacity: 0.28; } }

.qr {
    width: 168px;
    padding: 14px;
    border-radius: 20px;
    background: #fff;
}
.qr svg { width: 100%; height: auto; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.field__error { color: #ef4444; font-size: 0.88rem; }
.field__error:empty { display: none; }

/* ---------- Footer ---------- */

.site-footer {
    padding-block: 64px 28px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.site-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.site-footer__brand { display: grid; gap: 16px; align-content: start; }
.site-footer__brand p { max-width: 38ch; color: var(--muted); }
.site-footer__links { display: grid; gap: 10px; align-content: start; }
.site-footer__links h3 { font-size: 1rem; margin-block-end: 4px; }
.site-footer__links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--muted);
    transition: color 0.2s;
}
.site-footer__links a:hover { color: var(--violet); }
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-block-start: 48px;
    padding-block-start: 22px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88rem;
}

@media (max-width: 760px) {
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
    .site-footer { padding-block-end: 110px; } /* room for the app bar */
}

/* ---------- Keyframes ---------- */

@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
@keyframes spin { to { rotate: 360deg; } }

/* View-transition theme switch: circular reveal from the toggle */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
