/* Styles for the static, crawlable khedma.ai landing pages (all 17 languages).
   CSS logical properties (inline-start/end, text-align:start) keep one sheet
   working for LTR and RTL. Loaded from /landing.css (CSP style-src 'self').
   The #landing rules are scoped so they never touch the React app in #root.

   The html/body reset + base background are INTENTIONALLY UNSCOPED: the
   /<lang>/ pages are copied from public/ and do NOT get the SPA's bundled CSS
   reset, so without this they fall back to the UA default (8px body margin,
   white background) which showed as a white frame and overscroll. */

/* ── base reset / page surface ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html{ background:#04060f; -webkit-text-size-adjust:100%; scroll-behavior:smooth; scrollbar-color:#2b3658 transparent; }
body{ margin:0; min-height:100vh; background:#04060f; overflow-x:clip; text-wrap:pretty; }
/* Empty SPA mount node (English page) would otherwise add a blank viewport
   below the footer because the app stylesheet sets #root{height:100%}. */
#root:empty{ display:none; }

/* iOS-style colour emoji, subset to ONLY the ~10 glyphs used (~60KB). */
@font-face{
  font-family:'KhedmaEmoji';
  src:url('/fonts/khedma-emoji.woff2') format('woff2');
  font-display:swap;
  unicode-range:U+1F465,U+1F4C5,U+2728,U+1F5C2,U+1F514,U+1F4CA,U+1F3EB,U+1F392,U+26EA,U+1F331,U+FE0F;
}

:root{
  --bg:#04060f; --bg-soft:#070b18; --card:#0b1122; --card-top:rgba(255,255,255,.022);
  --line:#1b2440; --line-soft:#141b32; --line-strong:#2c385d;
  --text:#eef1f8; --muted:#a8b0c5; --muted-soft:#828bA3;
  --indigo:#6366f1; --indigo-bright:#818cf8;
  --accent-text:#bcc4ff;      /* small accent text, clears AAA (>=7:1) on the bg */
  --violet:#c4b5fd;
  --btn-top:#4338ca; --btn-bot:#37309e;   /* white label hits AAA across the gradient */
  --ease-quart:cubic-bezier(.25,1,.5,1);
  --ease-quint:cubic-bezier(.22,1,.36,1);
  --ease-expo:cubic-bezier(.16,1,.3,1);
  --maxw:1120px;
  --pad-section:clamp(56px,8vw,92px);
  --pad-inline:clamp(18px,5vw,26px);
}

#landing *{ box-sizing:border-box; }
#landing{
  font-family:'KhedmaEmoji','Almarai',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans','Noto Color Emoji','Apple Color Emoji','Segoe UI Emoji',sans-serif;
  color:var(--text); background:var(--bg); line-height:1.65; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; overflow-x:clip;
}
#landing a{ color:inherit; text-decoration:none; }

/* ── skip link (SC 2.4.1) ──────────────────────────────────────────────────── */
.skip{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }
.skip:focus{ position:fixed; top:8px; inset-inline-start:8px; width:auto; height:auto; margin:0; overflow:visible; clip:auto; clip-path:none; white-space:normal; z-index:1000; padding:12px 18px; border-radius:12px; font-weight:700; color:var(--text); background:var(--card); border:1px solid var(--line-strong); outline:2px solid var(--indigo-bright); outline-offset:2px; }
#landing ::selection{ background:rgba(129,140,248,.32); color:#fff; }
#landing .wrap{ max-width:var(--maxw); margin:0 auto; padding-inline:var(--pad-inline); }

