/* ==========================================================
   Rafaq Tec — Stronger Together
   ========================================================== */
:root {
  --bg: #010714;
  --bg-2: #011940;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --text: #fbfbfb;
  --muted: #94a3c2;
  --purple: #54efe4;
  --violet: #09ddec;
  --pink: #016cf0;
  --red: #ff4438;
  --orange: #014188;
  --grad: linear-gradient(115deg, #54efe4 0%, #09ddec 35%, #016cf0 70%, #014188 100%);
  --radius: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --container: 1240px;
  /* Theme tokens: dark is the default, light overrides live at the end of the file */
  --grad-text: var(--grad);
  --nav-line: rgba(255, 255, 255, .14);
  --panel-bg: rgba(1, 25, 64, .7);
  --chip-bg: rgba(1, 25, 64, .85);
  --menu-bg: rgba(1, 7, 20, .96);
  --tag: #c7d2e8;
  --hover-line: rgba(255, 255, 255, .25);
  --card-a: rgba(255, 255, 255, .045);
  --card-b: rgba(255, 255, 255, .01);
  --shine: 255, 255, 255;
  --stroke: rgba(255, 255, 255, .6);
  --field: rgba(255, 255, 255, .03);
  --stat-bg: rgba(1, 7, 20, .55);
  --giant: rgba(255, 255, 255, .14);
  color-scheme: dark;
}
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--violet); color: #fff; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 300; padding: 12px 22px; border-radius: 12px;
  background: #fff; color: #010c21; font-weight: 700; font-size: 14px; transition: top .3s var(--ease);
}
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: clamp(20px, 4vw, 40px); }
.section { position: relative; padding-block: clamp(90px, 12vw, 160px); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Grain & progress ---------- */
.grain {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 22px;
}
.pre-mark { width: 110px; height: auto; overflow: visible; }
.pre-word { display: flex; gap: .35em; font-size: 22px; font-weight: 700; letter-spacing: .02em; overflow: hidden; direction: ltr; }
.pre-word span { display: inline-block; }
.pre-word span:last-child { font-weight: 400; color: var(--muted); }
.pre-count { position: absolute; bottom: 36px; right: 40px; font-size: clamp(48px, 9vw, 120px); font-weight: 800; line-height: 1; letter-spacing: -.04em; opacity: .12; direction: ltr; }
.pre-curtain { position: absolute; inset: 0; background: var(--grad); transform: scaleY(0); transform-origin: bottom; }

/* ---------- Cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 150; border-radius: 50%; }
.cursor {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, .45);
  display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
  mix-blend-mode: difference;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255, 255, 255, .12); border-color: transparent; }
.cursor.is-label { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: #fff; mix-blend-mode: normal; border-color: transparent; }
.cursor-label { font-size: 13px; font-weight: 700; color: #010c21; opacity: 0; transition: opacity .25s; }
.cursor.is-label .cursor-label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap;
  isolation: isolate; overflow: hidden; transition: box-shadow .4s, color .4s;
  will-change: transform;
}
.btn .arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(4px); }
.btn-primary { background: var(--grad); background-size: 180% 100%; color: #010c21; font-weight: 700; box-shadow: 0 10px 40px -10px rgba(1, 108, 240, .6); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; transform: translateY(101%);
  border-radius: inherit; transition: transform .5s var(--ease);
}
.btn-primary:hover { color: #010c21; box-shadow: 0 16px 60px -12px rgba(1, 95, 179, .7); }
.btn-primary:hover::after { transform: translateY(0); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .3); background: var(--surface-2); }
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 100;
  width: min(calc(100% - 28px), 1240px); transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 12px 10px 20px; border-radius: 999px;
  border: 1px solid var(--nav-line); background: transparent; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .4s, border-color .4s, transform .5s var(--ease);
}
[dir="rtl"] .nav { padding: 10px 20px 10px 12px; }
.brand { display: flex; align-items: center; gap: 10px; direction: ltr; }
.brand-mark { width: 30px; height: auto; transition: transform .6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.08); }
.brand-text { font-size: 18px; letter-spacing: -.01em; font-family: "Plus Jakarta Sans", sans-serif; }
.brand-text b { font-weight: 800; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { position: relative; padding: 8px 14px; font-size: 14.5px; color: var(--muted); border-radius: 999px; transition: color .3s, background .3s; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.is-active { color: var(--text); background: var(--surface-2); }
.nav-links a.is-active::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px; background: var(--grad); }
.mobile-menu a.is-active { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  position: relative; display: flex; align-items: center; height: 38px; padding: 3px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700;
}
.lang-toggle span { position: relative; z-index: 1; width: 34px; text-align: center; transition: color .3s; color: var(--muted); }
.lang-toggle::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 34px; height: 30px; border-radius: 999px; background: var(--grad);
  transition: transform .45s var(--ease);
}
html[lang="ar"] .lang-toggle::before { transform: translateX(34px); }
html[lang="en"] .lang-en, html[lang="ar"] .lang-ar { color: #fff; }
.lang-toggle { direction: ltr; }
.burger { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease), top .4s var(--ease); }
.burger span:first-child { top: 16px; } .burger span:last-child { top: 24px; }
.menu-open .burger span:first-child { top: 20px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 20px; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 95; background: var(--menu-bg); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 32px;
  clip-path: circle(0% at calc(100% - 44px) 40px); transition: clip-path .8s var(--ease); pointer-events: none;
}
[dir="rtl"] .mobile-menu { clip-path: circle(0% at 44px 40px); }
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 44px) 40px); pointer-events: auto; }
[dir="rtl"].menu-open .mobile-menu, .menu-open[dir="rtl"] .mobile-menu { clip-path: circle(150% at 44px 40px); }
.mobile-menu a { font-size: clamp(36px, 10vw, 56px); font-weight: 700; letter-spacing: -.02em; }
.mobile-menu .mobile-cta { margin-top: 20px; font-size: 16px; font-weight: 600; letter-spacing: 0; padding: 16px 28px; width: fit-content; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding-block: 120px 80px; }
/* The ink runs behind the whole site, not only the hero */
#hero-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
.hero-aurora { display: none; }
.hero-aurora i { position: absolute; border-radius: 50%; }
.hero-aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -10vw; background: #014188; animation: blob1 18s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; bottom: -14vw; background: #01536b; animation: blob2 22s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(3) { width: 26vw; height: 26vw; right: 20vw; top: 10vw; background: var(--violet); opacity: .5; animation: blob1 16s ease-in-out infinite alternate-reverse; }
@keyframes blob1 { to { transform: translate(10vw, 8vw) scale(1.2); } }
@keyframes blob2 { to { transform: translate(-8vw, -10vw) scale(1.15); } }

.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 40px; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3ee08f; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.hero-title { margin: 0; font-size: clamp(42px, 5.3vw, 84px); line-height: 1; letter-spacing: -.04em; word-spacing: .06em; font-weight: 800; }
html[lang="ar"] .hero-title { letter-spacing: 0; word-spacing: 0; line-height: 1.25; font-size: clamp(38px, 5vw, 76px); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .18em; margin-bottom: -.1em; }
/* background-clip text only paints inside the box: give g, p and y room below */
.hero-title .grad-text { padding-bottom: .12em; margin-bottom: -.12em; }
.hero-title .line > span { display: inline-block; will-change: transform; }
.hero-sub { max-width: 540px; margin: 28px 0 38px; font-size: clamp(15px, 1.2vw, 17px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 540px; width: 100%; justify-self: center; }
/* Services constellation: every service on screen at once, joined to one core */
.cx-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cx-orbit { fill: none; stroke: var(--line); stroke-width: .25; stroke-dasharray: .8 1.6; transform-origin: 50% 50%; animation: spin 80s linear infinite; }
.cx-orbit-2 { stroke-dasharray: none; opacity: .7; animation-duration: 60s; animation-direction: reverse; }
.cx-web { fill: rgba(9, 221, 236, .025); stroke: rgba(9, 221, 236, .22); stroke-width: .2; }
.cx-link { stroke: rgba(9, 221, 236, .5); stroke-width: .28; stroke-dasharray: 1 1.6; stroke-linecap: round; animation: cxFlow 2.4s linear infinite; }
@keyframes cxFlow { to { stroke-dashoffset: -5.2; } }
.cx-pulse { fill: #54efe4; }
.cx-core {
  position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-content: center; text-align: center; gap: 2px;
  background: radial-gradient(circle at 50% 35%, rgba(9, 221, 236, .16), rgba(1, 25, 64, .55) 70%);
  border: 1px solid rgba(9, 221, 236, .25); animation: cxBreath 5s ease-in-out infinite;
}
.cx-core-ring {
  position: absolute; inset: -7px; border-radius: 50%; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 55%, #54efe4 75%, #016cf0 92%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
.cx-core b { font-size: clamp(38px, 5vw, 60px); line-height: 1; font-weight: 800; letter-spacing: -.04em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.cx-core span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); max-width: 10ch; margin-inline: auto; line-height: 1.35; }
html[lang="ar"] .cx-core span { letter-spacing: 0; font-size: 13px; }
@keyframes cxBreath { 0%, 100% { box-shadow: 0 0 40px -10px rgba(9, 221, 236, .35); } 50% { box-shadow: 0 0 70px -6px rgba(9, 221, 236, .55); } }
.cx-node {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; white-space: nowrap;
  background: var(--chip-bg); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .6);
  animation: cxIn .9s var(--ease) calc(.5s + var(--i) * .12s) both, cxFloat 7s ease-in-out calc(var(--i) * -1.4s) infinite;
  transition: border-color .3s, box-shadow .3s;
}
[dir="rtl"] .cx-node { padding: 8px 8px 8px 14px; }
.cx-node:hover { border-color: rgba(9, 221, 236, .6); box-shadow: 0 14px 40px -14px rgba(9, 221, 236, .55); }
.cx-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 8px 18px -8px rgba(1, 108, 240, .7); }
.cx-ic svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cx-txt { display: flex; flex-direction: column; line-height: 1.25; }
.cx-txt b { font-size: 14px; font-weight: 700; color: var(--text); }
.cx-txt small { font-size: 11.5px; color: var(--muted); }
@keyframes cxIn { from { opacity: 0; filter: blur(6px); } }
@keyframes cxFloat { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 7px)); } }
:root[data-theme="light"] .cx-core { background: radial-gradient(circle at 50% 35%, rgba(9, 221, 236, .14), rgba(255, 255, 255, .55) 70%); border-color: rgba(1, 108, 240, .2); }
:root[data-theme="light"] .cx-link { stroke: rgba(1, 108, 240, .45); }
:root[data-theme="light"] .cx-web { stroke: rgba(1, 108, 240, .2); fill: rgba(1, 108, 240, .03); }
:root[data-theme="light"] .cx-pulse { fill: #016cf0; }
:root[data-theme="light"] .cx-node { box-shadow: 0 14px 30px -20px rgba(1, 43, 98, .45); }
@media (prefers-reduced-motion: reduce) { .cx *, .cx { animation: none !important; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { translate: 0 -14px; } }



/* ---------- Marquee ---------- */
.marquee { position: relative; padding: 28px 0; border-block: 1px solid var(--line); overflow: hidden; background: transparent; direction: ltr; transform: rotate(-1.5deg) scale(1.03); }
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee-group { display: flex; align-items: center; gap: 36px; padding-right: 36px; }
.marquee span { font-size: clamp(22px, 3.1vw, 42px); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.marquee span:nth-child(4n+3) { -webkit-text-stroke: 1.5px var(--stroke); color: transparent; }
.marquee b { font-size: 26px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section heads ---------- */
.section-head { max-width: 760px; margin-bottom: clamp(48px, 6vw, 80px); }
.section-head.row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 15px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--grad); }
.section-title { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; }
html[lang="ar"] .section-title { letter-spacing: 0; line-height: 1.25; }
.section-sub { margin: 20px 0 0; font-size: clamp(15px, 1.15vw, 16.5px); color: var(--muted); max-width: 560px; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.svc-card {
  position: relative; padding: 30px 26px 28px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-a), var(--card-b));
  overflow: hidden; transform-style: preserve-3d; transition: border-color .4s; min-height: 420px; display: flex; flex-direction: column;
  --x: 50%; --y: 50%;
}
.svc-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: radial-gradient(260px circle at var(--x) var(--y), rgba(var(--shine), .55), rgba(var(--shine), .25) 40%, transparent 70%);
  -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 .4s;
}
.svc-glow { position: absolute; inset: 0; background: radial-gradient(360px circle at var(--x) var(--y), rgba(var(--shine), .06), transparent 60%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.svc-card:hover::before, .svc-card:hover .svc-glow { opacity: 1; }
.svc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 48px; }
.svc-num { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .1em; }
.svc-icon { width: 56px; height: 56px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; padding: 12px; box-sizing: content-box; border-radius: 18px; background: var(--grad); box-shadow: 0 12px 30px -10px rgba(1, 108, 240, .7); transition: transform .6s var(--ease); }
.svc-card:hover .svc-icon { transform: rotate(-8deg) scale(1.08); }
.svc-card h3 { margin: 0 0 12px; font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.svc-card p { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--tag); }
.svc-arrow { position: absolute; top: 30px; inset-inline-end: 26px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #010c21; transform: scale(0) rotate(-45deg); transition: transform .5s var(--ease); }
.svc-arrow svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.svc-card:hover .svc-arrow { transform: scale(1) rotate(0); }
.svc-card:hover .svc-icon { opacity: 0; }

/* ---------- Process ---------- */
.process { position: relative; }
.process-pin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 120px 60px; overflow: hidden; }
.process-head { margin-bottom: 50px; }
.process-bar { margin-top: 30px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; max-width: 420px; }
.process-bar span { display: block; height: 100%; width: 100%; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; }
[dir="rtl"] .process-bar span { transform-origin: 100% 50%; }
.process-track { display: flex; gap: 22px; padding-inline: max(clamp(20px, 4vw, 40px), calc((100vw - var(--container)) / 2 + 40px)); width: max-content; will-change: transform; }
.step {
  position: relative; width: clamp(290px, 30vw, 400px); min-height: 380px; padding: 32px; border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--card-a), var(--card-b)); overflow: hidden; display: flex; flex-direction: column;
}
.step-num { font-size: 60px; font-weight: 800; line-height: 1; letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .9; margin-bottom: 20px; }
.step h3 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); max-width: 300px; }
.step-art { margin-top: auto; padding-top: 30px; height: 110px; position: relative; display: flex; align-items: flex-end; gap: 8px; }
.step-art i { display: block; border-radius: 10px; background: var(--grad); opacity: .85; }
.art-1 i { width: 44px; height: 44px; border-radius: 50%; opacity: .5; animation: float 4s ease-in-out infinite; }
.art-1 i:nth-child(2) { width: 64px; height: 64px; opacity: .8; animation-delay: -1s; } .art-1 i:nth-child(3) { width: 28px; height: 28px; animation-delay: -2s; }
.art-2 i { flex: 1; height: 100%; background: transparent; border: 1.5px solid rgba(255, 255, 255, .18); }
.art-2 i:nth-child(2) { background: var(--grad); border: 0; height: 70%; } .art-2 i:nth-child(3) { height: 85%; } .art-2 i:nth-child(4) { height: 55%; }
.art-3 i { flex: 1; animation: grow 2.4s var(--ease) infinite alternate; transform-origin: bottom; }
.art-3 i:nth-child(1) { height: 30%; } .art-3 i:nth-child(2) { height: 55%; animation-delay: .2s; } .art-3 i:nth-child(3) { height: 40%; animation-delay: .4s; } .art-3 i:nth-child(4) { height: 80%; animation-delay: .6s; } .art-3 i:nth-child(5) { height: 100%; animation-delay: .8s; }
@keyframes grow { from { transform: scaleY(.3); } }
.art-4 i { width: 70px; height: 70px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); animation: rocket 2.4s ease-in-out infinite; box-shadow: 0 0 40px rgba(1, 95, 179, .5); }
@keyframes rocket { 50% { transform: rotate(-45deg) translate(10px, -10px); } }
.art-5 i { flex: 1; border-radius: 6px; }
.art-5 i:nth-child(1) { height: 15%; } .art-5 i:nth-child(2) { height: 28%; } .art-5 i:nth-child(3) { height: 42%; } .art-5 i:nth-child(4) { height: 58%; } .art-5 i:nth-child(5) { height: 78%; } .art-5 i:nth-child(6) { height: 100%; }

