:root {
  --bg-0: #07080f;
  --bg-1: #0d0f1e;
  --bg-2: #151830;
  --bg-3: #1c2040;
  --teal: #2dd4bf;
  --teal-2: #5eead4;
  --gold: #f4c860;
  --violet: #a78bfa;
  --text-hi: #f6f7fb;
  --text-lo: #9296bd;
  --border: rgba(255, 255, 255, 0.09);
  --radius: 20px;
  --container: 1120px;
  font-size: 16px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: "Tahoma", "Segoe UI", "Cairo", system-ui, sans-serif;
  overflow-x: hidden;
}

body { position: relative; }

img { max-width: 100%; display: block; }

/* ---------- background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 85% 8%, rgba(45, 212, 191, 0.16), transparent 65%),
    radial-gradient(600px 500px at 8% 30%, rgba(167, 139, 250, 0.13), transparent 65%),
    radial-gradient(900px 600px at 50% 100%, rgba(244, 200, 96, 0.06), transparent 70%);
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
  background: rgba(7, 8, 15, 0.75);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 32px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.nav-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.nav-brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}

.nav-brand-name em {
  font-style: normal;
  color: var(--teal);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-lo);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--text-hi);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.nav-cta {
  background: var(--teal);
  color: #04231c;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 6px 18px rgba(45, 212, 191, 0.25);
}

.nav-cta:hover {
  background: var(--teal-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(45, 212, 191, 0.35);
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-hi);
  margin: 0 auto;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- lang toggle (used in navbar) ---------- */
.lang-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.lang-toggle-track {
  position: relative;
  display: flex;
  width: 76px;
  height: 34px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-toggle-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 34px;
  height: 26px;
  background: linear-gradient(135deg, var(--teal), #189c8c);
  border-radius: 999px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px rgba(45, 212, 191, 0.4);
}

html[data-lang="fr"] .lang-toggle-thumb { transform: translateX(38px); }
html[dir="rtl"][data-lang="fr"] .lang-toggle-thumb { transform: translateX(-38px); }

.lang-toggle-opt {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--text-lo);
  transition: color 0.25s ease;
}

html[data-lang="ar"] .lang-toggle-opt[data-opt="ar"],
html[data-lang="fr"] .lang-toggle-opt[data-opt="fr"] {
  color: #04231c;
}

.lang-toggle:hover .lang-toggle-track { border-color: var(--teal); }

/* ==================== HERO ==================== */
main { position: relative; z-index: 1; }

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(30px, 6vh, 70px) clamp(18px, 4vw, 32px) clamp(50px, 8vh, 90px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
}

.hero-text {
  animation: heroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(244, 200, 96, 0.1);
  border: 1px solid rgba(244, 200, 96, 0.28);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-text h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  direction: ltr;
  text-align: start;
}

.hero-text h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--teal), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--text-lo);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.85;
  max-width: 480px;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #1fb8a5);
  color: #04231c;
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.28);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(45, 212, 191, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-hi);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-3px);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.stat-date { color: var(--gold); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-lo);
}

.stat-sep {
  width: 1px;
  height: 34px;
  background: var(--border);
}

/* ---------- hero visual ---------- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(260px, 34vw, 420px);
  animation: heroIn 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.moon {
  position: absolute;
  top: 6%;
  inset-inline-end: 10%;
  width: clamp(50px, 8vw, 76px);
  height: clamp(50px, 8vw, 76px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3d0, var(--gold) 70%);
  box-shadow: 0 0 40px rgba(244, 200, 96, 0.45);
}

.moon::after {
  content: "";
  position: absolute;
  top: 8%;
  inset-inline-start: -18%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-0);
}

.orbit {
  position: absolute;
  width: clamp(240px, 32vw, 380px);
  height: clamp(240px, 32vw, 380px);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.orbit-dot-1 { top: -4px; left: 50%; transform: translateX(-50%); }
.orbit-dot-2 { bottom: 18%; right: -4px; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.orbit-dot-3 { bottom: 8%; left: 6%; background: var(--gold); box-shadow: 0 0 10px var(--gold); width: 6px; height: 6px; }

.logo-frame {
  position: relative;
  width: clamp(200px, 26vw, 300px);
  height: clamp(200px, 26vw, 300px);
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.03);
}

.logo-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 32px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(45,212,191,0.5), transparent 40%, rgba(167,139,250,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-logo {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(45, 212, 191, 0.35));
  animation: float 5s ease-in-out infinite;
}

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

/* ==================== SECTIONS SHARED ==================== */
section.features, section.roadmap, section.demo {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(50px, 8vh, 90px) clamp(18px, 4vw, 32px);
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  text-align: center;
  margin: 0 0 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-lo);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

/* ==================== FEATURES ==================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: start;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  background: var(--bg-3);
  border-radius: 14px;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-lo);
  margin: 0;
}

/* ==================== ROADMAP ==================== */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.timeline-step {
  position: relative;
  display: flex;
  gap: 22px;
  padding-bottom: 40px;
  padding-inline-start: 34px;
}

.timeline-step:last-child { padding-bottom: 0; }

.step-dot {
  position: absolute;
  inset-inline-start: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
}

.timeline-step.is-done .step-dot {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
}

.timeline-step.is-active .step-dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(244, 200, 96, 0.18);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(244, 200, 96, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(244, 200, 96, 0.08); }
}

.step-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-lo);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.timeline-step.is-done .step-status { color: var(--teal); }
.timeline-step.is-active .step-status { color: var(--gold); }

.step-body h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.step-body p {
  margin: 0;
  color: var(--text-lo);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 520px;
}

/* ==================== CHAT DEMO ==================== */
.chat-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: rgba(21, 24, 48, 0.7);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.chat-card:hover {
  border-color: rgba(45, 212, 191, 0.3);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-header-logo { width: 36px; height: 36px; object-fit: contain; }

.chat-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}

.chat-header-title { font-weight: 700; font-size: 0.94rem; }

.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-lo);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  display: inline-block;
  animation: dotpulse 1.8s ease-in-out infinite;
}

@keyframes dotpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.chat-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  text-align: start;
  scroll-behavior: smooth;
}

.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  animation: rise 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.msg p { margin: 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg.bot {
  align-self: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-start-start-radius: 4px;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--teal), #1fb8a5);
  color: #04231c;
  font-weight: 500;
  border-start-end-radius: 4px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 13px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-start-start-radius: 4px;
  animation: rise 0.3s ease both;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-lo);
  animation: bounce 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-input input {
  flex: 1;
  min-width: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text-hi);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.chat-input input::placeholder { color: var(--text-lo); }

.chat-input button {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #04231c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}

.chat-input button:hover { background: var(--teal-2); transform: scale(1.08); }
.chat-input button:active { transform: scale(0.94); }

.chat-input button svg { transform: scaleX(-1); }
html[dir="ltr"] .chat-input button svg { transform: none; }

/* ==================== FOOTER ==================== */
.page-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 36px clamp(18px, 4vw, 32px);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 6px;
}

.footer-logo { width: 38px; height: 38px; object-fit: contain; }
.footer-brand em { font-style: normal; color: var(--teal); }

.footer-note, .footer-launch {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-lo);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text h1, .tagline { text-align: center; }
  .tagline { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 68px;
    inset-inline: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(10, 12, 24, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    padding: 12px 10px;
    border-radius: 10px;
  }
  .nav-link:hover { background: var(--bg-2); }
  .nav-link::after { display: none; }

  .nav-divider { width: 100%; height: 1px; margin: 4px 0; }

  .lang-toggle { align-self: center; margin: 6px 0; }
  .nav-cta { text-align: center; }

  .nav-burger { display: flex; }
}

@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .chat-body { max-height: 280px; min-height: 180px; }
  .msg { max-width: 90%; }
  .btn { flex: 1; }
}

@media (max-width: 420px) {
  .nav-brand-name { display: none; }
}
