/* NileAI System — "weightless" design system
   Inspired by antigravity.google: airy white, mega variable type,
   mono code accents, Google-palette gradient ribbon, floating chips. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ink: #1f1f1f;
  --ink-soft: #5f6368;
  --line: #e8eaed;
  --blue: #4285F4;
  --red: #EA4335;
  --yellow: #FBBC04;
  --green: #34A853;
  --grad: linear-gradient(90deg, #4285F4, #EA4335 38%, #FBBC04 66%, #34A853);
  --font: "Google Sans Flex", "Space Grotesk", system-ui, sans-serif;
  --mono: "Google Sans Code", "Space Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }

::selection { background: #FBBC04; color: #1f1f1f; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--mono); }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; }

/* ============ Progress bar ============ */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: var(--grad);
}

/* ============ Preloader ============ */
.preloader {
  position: fixed; inset: 0; z-index: 300;
  background: #1f1f1f; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.8s var(--ease);
}
.preloader.done { transform: translateY(-100%); }
.preloader-inner {
  display: flex; align-items: baseline; gap: 18px;
  font-size: 1rem; letter-spacing: 0.08em;
}
.preloader-count { color: #FBBC04; min-width: 3ch; text-align: right; }

/* ============ Header ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: transform 0.4s var(--ease), background 0.3s, box-shadow 0.3s;
  background: transparent;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header.hidden { transform: translateY(-100%); }

.floating-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.floating-cta.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.nav {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; gap: 24px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em;
}
.logo em { font-style: normal; font-weight: 400; color: var(--ink-soft); margin-left: 5px; }
.logo-mark { width: 28px; height: 28px; color: var(--blue); }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

/* ============ Pills ============ */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  padding: 11px 22px; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s, color 0.2s;
  will-change: transform;
}
.pill svg { width: 17px; height: 17px; transition: transform 0.25s var(--ease); }
.pill:hover svg { transform: translate(2px, -2px); }

.pill-dark { background: #1f1f1f; color: #fff; }
.pill-dark:hover { background: #000; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22); }

.pill-ghost { color: var(--ink); border: 1.5px solid var(--line); background: #fff; }
.pill-ghost:hover { border-color: var(--ink); }

.pill-lg { padding: 15px 30px; font-size: 1.02rem; }
.pill-xl { padding: 18px 38px; font-size: 1.1rem; }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  padding: 120px 0 80px;
}

#ribbon {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.9;
}

.hero-content {
  position: relative; z-index: 3;
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  width: 100%;
}

.eyebrow {
  font-size: 0.88rem; color: var(--ink-soft);
  letter-spacing: 0.04em; margin-bottom: 26px;
}

.display {
  font-size: clamp(3rem, 8.5vw, 7.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 34px;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: grad-pan 7s ease-in-out infinite alternate;
}
@keyframes grad-pan { from { background-position: 0% 0; } to { background-position: 100% 0; } }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 40px;
}

.cta-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.cta-center { justify-content: center; }

.hero-note { margin-top: 26px; font-size: 0.85rem; color: var(--ink-soft); }
.hero-note a { color: var(--ink); }

/* scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-soft); font-size: 0.78rem; letter-spacing: 0.18em;
  z-index: 3;
}
.cue-line {
  width: 1.5px; height: 44px; overflow: hidden; position: relative;
  background: var(--line); border-radius: 2px;
}
.cue-line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--ink);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ============ Floating chips ============ */
.chips { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.chip {
  position: absolute;
  left: var(--fx); top: var(--fy);
  transform: translate(var(--px, 0), var(--py, 0));
  transition: transform 0.6s var(--ease);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(31, 31, 31, 0.09);
  backdrop-filter: blur(6px);
}
.chip svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--ink); stroke-width: 1.8;
  animation: bob var(--dur) ease-in-out var(--del) infinite alternate;
}
.chip { animation: bob-outer var(--dur) ease-in-out var(--del) infinite alternate; }
@keyframes bob-outer { from { margin-top: -9px; } to { margin-top: 9px; } }
@keyframes bob { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* ============ Entrance animations ============ */
.js .rise { opacity: 0; transform: translateY(30px); }
.js .rise.in, body.ready .rise {
  opacity: 1; transform: none;
  transition: opacity 0.8s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js .rise-line { display: block; transform: translateY(112%); }
body.ready .rise-line { transform: none; transition: transform 1s var(--ease) var(--d, 0s); }

.js .reveal { opacity: 0; transform: translateY(36px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.8s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}

/* ============ Marquee ============ */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
  padding: 16px 0; background: var(--bg);
}
.marquee-track { display: inline-flex; animation: marquee 26s linear infinite; }
.marquee-track span {
  font-family: var(--mono); font-size: 0.9rem; color: var(--ink-soft);
  letter-spacing: 0.06em; padding-right: 12px;
}
.marquee-track i { font-style: normal; color: var(--yellow); padding: 0 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: 130px 0; }
.section-gray { background: var(--bg-soft); }

.kicker { font-size: 0.85rem; color: var(--ink-soft); letter-spacing: 0.05em; margin-bottom: 18px; }
.kicker-light { color: #bdc1c6; }

h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  margin-bottom: 56px;
  max-width: 720px;
}

.body { color: var(--ink-soft); max-width: 600px; margin-bottom: 18px; }

.trust-row { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 24px; }
.trust-row li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--ink-soft); }
.trust-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--green); }