/* ---------- Stats ---------- */
.stats { padding-block: clamp(70px, 9vw, 120px); }
.stats-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--stat-bg); padding: clamp(26px, 3.2vw, 40px) 28px; display: flex; flex-direction: column; gap: 10px; transition: background .4s; }
.stat:hover { background: rgba(var(--shine), .03); }
.stat b { font-size: clamp(19px, 1.7vw, 23px); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; align-self: flex-start; padding-bottom: .08em; }
.stat > span { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ---------- Work ---------- */
/* Featured project: screenshot first, the story slides up on hover or focus */
.project { position: relative; display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.project .work-meta { display: block; padding: 0; }
.project .work-meta h3 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; }
.project .work-meta p { margin-top: 10px; font-size: 16px; max-width: 30ch; }
@media (max-width: 960px) { .project { grid-template-columns: 1fr; } .project .work-meta { padding: 4px 6px 0; } }
.project-shot {
  position: relative; border-radius: 26px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: #0b0f14;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7);
}
.project-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; background: var(--chip-bg); border-bottom: 1px solid var(--line); }
.project-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.project-bar span { margin-inline-start: 12px; font-size: 12px; color: var(--muted); direction: ltr; }
.project-shot picture, .project-shot img { display: block; width: 100%; height: auto; }
.project-shot img { transition: transform 1.2s var(--ease), filter .6s var(--ease); }
html[lang="ar"] .only-en, html[lang="en"] .only-ar { display: none; }
:root[data-theme="light"] .only-dark, :root:not([data-theme="light"]) .only-light { display: none; }
/* In light mode the story panel is light too */
:root[data-theme="light"] .project-story {
  --text: #0a1b33; --muted: #50627e; --line: rgba(1, 43, 98, .16); --surface: rgba(255, 255, 255, .6); --surface-2: rgba(255, 255, 255, .9); --hover-line: rgba(1, 43, 98, .35);
  background: linear-gradient(to top, rgba(240, 245, 252, .98) 0%, rgba(240, 245, 252, .93) 55%, rgba(240, 245, 252, .6) 100%);
}
:root[data-theme="light"] .project-kicker { color: #016cf0; }
:root[data-theme="light"] .project-shot { background: #f6f7f8; box-shadow: 0 40px 80px -45px rgba(1, 43, 98, .45); }
.project-hint {
  position: absolute; z-index: 2; inset-inline-end: 18px; bottom: 18px; padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #fbfbfb; background: rgba(1, 7, 20, .72); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .3s;
}
.project-story {
  /* Always dark over the screenshot, in both themes */
  --text: #fbfbfb; --muted: #b5c3d9; --line: rgba(255, 255, 255, .18); --surface: rgba(255, 255, 255, .08); --surface-2: rgba(255, 255, 255, .14); --hover-line: rgba(255, 255, 255, .4);
  position: absolute; z-index: 3; inset: 38px 0 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px;
  padding: clamp(22px, 3.2vw, 40px); color: var(--text);
  background: linear-gradient(to top, rgba(1, 7, 20, .97) 0%, rgba(1, 7, 20, .9) 55%, rgba(1, 7, 20, .55) 100%);
  opacity: 0; transform: translateY(28px); transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.project-shot:hover .project-story, .project-shot:focus-within .project-story { opacity: 1; transform: none; }
.project-shot:hover .project-hint, .project-shot:focus-within .project-hint { opacity: 0; }
.project-shot:hover img, .project-shot:focus-within img { transform: scale(1.04); filter: blur(3px); }
.project-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #54efe4; }
html[lang="ar"] .project-kicker { letter-spacing: 0; font-size: 14px; }
.project-desc { margin: 0; max-width: 54ch; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.7; }
.project-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.project-actions .arrow { width: 16px; height: 16px; }
[dir="rtl"] .project-actions .arrow { transform: scaleX(-1); }
/* Touch screens can't hover: show the story under the screenshot instead */
@media (hover: none), (max-width: 760px) {
  .project-hint { display: none; }
  .project-story { position: relative; inset: auto; opacity: 1; transform: none; background: linear-gradient(180deg, #06101f, #010714); }
  :root[data-theme="light"] .project-story { background: #f0f5fc; }
  .project-shot:hover img { transform: none; filter: none; }
}
.work-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 6px 0; }
.work-meta h3 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.work-meta p { margin: 2px 0 0; color: var(--muted); }
.work-tags { font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--tag); white-space: nowrap; direction: ltr; }

/* mockups */

/* ---------- Stack ---------- */

/* ---------- Testimonials ---------- */
.tst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tst { margin: 0; padding: 32px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; gap: 30px; transition: transform .5s var(--ease), border-color .4s; }
.tst:hover { transform: translateY(-8px); border-color: var(--hover-line); }
.tst blockquote { margin: 0; font-size: 18px; line-height: 1.55; }
.tst figcaption { display: flex; align-items: center; gap: 14px; }
.tst figcaption b { display: block; }
.tst figcaption span:not(.avatar) { color: var(--muted); font-size: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.a1 { background: linear-gradient(135deg, #54efe4, #016cf0); } .a2 { background: linear-gradient(135deg, #014188, #09ddec); } .a3 { background: linear-gradient(135deg, #09ddec, #014188); }

/* ---------- Quiz ---------- */
.quiz-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.quiz-intro { position: sticky; top: 140px; }
.quiz-card {
  position: relative; padding: clamp(28px, 3.4vw, 40px); border-radius: 28px; border: 1px solid var(--line);
  background: var(--panel-bg); backdrop-filter: blur(16px); min-height: 380px;
}
.quiz-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 32px; }
.quiz-progress-fill { display: block; height: 100%; width: 100%; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
[dir="rtl"] .quiz-progress-fill { transform-origin: 100% 50%; }
.quiz-step h3, .quiz-result h3 { margin: 0 0 22px; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -.02em; }
.quiz-options { display: grid; gap: 12px; }
.quiz-opt {
  width: 100%; text-align: start; padding: 16px 20px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); font-size: 15.5px; font-weight: 500; transition: border-color .3s, background .3s, transform .3s var(--ease);
}
.quiz-opt:hover { background: var(--surface-2); border-color: var(--hover-line); }
.quiz-opt.is-active { border-color: transparent; background: var(--grad); color: #fff; transform: translateX(4px); }
[dir="rtl"] .quiz-opt.is-active { transform: translateX(-4px); }
.quiz-back { margin-top: 22px; color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 4px; }
.quiz-back:hover { color: var(--text); }
.quiz-result { text-align: start; }
.quiz-result-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 12px 30px -10px rgba(1, 108, 240, .7); margin-bottom: 18px; }
.quiz-result-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quiz-result-label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.quiz-result #quiz-result-service { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quiz-result p { margin: 0 0 26px; color: var(--muted); font-size: 15.5px; max-width: 480px; }
.quiz-next { padding: 18px 20px; border-radius: 16px; border: 1px dashed var(--line); background: var(--surface); margin-bottom: 26px; }
.quiz-next > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.quiz-next ol { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: 14.5px; display: grid; gap: 6px; }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.quiz-restart { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.quiz-restart:hover { color: var(--text); }
@media (max-width: 960px) {
  .quiz-grid { grid-template-columns: 1fr; }
  .quiz-intro { position: static; }
}

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.contact-title { margin: 0; font-size: clamp(32px, 4.3vw, 62px); line-height: 1; letter-spacing: -.045em; font-weight: 800; }
html[lang="ar"] .contact-title { letter-spacing: 0; line-height: 1.25; }
.contact-info { margin-top: 36px; display: flex; flex-direction: column; gap: 6px; font-size: 20px; font-weight: 600; }
.contact-info a { width: fit-content; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease); }
.contact-info a:hover { background-size: 100% 2px; }
.contact-info span { color: var(--muted); font-weight: 400; direction: ltr; width: fit-content; }
.contact-form { padding: clamp(24px, 3vw, 36px); border-radius: 28px; border: 1px solid var(--line); background: var(--panel-bg); backdrop-filter: blur(16px); display: grid; gap: 16px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 24px 18px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--field);
  color: var(--text); font: inherit; outline: none; resize: vertical; transition: border-color .3s, background .3s, box-shadow .3s;
}
.field input:focus, .field textarea:focus { border-color: rgba(9, 221, 236, .8); background: rgba(9, 221, 236, .06); box-shadow: 0 0 0 4px rgba(9, 221, 236, .15); }
.field label { position: absolute; top: 17px; inset-inline-start: 19px; color: var(--muted); pointer-events: none; transition: transform .3s var(--ease), font-size .3s, top .3s; transform-origin: left top; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 7px; font-size: 12px; color: #54efe4; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-label { width: 100%; color: var(--muted); font-size: 14px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; transition: all .3s var(--ease); }
.chips label:hover span { border-color: var(--hover-line); }
.chips input:checked + span { background: var(--grad); border-color: transparent; color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.form-note { margin: 0; min-height: 1.4em; font-size: 14px; color: #3ee08f; }
.form-note.err { color: #ff7b72; }

/* ---------- Footer ---------- */
.footer { position: relative; border-top: 1px solid var(--line); padding-top: 60px; overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); transition: color .3s; } .footer-links a:hover { color: var(--text); }
.socials { display: flex; gap: 10px; }
.socials a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; transition: background .3s, transform .4s var(--ease); }
.socials a:hover { background: var(--grad); transform: translateY(-4px); border-color: transparent; }
.footer-giant { direction: ltr; text-align: center; line-height: .8; margin-top: 50px; user-select: none; }
.footer-giant span { display: inline-block; padding-inline: .06em; font-size: clamp(80px, 23vw, 360px); font-weight: 800; letter-spacing: -.06em; background: linear-gradient(180deg, var(--giant), transparent 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tagline { letter-spacing: .35em; font-size: 12px; direction: ltr; }

/* ---------- Reveal defaults (JS enhances) ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); }
.js .intro-fade { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-card { min-height: 360px; }
}
@media (max-width: 960px) {
  .nav-links, .nav-actions .btn { display: none; }
  .burger { display: block; }
  .hero-inner { grid-template-columns: 1fr; text-align: start; }
  .hero-visual { max-width: 380px; order: -1; margin-bottom: -10px; }
  .cx-node { gap: 8px; padding: 6px 10px 6px 6px; border-radius: 13px; }
  .cx-ic { width: 30px; height: 30px; border-radius: 9px; }
  .cx-ic svg { width: 16px; height: 16px; }
  .cx-txt b { font-size: 12.5px; }
  .cx-txt small { display: none; }
  .ai-grid, .contact-grid { grid-template-columns: 1fr; }
  .tst-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .process-pin { min-height: auto; }
  .process-track { width: auto; flex-direction: column; padding-inline: clamp(20px, 4vw, 40px); }
  .step { width: 100%; min-height: 300px; }
  .process-bar { display: none; }
}
@media (max-width: 680px) {
  .services-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 320px; }
  .cx-node, [dir="rtl"] .cx-node { flex-direction: column; gap: 5px; padding: 7px 8px; text-align: center; }
  .cx-txt b { font-size: 10.5px; white-space: normal; max-width: 11ch; }
  .term-body { height: 320px; font-size: 13.5px; }
  .pre-count { right: 20px; bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal, .js .intro-fade { opacity: 1; transform: none; }
}

/* ---------- Direction & cursor helpers ---------- */
.process-pin { direction: ltr; }
[dir="rtl"] .process-head, [dir="rtl"] .step { direction: rtl; }
.has-cursor body, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.step-art { direction: ltr; }

/* ---------- Lite mode: phones & weaker devices (class set by main.js) ---------- */
.lite .grain, .lite .cursor, .lite .cursor-dot { display: none; }
.lite .btn-ghost, .lite .mobile-menu, .lite .contact-form { -webkit-backdrop-filter: none; backdrop-filter: none; }
.lite .contact-form { background: var(--panel-bg); }
.lite .marquee-track { animation-duration: 40s; }

/* Fallbacks for older browsers without `inset` */
.preloader, .pre-curtain, .mobile-menu, #hero-canvas, .hero-aurora { top: 0; right: 0; bottom: 0; left: 0; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--text); transition: background .3s, transform .5s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); transform: rotate(-20deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* ---------- Light mode ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8f0fa;
  --bg-2: #dce7f5;
  --surface: rgba(1, 43, 98, .035);
  --surface-2: rgba(1, 43, 98, .07);
  --line: rgba(1, 43, 98, .13);
  --text: #0a1b33;
  --muted: #50627e;
  --grad-text: linear-gradient(115deg, #06a3b3 0%, #016cf0 55%, #014188 100%);
  --nav-line: rgba(1, 43, 98, .14);
  --panel-bg: rgba(245, 248, 251, .7);
  --chip-bg: rgba(242, 246, 250, .9);
  --menu-bg: rgba(232, 240, 250, .97);
  --tag: #33486a;
  --hover-line: rgba(1, 43, 98, .3);
  --card-a: rgba(248, 250, 252, .6);
  --card-b: rgba(248, 250, 252, .3);
  --shine: 1, 65, 136;
  --stroke: rgba(1, 43, 98, .45);
  --field: rgba(248, 250, 252, .55);
  --stat-bg: rgba(248, 250, 252, .4);
  --giant: rgba(1, 43, 98, .12);
}
:root[data-theme="light"] .svc-arrow { background: var(--text); color: #fff; }
:root[data-theme="light"] .btn-primary { box-shadow: 0 10px 30px -12px rgba(1, 108, 240, .55); }

@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }
