/* =========================================================
   Allef — landing page styles
   LIGHT is the default theme; dark is available via the toggle
   (applied as the [data-theme="dark"]-less :root being dark, see note).
   Brand accent: turquoise #30D5C8
   ========================================================= */

/* :root holds the DARK palette. The page ships with <html data-theme="light">
   (set in index.html + app.js), so LIGHT is what visitors see first. Removing
   the data-theme attribute (the toggle's "dark" state) falls back to :root. */
:root {
  --accent: #30d5c8;
  --accent-strong: #18b8ab;
  --accent-soft: rgba(48, 213, 200, 0.12);

  /* Dark palette */
  --bg: #0a0f12;
  --bg-elev: #0f161b;
  --bg-alt: #0c1317;
  --surface: #121b21;
  --surface-2: #16212a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eaf2f4;
  --text-dim: #9fb2bb;
  --text-faint: #6f828c;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.6);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Cairo", "Inter", system-ui, sans-serif;
  --font: var(--font-en);
}

[data-theme="light"] {
  --bg: #f6f9fa;
  --bg-elev: #ffffff;
  --bg-alt: #eef3f4;
  --surface: #ffffff;
  --surface-2: #f1f6f7;
  --border: rgba(10, 30, 35, 0.10);
  --border-strong: rgba(10, 30, 35, 0.18);
  --text: #0d1b20;
  --text-dim: #46606a;
  --text-faint: #7c929b;
  --accent-soft: rgba(48, 213, 200, 0.16);
  --shadow: 0 24px 60px -22px rgba(20, 50, 55, 0.28);
  --shadow-soft: 0 10px 30px -14px rgba(20, 50, 55, 0.22);
}

/* Arabic uses the Cairo font automatically */
html[lang="ar"] { --font: var(--font-ar); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 680px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04211f;
  box-shadow: 0 10px 28px -10px rgba(48, 213, 200, 0.6);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(48, 213, 200, 0.7); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* "Coming soon" placeholder buttons: non-functional, WHITE text, no shadow, no tag */
.btn.is-soon {
  cursor: default;
  color: #ffffff;
  box-shadow: none;
}
.btn.is-soon:hover { transform: none; box-shadow: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; }
.brand-word { height: 26px; width: auto; color: var(--text); }
.brand-word--ar { display: none; height: 34px; }
html[lang="ar"] .brand-word--en { display: none; }
html[lang="ar"] .brand-word--ar { display: block; }

.nav-links {
  display: flex;
  gap: 26px;
  margin-inline-start: auto;
}
.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; gap: 10px; align-items: center; }
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.toggle:hover { border-color: var(--accent); color: var(--accent); }
.toggle--icon { width: 40px; padding: 0; }

/* theme icon swap: default (dark, no data-theme) shows the SUN (click -> light);
   light shows the MOON (click -> dark). */
