/* ============================================================
   دوامي — Landing page
   الألوان مأخوذة حرفياً من AppPalette في
   lib/core/constants/design_tokens.dart — لا تُخترع هنا قيمة جديدة.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Tajawal';
  src: url('../fonts/tajawal-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('../fonts/tajawal-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('../fonts/tajawal-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* الهوية — AppPalette.light + brandGradient */
  --brand:        #16255C;
  --brand-2:      #2B4394;
  --brand-ink:    #0C1738;
  --accent:       #8A5A0B;   /* ذهبي للمال على سطح فاتح */
  --accent-bright:#E9B44C;   /* ذهبي فوق تدرّج العلامة الداكن */
  --positive:     #15803D;
  --positive-2:   #34D399;
  --negative:     #DC2626;
  --warning:      #B45309;
  --info:         #1D4ED8;
  --green-deep:   #04503A;
  --green-mid:    #0C7A56;

  --bg:           #F2F2F2;
  --surface:      #FFFFFF;
  --surface-alt:  #F7F7F9;
  --ink:          #1E212B;
  --ink-soft:     #5F6470;
  --line:         #E8E9ED;

  --brand-tint:   rgba(22, 37, 92, .055);
  --brand-tint-2: rgba(22, 37, 92, .10);

  /* الظل محايد دائماً — لا هالة ملوّنة */
  --shadow-sm: 0 1px 2px rgba(27,36,64,.05),  0 4px 12px rgba(27,36,64,.045);
  --shadow-md: 0 2px 6px rgba(27,36,64,.06),  0 14px 30px rgba(27,36,64,.07);
  --shadow-lg: 0 4px 14px rgba(27,36,64,.07), 0 30px 64px rgba(27,36,64,.11);
  --shadow-phone: 0 10px 26px rgba(27,36,64,.13), 0 54px 96px rgba(27,36,64,.20);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shell: 1200px;
  --header-h: 68px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

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

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

body {
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.skip-link {
  position: fixed; inset-block-start: 8px; inset-inline-start: 8px;
  z-index: 200; background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: var(--r-sm);
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

/* ---------- Typography helpers ---------- */
.section__title {
  font-weight: 700;
  font-size: clamp(1.65rem, 1.15rem + 2.1vw, 2.85rem);
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--brand-ink);
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 500;
  color: var(--brand);
  background: var(--brand-tint);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.eyebrow--muted { color: var(--ink-soft); background: transparent; padding: 0; margin-bottom: 12px; }
.eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 4px rgba(21,128,61,.14);
}

.section { padding-block: clamp(72px, 9vw, 140px); }
.section__head { margin-bottom: clamp(40px, 5vw, 64px); }
.section__head--center { text-align: center; max-width: 760px; margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1rem;
  padding: 13px 24px;
  min-height: 48px;
  border-radius: var(--r-pill);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              background-color .22s var(--ease), border-color .22s var(--ease);
  will-change: transform;
}
.btn--sm { padding: 9px 18px; min-height: 42px; font-size: .9375rem; }
.btn--lg { padding: 15px 30px; min-height: 54px; font-size: 1.0625rem; }

.btn__icon { width: 20px; height: 20px; flex: none; }
.btn__icon--chevron { transition: transform .22s var(--ease); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn--primary:active { transform: translateY(-1px); }

.btn--accent {
  background: var(--accent-bright);
  color: #1A1204;
  box-shadow: 0 10px 30px rgba(233,180,76,.28);
}
.btn--accent:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(233,180,76,.36); }
.btn--accent:active { transform: translateY(-1px); }

.btn--ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
}
.btn--ghost:hover { transform: translateY(-3px); border-color: var(--brand-tint-2); box-shadow: var(--shadow-sm); }
.btn--ghost:hover .btn__icon--chevron { transform: translateX(-4px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease),
              backdrop-filter .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  width: 100%;
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand) 0%, #23386E 100%);
  color: #EEF1F7;
  box-shadow: var(--shadow-sm);
}
.brand__mark svg { width: 22px; height: 22px; }
.brand__name { font-weight: 700; font-size: 1.25rem; color: var(--brand-ink); letter-spacing: -.01em; }

.site-nav {
  display: flex; align-items: center; gap: 4px;
  margin-inline-start: auto;
}
.site-nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: .9375rem; font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--r-sm);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.site-nav__link:hover { color: var(--brand); background: var(--brand-tint); }
.site-nav__link.is-current { color: var(--brand); font-weight: 700; }

.site-header__actions { display: flex; align-items: center; gap: 10px; margin-inline-start: 8px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  padding: 11px;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle__bar {
  display: block; height: 2px; width: 100%;
  background: var(--brand-ink); border-radius: 2px;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s var(--ease);
}
.nav-scrim.is-open { opacity: 1; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding-block: calc(var(--header-h) + clamp(40px, 7vw, 80px)) clamp(72px, 9vw, 120px);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(43,67,148,.10) 0%, transparent 60%),
    radial-gradient(90% 70% at 10% 0%, rgba(22,37,92,.07) 0%, transparent 55%),
    linear-gradient(180deg, #FBFBFC 0%, var(--bg) 100%);
}
.hero__glow {
  position: absolute; inset-block-start: -20%; inset-inline-start: 45%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, rgba(43,67,148,.14) 0%, transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.hero__grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to left, rgba(22,37,92,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22,37,92,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero__title {
  font-weight: 700;
  font-size: clamp(2.1rem, 1.2rem + 3.9vw, 4rem);
  line-height: 1.24;
  letter-spacing: -.022em;
  color: var(--brand-ink);
  text-wrap: balance;
  margin-bottom: 22px;
}
.hero__title-em {
  display: block;
  background: linear-gradient(100deg, var(--brand) 10%, #3C5AB8 60%, var(--brand) 95%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero__title-dots { color: var(--ink-soft); font-weight: 500; letter-spacing: .05em; }

.hero__lede {
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 34px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }

.hero__proof {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-size: .9375rem; color: var(--ink-soft);
}
.hero__proof li { display: flex; align-items: center; gap: 8px; }
.hero__proof li::before {
  content: ''; width: 16px; height: 16px; flex: none;
  border-radius: 50%;
  background: rgba(21,128,61,.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m5 13 4.5 4.5L19 7' stroke='%2315803D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 10px; background-repeat: no-repeat; background-position: center;
}

.hero__scroll {
  position: absolute; inset-block-end: 26px; inset-inline: 0;
  margin-inline: auto; width: 28px; height: 44px;
  display: grid; place-items: center;
  opacity: .5; transition: opacity .25s var(--ease);
}
.hero__scroll:hover { opacity: .9; }
.hero__scroll-mouse {
  width: 22px; height: 36px;
  border: 2px solid var(--brand); border-radius: var(--r-pill);
  display: grid; justify-items: center; padding-top: 6px;
}
.hero__scroll-mouse i {
  width: 3px; height: 7px; border-radius: 2px; background: var(--brand);
  animation: scroll-hint 1.9s var(--ease-soft) infinite;
}
@keyframes scroll-hint {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(8px); opacity: .2; }
}

/* ============================================================
   3D stage — phone + floating chips
   ============================================================ */
.stage {
  position: relative;
  /* العرض يساوي عرض الهاتف: البطاقات الطائرة تُوضع بنسبة منه لا من العمود */
  width: fit-content;
  margin-inline: auto;
  display: grid; place-items: center;
  perspective: 1400px;
  perspective-origin: 50% 45%;
  --rx: 0deg; --ry: 0deg; --px: 0; --py: 0;
}
.stage__halo {
  position: absolute; inset-block-end: 2%; inset-inline: 12%;
  height: 60px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(27,36,64,.22) 0%, transparent 70%);
  filter: blur(18px);
}

.phone {
  position: relative;
  --bezel: clamp(6px, .75vw, 9px);
  --phone-w: clamp(220px, 24vw, 300px);
  width: var(--phone-w);
  height: calc(2 * var(--bezel) + (var(--phone-w) - 2 * var(--bezel)) * 1564 / 720);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transition: transform .45s var(--ease-soft);
}
.phone--hero { animation: phone-float 7s var(--ease-soft) infinite; }
@keyframes phone-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -14px; }
}

.phone__frame {
  position: absolute; inset: 0;
  border-radius: clamp(30px, 3.4vw, 42px);
  padding: var(--bezel);
  background: linear-gradient(155deg, #2A3348 0%, #0B1020 42%, #161C2E 100%);
  box-shadow:
    var(--shadow-phone),
    inset 0 0 0 1px rgba(255,255,255,.10);
  overflow: hidden;
}
.phone__screen {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  border-radius: clamp(25px, 2.9vw, 35px);
  background: var(--surface-alt);
}

/* Floating chips */
.chip {
  position: absolute;
  z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232,233,237,.9);
  border-radius: var(--r-md);
  padding: 11px 14px;
  box-shadow: var(--shadow-md);
  font-size: .8125rem;
  white-space: nowrap;
  animation: chip-float 6.5s var(--ease-soft) infinite;
  animation-delay: var(--delay, 0s);
  translate:
    calc(var(--ox, 0%) + var(--px) * var(--depth) * -1px)
    calc(var(--py) * var(--depth) * -1px);
  transition: translate .5s var(--ease-soft);
}
@keyframes chip-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -11px, 0); }
}