/* ── header / nav ──────────────────────────────────────────────────────────── */
#landing header{ position:sticky; top:0; z-index:30; backdrop-filter:blur(12px); background:rgba(4,6,15,.66); border-bottom:1px solid var(--line-soft); }
#landing nav{ display:flex; align-items:center; justify-content:space-between; height:66px; gap:16px; }
#landing .brand{ display:inline-flex; align-items:center; gap:10px; font-weight:800; font-size:18px; letter-spacing:-.01em; }
#landing .brand svg{ width:30px; height:30px; border-radius:9px; flex:none; transition:transform .35s var(--ease-quint); }
#landing .brand:hover svg{ transform:rotate(-6deg) scale(1.06); }
#landing .navlinks{ display:flex; align-items:center; gap:clamp(14px,2.4vw,24px); flex-wrap:wrap; }
#landing .navlinks a{ color:var(--muted); font-size:14px; font-weight:600; transition:color .18s var(--ease-quart); }
#landing .navlinks a:hover{ color:var(--text); }
#landing .navlinks a:not(.btn){ position:relative; }
#landing .navlinks a:not(.btn)::after{ content:""; position:absolute; inset-inline:0; bottom:-6px; height:2px; border-radius:2px; background:var(--indigo-bright); transform:scaleX(0); transition:transform .24s var(--ease-quart); }
#landing .navlinks a:not(.btn):hover::after{ transform:scaleX(1); }

/* ── buttons ───────────────────────────────────────────────────────────────── */
#landing .btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size:15px; min-height:46px; padding:12px 22px; border-radius:12px; cursor:pointer; white-space:nowrap; transition:transform .2s var(--ease-quart), box-shadow .2s var(--ease-quart), background .2s, border-color .2s; }
/* Deep-indigo gradient + inset top highlight (premium, not a flat fill). White
   label hits ~7.9:1 (AAA). text-fill-color set so the label can never inherit a
   transparent fill. */
#landing .btn-primary{ background:linear-gradient(180deg,var(--btn-top),var(--btn-bot)); color:#fff; -webkit-text-fill-color:#fff; box-shadow:0 1px 0 rgba(255,255,255,.15) inset, 0 10px 24px -12px rgba(67,56,202,.85); }
#landing .btn-primary:hover{ transform:translateY(-2px); box-shadow:0 1px 0 rgba(255,255,255,.22) inset, 0 18px 38px -14px rgba(99,102,241,.9); }
#landing .btn-ghost{ border:1px solid var(--line-strong); color:var(--text); background:rgba(255,255,255,.015); }
#landing .btn-ghost:hover{ transform:translateY(-2px); border-color:var(--indigo-bright); background:rgba(99,102,241,.1); }
#landing .btn:active{ transform:translateY(0) scale(.98); }

/* ── sections / rhythm ─────────────────────────────────────────────────────── */
#landing section{ padding-block:var(--pad-section); border-bottom:1px solid var(--line-soft); }
#landing h2{ font-size:clamp(27px,4.2vw,42px); font-weight:800; letter-spacing:-.025em; line-height:1.12; margin:0 0 16px; text-align:center; text-wrap:balance; }
#landing h3{ font-size:18px; font-weight:700; letter-spacing:-.01em; margin:0 0 8px; }
#landing p{ margin:0 0 16px; }
#landing .sub{ color:var(--muted); text-align:center; max-width:62ch; margin:0 auto 40px; font-size:clamp(15px,1.6vw,17px); }
#landing .prose{ max-width:72ch; margin:0 auto; text-align:start; }
#landing .prose p{ color:#d6dbe8; }
#landing .prose ul{ padding:0; list-style:none; margin:0 0 16px; }
#landing .prose ul li{ position:relative; padding-inline-start:28px; margin-bottom:12px; color:#d6dbe8; }
#landing .prose ul li::before{ content:""; position:absolute; inset-inline-start:7px; top:11px; width:7px; height:7px; border-radius:50%; background:var(--indigo-bright); box-shadow:0 0 0 4px rgba(99,102,241,.12); }
#landing .featured{ background:linear-gradient(180deg,rgba(99,102,241,.1),rgba(99,102,241,.05)); border:1px solid rgba(129,140,248,.32); border-radius:16px; padding:clamp(20px,3vw,26px); font-size:clamp(16px,2vw,19px); color:#e7eaf4; max-width:72ch; }

/* ── hero ──────────────────────────────────────────────────────────────────── */
#landing .hero{ position:relative; overflow:hidden; text-align:center; padding-block:clamp(72px,11vw,118px); border-bottom:1px solid var(--line-soft); }
#landing .hero::before{ content:""; position:absolute; inset:-22% -10% auto; height:600px; z-index:0; pointer-events:none;
  background:radial-gradient(620px 320px at 30% 18%,rgba(99,102,241,.20),transparent 70%), radial-gradient(560px 300px at 74% 8%,rgba(168,132,252,.14),transparent 70%);
  animation:hero-aura 17s var(--ease-quart) infinite alternate; }
#landing .hero .wrap{ position:relative; z-index:1; }
#landing .badge{ display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--accent-text); background:rgba(99,102,241,.12); border:1px solid rgba(129,140,248,.4); padding:7px 15px; border-radius:999px; margin-bottom:26px; }
#landing h1{ font-size:clamp(36px,7vw,72px); line-height:1.05; font-weight:800; letter-spacing:-.03em; margin:0 0 22px; text-wrap:balance; }
#landing h1 .grad{ color:var(--violet); -webkit-text-fill-color:var(--violet); }
#landing .lede{ font-size:clamp(16px,2.1vw,21px); color:var(--muted); max-width:64ch; margin:0 auto 14px; }
#landing .hero-cta{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin:32px 0 16px; }
#landing .fine{ font-size:13px; color:var(--muted-soft); }

/* ── feature grid ──────────────────────────────────────────────────────────── */
#landing .grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(258px,1fr)); gap:clamp(14px,1.8vw,20px); margin-top:8px; }
#landing .card{ position:relative; background:linear-gradient(180deg,var(--card-top),transparent), var(--card); border:1px solid var(--line); border-radius:18px; padding:clamp(20px,2.4vw,26px); text-align:start; transition:transform .28s var(--ease-quart), border-color .28s, box-shadow .28s; }
#landing .card:hover{ transform:translateY(-5px); border-color:var(--indigo-bright); box-shadow:0 26px 54px -30px rgba(99,102,241,.6); }
#landing .card .ic{ width:46px; height:46px; border-radius:13px; background:radial-gradient(120% 120% at 30% 20%,rgba(129,140,248,.28),rgba(99,102,241,.12)); display:flex; align-items:center; justify-content:center; margin-bottom:16px; font-size:22px; transition:transform .28s var(--ease-quint); }
#landing .card:hover .ic{ transform:scale(1.09) rotate(-3deg); }
#landing .card h3{ font-size:18px; }
#landing .card p{ color:var(--muted); font-size:14.5px; margin:0; }

/* ── use cases: differentiated horizontal cards (not a clone of the feature grid) */
#landing .usecases{ grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); }
#landing .usecases .card{ display:grid; grid-template-columns:auto 1fr; column-gap:18px; align-items:start; }
#landing .usecases .card .ic{ grid-row:1 / span 2; margin-bottom:0; }
#landing .usecases .card h3{ margin-top:2px; }

/* ── pricing ───────────────────────────────────────────────────────────────── */
#landing .pricing{ display:grid; grid-template-columns:repeat(auto-fit,minmax(264px,1fr)); gap:clamp(14px,1.8vw,20px); align-items:stretch; margin-bottom:40px; }
#landing .plan{ display:flex; flex-direction:column; background:linear-gradient(180deg,var(--card-top),transparent), var(--card); border:1px solid var(--line); border-radius:20px; padding:clamp(22px,2.6vw,28px); position:relative; text-align:start; transition:transform .28s var(--ease-quart), border-color .28s, box-shadow .28s; }
#landing .plan:hover{ transform:translateY(-5px); border-color:var(--indigo-bright); }
#landing .plan.pop{ border-color:rgba(129,140,248,.7); box-shadow:0 0 0 1px rgba(99,102,241,.5), 0 30px 66px -34px rgba(99,102,241,.75); }
#landing .plan.pop:hover{ box-shadow:0 0 0 1px rgba(99,102,241,.6), 0 34px 74px -32px rgba(99,102,241,.9); }
#landing .tag{ position:absolute; top:-13px; inset-inline-start:50%; transform:translateX(-50%); background:linear-gradient(180deg,var(--indigo-bright),var(--indigo)); color:#0a0f1f; -webkit-text-fill-color:#0a0f1f; font-size:12px; font-weight:800; padding:5px 14px; border-radius:999px; letter-spacing:.01em; }
#landing .plan h3{ font-size:21px; }
#landing .plan .for{ color:var(--muted); font-size:13px; margin-bottom:16px; }
#landing .price{ font-size:clamp(34px,4vw,44px); font-weight:800; letter-spacing:-.02em; margin:0; }
#landing .price span:not([data-pv]){ font-size:14px; font-weight:500; color:var(--muted); }
#landing .price span[data-pv]{ font:inherit; color:inherit; letter-spacing:inherit; }
#landing .plan ul{ list-style:none; padding:0; margin:18px 0 24px; flex:1; }
#landing .plan ul li{ padding-inline-start:26px; position:relative; margin-bottom:11px; font-size:14.5px; color:#d6dbe8; }
#landing .plan ul li::before{ content:"✓"; position:absolute; inset-inline-start:0; color:var(--indigo-bright); font-weight:800; }
/* Wide screens: all five plans in one row. The cards are narrow there, so the
   price is smaller and "per month" sits on its own line under it. */
