:root {
  --navy: #00193f;
  --navy-2: #06152c;
  --orange: #fd5b05;
  --orange-rgb: 253, 91, 5;
  --green: #22c55e;
  --blue: #4f7cff;
  --bg: #071326;
  --bg-2: #0a1930;
  --surface: rgba(255, 255, 255, 0.075);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.09);
  --text: #eef5ff;
  --muted: #9fb1cd;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.22);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-ar: "Cairo", sans-serif;
  --font-en: "Inter", sans-serif;
  --transition: 0.35s cubic-bezier(0.2, 0.65, 0.25, 1);
}

html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #edf2fa;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --card: rgba(255, 255, 255, 0.92);
  --text: #10213b;
  --muted: #65748c;
  --border: rgba(0, 25, 63, 0.1);
  --shadow: 0 28px 80px rgba(0, 25, 63, 0.12);
  --shadow-soft: 0 16px 40px rgba(0, 25, 63, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 10%, rgba(var(--orange-rgb), 0.18), transparent 22rem),
    radial-gradient(circle at 90% 4%, rgba(79, 124, 255, 0.15), transparent 24rem),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.75;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
html[lang="en"] body { font-family: var(--font-en); }
a { text-decoration: none; }
img { max-width: 100%; display: block; }

.noise-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, #000, transparent 82%);
}
.skip-link {
  position: absolute; top: -60px; inset-inline-start: 16px; z-index: 2000; color: #fff; background: var(--orange); padding: 10px 14px; border-radius: 12px;
}
.skip-link:focus { top: 16px; }
.container { max-width: 1180px; }
.section-pad { padding: 92px 0; }

.topbar { position: sticky; top: 0; z-index: 1030; transition: transform var(--transition), background var(--transition), box-shadow var(--transition); }

/* Header logo visibility fix:
   The RadiXa mark is navy/orange, so it needs a light capsule on dark theme.
*/
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 18px;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

html[data-theme="dark"] .brand-mark {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] .brand-mark {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.topbar .navbar {
  min-height: 76px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border);
}
.topbar.is-scrolled .navbar { box-shadow: var(--shadow-soft); }
.brand-mark img { width: 170px; height: auto; }
.nav-link {
  color: var(--muted); font-weight: 700; font-size: 0.88rem; padding: 0.7rem 0.9rem !important; border-radius: 999px; transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link:focus, .nav-link.active { color: var(--text); background: var(--surface); }
.soft-toggler { width: 42px; height: 42px; border-radius: 14px; color: var(--text); background: var(--surface); display: inline-grid; place-items: center; }
.tool-btn {
  width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; font-weight: 800; transition: transform var(--transition), border-color var(--transition);
}
.tool-btn:hover { transform: translateY(-2px); border-color: rgba(var(--orange-rgb), 0.55); }
.btn {
  border-radius: 999px; font-weight: 800; font-size: 0.9rem; padding: 0.82rem 1.2rem; border: 0; display: inline-flex; align-items: center; gap: 0.55rem;
}
.btn-main { background: linear-gradient(135deg, #ff7a2d, var(--orange)); color: #fff; box-shadow: 0 20px 45px rgba(var(--orange-rgb), 0.24); }
.btn-main:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 24px 56px rgba(var(--orange-rgb), 0.34); }
.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--orange); border-color: rgba(var(--orange-rgb), 0.48); }
.btn-whatsapp { background: #25d366; color: #fff; box-shadow: 0 18px 42px rgba(37, 211, 102, 0.2); }
.btn-whatsapp:hover { color: #fff; transform: translateY(-2px); }

.hero-lab { position: relative; padding: 82px 0 42px; }
.hero-copy { max-width: 620px; }
.status-pill, .mini-label {
  display: inline-flex; align-items: center; gap: 8px; color: var(--orange); background: rgba(var(--orange-rgb), 0.11); border: 1px solid rgba(var(--orange-rgb), 0.2); padding: 8px 13px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; margin-bottom: 16px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,0.5); animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero-copy h1 {
  font-size: clamp(2.25rem, 5vw, 4.4rem); line-height: 1.06; font-weight: 800; letter-spacing: -0.05em; margin-bottom: 20px;
}
html[dir="rtl"] .hero-copy h1 { letter-spacing: -0.015em; }
.hero-copy h1 span { color: var(--orange); }
.lead-copy, .section-text, .section-head p, .flow-step p, .module-card p, .screen-caption p, .compare-card li, .contact-card p, .form-note {
  color: var(--muted); font-size: 0.96rem;
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 28px; }
.hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; gap: 12px; }
.hero-meta div { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.hero-meta strong { display: block; font-size: 1.35rem; line-height: 1; }
.hero-meta small { color: var(--muted); font-size: 0.78rem; }

.product-stage { position: relative; min-height: 560px; display: grid; place-items: center; }
.stage-glow { position: absolute; width: 68%; height: 68%; background: radial-gradient(circle, rgba(var(--orange-rgb), 0.2), rgba(79,124,255,0.16), transparent 70%); filter: blur(22px); }
.hero-device {
  position: relative; z-index: 1; width: min(100%, 860px); border-radius: 34px; padding: 12px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03)); box-shadow: var(--shadow); transform: perspective(1400px) rotateY(-8deg) rotateX(3deg); transition: transform var(--transition), opacity var(--transition);
}
html[dir="ltr"] .hero-device { transform: perspective(1400px) rotateY(8deg) rotateX(3deg); }
.hero-device:hover { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg) translateY(-6px); }
html[dir="ltr"] .hero-device:hover { transform: perspective(1400px) rotateY(3deg) rotateX(1deg) translateY(-6px); }
.hero-device img { border-radius: 24px; width: 100%; transition: opacity .25s ease, transform .25s ease; }
.hero-device img.is-switching { opacity: .2; transform: scale(.985); }