.icon-moon { display: none; }
.icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; }
.hero-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-name {
  background: linear-gradient(120deg, var(--text), var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-name-ar {
  font-family: var(--font-ar);
  color: var(--accent-strong);
  font-size: 0.82em;
  font-weight: 700;
}
.hero-sub {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-dim);
  max-width: 40ch;
  margin: 0 0 30px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-note { font-size: 14px; color: var(--text-faint); margin: 0; }

/* Hero glow */
.hero-glow {
  position: absolute;
  inset-inline-end: -10%;
  top: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(48, 213, 200, 0.20), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}

/* Hero app-window mockup (Windows style) */
.hero-visual { position: relative; }
.window {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  transition: transform 0.4s ease;
}
.hero-visual:hover .window { transform: perspective(1400px) rotateY(-4deg) rotateX(1deg); }
html[dir="rtl"] .window { transform: perspective(1400px) rotateY(9deg) rotateX(3deg); }
html[dir="rtl"] .hero-visual:hover .window { transform: perspective(1400px) rotateY(4deg) rotateX(1deg); }

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 14px;
  height: 40px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.window-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.window-favicon { width: 14px; height: 16px; }

/* Windows-style caption buttons (minimize / maximize / close) */
.win-controls { display: flex; height: 100%; }
.win-btn {
  position: relative;
  width: 44px;
  height: 100%;
  display: inline-block;
  color: var(--text-faint);
}
.win-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.win-min::before { width: 11px; height: 0; border-top: 1.5px solid currentColor; }
.win-max::before { width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 1px; }
.win-close::before {
  content: "\00d7";              /* × */
  width: auto; height: auto;
  font-size: 15px;
  line-height: 1;
  color: var(--text-dim);
}

.window-body { display: grid; grid-template-columns: 56px 1fr 92px; gap: 12px; padding: 16px; min-height: 280px; }
.wb-rail { display: flex; flex-direction: column; gap: 10px; }
.rail-item { height: 40px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.rail-item.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wb-canvas {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  overflow: hidden;
}
.canvas-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 75%;
}
.cc-line { height: 9px; border-radius: 6px; background: var(--surface-2); }
.cc-line--lg { height: 14px; width: 70%; background: linear-gradient(90deg, var(--accent), transparent); }
.cc-line--sm { width: 45%; }
.cc-pill { margin-top: 6px; width: 90px; height: 26px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); }
.canvas-orb {
  position: absolute;
  inset-inline-end: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  opacity: 0.7;
}
.wb-panel { display: flex; flex-direction: column; gap: 10px; }
.panel-block { height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.panel-block.short { height: 18px; width: 60%; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section-head p { color: var(--text-dim); font-size: 18px; margin: 0; }

.grid { display: grid; gap: 22px; }
.features-grid { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}
.feature-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 18px;
}
.feature h3 { margin: 0 0 8px; font-size: 19px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
}
.step-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;                 /* white numbers (was dark) */
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  margin-bottom: 16px;
}
.step h3 { margin: 0 0 8px; font-size: 19px; }
.step p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---------- Carousel ---------- */
.carousel { position: relative; max-width: 940px; margin: 0 auto; }
.carousel-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; background: #0a0f12; }
.carousel-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-weight: 600;
  margin: 0;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}
.carousel-btn:hover { color: var(--accent); border-color: var(--accent); }
.carousel-prev { inset-inline-start: -10px; }
.carousel-next { inset-inline-end: -10px; }
/* arrows mirror automatically in RTL */
html[dir="rtl"] .carousel-prev svg,
html[dir="rtl"] .carousel-next svg { transform: scaleX(-1); }
.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.carousel-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border-strong);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-dot.active { background: var(--accent); transform: scale(1.3); }
.carousel.is-empty .carousel-btn,
.carousel.is-empty .carousel-dots { display: none; }

/* ---------- Demo video ---------- */
.video-wrap {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0f12;
  box-shadow: var(--shadow-soft);
}
.demo-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0a0f12; }
.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  background:
    radial-gradient(circle at 50% 40%, rgba(48,213,200,0.16), transparent 60%),
    repeating-linear-gradient(45deg, var(--surface) 0 16px, var(--surface-2) 16px 32px);
}
.video-empty p { margin: 0; font-weight: 600; }
.video-play {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #04211f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 30px -8px rgba(48,213,200,0.6);
}
html[dir="rtl"] .video-play svg { transform: scaleX(-1); }

/* ---------- Request-a-demo form ---------- */
.demo-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .opt { color: var(--text-faint); font-weight: 400; }
.field input,
.field textarea {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input.invalid,
.field textarea.invalid { border-color: #e2564d; box-shadow: 0 0 0 3px rgba(226,86,77,0.18); }
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.form-actions .btn { min-width: 170px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.form-status.ok { color: var(--accent-strong); }
.form-status.err { color: #e2564d; }

/* ---------- CTA strip ---------- */
.cta-strip {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border-block: 1px solid var(--border);
}
.cta-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 24px;
  flex-wrap: wrap;
}
.cta-strip h2 { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 32px); }
.cta-strip p { margin: 0; color: var(--text-dim); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-elev); border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
  flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; }
.footer-brand .brand-word { height: 24px; }
.footer-brand .brand-word--ar { height: 30px; }
.footer-links { display: flex; gap: 22px; margin-inline: auto; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { margin: 0; color: var(--text-faint); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 520px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 64px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .demo-form { grid-template-columns: 1fr; padding: 22px; }
  .carousel-prev { inset-inline-start: 4px; }
  .carousel-next { inset-inline-end: 4px; }
  .footer-links { order: 3; width: 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
