@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
    --paper: #F7F3EA;
    --ink: #2D2D3A;
    --muted: #7B7B8E;
    --teal: #3FA389;
    --teal-deep: #2C7A66;
    --mint: #62CDB4;
    --lemon: #F4CE67;
    --gold: #C9A24A;
    --whatsapp: #25D366;
    --telegram: #2AABEE;
    --card: #FFFDFB;
    --line: #E8DFD4;
    --mint-wash: #E6F6F1;
    --lemon-wash: #FFF5D8;
    --icon-glow: 0 16px 36px rgba(44, 122, 102, 0.16);
    --bezel: #2D2D3A;
    --shadow: 0 24px 60px rgba(45, 45, 58, 0.1);
    --radius: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Tajawal', sans-serif;
    background: var(--paper);
    color: var(--ink);
    direction: rtl;
    line-height: 1.75;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font-family: inherit; }
:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

.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;
}

.skip-link {
    position: absolute; top: 8px; right: 8px; z-index: 30000;
    background: var(--teal-deep); color: #fff; font-weight: 800;
    padding: 10px 16px; border-radius: 999px; text-decoration: none;
    transform: translateY(-140%);
}
.skip-link:focus { transform: none; }

.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

/* Preloader */
#preloader {
    position: fixed; inset: 0; z-index: 20000;
    background: var(--paper);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px;
    transition: opacity .4s ease, visibility .4s ease;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.pre-logo {
    width: 92px; height: 92px;
    animation: prePulse 1.4s ease-in-out infinite;
    box-shadow: var(--icon-glow);
}
.pre-name { font-weight: 900; font-size: 1.6rem; }
.pre-bar {
    width: 140px; height: 4px; border-radius: 99px; background: #E6DFD2; overflow: hidden;
}
.pre-bar i {
    display: block; height: 100%; width: 40%;
    background: linear-gradient(90deg, var(--teal), var(--mint));
    animation: preLoad 1.1s ease-in-out infinite;
}
@keyframes prePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
@keyframes preLoad {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* Ambient */
.orb {
    position: fixed; border-radius: 50%; filter: blur(80px); z-index: 0; pointer-events: none;
    animation: drift 16s ease-in-out infinite alternate;
}
.orb-a { width: 42vw; height: 42vw; top: -12%; right: -8%; background: rgba(63, 163, 137, 0.18); }
.orb-b { width: 36vw; height: 36vw; bottom: 10%; left: -10%; background: rgba(244, 206, 103, 0.16); animation-delay: -6s; }
@keyframes drift {
    to { transform: translate(-30px, 24px) scale(1.08); }
}

/* Nav */
.nav {
    position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    width: min(1120px, calc(100% - 24px));
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px;
    background: rgba(247, 243, 234, 0.78);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(45, 45, 58, 0.06);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand img { width: 40px; height: 40px; background: transparent; }
.nav-brand span { font-weight: 900; font-size: 1.2rem; }
.nav-links { display: flex; align-items: center; gap: 18px; font-weight: 700; font-size: 0.92rem; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--teal-deep); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

.play-link { display: inline-flex; align-items: center; line-height: 0; }
.play-badge { height: 44px; width: auto; display: block; }
.play-badge-lg { height: 52px; }

/* Buttons */
.btn-primary, .btn-ghost, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 999px; border: none; cursor: pointer; text-decoration: none; font-weight: 800;
}
.btn-primary {
    padding: 14px 26px; color: #fff;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
    box-shadow: 0 12px 28px rgba(63, 163, 137, 0.28);
    transition: transform .25s ease, box-shadow .25s ease;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(63, 163, 137, 0.36); }
.btn-ghost {
    padding: 12px 20px; background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-deep); }
.btn-secondary {
    padding: 12px 22px; background: transparent; color: var(--ink); border: 2px solid var(--line);
}

/* Hero */
.hero {
    position: relative; z-index: 1;
    padding: 132px 0 24px;
    text-align: center;
}
.hero-copy { max-width: 760px; margin: 0 auto; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--mint-wash); color: var(--teal-deep); font-weight: 800; font-size: 0.82rem;
    margin-bottom: 16px;
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 4.2rem);
    font-weight: 900; line-height: 1.2;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--teal), #2C7A66);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin: 18px auto 28px; color: var(--muted); font-size: 1.12rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.hero-meta { display: flex; gap: 28px; justify-content: center; margin-top: 28px; color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.hero-meta b { display: block; color: var(--ink); font-size: 1.15rem; }
.hero-web-link { margin-top: 14px; font-size: 0.92rem; font-weight: 700; color: var(--muted); }
.hero-web-link a { color: var(--teal-deep); text-decoration: none; }
.hero-web-link a:hover { text-decoration: underline; }

.stage {
    position: relative;
    height: 640px;
    max-width: 880px;
    margin: 28px auto 0;
    perspective: 1400px;
}
.stage-glow {
    position: absolute; inset: 12% 18% 8%;
    background: radial-gradient(circle, rgba(63,163,137,.28), rgba(244,206,103,.12) 46%, transparent 72%);
    filter: blur(18px);
    animation: glowPulse 6s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: .7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}
.phone {
    position: absolute;
    padding: 8px; border-radius: 36px;
    background: var(--bezel);
    box-shadow: 0 28px 60px rgba(45, 45, 58, 0.12), 0 0 0 1px rgba(244, 206, 103, 0.16);
    transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s;
}
.phone img { border-radius: 28px; aspect-ratio: 9/19.5; object-fit: cover; object-position: top; width: 100%; }
.phone-a {
    width: 220px; top: 78px; left: 2%;
    transform: rotate(-16deg);
    z-index: 1; animation: floatY 6.4s ease-in-out infinite;
}
.phone-b {
    width: 268px; top: 8px; left: 50%;
    transform: translateX(-50%);
    z-index: 3; animation: floatY 5s ease-in-out infinite;
}
.phone-c {
    width: 220px; top: 98px; right: 2%;
    transform: rotate(16deg);
    z-index: 1; animation: floatY 7s ease-in-out infinite reverse;
}
.phone-b.interactive-3d { transition: transform .12s linear; animation: none; }
@keyframes floatY {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -14px; }
}

