/* Dark-first redesign (2026-08-26) — reuses the real app's own dark-mode
   palette (src/constants/theme.ts's darkColors) so the marketing site feels
   like an authentic extension of the product, not a generic template. */
:root {
  --primary: #7A76F0;
  --primary-on: #FFFFFF;
  --accent: #F0C563;
  --accent-on: #14121F;
  --ground: #0D0B1F;
  --ground-deep: #08071A;
  --card: #17152E;
  --card-alt: #1F1C3B;
  --ink: #F1F0FA;
  --ink-muted: rgba(241, 240, 250, 0.66);
  --ink-faint: rgba(241, 240, 250, 0.40);
  --border: rgba(241, 240, 250, 0.14);
  --hero-dark: #0D0B1F;
  --hero-end: #08071A;
  --blob-opacity-1: 0.28;
  --blob-opacity-2: 0.16;
  --blob-opacity-3: 0.14;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode — reuses the real app's own light-mode palette
   (src/constants/theme.ts's lightColors), toggled via a button next to
   the language switch. Persisted to localStorage; defaults to dark
   (this page's original, primary identity) when no preference is
   stored. The hero keeps a dark gradient in BOTH modes on purpose —
   same pattern the app itself uses for its "hero" surfaces (SearchBar,
   wallet balance) staying dark even in light mode, per CLAUDE.md's
   design-system notes: a deliberate highlight, not a second theme. */
:root[data-theme="light"] {
  --primary: #2A2680;
  --primary-on: #FFFFFF;
  --accent: #E8B94D;
  --accent-on: #14121F;
  --ground: #F5F5FA;
  --ground-deep: #FFFFFF;
  --card: #FFFFFF;
  --card-alt: #EEEDF6;
  --ink: #14121F;
  --ink-muted: rgba(20, 18, 31, 0.62);
  --ink-faint: rgba(20, 18, 31, 0.38);
  --border: rgba(20, 18, 31, 0.08);
  --hero-dark: #2A2680;
  --hero-end: #14121F;
  --blob-opacity-1: 0.14;
  --blob-opacity-2: 0.08;
  --blob-opacity-3: 0.07;
}

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

html, body { height: 100%; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'Noto Kufi Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Bilingual content toggle — every element tagged .lang-ar / .lang-en,
   visibility keyed off <html data-lang="ar|en">. See script.js. */
html[data-lang="ar"] .lang-en { display: none; }
html[data-lang="en"] .lang-ar { display: none; }

/* Ambient gradient blobs — a handful of large, blurred, slowly drifting
   circles behind the hero. Pure CSS (no images), respects reduced-motion
   by simply not animating (they still render as a static glow). */
.bg-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  transition: opacity 300ms var(--ease-out);
}

.bg-blob--1 {
  width: 480px;
  height: 480px;
  top: -160px;
  inset-inline-start: -120px;
  background: var(--primary);
  opacity: var(--blob-opacity-1);
  animation: drift1 22s ease-in-out infinite;
}

.bg-blob--2 {
  width: 380px;
  height: 380px;
  top: 220px;
  inset-inline-end: -140px;
  background: var(--accent);
  opacity: var(--blob-opacity-2);
  animation: drift2 26s ease-in-out infinite;
}

.bg-blob--3 {
  width: 320px;
  height: 320px;
  top: 900px;
  inset-inline-start: 40%;
  background: var(--primary);
  opacity: var(--blob-opacity-3);
  animation: drift1 30s ease-in-out infinite reverse;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.08); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none !important; }
}

/* Nav — sticky glass bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1100px;
  margin: 0 auto;
  transition: background-color 300ms var(--ease-out), backdrop-filter 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
  border-radius: 0 0 20px 20px;
}

.topbar.scrolled {
  background: rgba(13, 11, 31, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.5);
}

.wordmark {
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 200ms var(--ease-out);
}

.wordmark:hover { opacity: 0.8; }

.lang-toggle {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 150ms var(--ease-out);
}

.lang-toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.lang-toggle:active { transform: scale(0.96); }

.topbar-controls { display: flex; align-items: center; gap: 10px; }

.icon-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 150ms var(--ease-out);
}

.icon-toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.icon-toggle:active { transform: scale(0.92); }
.icon-toggle svg { width: 18px; height: 18px; }

/* Only one of sun/moon shows at a time, keyed off <html data-theme>. */
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px;
}

/* A thin top divider on every section after the hero, so the eye gets
   a clear "new zone starts here" cue even between two un-banded
   sections. The hero and legal sections skip it (hero has its own
   rounded-bottom edge; the three legal sections already separate via
   the .band alternation and their own heading spacing). */
.how-it-works, .why-mishwar, .screenshots {
  border-top: 1px solid var(--border);
}