@media (min-width:1100px){
  #landing .pricing{ grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; }
  #landing .plan{ padding:22px 16px; border-radius:18px; }
  #landing .plan h3{ font-size:18px; }
  #landing .price{ font-size:clamp(22px,2.1vw,27px); line-height:1.15; overflow-wrap:anywhere; }
  #landing .price > span:not([data-pv]){ display:block; margin-top:6px; font-size:13px; letter-spacing:0; }
  #landing .plan ul{ margin:16px 0 20px; }
  #landing .plan ul li{ padding-inline-start:22px; margin-bottom:10px; font-size:13.5px; }
  #landing .plan .btn{ padding-inline:10px; font-size:13.5px; }
  #landing .tag{ white-space:nowrap; }
}

/* ── comparison table (scoped headers; rounded WITHOUT overflow-clip so the
      caption's first letter is never cut) ─────────────────────────────────── */
#landing .tablewrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:16px; }
#landing table{ width:100%; border-collapse:separate; border-spacing:0; font-size:14px; background:var(--card); border:1px solid var(--line); border-radius:16px; }
#landing th,#landing td{ padding:14px 16px; text-align:start; border-bottom:1px solid var(--line); vertical-align:top; }
#landing thead th{ background:rgba(99,102,241,.12); color:var(--text); font-weight:700; white-space:nowrap; }
#landing thead tr:first-child th:first-child{ border-start-start-radius:16px; }
#landing thead tr:first-child th:last-child{ border-start-end-radius:16px; }
#landing tbody tr{ transition:background .18s; }
#landing tbody tr:hover{ background:rgba(99,102,241,.05); }
#landing tbody tr:last-child td,#landing tbody tr:last-child th{ border-bottom:none; }
#landing caption{ caption-side:top; text-align:start; margin-bottom:12px; padding-inline:2px; color:var(--muted); font-size:13px; }

/* ── ordered steps ─────────────────────────────────────────────────────────── */
#landing ol{ max-width:72ch; margin:0 auto; padding-inline-start:24px; text-align:start; }
#landing ol li{ margin-bottom:12px; color:#d6dbe8; }

/* ── FAQ (fully visible, divided list, never collapsed for SEO/AEO) ────────── */
#landing .faq{ max-width:820px; margin:0 auto; text-align:start; }
#landing .faq dl{ margin:0; }
#landing .faq dt.q{ font-size:clamp(16px,2vw,18px); font-weight:700; color:var(--text); margin:0; padding-top:26px; border-top:1px solid var(--line); letter-spacing:-.01em; }
#landing .faq dt.q:first-of-type{ border-top:none; padding-top:0; }
#landing .faq dd.a{ color:var(--muted); margin:8px 0 0; padding-bottom:26px; max-width:72ch; }

/* ── final cta ─────────────────────────────────────────────────────────────── */
#landing .final{ text-align:center; position:relative; overflow:hidden; background:radial-gradient(900px 380px at 50% 120%,rgba(99,102,241,.22),transparent); }

/* ── language bar + footer ─────────────────────────────────────────────────── */
#landing .langbar{ display:flex; flex-wrap:wrap; gap:8px 16px; justify-content:center; align-items:center; padding:28px 0 4px; }
#landing .langbar .lbl{ color:var(--muted-soft); font-size:13px; font-weight:700; margin-inline-end:4px; }
#landing .langbar a{ color:var(--muted); font-size:13px; padding:4px 2px; transition:color .18s; }
#landing .langbar a:hover{ color:var(--text); }
#landing .langbar a.active{ color:var(--accent-text); font-weight:700; }
#landing footer{ padding:44px 0 40px; color:var(--muted-soft); font-size:13px; border-top:1px solid var(--line); }
#landing footer .wrap{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:14px; align-items:center; }
#landing footer a:hover{ color:var(--text); }