.chip__icon {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center; border-radius: 8px;
}
.chip__icon svg { width: 15px; height: 15px; }
.chip__icon--ok   { background: rgba(21,128,61,.12);  color: var(--positive); }
.chip__icon--up   { background: rgba(21,128,61,.12);  color: var(--positive); }
.chip__icon--info { background: rgba(29,78,216,.10);  color: var(--info); }

.chip__text  { font-weight: 500; color: var(--ink); }
.chip__stack { display: grid; }
.chip__label { display: block; font-size: .6875rem; color: var(--ink-soft); line-height: 1.5; }
.chip__value { display: block; font-weight: 700; font-size: 1rem; color: var(--accent); line-height: 1.4; }
.chip__value small { font-size: .625rem; font-weight: 500; color: var(--ink-soft); }
.chip__value--sm { font-size: .8125rem; color: var(--positive); }

.chip__bar {
  display: block; width: 92px; height: 6px; margin-top: 5px;
  border-radius: var(--r-pill); background: var(--line); overflow: hidden;
}
.chip__bar i {
  display: block; height: 100%; width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
}

/* تتناوب البطاقات بين جانبي الهاتف، وكل واحدة تُدفع للخارج بـ --ox
   فيبقى ثلثها فوق الجهاز — تطفو أمامه ولا تحجب الشاشة. */
.chip--check    { inset-block-start: 7%;  inset-inline-start: 0; --ox:  55%; }
.chip--salary   { inset-block-start: 25%; inset-inline-end: 0;   --ox: -58%; }
.chip--overtime { inset-block-start: 47%; inset-inline-start: 0; --ox:  58%; }
.chip--report   { inset-block-start: 69%; inset-inline-end: 0;   --ox: -55%; }
.chip--expense  { inset-block-end: 6%;    inset-inline-start: 0; --ox:  52%; }

/* ============================================================
   Problem
   ============================================================ */
.section--problem { background: var(--surface); }