.mockup-stack { position: absolute; z-index: 4; bottom: 28px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 8px; }
.mock-thumb {
  border: 1px solid var(--border); border-radius: 16px; color: var(--text); background: color-mix(in srgb, var(--surface-strong) 88%, transparent); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 800; font-size: 0.78rem; box-shadow: var(--shadow-soft); transition: transform var(--transition), background var(--transition);
}
.mock-thumb:hover, .mock-thumb.active { transform: translateX(-4px); color: #fff; background: var(--orange); }
html[dir="ltr"] .mock-thumb:hover, html[dir="ltr"] .mock-thumb.active { transform: translateX(4px); }

.floating-card {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 20px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-strong) 90%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow-soft); animation: float 5.5s ease-in-out infinite;
}
.floating-card i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; color: var(--orange); background: rgba(var(--orange-rgb), 0.12); }
.floating-card b { display: block; font-size: 0.8rem; }
.floating-card span { color: var(--green); font-weight: 800; font-size: 0.82rem; }
.insight-a { top: 72px; inset-inline-start: 20px; }
.insight-b { bottom: 95px; inset-inline-end: 0; animation-delay: 1s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.ticker-strip { overflow: hidden; border-block: 1px solid var(--border); background: rgba(255,255,255,0.035); }
.ticker-track { display: flex; width: max-content; gap: 14px; padding: 14px 0; animation: ticker 24s linear infinite; }
.ticker-track span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; font-size: 0.84rem; }
.ticker-track i { color: var(--orange); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
html[dir="rtl"] .ticker-track { animation-direction: reverse; }

.section-head { max-width: 760px; margin-inline: auto; }
.section-head h2, .screen-showcase h2, .contact-card h2, .comparison-shell h2, #flow h2 {
  font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.22; font-weight: 800; letter-spacing: -0.02em;
}
.module-card, .screen-panel, .flow-step, .comparison-shell, .compare-card, .contact-card, .lead-form {
  border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
}
.module-card { height: 100%; padding: 26px 22px; transition: transform var(--transition), border-color var(--transition), background var(--transition); }
.module-card:hover { transform: translateY(-8px); border-color: rgba(var(--orange-rgb), 0.46); background: var(--surface-strong); }
.module-icon { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; color: var(--orange); background: rgba(var(--orange-rgb), 0.12); font-size: 1.25rem; margin-bottom: 18px; }
.module-card h3, .flow-step h3, .screen-caption h3, .compare-card h3 { font-size: 1.08rem; font-weight: 800; margin-bottom: 8px; }

.screen-showcase {
  position: relative;
  background: linear-gradient(180deg, transparent, rgba(var(--orange-rgb), 0.035), transparent);
}

/* Fixed screenshots layout:
   - 2x2 balanced grid on desktop
   - no oversized featured card
   - screenshots are contained, not cropped
*/
.screen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.screen-panel {
  overflow: hidden;
  position: relative;
  min-height: 100%;
  border-radius: var(--radius-lg);
  transform: translateZ(0);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.screen-panel.featured {
  grid-row: auto;
}

.screen-panel:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--orange-rgb), 0.42);
  box-shadow: 0 26px 58px rgba(0,0,0,.24);
}

.screen-img {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10.6;
  padding: 12px;
  background:
    radial-gradient(circle at 18% 12%, rgba(var(--orange-rgb), .18), transparent 32%),
    radial-gradient(circle at 86% 74%, rgba(79,124,255,.18), transparent 36%),
    rgba(0, 25, 63, .94);
}

.screen-img::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  pointer-events: none;
  z-index: 1;
}

.screen-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0%, rgba(255,255,255,.16) 48%, transparent 58%);
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.screen-panel:hover .screen-img::after {
  opacity: 1;
  animation: screenShine .9s ease forwards;
}

.screen-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 18px;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 44px rgba(0,0,0,.24);
  transition: transform .65s ease, filter .65s ease;
}