/* ── keyboard focus (a11y) ─────────────────────────────────────────────────── */
#landing a:focus-visible,#landing .btn:focus-visible,#landing summary:focus-visible{ outline:2px solid var(--accent-text); outline-offset:3px; border-radius:8px; }

/* ── motion ────────────────────────────────────────────────────────────────── */
@keyframes hero-rise{ from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:none} }
@keyframes reveal-rise{ from{opacity:0;transform:translateY(26px)} to{opacity:1;transform:none} }
@keyframes reveal-scale{ from{opacity:0;transform:translateY(18px) scale(.97)} to{opacity:1;transform:none} }
@keyframes hero-aura{ from{opacity:.6;transform:translate3d(-2%,0,0) scale(1)} to{opacity:1;transform:translate3d(2%,1.5%,0) scale(1.05)} }
@keyframes scroll-progress{ from{transform:scaleX(0)} to{transform:scaleX(1)} }
@keyframes header-settle{ to{ background:rgba(4,6,15,.9); border-bottom-color:var(--line); box-shadow:0 10px 30px -22px rgba(0,0,0,.9); } }

@media (prefers-reduced-motion: no-preference){
  /* Signature: the hero composes itself on load, staggered top to bottom. */
  #landing .hero .wrap > *{ opacity:0; animation:hero-rise .72s var(--ease-quint) forwards; }
  #landing .hero .wrap > *:nth-child(1){ animation-delay:.05s }
  #landing .hero .wrap > *:nth-child(2){ animation-delay:.13s }
  #landing .hero .wrap > *:nth-child(3){ animation-delay:.21s }
  #landing .hero .wrap > *:nth-child(4){ animation-delay:.29s }
  #landing .hero .wrap > *:nth-child(5){ animation-delay:.37s }
  #landing .hero .wrap > *:nth-child(6){ animation-delay:.45s }

  @supports (animation-timeline: view()){
    /* Each card reveals as IT enters (natural per-item stagger), not one uniform
       section fade. Cards rise; pricing plans scale in for a different feel. */
    #landing .grid > .card{ opacity:0; animation:reveal-rise linear both; animation-timeline:view(); animation-range:entry 0% cover 24%; }
    #landing .pricing > .plan{ opacity:0; animation:reveal-scale linear both; animation-timeline:view(); animation-range:entry 0% cover 26%; }
  }
  @supports (animation-timeline: scroll()){
    /* Thin reading-progress accent + the header settling into a denser state. */
    #landing header{ animation:header-settle linear both; animation-timeline:scroll(root); animation-range:0 130px; }
    #landing header::after{ content:""; position:absolute; inset-inline-start:0; bottom:-1px; height:2px; width:100%; transform:scaleX(0); transform-origin:left; background:linear-gradient(90deg,var(--indigo-bright),var(--violet)); animation:scroll-progress linear; animation-timeline:scroll(root); }
    [dir="rtl"] #landing header::after{ transform-origin:right; }
  }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  #landing *,#landing *::before,#landing *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  #landing .hero .wrap > *{ opacity:1 !important; transform:none !important; }
}

/* ── responsive ────────────────────────────────────────────────────────────── */
@media (max-width:980px){
  #landing .usecases{ grid-template-columns:1fr; }
}
@media (max-width:760px){
  #landing nav{ height:60px; }
  #landing .navlinks .hide-sm{ display:none; }
  #landing .navlinks{ gap:12px; }
  #landing .hero-cta{ flex-direction:column; align-items:stretch; }
  #landing .hero-cta .btn{ width:100%; }
  #landing .featured{ font-size:16px; }
}
@media (max-width:520px){
  :root{ --pad-inline:18px; }
  #landing .brand{ font-size:17px; }
  #landing .badge{ font-size:12px; }
  #landing h1{ letter-spacing:-.02em; }
  #landing .usecases .card{ grid-template-columns:1fr; }
  #landing .usecases .card .ic{ grid-row:auto; margin-bottom:14px; }
}