/* ============ Build cards ============ */
.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  perspective: 1200px;
}

.build-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.3s;
  will-change: transform;
}
.js .build-card.reveal { transform: translateY(36px); }
.js .build-card.reveal.in { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.build-card:hover {
  box-shadow: 0 24px 60px rgba(31, 31, 31, 0.12);
  border-color: transparent;
}
.build-card::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: var(--radius);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--hue1), var(--hue2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.build-card:hover::before { opacity: 1; }

.card-index { font-size: 0.8rem; color: #9aa0a6; }

.card-icon {
  width: 52px; height: 52px; margin: 20px 0 18px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hue1), var(--hue2));
  transition: transform 0.35s var(--ease);
}
.build-card:hover .card-icon { transform: translateY(-4px) rotate(-4deg); }
.card-icon svg { width: 25px; height: 25px; fill: none; stroke: #fff; stroke-width: 1.9; }

.build-card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.build-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 20px; }

.card-tag {
  font-size: 0.75rem; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; display: inline-block;
}

/* ============ Statement ============ */
.statement-wrap { padding: 150px 0; }
.statement {
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
  max-width: 1000px;
}
.statement .w { color: #d5d8dc; transition: color 0.35s; }
.statement .w.on { color: var(--ink); }

/* ============ Process ============ */
.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px 28px;
  padding-top: 34px;
}
.process-line {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--line); border-radius: 2px;
  overflow: hidden;
}
.process-line span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s linear; }

