/* apppro.pro — public site. Tokens first; dark mode follows the system. */
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f0f0f7;
  --ink: #16162a;
  --muted: #5d5f7a;
  --line: #e3e3ee;
  --accent: #5b5bd6;
  --accent-2: #8b5cf6;
  --accent-ink: #ffffff;
  --paper: #ffffff;
  --paper-line: #d9dbe8;
  --shadow: 0 18px 50px -18px rgba(40, 40, 110, .28);
  --radius: 18px;
  --font: "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e1a;
    --surface: #17172a;
    --surface-2: #1f1f36;
    --ink: #ececf6;
    --muted: #a3a5c2;
    --line: #2b2b46;
    --accent: #7c7cf0;
    --accent-2: #a78bfa;
    --paper: #f4f4fa;
    --paper-line: #c9cbe0;
    --shadow: 0 18px 50px -18px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.7; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { font-family: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.icon { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .icon.flip { transform: scaleX(-1); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.6) blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.logo-mark { width: 30px; height: 30px; }
.lm-back { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.lm-front { fill: var(--accent); }
.lm-lines { stroke: #fff; stroke-width: 2; stroke-linecap: round; fill: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.lang { color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 560px) { .nav a:not(.lang) { display: none; } }

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 600; border: 0; cursor: pointer; box-shadow: 0 10px 24px -10px var(--accent); transition: transform .2s, box-shadow .2s; }
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--accent); }
.button.ghost { background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.button.small { padding: 8px 16px; font-size: .92rem; }
.button.store { padding: 14px 24px; }
.button.disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: default; transform: none; }
.text-link { font-weight: 500; font-size: .92rem; }

/* Hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 40px; overflow: hidden; }
.hero-grid, .app-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px; }
@media (max-width: 880px) { .hero-grid, .app-hero-grid { grid-template-columns: 1fr; } }
.eyebrow { display: inline-block; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 12px; border-radius: 999px; font-size: .9rem; }
.hero h1, .app-hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 700; letter-spacing: -.01em; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* The animated document scene */
.scene { position: relative; height: 440px; max-width: 460px; width: 100%; margin-inline: auto; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; }
.blob-a { width: 260px; height: 260px; background: var(--accent); top: 10%; inset-inline-start: 5%; }
.blob-b { width: 220px; height: 220px; background: var(--accent-2); bottom: 5%; inset-inline-end: 0; animation-delay: -6s; }
.doc { position: absolute; width: 230px; height: 310px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); padding: 26px 22px; display: flex; flex-direction: column; gap: 11px; }
.doc .l { display: block; height: 8px; border-radius: 4px; background: var(--paper-line); }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; }
.doc-back { top: 30px; inset-inline-start: 30px; transform: rotate(-9deg); opacity: .75; animation: float 9s ease-in-out infinite; }
.doc-mid { top: 60px; inset-inline-start: 120px; transform: rotate(7deg); opacity: .9; animation: float 11s ease-in-out infinite -3s; }
.doc-front { top: 80px; inset-inline-start: 70px; width: 250px; height: 330px; overflow: hidden; animation: float 8s ease-in-out infinite -1.5s; }
.doc-title { height: 14px; width: 55%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); margin-bottom: 6px; }
.doc .write { transform-origin: var(--start, left); transform: scaleX(0); animation: write 6s ease-in-out infinite; animation-delay: var(--d); }
[dir="rtl"] .doc .write { --start: right; }
.doc-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.doc-table i { height: 22px; border-radius: 4px; border: 1.5px solid var(--paper-line); }
.doc-sign { margin-top: auto; height: 22px; width: 46%; border-bottom: 2px solid var(--accent); border-radius: 0 0 40% 10%; opacity: .8; }
.scan { position: absolute; inset-inline: 0; height: 56px; top: -60px; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent); border-bottom: 2px solid var(--accent); animation: scan 3.6s cubic-bezier(.45, 0, .55, 1) infinite; }
.corner { position: absolute; width: 22px; height: 22px; border: 3px solid var(--accent); animation: corner 3.6s ease-in-out infinite; }
.c1 { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.c2 { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.c3 { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.c4 { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: .9rem; animation: bob 5s ease-in-out infinite; }
.chip .icon { color: var(--accent); }
.chip-ai { top: 40px; inset-inline-end: 10px; }
.chip-pdf { bottom: 60px; inset-inline-start: 0; animation-delay: -2s; color: #fff; background: linear-gradient(135deg, #ef4444, #f97316); }
.badge-check { position: absolute; bottom: 30px; inset-inline-end: 50px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #22c55e; color: #fff; box-shadow: 0 12px 30px -10px #22c55e; animation: pop 3.6s ease-in-out infinite; }
.badge-check .icon { width: 28px; height: 28px; stroke-width: 2.6; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes drift { to { transform: translate(30px, -20px) scale(1.1); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes write { 0%, 8% { transform: scaleX(0); } 30%, 85% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 1; } }
@keyframes scan { 0% { top: -60px; } 70%, 100% { top: 105%; } }
@keyframes corner { 0%, 20% { opacity: 0; scale: 1.4; } 35%, 80% { opacity: 1; scale: 1; } 100% { opacity: 0; } }
@keyframes pop { 0%, 55% { opacity: 0; scale: .4; } 65% { opacity: 1; scale: 1.12; } 72%, 92% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .8; } }
@media (max-width: 480px) { .scene { height: 380px; transform: scale(.86); transform-origin: top center; } }

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: 28px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.app-card { display: flex; gap: 18px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .25s, box-shadow .25s, border-color .25s; }
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--app) 40%, var(--line)); }
.app-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35); }
.app-icon.big { width: 120px; height: 120px; border-radius: 28px; margin-bottom: 20px; }
.app-card h3 { margin-bottom: .2em; }
.app-card p { color: var(--muted); margin-bottom: .8em; }
.app-card-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.value .icon { width: 44px; height: 44px; padding: 10px; border-radius: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); margin-bottom: 14px; }
.value p { color: var(--muted); }
.contact { text-align: center; }

/* App page */
.app-hero { padding: clamp(40px, 7vw, 80px) 0; background: radial-gradient(1200px 400px at 50% -10%, color-mix(in srgb, var(--app) 18%, transparent), transparent); }
.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.feature-grid li { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.feature-grid .icon { color: #fff; background: var(--accent); border-radius: 50%; padding: 4px; width: 26px; height: 26px; stroke-width: 2.6; }
.legal-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.legal-card { display: flex; align-items: center; gap: 12px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 600; transition: transform .2s, border-color .2s; }
.legal-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.legal-card .icon { color: var(--accent); width: 26px; height: 26px; }

/* Policy pages */
.doc-page { padding: clamp(32px, 6vw, 72px) 0 80px; }
.doc-page h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.crumb { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; margin-bottom: 22px; }
.crumb img { border-radius: 8px; }
.prose { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; padding-top: .2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.support-box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface-2); margin-bottom: 20px; }
.support-box p { margin: 0; }
.doc-switch { display: flex; gap: 18px; margin-top: 24px; font-weight: 600; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h3 { font-size: .95rem; color: var(--muted); font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0; margin-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Scroll reveal (site.js adds .in) */
.reveal { opacity: 0; translate: 0 18px; transition: opacity .7s ease, translate .7s ease; transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; translate: 0 0; }
.no-js .reveal { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; translate: none; }
  .doc .write { transform: none; }
  .scan { display: none; }
}
@media print {
  .topbar, .footer, .doc-switch, .crumb { display: none; }
  .prose { border: 0; padding: 0; }
}
bdi.name { white-space: nowrap; }
