:root {
  --blue: #8ccbf0;
  --blue-deep: #4fa8dd;
  --ink: #1e1714;
  --cream: #f5f0e8;
  --night: #120d0b;
  --beige: #ead8c0;
  --red: #ff2d2d;
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--night);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.45;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 max(20px, env(safe-area-inset-left));
  padding-top: env(safe-area-inset-top);
  background: rgba(11, 10, 9, 0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s;
}
.nav.on-blue { background: rgba(140, 203, 240, 0.6); color: var(--ink); border-color: rgba(28, 23, 19, 0.1); }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-cta { background: var(--blue); color: var(--ink); padding: 7px 16px; border-radius: 999px; font-weight: 600; opacity: 1 !important; }
.nav.on-blue .nav-cta { background: var(--ink); color: var(--cream); }

/* ---------- story (3D) ---------- */
.story { position: relative; height: 365vh; }
.story-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 30%, #2a201b 0%, var(--night) 70%);
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; mix-blend-mode: screen; }

.story-copy {
  position: absolute; left: 0; right: 0; text-align: center; padding: 0 24px;
  pointer-events: none; opacity: 0; will-change: opacity, transform;
}
.copy-intro { top: 15vh; top: 15svh; }
.copy-impact { bottom: 14vh; }
.copy-brand { bottom: 12vh; bottom: 12svh; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }
h1, h2 { font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
h1 { font-size: clamp(42px, 8.4vw, 104px); }
h2 { font-size: clamp(34px, 6vw, 72px); }
.lede { font-size: clamp(17px, 2vw, 22px); color: var(--text-dim); margin-top: 18px; max-width: 34ch; margin-inline: auto; }
.copy-impact h2 { font-size: clamp(30px, 5vw, 60px); }
.brand-wordmark { width: min(74vw, 520px); height: auto; margin: 0 auto; }
.brand-line { color: var(--ink); font-size: clamp(19px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.02em; margin-top: 18px; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase;
  transition: opacity 0.4s;
}
.scroll-hint i { width: 22px; height: 34px; border: 2px solid currentColor; border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; background: currentColor; border-radius: 2px; animation: wheel 1.6s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }

.loader { position: absolute; inset: auto 0 50% 0; display: flex; justify-content: center; transition: opacity 0.6s; }
.loader-bar { width: 140px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.3s; }
.loader.done { opacity: 0; pointer-events: none; }

/* ---------- shared section ---------- */
section.how, section.why, section.contact { padding: clamp(90px, 14vw, 160px) 20px; }
.section-head { text-align: center; max-width: 900px; margin: 0 auto clamp(50px, 8vw, 90px); }
.muted { color: var(--text-dim); }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- how it works ---------- */
.how { background: var(--night); }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; max-width: 1100px; margin: 0 auto; }
.how-device { position: relative; }
.device {
  position: sticky; top: calc(50vh - 290px);
  width: 280px; height: 580px; margin: 0 auto;
  border-radius: 48px; padding: 12px;
  background: linear-gradient(145deg, #3a3633, #121110);
  box-shadow: 0 0 0 1.5px #4a4541, 0 40px 80px -20px rgba(140, 203, 240, 0.25), 0 30px 60px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s var(--ease);
}
.device-island { position: absolute; top: 22px; left: 50%; width: 86px; height: 25px; margin-left: -43px; background: #000; border-radius: 20px; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 37px; overflow: hidden; background: var(--cream); color: var(--ink); }
.scr {
  position: absolute; inset: 0; padding: 64px 22px 28px;
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: scale(0.96); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.device[data-step="1"] .scr-1, .device[data-step="2"] .scr-2, .device[data-step="3"] .scr-3,
.device[data-step="4"] .scr-4, .device[data-step="5"] .scr-5 { opacity: 1; transform: none; }

.scr-top { font-size: 12px; font-weight: 600; color: #6b6560; display: flex; align-items: center; gap: 6px; }
.scr-top .dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; }
.scr-label { margin-top: 26px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b6560; font-weight: 600; }
.scr-num { font-size: 84px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.scr-num.small { font-size: 40px; margin-top: 12px; }
.scr-hint { margin-top: auto; font-size: 13px; color: #6b6560; }
.qr { width: 150px; height: 150px; margin-top: 18px; display: grid; grid-template-columns: repeat(21, 1fr); background: #fff; padding: 8px; border-radius: 12px; }
.qr i { background: var(--ink); border-radius: 1px; }
.qr i.o { background: transparent; }
.qr-small { width: 120px; height: 120px; margin: 0; }

.scr-2 { background: #111; padding: 0; }
.cam { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(circle at 50% 40%, #3b3532, #0d0c0b); }
.cam-frame { position: relative; padding: 14px; border-radius: 20px; }
.cam-frame::before { content: ""; position: absolute; inset: 0; border: 3px solid #ffd60a; border-radius: 20px; clip-path: polygon(0 0, 30% 0, 30% 4%, 4% 4%, 4% 30%, 0 30%, 0 70%, 4% 70%, 4% 96%, 30% 96%, 30% 100%, 70% 100%, 70% 96%, 96% 96%, 96% 70%, 100% 70%, 100% 30%, 96% 30%, 96% 4%, 70% 4%, 70% 0, 100% 0, 100% 100%, 0 100%); }
.cam-line { position: absolute; left: 10px; right: 10px; height: 2px; background: #ffd60a; box-shadow: 0 0 12px #ffd60a; top: 14px; animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { to { top: calc(100% - 16px); } }
.cam-pill { background: rgba(255, 255, 255, 0.92); color: #111; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px; display: flex; gap: 6px; }

/* real screenshots of the customer page (steps 3 and 4) */
.scr-shot { padding: 0; background: var(--ink); }
.scr-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.device[data-step="3"] .shot-alt, .device[data-step="4"] .shot-alt { animation: lang 6s 1.8s ease-in-out infinite; }
.shot-alt { opacity: 0; }
@keyframes lang { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.device[data-step="4"] { animation: shake 0.42s 0.3s 3; }
@keyframes shake { 25% { transform: rotate(-1.5deg); } 75% { transform: rotate(1.5deg); } }

.scr-5 { justify-content: center; }
.check { width: 92px; height: 92px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; font-size: 46px; font-weight: 800; }
.scr-5 .scr-hint { margin-top: 10px; }

.steps { list-style: none; }
.step { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.25; transition: opacity 0.6s var(--ease); }
.step.active { opacity: 1; }
.step-n { font-size: 14px; font-weight: 700; color: var(--blue); letter-spacing: 0.08em; }
.step h3 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 14px; }
.step h3 em { font-style: normal; color: var(--blue); }
.step p { font-size: 18px; color: var(--text-dim); max-width: 40ch; }

/* ---------- why ---------- */
.why { background: var(--cream); color: var(--ink); }
.why .eyebrow { color: var(--blue-deep); }
.why .muted { color: #86868b; }
.cards { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border-radius: var(--radius); padding: 34px 30px; box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 1s var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); }
.card-ic { font-size: 30px; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--beige); margin-bottom: 22px; }
.card h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 8px; }
.card p { color: #6e6e73; font-size: 16px; }
.card-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.3fr; gap: 26px; align-items: center; }
.island-shot { width: 100%; border-radius: 26px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18); }
.cards .card:nth-child(3n + 2) { transition-delay: 0.08s; }
.cards .card:nth-child(3n + 3) { transition-delay: 0.16s; }

/* ---------- contact ---------- */
.contact { background: var(--blue); color: var(--ink); }
.contact .eyebrow { color: var(--ink); opacity: 0.6; }
.contact .lede { color: rgba(28, 23, 19, 0.7); margin-inline: 0; }
.contact-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.1fr; gap: 6vw; align-items: start; }
.contact-phone { display: inline-flex; flex-direction: column; margin-top: 40px; padding: 18px 26px; background: var(--ink); color: var(--cream); border-radius: 20px; transition: transform 0.3s var(--ease); }
.contact-phone:hover { transform: scale(1.03); }
.cp-label { font-size: 13px; opacity: 0.7; }
.cp-num { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -0.01em; direction: ltr; }
.contact-mail { display: block; margin-top: 18px; font-size: 18px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.mail-form { background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(20px); border-radius: 28px; padding: clamp(22px, 3vw, 36px); box-shadow: 0 30px 60px -20px rgba(28, 23, 19, 0.25); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; flex: 1; }
.field-row { display: flex; gap: 14px; }
.field label { font-size: 13px; font-weight: 600; opacity: 0.75; }
.field input, .field select, .field textarea {
  font: 16px var(--font); color: var(--ink); background: #fff;
  border: 1.5px solid transparent; border-radius: 14px; padding: 13px 14px; outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(28, 23, 19, 0.08); }
.field.invalid input, .field.invalid textarea { border-color: #d70015; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-primary, .btn-ghost { font: 600 16px var(--font); border-radius: 999px; padding: 14px 26px; cursor: pointer; border: 0; transition: transform 0.2s var(--ease), background 0.2s; }
.btn-primary { background: var(--ink); color: var(--cream); flex: 1; }
.btn-primary:hover { transform: scale(1.02); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid rgba(28, 23, 19, 0.3); }
.form-note { margin-top: 12px; font-size: 13px; opacity: 0.7; min-height: 1.4em; }

.footer { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 34px 20px calc(34px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--text-dim); background: var(--night); }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .how-grid { grid-template-columns: 1fr; gap: 0; }
  .how-device { position: sticky; top: 56px; z-index: 2; padding: 14px 0 34px; background: linear-gradient(var(--night) 82%, rgba(11, 10, 9, 0)); }
  .device { position: relative; top: 0; width: 200px; height: 414px; border-radius: 38px; padding: 9px; }
  .device-island { top: 16px; width: 64px; height: 19px; margin-left: -32px; }
  .screen { border-radius: 30px; }
  .scr { padding: 46px 16px 20px; }
  .scr-num { font-size: 62px; }
  .qr { width: 118px; height: 118px; padding: 6px; }
  .qr-small { width: 96px; height: 96px; }
  .steps { padding-bottom: 20vh; }
  .step { min-height: 55vh; justify-content: flex-start; padding-top: 2vh; text-align: center; align-items: center; }
  .step p { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .card-wide { grid-column: auto; grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .copy-intro { top: 12svh; }
}
@media (min-width: 821px) and (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .device[data-step="4"] { animation: none; }
}

/* ---------- language toggle + Arabic ---------- */
.lang-toggle { font: inherit; font-size: 14px; font-weight: 600; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 6px 14px; cursor: pointer; opacity: 0.85; }
.lang-toggle:hover { opacity: 1; }
html[lang="ar"] { --font: "IBM Plex Sans Arabic", Inter, system-ui, sans-serif; }
html[lang="ar"] body, html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] em { font-style: normal; }
html[lang="ar"] h1, html[lang="ar"] h2 { line-height: 1.25; }
.ltr { direction: ltr; unicode-bidi: isolate; }