.pstep { position: relative; }
.pdot {
  position: absolute; top: -40px; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent);
}
.pnum { font-size: 0.8rem; color: #9aa0a6; display: block; margin-bottom: 10px; }
.pstep h3 { font-size: 1.25rem; margin-bottom: 8px; }
.pstep p { color: var(--ink-soft); font-size: 0.95rem; }

/* ============ Teams ============ */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.team-card {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform 0.3s var(--ease), background 0.3s;
}
.team-card:hover { transform: translateY(-6px); background: #eef1f4; }
.team-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.team-card p { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 20px; }
.team-tag { font-size: 0.82rem; color: var(--ink); }

/* ============ Results ============ */
.results {
  background: #1f1f1f;
  color: #e8eaed;
  padding: 130px 0;
  position: relative;
  overflow: hidden;
}
.results::before, .results::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.25; pointer-events: none;
}
.results::before { width: 480px; height: 480px; background: var(--blue); top: -180px; right: -120px; }
.results::after { width: 420px; height: 420px; background: var(--green); bottom: -200px; left: -100px; }

.results-inner {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 70px;
  position: relative; z-index: 1;
}
.results h2 { color: #fff; margin-bottom: 24px; }
.results-note { color: #9aa0a6; max-width: 420px; }

.results-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; align-content: center; }
.rstat { display: flex; flex-direction: column; gap: 8px; }
.rnum {
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  font-weight: 500; letter-spacing: -0.03em;
  color: var(--c); line-height: 1;
}
.rstat > span:last-child { color: #bdc1c6; font-size: 0.92rem; max-width: 240px; }

/* ============ About ============ */
.about-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 70px; align-items: center;
}
.about-photo { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.about-avatar {
  width: 190px; height: 190px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 4.6rem; font-weight: 500; color: #fff;
  background: conic-gradient(from 220deg, #4285F4, #EA4335, #FBBC04, #34A853, #4285F4);
  position: relative;
}
.about-avatar::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: #1f1f1f; z-index: 0;
}
.about-avatar { text-indent: 0; }
.about-avatar::after { content: "M"; position: absolute; z-index: 1; }
.about-caption { font-size: 0.8rem; color: var(--ink-soft); }

/* ============ Finale ============ */
.finale {
  position: relative;
  padding: 170px 0 150px;
  background: var(--bg-soft);
  overflow: hidden;
  text-align: center;
}
.finale-inner { position: relative; z-index: 3; }
.finale-title { margin-bottom: 26px; }
.finale .lead { margin: 0 auto 44px; }
.chips-finale .chip { background: #fff; }

/* ============ Footer ============ */
.site-footer {
  background: #1f1f1f; color: #9aa0a6;
  padding: 30px 0; font-size: 0.88rem;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}

/* ============ Language toggle ============ */
.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  width: 42px; height: 42px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.lang-btn:hover { border-color: var(--ink); transform: translateY(-1px); }

/* ============ RTL / Arabic ============ */
html[dir="rtl"] body,
html[dir="rtl"] .display,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-family: "Cairo", "Google Sans Flex", system-ui, sans-serif;
  letter-spacing: 0;
}
html[dir="rtl"] [data-i18n].mono,
html[dir="rtl"] .marquee-track span,
html[dir="rtl"] .statement {
  font-family: "Cairo", var(--mono);
  letter-spacing: 0;
}
html[dir="rtl"] .display { line-height: 1.18; font-weight: 700; }
html[dir="rtl"] h2 { line-height: 1.25; }
html[dir="rtl"] .statement { line-height: 1.5; }
html[dir="rtl"] .pill svg { transform: scaleX(-1); }
html[dir="rtl"] .pill:hover svg { transform: scaleX(-1) translate(2px, -2px); }
html[dir="rtl"] .marquee-track { animation-direction: reverse; }
html[dir="rtl"] .logo em { margin-left: 0; margin-right: 5px; }
html[dir="rtl"] .pdot { left: auto; right: 0; }
html[dir="rtl"] .floating-cta { right: auto; left: 24px; }
html[dir="rtl"] .trust-row li { text-align: right; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grad, .cue-line::after, .marquee-track, .chip, .chip svg { animation: none !important; }
  .rise, .rise-line, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .preloader { display: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1000px) {
  .results-inner { grid-template-columns: 1fr; gap: 50px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; text-align: left; }
  .about-photo { align-items: flex-start; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .section { padding: 90px 0; }
  .statement-wrap { padding: 100px 0; }
  .hero { padding: 110px 0 90px; }
  .chip { width: 44px; height: 44px; border-radius: 13px; }
  .chip svg { width: 20px; height: 20px; }
  .results-stats { grid-template-columns: 1fr; gap: 30px; }
  .display { font-size: clamp(2.6rem, 11vw, 4rem); }
  .scroll-cue { display: none; }
}