/* Showcase */
.showcase { position: relative; z-index: 1; padding: 64px 0 90px; }
.section-kicker { color: var(--teal-deep); font-weight: 800; margin-bottom: 8px; }
.section-title { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; margin-bottom: 10px; }
.section-sub { color: var(--muted); margin-bottom: 28px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tab {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    padding: 10px 16px; border-radius: 999px; font-weight: 800; cursor: pointer;
}
.tab.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.showcase-frame {
    display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: center;
}
.big-phone {
    width: 280px; margin-inline: auto; padding: 10px; border-radius: 38px;
    background: var(--bezel); box-shadow: var(--shadow);
}
.big-phone img {
    border-radius: 28px; aspect-ratio: 9/19.5; object-fit: cover; object-position: top;
    transition: opacity .28s ease, transform .45s ease;
}
.big-phone img.swap { opacity: 0; transform: scale(.97); }
.filmstrip {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
    margin-top: 28px;
}
.filmstrip button {
    border: 2px solid transparent; background: #fff; padding: 6px; border-radius: 18px;
    cursor: pointer; overflow: hidden; transition: transform .25s ease, border-color .25s ease;
}
.filmstrip button img { border-radius: 12px; aspect-ratio: 9/16; object-fit: cover; object-position: top; }
.filmstrip button:hover { transform: translateY(-4px); }
.filmstrip button.on { border-color: var(--teal); box-shadow: 0 10px 24px rgba(63,163,137,.18); }
.feature-copy h3 { font-size: 1.7rem; font-weight: 900; margin-bottom: 10px; }
.feature-copy p { color: var(--muted); margin-bottom: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span { background: var(--mint-wash); color: var(--teal-deep); padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 0.82rem; }

/* Grid features */
.pillars { padding: 20px 0 80px; position: relative; z-index: 1; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pillar {
    background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 22px;
    transition: transform .3s ease, box-shadow .3s ease;
}
.pillar:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.pillar .ico {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
    margin-bottom: 12px; background: var(--mint-wash); color: var(--teal-deep);
    border: 1px solid var(--line);
}
.pillar .ico svg { width: 22px; height: 22px; }
.pillar .ico.lemon { background: var(--lemon-wash); color: #8A6A16; }
.pillar h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 6px; }
.pillar p { color: var(--muted); font-size: 0.95rem; }

/* Download */
.download {
    position: relative; z-index: 1; margin: 20px 0 80px;
    background: linear-gradient(135deg, #2C7A66, #3FA389);
    color: #fff; border-radius: 36px; padding: 48px 40px;
    display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center;
}
.download h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 900; }
.download p { opacity: .9; margin: 10px 0 22px; }
.download-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.qr-card {
    background: #fff; color: var(--ink); border-radius: 24px; padding: 18px; text-align: center;
    justify-self: end; width: min(240px, 100%);
}
.qr-card img { width: 180px; height: 180px; margin: 8px auto; }
.qr-card small { color: var(--muted); font-weight: 700; display: block; line-height: 1.6; }

/* FAQ */
.faq { position: relative; z-index: 1; padding-bottom: 80px; }
.faq-list { display: grid; gap: 12px; }
.faq-item {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 8px;
}
.faq-item summary {
    cursor: pointer; font-weight: 800; padding: 14px 16px; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { color: var(--muted); padding: 0 16px 16px; }

/* Community */
.community { position: relative; z-index: 1; padding-bottom: 90px; }
.comm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comm-card {
    border-radius: 28px; padding: 28px; color: #fff; text-decoration: none;
    display: flex; flex-direction: column; gap: 10px; min-height: 180px;
    transition: transform .3s ease;
}
.comm-card:hover { transform: translateY(-6px) scale(1.01); }
.comm-wa { background: linear-gradient(135deg, #128C7E, #25D366); }
.comm-tg { background: linear-gradient(135deg, #1E96C8, #2AABEE); }
.comm-card strong { font-size: 1.4rem; font-weight: 900; }

/* Footer */
.footer { position: relative; z-index: 1; padding: 28px 0 max(40px, env(safe-area-inset-bottom)); color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.footer .nav-brand img { width: 36px; height: 36px; }
.legal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-row a {
    text-decoration: none; padding: 8px 12px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line); font-weight: 800; font-size: 0.8rem;
}

/* Dock */
.dock {
    position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 90;
    display: flex; flex-direction: column; gap: 10px;
}
.dock a {
    width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; box-shadow: 0 12px 24px rgba(0,0,0,.18); text-decoration: none;
}
.dock .wa { background: var(--whatsapp); }
.dock .tg { background: var(--telegram); }

/* Reveal */
.reveal, .reveal-left, .reveal-right { opacity: 0; transform: translateY(28px); transition: .7s cubic-bezier(.2,.8,.2,1); }
.reveal-left { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal.active, .reveal-left.active, .reveal-right.active { opacity: 1; transform: none; }

/* Auth */
.auth-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(247, 243, 234, 0.86); backdrop-filter: blur(18px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; padding: 20px; transition: .4s ease;
}
.auth-modal.active { opacity: 1; pointer-events: all; }
.auth-box {
    width: 100%; max-width: 440px; padding: 36px 28px; background: #fff;
    border-radius: 28px; box-shadow: var(--shadow); position: relative;
    max-height: calc(100vh - 40px); overflow-y: auto;
}
.auth-close { position: absolute; top: 14px; left: 14px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.auth-close svg { width: 24px; height: 24px; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header img {
    width: 56px; height: 56px; object-fit: contain;
    margin: 0 auto 14px; box-shadow: 0 10px 24px rgba(63,163,137,.14);
}
.auth-header h3 { font-size: 1.5rem; font-weight: 900; }
.auth-header p { color: var(--muted); }
.auth-tabs { display: flex; border-bottom: 2px solid #F0EBE3; margin-bottom: 22px; }
.auth-tab {
    flex: 1; text-align: center; padding: 10px 0; font-weight: 800; color: var(--muted);
    cursor: pointer; position: relative; border: 0; background: transparent;
}
.auth-tab.active { color: var(--ink); }
.auth-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--teal); }
.input-group { margin-bottom: 16px; position: relative; }
.input-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon svg { width: 20px; height: 20px; }
.input-group input {
    width: 100%; padding: 14px 44px 14px 16px; border: 1px solid transparent;
    background: #F7F3EA; border-radius: 14px; font-size: 1rem;
}
.input-group input:focus { outline: none; background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63,163,137,.18); }
.auth-error {
    background: #F8EDE8; color: #9A4A3A; padding: 10px 14px; border-radius: 10px;
    font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; display: none;
}
.google-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
    font-weight: 800; cursor: pointer;
}
.google-btn-primary {
    min-height: 56px;
    border-color: #E8DFD4;
    box-shadow: 0 8px 20px rgba(45, 45, 58, 0.06);
}
.google-btn-primary:hover { border-color: var(--teal); background: #fff; }
.google-g { flex: 0 0 20px; display: block; }
.google-hint {
    margin: 10px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}
.auth-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 16px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}
.auth-or::before,
.auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}
.auth-or span { white-space: nowrap; }

.ios-web-notice {
    position: fixed; top: calc(84px + env(safe-area-inset-top)); left: 50%; z-index: 95;
    width: min(520px, calc(100% - 24px));
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 22px; background: rgba(255,255,255,.94);
    border: 1px solid rgba(63,163,137,.25); box-shadow: var(--shadow);
    transform: translateX(-50%) translateY(-10px); opacity: 0; visibility: hidden; transition: .35s ease;
}
.ios-web-notice.show { opacity: 1; visibility: visible; transform: translateX(-50%); }
.ios-web-notice[hidden] { display: none !important; }
.ios-web-notice-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--mint-wash); color: var(--teal-deep); }
.ios-web-notice-icon svg { width: 22px; height: 22px; }
.ios-web-notice-body { flex: 1; text-align: right; }
.ios-web-notice-title { font-weight: 900; font-size: .88rem; }
.ios-web-notice-text { font-size: .78rem; color: var(--muted); font-weight: 600; }
.ios-web-notice-cta { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--teal); color: #fff; font-weight: 800; cursor: pointer; }
.ios-web-notice-close { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #f3efe6; cursor: pointer; }
.ios-web-notice-close svg { width: 14px; height: 14px; }
.ios-auth-hint { margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--mint-wash); color: var(--teal-deep); font-size: .8rem; font-weight: 700; }
.ios-auth-hint[hidden] { display: none !important; }

@media (min-width: 900px) {
    .hero {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 24px;
        text-align: right;
        padding-top: 140px;
    }
    .hero-copy { margin: 0; max-width: none; }
    .hero-actions, .hero-meta { justify-content: flex-start; }
    .hero .lead { margin-inline: 0; }
    .stage { height: 560px; margin: 0; max-width: none; }
    .filmstrip { display: none; }
}
@media (max-width: 980px) {
    .showcase-frame, .download, .comm-grid, .pillar-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .stage { height: 420px; max-width: 280px; }
    .phone-a, .phone-c { display: none; }
    .phone-b { width: 220px; }
    .download { justify-items: center; text-align: center; }
    .qr-card { justify-self: center; }
    .hero { padding-top: 120px; }
    .tabs { display: none; }
    .filmstrip {
        display: grid;
        grid-auto-flow: column;
        grid-template-columns: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
    }
    .filmstrip button { min-width: 72px; scroll-snap-align: start; }
}
@media (max-width: 720px) {
    .nav-brand img { width: 36px; height: 36px; }
    .phone-b { width: 200px; }
    .stage { height: 360px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn-primary,
    .hero-actions .play-link { width: min(320px, 100%); justify-content: center; }
    .hero-meta { flex-wrap: wrap; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; }
}