/* Scroll-reveal: hidden/lowered by default, animated to place once
   script.js's IntersectionObserver adds .in-view. No-JS / reduced-motion
   visitors get .in-view added immediately, so content is never stuck
   invisible. */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

[data-reveal].in-view { opacity: 1; transform: translateY(0); }

[data-reveal="1"] { transition-delay: 0ms; }
[data-reveal="2"] { transition-delay: 90ms; }
[data-reveal="3"] { transition-delay: 180ms; }
[data-reveal="4"] { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; opacity: 1; transform: none; }
}

/* Gradient text — the brand's own indigo→gold pair, used for emphasis
   words in headings rather than the whole heading (a full-gradient
   heading reads busy at this weight/size). */
/* Fixed vivid pair, not the theme-swappable tokens — only ever used on
   the always-dark hero, so it must stay bright/readable regardless of
   the site-wide light/dark toggle. */
.gradient-text {
  background: linear-gradient(90deg, #7A76F0, #F0C563);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Hero — always a dark gradient surface regardless of the site-wide
   light/dark toggle, same pattern the real app uses for its own "hero"
   surfaces (SearchBar, wallet balance): a deliberate dark highlight,
   not a second theme. Fixed hex values here on purpose, not the
   theme-swappable tokens, since this surface never changes. */
.hero {
  position: relative;
  border-radius: 0 0 32px 32px;
  background: linear-gradient(160deg, #2A2680 0%, #3B2F8F 55%, #08071A 100%);
  color: rgba(255, 255, 255, 0.94);
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 20px;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px var(--accent);
}

.hero-text { flex: 1; max-width: 560px; }
.hero-text h1 { font-size: 40px; font-weight: 700; line-height: 1.25; margin-bottom: 16px; letter-spacing: -0.01em; }
.hero-sub { font-size: 17px; color: rgba(255, 255, 255, 0.78); margin-bottom: 32px; max-width: 480px; }

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out), background-color 200ms var(--ease-out);
}

.store-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 197, 99, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.phone-mockup {
  flex-shrink: 0;
  width: 220px;
  height: 380px;
  background: linear-gradient(160deg, #1F1C3B, #08071A);
  border-radius: 32px;
  border: 6px solid #211d4a;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(122, 118, 240, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 28px 18px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  .phone-mockup { animation: none; }
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 8px;
  background: #2a2760;
  border-radius: 4px;
}

.phone-bar { height: 14px; background: var(--accent); border-radius: 6px; margin-bottom: 10px; box-shadow: 0 0 12px rgba(240, 197, 99, 0.35); }
.phone-bar--title { width: 70%; }
.phone-bar--sub { width: 45%; background: rgba(255, 255, 255, 0.3); height: 10px; box-shadow: none; }
.phone-card { height: 70px; background: rgba(255, 255, 255, 0.06); border-radius: 12px; margin-top: 14px; border: 1px solid rgba(255, 255, 255, 0.06); }

/* Section bands — alternating full-bleed tint so sections read as
   distinct zones while scrolling, not one undifferentiated dark page.
   The pseudo-element bleeds edge-to-edge regardless of the section's
   own centered max-width, so no extra wrapper markup is needed. */
.band { position: relative; }
.band::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--card);
  opacity: 0.4;
  z-index: -1;
}

.how-it-works h2, .why-mishwar h2, .screenshots h2 {
  text-align: center;
  font-size: 30px;
  margin-bottom: 12px;
  color: var(--ink);
}

.section-sub {
  text-align: center;
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto 48px;
}

/* Animated flow track — a horizontal line spanning the 4 step cards
   with a small gradient dot that travels along it on a loop, a literal
   visual of "the ride moving through stages". Purely decorative
   (aria-hidden), paused for reduced-motion so it still shows as a
   static connecting line rather than disappearing. */
.flow-track {
  position: relative;
  height: 2px;
  max-width: 900px;
  margin: 0 auto 8px;
  display: none;
}

.flow-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--border) 10%, var(--border) 90%, transparent);
}

.flow-dot {
  position: absolute;
  top: 50%;
  inset-inline-start: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px 2px rgba(240, 197, 99, 0.5);
  transform: translate(-50%, -50%);
  animation: travel 5s var(--ease-out) infinite;
}

@keyframes travel {
  0% { inset-inline-start: 0%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { inset-inline-start: 100%; opacity: 0; }
}

@media (min-width: 761px) {
  .flow-track { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-dot { animation: none; inset-inline-start: 50%; opacity: 1; }
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step {
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 18px;
  transition: transform 250ms var(--ease-out), border-color 250ms var(--ease-out), background-color 250ms var(--ease-out);
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 118, 240, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.step-icon, .trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(122, 118, 240, 0.18), rgba(240, 197, 99, 0.18));
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step-icon svg, .trust-icon svg { width: 22px; height: 22px; }

.step h3 { font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.step p { font-size: 13px; color: var(--ink-muted); }

.trust-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.trust-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 18px;
  text-align: center;
  transition: transform 250ms var(--ease-out), border-color 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

.trust-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 197, 99, 0.35);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.5);
}

.trust-card h3 { font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.trust-card p { font-size: 13px; color: var(--ink-muted); }

/* Screenshots */
.screenshot-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.screenshot-frame { flex: 0 0 200px; text-align: center; }

.screenshot-mock {
  width: 200px;
  height: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px 14px;
  box-shadow: 0 20px 45px -18px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

.screenshot-frame:hover .screenshot-mock {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 28px 55px -18px rgba(122, 118, 240, 0.3);
}

.screenshot-frame p { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }

/* Unified app-style header — same logo mark + menu icon on every
   feature frame, so they read as "screens of one real app" rather than
   five unrelated boxes. */
.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.feature-logo {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.feature-menu { display: flex; flex-direction: column; gap: 3px; }
.feature-menu i { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink-faint); font-style: normal; }

.feature-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(122, 118, 240, 0.16), rgba(240, 197, 99, 0.16));
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-icon--good { color: #4FD98A; background: rgba(79, 217, 138, 0.14); }

.feature-line { width: 70%; height: 10px; border-radius: 6px; background: var(--card-alt); }
.feature-line--wide { width: 85%; }
.feature-line--short { width: 45%; height: 8px; }

.feature-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.feature-pill--good { color: #4FD98A; background: rgba(79, 217, 138, 0.14); }

.feature-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card-alt);
  border: 1px solid var(--border);
}

.feature-badge {
  position: absolute;
  bottom: -4px;
  inset-inline-end: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
}
.feature-badge svg { width: 12px; height: 12px; }

/* Map-style illustrations — a simplified grid, two pins joined by a
   dashed route (maps), or a pulsing location dot (location tracking). */
.feature-map {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--card-alt);
  overflow: hidden;
}

.feature-route {
  position: absolute;
  top: 30%;
  inset-inline-start: 20%;
  width: 60%;
  height: 46%;
  border: 2px dashed var(--primary);
  border-inline-end: none;
  border-bottom: none;
  border-radius: 0 0 0 40px;
}

.feature-pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
  box-shadow: 0 0 8px rgba(240, 197, 99, 0.5);
}
.feature-pin--a { top: 26%; inset-inline-start: 17%; }
.feature-pin--b { top: 72%; inset-inline-start: 76%; background: var(--primary); box-shadow: 0 0 8px rgba(122, 118, 240, 0.5); }

.feature-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px 2px rgba(122, 118, 240, 0.6);
}

.feature-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  transform: translate(-50%, -50%);
  animation: radar 2.4s ease-out infinite;
}
.feature-radar--2 { animation-delay: 1.2s; }

@keyframes radar {
  0% { width: 12px; height: 12px; opacity: 0.8; }
  100% { width: 90px; height: 90px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-radar { animation: none; opacity: 0; }
}

.feature-toast {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-alt);
  border: 1px solid var(--border);
}

.feature-bell {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(240, 197, 99, 0.16);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-bell svg { width: 14px; height: 14px; }
.feature-bell--muted { background: transparent; color: var(--ink-faint); }

/* Legal content */
.legal { max-width: 760px; }

.back-link {
  display: inline-block;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 200ms var(--ease-out);
}
.back-link:hover { color: var(--primary); }

.legal h2 { color: var(--ink); font-size: 24px; margin-bottom: 8px; }
.legal-updated { font-size: 12px; color: var(--ink-faint); margin-bottom: 24px; }
.legal-section { margin-bottom: 20px; }
.legal-section h3 { font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.legal-section p { font-size: 13px; color: var(--ink-muted); line-height: 1.7; }
.legal-section a { color: var(--primary); text-decoration: underline; }

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 24px 40px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-muted); font-size: 13px; text-decoration: none; transition: color 200ms var(--ease-out); }
.footer-links a:hover { color: var(--accent); }

.footer-contact { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-contact a { color: var(--primary); font-size: 13px; text-decoration: none; font-weight: 600; transition: color 200ms var(--ease-out); }
.footer-contact a:hover { color: var(--accent); }

.footer-copyright { font-size: 12px; color: var(--ink-faint); }

@media (max-width: 760px) {
  .hero-inner { flex-direction: column; text-align: center; padding: 40px 20px 56px; }
  .hero-text { max-width: none; }
  .hero-eyebrow { margin-inline: auto; }
  .hero-sub { max-width: none; margin-inline: auto; }
  .store-badges { justify-content: center; }
  .phone-mockup { width: 180px; height: 300px; }
  .steps, .trust-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 32px; }
  .steps, .trust-cards { grid-template-columns: 1fr; }
}