.screen-panel:hover .screen-img img {
  transform: scale(1.018);
  filter: saturate(1.04) contrast(1.02);
}

.screen-caption {
  min-height: 148px;
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.screen-caption span {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@keyframes screenShine {
  from { transform: translateX(-130%) skewX(-10deg); }
  to { transform: translateX(130%) skewX(-10deg); }
}

/* Fixed showcase animation:
   Uses consistent staggered card entrance instead of mixed left/right/up transforms.
*/
.screen-reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(34px) scale(.965);
  will-change: transform, opacity, filter;
}

.screen-reveal.in-view {
  animation: screenCardReveal .78s cubic-bezier(.18,.75,.25,1) both;
}

.screen-reveal.in-view[data-seq="1"] { animation-delay: 0s; }
.screen-reveal.in-view[data-seq="2"] { animation-delay: .09s; }
.screen-reveal.in-view[data-seq="3"] { animation-delay: .18s; }
.screen-reveal.in-view[data-seq="4"] { animation-delay: .27s; }

@keyframes screenCardReveal {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(34px) scale(.965);
  }
  62% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-4px) scale(1.006);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.flow-list { display: grid; gap: 14px; }
.flow-step { display: flex; align-items: flex-start; gap: 16px; padding: 22px; }
.flow-step > span { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 16px; display: grid; place-items: center; color: var(--orange); background: rgba(var(--orange-rgb), 0.13); font-weight: 800; }
.flow-step p { margin-bottom: 0; }

.comparison-section { padding-top: 0; }
.comparison-shell { padding: 34px; background: radial-gradient(circle at 15% 25%, rgba(var(--orange-rgb), 0.15), transparent 20rem), var(--card); }
.compare-card { height: 100%; padding: 24px; box-shadow: none; }
.compare-card i { font-size: 1.4rem; color: var(--orange); margin-bottom: 14px; }
.compare-card ul { margin: 0; padding: 0; list-style: none; }
.compare-card li { padding: 7px 0; display: flex; gap: 8px; }
.compare-card li::before { content: "\F633"; font-family: bootstrap-icons; color: var(--orange); }
.active-card { background: linear-gradient(180deg, rgba(var(--orange-rgb), 0.14), var(--card)); border-color: rgba(var(--orange-rgb), 0.28); }

.contact-zone { padding-top: 0; }
.contact-card { padding: 38px; background: linear-gradient(135deg, rgba(var(--orange-rgb), 0.12), transparent 38%), var(--card); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.privacy-link { color: var(--muted); font-weight: 800; }
.privacy-link:hover { color: var(--orange); }
.lead-form { padding: 24px; background: color-mix(in srgb, var(--card) 92%, transparent); }
.lead-form label { display: block; font-weight: 800; font-size: 0.82rem; margin-bottom: 7px; }
.form-control { border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface-strong) 70%, transparent); color: var(--text); padding: 0.82rem 0.95rem; font-size: 0.9rem; }
.form-control:focus { background: var(--surface-strong); color: var(--text); border-color: rgba(var(--orange-rgb), 0.54); box-shadow: 0 0 0 0.22rem rgba(var(--orange-rgb), 0.12); }
.form-status { min-height: 24px; font-weight: 800; font-size: 0.86rem; }

.footer { padding: 26px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.86rem; }
.footer-nav { display: flex; gap: 16px; }
.footer a { color: var(--muted); font-weight: 700; }
.footer a:hover { color: var(--orange); }

.animate-in { opacity: 0; transform: translateY(28px) scale(0.985); transition: opacity 0.75s ease, transform 0.75s ease; }
.animate-in.in-view { opacity: 1; transform: translateY(0) scale(1); }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }

@media (max-width: 1199.98px) {
  .product-stage { min-height: 500px; }
  .brand-mark img { width: 154px; }
}

@media (max-width: 991.98px) {
  .topbar .navbar { min-height: 68px; }
  .navbar-collapse { margin-top: 14px; padding: 14px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-strong); box-shadow: var(--shadow-soft); }
  .hero-lab { padding-top: 58px; }
  .hero-copy h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); }
  .product-stage { min-height: auto; padding-top: 22px; }
  .hero-device, html[dir="ltr"] .hero-device, .hero-device:hover, html[dir="ltr"] .hero-device:hover { transform: none; }
  .screen-grid { grid-template-columns: 1fr; }
  .screen-caption { min-height: auto; }
  .mockup-stack { position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 12px; }
  .floating-card { display: none; }
}

@media (max-width: 767.98px) {
  body { font-size: 13.8px; }
  .section-pad { padding: 68px 0; }
  .hero-lab { padding-top: 42px; }
  .brand-mark img { width: 140px; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-meta { grid-template-columns: 1fr; }
  .contact-card, .comparison-shell { padding: 24px; }
  .lead-form { padding: 18px; }
  .screen-caption { padding: 16px; }
  .ticker-track { animation-duration: 18s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .animate-in, .screen-reveal { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }
}