.problems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(20px, 2.6vw, 32px);
}
.problem {
  position: relative;
  padding: 30px 26px;
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.problem:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.problem__num {
  display: block;
  font-size: 1.75rem; font-weight: 700;
  color: var(--brand);
  opacity: .38;
  line-height: 1; margin-bottom: 16px;
}
.problem__title { font-size: 1.1875rem; font-weight: 700; color: var(--brand-ink); margin-bottom: 8px; }
.problem__text  { color: var(--ink-soft); font-size: .9688rem; }

.problem__answer {
  position: relative;
  margin-block-start: clamp(48px, 6vw, 80px);
  text-align: center;
  font-size: clamp(1.5rem, 1rem + 2.2vw, 2.6rem);
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: -.015em;
}
.problem__answer-line {
  display: block;
  width: 2px; height: clamp(32px, 5vw, 56px);
  margin: 0 auto 26px;
  background: linear-gradient(180deg, transparent, var(--brand));
  opacity: .35;
}

/* ============================================================
   Features
   ============================================================ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}
.feature {
  padding: 30px 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .32s var(--ease);
}
.feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(22,37,92,.14);
}
/* عمودان فقط حيث يوجد عمودان فعلاً: تحت هذا الحد يفرض span
   عموداً ثانياً ضمنياً فيتمدّد المستند أفقياً على الهاتف. */
.feature--wide { grid-column: span 1; }
@media (min-width: 640px) {
  .feature--wide { grid-column: span 2; }
}

.feature__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  margin-bottom: 18px;
  transition: transform .32s var(--ease);
}
.feature:hover .feature__icon { transform: scale(1.06) rotate(-3deg); }
.feature__icon svg { width: 23px; height: 23px; }
.feature__icon--brand    { background: rgba(22,37,92,.08);  color: var(--brand); }
.feature__icon--accent   { background: rgba(138,90,11,.10); color: var(--accent); }
.feature__icon--positive { background: rgba(21,128,61,.10); color: var(--positive); }
.feature__icon--negative { background: rgba(220,38,38,.09); color: var(--negative); }
.feature__icon--info     { background: rgba(29,78,216,.09); color: var(--info); }
.feature__icon--warning  { background: rgba(180,83,9,.10);  color: var(--warning); }

.feature__title { font-size: 1.125rem; font-weight: 700; color: var(--brand-ink); margin-bottom: 8px; }
.feature__text  { color: var(--ink-soft); font-size: .9375rem; }

/* ============================================================
   Showcase
   ============================================================ */
.section--showcase { background: var(--surface); }

.showcase {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.showcase__sticky {
  position: sticky;
  inset-block-start: calc(var(--header-h) + clamp(24px, 6vh, 72px));
  display: grid; place-items: center;
}
.stage--showcase { margin-inline: auto; }
.phone--showcase { --phone-w: clamp(210px, 22vw, 286px); }

.phone--showcase .phone__frame > .phone__screen {
  /* ‏العنصر بديل (img): مع width/height: auto لا يمدّه inset بل يأخذ مقاسه
     الذاتي فيتجاوز حافة الإطار. لذلك يُصرَّح بالمقاس بدل تركه للـ inset. */
  position: absolute; inset: var(--bezel);
  width: calc(100% - 2 * var(--bezel));
  height: calc(100% - 2 * var(--bezel));
  opacity: 0;
  transform: scale(1.02);
  filter: blur(6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), filter .5s var(--ease);
}
.phone--showcase .phone__frame > .phone__screen:first-child { opacity: 1; transform: none; filter: none; }
.phone--showcase .phone__screen.is-active {
  opacity: 1; transform: scale(1); filter: blur(0);
}

.showcase__head { margin-bottom: clamp(28px, 4vw, 44px); }
.showcase__steps { display: grid; }

.step {
  padding-block: clamp(40px, 8vh, 88px);
  opacity: 1;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  transform: translateY(6px);
  border-top: 1px solid var(--line);
}
.js .step { opacity: .72; }
.step:first-of-type { border-top: 0; padding-block-start: 0; }
.step.is-active { opacity: 1; transform: translateY(0); }

.step__index {
  display: inline-block;
  font-size: .8125rem; font-weight: 700;
  color: var(--brand);
  background: var(--brand-tint);
  padding: 4px 12px; border-radius: var(--r-pill);
  margin-bottom: 14px;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.step.is-active .step__index { background: var(--brand); color: #fff; }
.step__title {
  font-size: clamp(1.3rem, 1rem + 1.1vw, 1.75rem);
  font-weight: 700; color: var(--brand-ink);
  margin-bottom: 10px; letter-spacing: -.012em;
}
.step__text { color: var(--ink); max-width: 46ch; }

/* ============================================================
   Orbit — dark section
   ============================================================ */
.section--orbit {
  position: relative;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(43,67,148,.55) 0%, transparent 60%),
    linear-gradient(165deg, var(--brand) 0%, #0D183C 55%, #0A1130 100%);
  overflow: hidden;
}
.section--orbit .section__title { color: #F2F5FC; }
.section--orbit .hero__title-dots { color: rgba(203,213,225,.85); }

.orbit {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1;
  width: min(100%, 620px);
  margin-inline: auto;
  perspective: 1200px;
}
.orbit__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(203,213,225,.13);
}
.orbit__ring--outer { inset: 0; }
.orbit__ring--inner { inset: 16%; border-color: rgba(203,213,225,.08); }

.orbit__center { position: relative; z-index: 2; }
.phone--orbit { --phone-w: clamp(148px, 20vw, 196px); }
.phone--orbit .phone__frame { box-shadow: 0 18px 40px rgba(0,0,0,.42), 0 60px 110px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.14); }

.orbit__track {
  position: absolute; inset: 0;
  transform: rotate(var(--spin, 0deg));
  transition: transform .1s linear;
}
.orbit__item {
  position: absolute;
  inset-block-start: 50%; inset-inline-start: 50%;
  transform: rotate(var(--angle)) translate(calc(min(46vw, 280px) * -1)) rotate(calc(var(--angle) * -1)) rotate(calc(var(--spin, 0deg) * -1));
  transition: transform .1s linear;
}
.orbit__chip {
  display: inline-flex; align-items: center; gap: 9px;
  transform: translate(50%, -50%);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(203,213,225,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #DCE3F2;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: .875rem; font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
.orbit__chip svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.orbit__chip--accent { color: var(--accent-bright); border-color: rgba(233,180,76,.32); background: rgba(233,180,76,.10); }

/* ============================================================
   Trust
   ============================================================ */
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  max-width: 940px; margin-inline: auto;
}
.trust__item {
  text-align: center;
  padding: 34px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.trust__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.trust__icon {
  width: 52px; height: 52px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(22,37,92,.09), rgba(43,67,148,.05));
  color: var(--brand);
}
.trust__icon svg { width: 25px; height: 25px; }
.trust__title { font-size: 1.0625rem; font-weight: 700; color: var(--brand-ink); }

/* ============================================================
   FAQ
   ============================================================ */
.section--faq { background: var(--surface); }

.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin-inline: auto;
}

.faq__item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: background-color .3s var(--ease), border-color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.faq__item:hover { border-color: rgba(22,37,92,.14); }
.faq__item[open] {
  background: var(--surface);
  border-color: rgba(22,37,92,.14);
  box-shadow: var(--shadow-sm);
}

/* المثلث الافتراضي يُزال في المحركين، والسهم الخاص يحلّ محلّه. */
.faq__q {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px;
  min-height: 56px;
  cursor: pointer;
  font-weight: 700; font-size: 1.0625rem; line-height: 1.6;
  color: var(--brand-ink);
  list-style: none;
  border-radius: inherit;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::marker { content: ''; }
.faq__q-text { text-wrap: pretty; }

.faq__icon {
  width: 28px; height: 28px; flex: none;
  margin-inline-start: auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
  transition: transform .28s var(--ease), background-color .28s var(--ease);
}
.faq__icon svg { width: 15px; height: 15px; }
.faq__item[open] .faq__icon { transform: rotate(180deg); background: var(--brand-tint-2); }

.faq__a {
  padding: 0 24px 22px;
  color: var(--ink-soft);
  font-size: .9688rem;
}
.faq__a a {
  color: var(--brand); font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--brand-tint-2);
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.faq__a a:hover { color: var(--brand-2); text-decoration-color: currentColor; }

/* ============================================================
   Final CTA
   ============================================================ */
.cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(36px, 5vw, 68px);
  border-radius: var(--r-xl);
  background: linear-gradient(140deg, var(--brand) 0%, #22377C 48%, #101C46 100%);
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.cta__glow {
  position: absolute; inset-block-start: -60%; inset-inline-end: -10%;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(233,180,76,.20) 0%, transparent 62%);
  filter: blur(20px); pointer-events: none;
}
.cta__copy { position: relative; z-index: 1; }
.cta__title {
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem);
  font-weight: 700; line-height: 1.35; letter-spacing: -.018em;
  margin-bottom: 12px; text-wrap: balance;
}
.cta__text { color: rgba(226,232,240,.86); font-size: clamp(1rem, .96rem + .3vw, 1.125rem); margin-bottom: 28px; max-width: 46ch; }
.cta__actions { margin-bottom: 24px; }

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 10px 20px 10px 18px;
  min-height: 52px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  transition: transform .22s var(--ease), background-color .22s var(--ease), border-color .22s var(--ease);
}
.store-badge:hover { transform: translateY(-3px); background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }
.store-badge--soon { opacity: .7; cursor: default; }
.store-badge--soon:hover { transform: none; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.store-badge__icon { width: 26px; height: 26px; flex: none; }
.store-badge__text { display: grid; line-height: 1.3; text-align: start; }
.store-badge__text small  { font-size: .6875rem; opacity: .75; font-weight: 400; }
.store-badge__text strong { font-size: 1rem; font-weight: 700; }

.cta__qr { position: relative; z-index: 1; }
.qr-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 18px 18px 14px;
  text-align: center;
  box-shadow: 0 18px 44px rgba(0,0,0,.26);
  width: 190px;
}
.qr-card__img { width: 150px; height: 150px; margin: 0 auto 10px; }
.qr-card__text { font-size: .75rem; color: var(--ink-soft); line-height: 1.5; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: 40px;
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 18px 32px;
}
.brand--footer { margin-inline-end: auto; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9375rem; }
.site-footer__nav a { color: var(--ink-soft); transition: color .2s var(--ease); }
.site-footer__nav a:hover { color: var(--brand); }
.site-footer__note {
  width: 100%;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 6px 24px;
  font-size: .8125rem; color: var(--ink-soft);
  padding-top: 8px; border-top: 1px solid var(--line);
}
.site-footer__credits { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.site-footer__credits-names {
  color: var(--ink); font-weight: 600;
  letter-spacing: .02em; white-space: nowrap;
}

/* ============================================================
   Download modal
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__panel {
  position: relative;
  width: min(100%, 400px);
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 38px 32px 30px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(15,23,42,.32);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.modal.is-open .modal__panel { opacity: 1; transform: translateY(0) scale(1); }

.modal__close {
  position: absolute; inset-block-start: 14px; inset-inline-end: 14px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.modal__close:hover { background: var(--surface-alt); color: var(--ink); }
.modal__close svg { width: 20px; height: 20px; }

.modal__title { font-size: 1.375rem; font-weight: 700; color: var(--brand-ink); margin-bottom: 6px; }
.modal__sub   { font-size: .9375rem; color: var(--ink-soft); margin-bottom: 24px; }

.modal__qr {
  display: inline-grid; place-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  margin-bottom: 24px;
}
.modal__qr img { width: 170px; height: 170px; }

.modal__badges { display: grid; gap: 10px; }
.modal__badges .store-badge {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink);
  justify-content: center;
}
.modal__badges .store-badge:hover { background: #EDEFF3; border-color: rgba(22,37,92,.16); }
.modal__badges .store-badge--soon:hover { background: var(--surface-alt); border-color: var(--line); }
.modal__badges .store-badge__text small { color: var(--ink-soft); opacity: 1; }

/* نص العلامة متدرّج عبر background-clip، ولونه transparent —
   في وضع التباين القسري لا يُرسم التدرّج فيختفي النص تماماً. */
@media (forced-colors: active) {
  .hero__title-em {
    background: none;
    -webkit-background-clip: border-box; background-clip: border-box;
    color: CanvasText;
  }
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(5px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; filter: blur(0); }

/* ============================================================
   Responsive
   ============================================================ */

/* Large desktop */
@media (min-width: 1440px) {
  :root { --shell: 1280px; }
}

/* Laptop and below — narrower hero copy */
@media (max-width: 1080px) {
  .chip--report { display: none; }
  .chip--salary   { --ox: -46%; }
  .chip--overtime { --ox:  46%; }
  .chip--expense  { --ox:  42%; }
}

/* Tablet */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { display: grid; justify-items: center; }
  .hero__lede { margin-inline: auto; }
  .hero__actions, .hero__proof { justify-content: center; }
  .hero__stage { margin-top: 8px; }
  .phone { --phone-w: clamp(210px, 42vw, 268px); }

  .showcase { grid-template-columns: 1fr; }
  .showcase__sticky {
    inset-block-start: calc(var(--header-h) + 8px);
    padding-block: 14px 18px;
    z-index: 5;
    background: linear-gradient(180deg, var(--surface) 72%, rgba(255,255,255,0));
  }
  .phone--showcase { --phone-w: clamp(140px, 34vw, 180px); }
  .showcase__head { text-align: center; }
  .step { text-align: center; padding-block: clamp(32px, 6vh, 56px); }
  .step__text { margin-inline: auto; }

  .cta { grid-template-columns: 1fr; text-align: center; }
  .cta__text { margin-inline: auto; }
  .store-badges { justify-content: center; }
  .cta__qr { display: none; }

  .site-footer__inner { justify-content: center; text-align: center; }
  .brand--footer { margin-inline-end: 0; width: 100%; justify-content: center; }
  .site-footer__nav { justify-content: center; width: 100%; }
  .site-footer__note { text-align: center; justify-content: center; }
  .site-footer__credits { justify-content: center; width: 100%; }
}

/* Mobile navigation */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-header__cta { display: none; }

  .site-nav {
    position: fixed;
    inset-block-start: var(--header-h);
    inset-inline: 12px;
    z-index: 95;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(.985);
    transform-origin: top center;
    transition: opacity .26s var(--ease), transform .26s var(--ease), visibility .26s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
  .site-nav__link { padding: 13px 16px; font-size: 1rem; min-height: 48px; display: flex; align-items: center; }
}

/* Phone */
@media (max-width: 620px) {
  :root { --header-h: 62px; }

  .hero { padding-block-start: calc(var(--header-h) + 28px); }
  .hero__title { font-size: clamp(1.9rem, 1.2rem + 4.4vw, 2.6rem); }
  .hero__proof { gap: 8px 16px; font-size: .8438rem; }
  .hero__actions .btn { width: 100%; }
  .hero__scroll { display: none; }

  /* على الهاتف تبقى بطاقتان فقط حتى لا تتداخل مع الجهاز */
  .chip--overtime, .chip--expense { display: none; }
  .chip { padding: 9px 12px; font-size: .75rem; }
  .chip--check  { inset-block-start: 5%;  --ox:  32%; }
  .chip--salary { inset-block-start: 62%; --ox: -24%; }
  .chip__value  { font-size: .875rem; }

  .phone { --phone-w: min(62vw, 240px); }

  .problem, .feature, .trust__item { padding: 24px 20px; }
  .faq__q { padding: 16px 18px; font-size: 1rem; gap: 10px; }
  .faq__a { padding: 0 18px 18px; }
  .cta { padding: 32px 22px; }
  .store-badges { flex-direction: column; }
  .store-badge { justify-content: center; }

  .orbit { width: min(100%, 360px); }
  .orbit__item { transform: rotate(var(--angle)) translate(calc(min(38vw, 150px) * -1)) rotate(calc(var(--angle) * -1)) rotate(calc(var(--spin, 0deg) * -1)); }
  .orbit__chip { padding: 7px 11px; font-size: .75rem; gap: 6px; }
  .orbit__chip svg { width: 14px; height: 14px; }

  .modal__panel { padding: 32px 22px 26px; }
  .modal__qr img { width: 150px; height: 150px; }
}

/* Very small */
@media (max-width: 380px) {
  .orbit__chip span { display: none; }
}

/* ============================================================
   Reduced motion / low-power — الموقع يبقى جميلاً بلا حركة
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .step { opacity: 1; transform: none; }
  .phone { transform: none; }
}

/* JS يضيف هذا الصنف على أجهزة ضعيفة أو عند طلب تقليل الحركة */
.no-motion .phone { transform: none !important; animation: none !important; }
.no-motion .chip  { animation: none !important; translate: var(--ox, 0%) 0 !important; }
.no-motion .orbit__track { transform: none !important; }
.no-motion .orbit__item  { transform: rotate(var(--angle)) translate(calc(min(46vw, 280px) * -1)) rotate(calc(var(--angle) * -1)) !important; }
.no-motion .reveal { opacity: 1; transform: none; filter: none; }
.no-motion .step   { opacity: 1; transform: none; }
.no-motion .hero__scroll-mouse i { animation: none; }
.no-motion .faq__icon { transition: none; }
