/* ============================================================
   CloudLink Technologies — motion redesign
   Light corporate reinterpretation of the brand: airy near-white
   base, navy type, coral accent, teal atmosphere.
   EN (Space Grotesk/Inter) + AR (Tajawal).
   ============================================================ */

:root {
  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --text: #0f1f3d;
  --text-muted: rgba(15, 31, 61, 0.58);
  --accent: #f26b3a;
  --accent-glow: rgba(242, 107, 58, 0.22);
  --teal: #3abfbf;
  --border: rgba(15, 31, 61, 0.1);
  --radius: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --section-pad: clamp(96px, 14vh, 180px);
  --font-display: "Space Grotesk", "Tajawal", system-ui, sans-serif;
  --font-body: "Inter", "Tajawal", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* No CSS scroll-behavior:smooth — it corrupts ScrollTrigger.refresh() measurements.
   Lenis owns smooth scrolling (including anchors); without JS, anchors jump instantly. */
html.lenis, html.lenis body { height: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

[dir="rtl"] body, [dir="rtl"] { --font-display: "Tajawal", system-ui, sans-serif; --font-body: "Tajawal", system-ui, sans-serif; }
[dir="rtl"] .headline, [dir="rtl"] h2 { letter-spacing: 0; }

/* Film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.03; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }
h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
h3 { font-size: 1.35rem; }

.label {
  font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.75rem;
  color: var(--accent); margin-bottom: 1.25rem; font-weight: 500;
}
[dir="rtl"] .label { letter-spacing: 0.06em; }

.body-copy { color: var(--text-muted); max-width: 56ch; margin-bottom: 1.25rem; }
.section-sub { margin-bottom: 3rem; }

.section { padding: var(--section-pad) clamp(1.5rem, 6vw, 6rem); max-width: 1320px; margin: 0 auto; }

/* ============ glass / buttons / links ============ */
.glass {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(15, 31, 61, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn-primary {
  display: inline-block; padding: 0.95rem 2rem; border-radius: 999px;
  font-weight: 600; font-family: var(--font-display); font-size: 1rem;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  text-decoration: none; text-align: center;
  box-shadow: 0 0 28px var(--accent-glow);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 46px var(--accent-glow); }
.btn-sm { padding: 0.6rem 1.3rem; font-size: 0.9rem; box-shadow: 0 0 18px rgba(242, 107, 58, 0.25); }

.btn-ghost {
  display: inline-block; padding: 0.95rem 2rem; border-radius: 999px;
  font-weight: 500; font-family: var(--font-display); font-size: 1rem;
  background: transparent; color: var(--text); border: 1px solid var(--border);
  text-decoration: none; text-align: center;
  transition: border-color 0.3s, background 0.3s;
}
.btn-ghost:hover { border-color: rgba(15, 31, 61, 0.35); background: rgba(15, 31, 61, 0.04); }

.link { position: relative; text-decoration: none; color: var(--text); }
.link::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: -3px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
[dir="rtl"] .link::after { transform-origin: left; }
.link:hover::after { transform: scaleX(1); transform-origin: left; }
[dir="rtl"] .link:hover::after { transform-origin: right; }

/* ============ nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem);
  transition: background 0.4s, border-color 0.4s, padding 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.logo span { color: var(--accent); }
.logo em { font-style: normal; font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }
.nav-links { display: flex; gap: 2rem; font-size: 0.95rem; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 0.45rem 1rem; cursor: pointer;
  font-family: "Tajawal", var(--font-display); font-size: 0.9rem; font-weight: 500;
  transition: border-color 0.3s, background 0.3s;
}
.lang-toggle:hover { border-color: rgba(15, 31, 61, 0.35); background: rgba(15, 31, 61, 0.04); }

/* ============ hero ============ */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 7rem clamp(1.5rem, 6vw, 6rem) 4rem; overflow: hidden;
}
.mesh { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.mesh span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  will-change: transform;
  animation: drift 18s ease-in-out infinite alternate;
}
.mesh span:nth-child(1) { width: 55vw; height: 55vw; background: var(--accent); top: -22%; inset-inline-start: -12%; opacity: 0.16; }
.mesh span:nth-child(2) { width: 42vw; height: 42vw; background: var(--teal); bottom: -18%; inset-inline-end: -8%; opacity: 0.14; animation-delay: -6s; }
.mesh span:nth-child(3) { width: 30vw; height: 30vw; background: #93c5fd; top: 32%; inset-inline-end: 28%; opacity: 0.2; animation-delay: -12s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8vw, -6vh) scale(1.15); }
}

.hero-content { position: relative; z-index: 1; max-width: 920px; }
.headline {
  font-size: clamp(2.7rem, 7.5vw, 6.8rem);
  line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 1.75rem;
}
[dir="rtl"] .headline { line-height: 1.15; }
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.word { display: inline-block; }
.hero .sub { color: var(--text-muted); max-width: 58ch; margin-bottom: 2.5rem; font-size: 1.0625rem; }
.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.trust { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.04em; }
.trust::before { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--accent); vertical-align: middle; margin-inline-end: 0.75rem; }

.scroll-cue { position: absolute; bottom: 2rem; inset-inline-start: 50%; transform: translateX(-50%); opacity: 0.4; }
.scroll-cue span { display: block; width: 1px; height: 48px; background: linear-gradient(var(--text), transparent); animation: cue 2s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ============ marquee ============ */
.marquee-section { padding: 2rem 0 0; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 3.5rem; width: max-content; animation: marquee 30s linear infinite; padding: 1.5rem 0; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
.marquee-item { display: flex; align-items: center; gap: 0.8rem; color: var(--text-muted); font-family: var(--font-display); font-weight: 500; white-space: nowrap; }
.marquee-item img { width: 22px; height: 22px; opacity: 0.75; }
.marquee-item .tile-initial { font-size: 1rem; color: var(--text-muted); }

/* ============ stats ============ */
.stats-section { padding-top: clamp(48px, 7vh, 90px); padding-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { padding: 1.75rem; text-align: center; }
.stat-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ============ about ============ */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.values { list-style: none; margin: 1.5rem 0 0; }
.values li { padding-inline-start: 1.9rem; position: relative; margin-bottom: 0.9rem; color: var(--text); }
.values li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 0.05em;
  color: var(--accent); font-weight: 700;
}
.about-visual { position: relative; }
.about-glow, .agent-glow {
  position: absolute; inset: -15%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  filter: blur(30px); opacity: 0.7;
}
.pos-card { padding: 2rem; max-width: 420px; margin-inline: auto; transform-style: preserve-3d; }
.pos-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.75rem; }
.pos-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.pos-sub { font-size: 0.8rem; color: var(--text-muted); }
.pos-dot { width: 10px; height: 10px; border-radius: 50%; background: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, 0.8); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.25); opacity: 0.7; } }
.pos-row { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 12px; background: rgba(15, 31, 61, 0.03); border: 1px solid var(--border); margin-bottom: 1.25rem; }
.pos-brand-chip {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  background: #0070d1; color: #fff; font-size: 0.9rem;
}
.pos-brand { font-weight: 600; font-size: 0.95rem; }
.pos-type { font-size: 0.78rem; color: var(--text-muted); }
.pos-amount { margin-inline-start: auto; font-family: var(--font-display); font-weight: 700; color: var(--accent); white-space: nowrap; }
.pos-bars { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.pos-bars i { height: 6px; border-radius: 3px; background: rgba(15, 31, 61, 0.08); flex: 1; }
.pos-bars i:first-child { background: var(--accent); flex: 1.6; }
.pos-btn { width: 100%; }

/* ============ how it works ============ */
.how-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.how-sticky { position: sticky; top: 18vh; }
.how-progress { display: flex; align-items: center; gap: 1rem; margin-top: 2.5rem; font-family: var(--font-display); color: var(--text-muted); }
.how-counter { color: var(--accent); font-weight: 700; font-size: 1.2rem; min-width: 2ch; }
.how-bar { flex: 1; height: 2px; background: rgba(15, 31, 61, 0.1); border-radius: 1px; overflow: hidden; }
.how-bar i { display: block; height: 100%; width: 0%; background: var(--accent); }
.steps { list-style: none; display: flex; flex-direction: column; gap: 1.5rem; }
.step { padding: 2.25rem; position: relative; transition: border-color 0.5s, background 0.5s; }
.step.active { border-color: rgba(242, 107, 58, 0.45); background: rgba(242, 107, 58, 0.05); }
.step-num {
  font-family: var(--font-display); font-weight: 700; font-size: 2.6rem;
  color: transparent; -webkit-text-stroke: 1px rgba(15, 31, 61, 0.28);
  display: block; margin-bottom: 0.75rem; line-height: 1;
}
.step.active .step-num { -webkit-text-stroke-color: var(--accent); }
.step h3 { margin-bottom: 0.6rem; }
.step p { color: var(--text-muted); font-size: 0.98rem; }

/* ============ brands ============ */
.brands { text-align: center; }
.brands .label, .brands h2 { text-align: center; }
.brands .section-sub { margin-inline: auto; }
.brand-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 2.5rem;
}
.brand-tile {
  position: relative; padding: 1.9rem 1rem; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px -22px rgba(15, 31, 61, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 0.85rem;
  transition: transform 0.5s var(--ease-out), border-color 0.5s, background 0.5s;
  overflow: hidden;
}
.brand-tile:hover { transform: translateY(-6px); border-color: rgba(15, 31, 61, 0.22); }
.brand-tile::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(58, 191, 191, 0.12), transparent 60%);
  transition: opacity 0.4s;
}
.brand-tile:hover::before { opacity: 1; }
.brand-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: #fff;
}
.brand-icon img { width: 26px; height: 26px; }
.brand-name { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.brands-more { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 3rem; }
.brands-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 2rem 2.5rem; max-width: 720px; margin: 0 auto 2rem; flex-wrap: wrap;
}
.brands-cta p { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.disclaimer { font-size: 0.75rem; color: rgba(15, 31, 61, 0.38); max-width: 64ch; margin: 0 auto; }

/* ============ become agent ============ */
.agent { position: relative; }
.agent-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.agent-h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.benefits { display: flex; gap: 0.85rem; flex-wrap: wrap; margin: 1.75rem 0 2.25rem; }
.benefit { padding: 0.65rem 1.3rem; font-family: var(--font-display); font-weight: 500; font-size: 0.92rem; border-radius: 999px; }
.phone-wrap { position: relative; display: flex; justify-content: center; }
.phone { width: min(300px, 80vw); padding: 2.25rem 1.75rem; border-radius: 36px; transform-style: preserve-3d; }
.phone-notch { width: 90px; height: 5px; border-radius: 3px; background: rgba(15, 31, 61, 0.14); margin: 0 auto 1.75rem; }
.phone-app { font-family: var(--font-display); font-weight: 600; margin-bottom: 1.5rem; }
.phone-balance-label { font-size: 0.78rem; color: var(--text-muted); }
.phone-balance { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--accent); margin-bottom: 1.5rem; }
.phone-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1.5rem; }
.phone-tiles i { aspect-ratio: 1; border-radius: 10px; background: rgba(15, 31, 61, 0.05); border: 1px solid var(--border); }
.phone-btn { display: block; width: 100%; padding: 0.8rem; font-size: 0.95rem; }

/* ============ contact ============ */
.contact .label, .contact h2 { text-align: center; }
.contact .section-sub { margin-inline: auto; text-align: center; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
.contact-form { padding: 2.25rem; display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 0.9rem 1.1rem; border-radius: 12px;
  background: #ffffff; border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.3s; resize: vertical;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form select { color: var(--text); appearance: none; }
.contact-form select option { color: #111; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: rgba(242, 107, 58, 0.6);
}
.form-success { font-size: 0.95rem; color: var(--text-muted); }
.form-success strong { color: #0e9f6e; }
.contact-side { display: flex; flex-direction: column; gap: 1.5rem; }
.whatsapp-cta {
  display: flex; align-items: center; gap: 1rem; padding: 1.5rem 1.75rem;
  color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 600;
  transition: transform 0.5s var(--ease-out), border-color 0.5s;
}
.whatsapp-cta:hover { transform: translateY(-4px); border-color: rgba(242, 107, 58, 0.5); }
.wa-icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0;
}
.contact-info { padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.contact-info p { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.98rem; }
.info-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent); font-family: var(--font-display); }
[dir="rtl"] .info-label { letter-spacing: 0.04em; }

/* ============ footer ============ */
.footer { position: relative; overflow: hidden; padding: var(--section-pad) clamp(1.5rem, 6vw, 6rem) 2.5rem; border-top: 1px solid var(--border); }
.footer-mesh { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.footer-mesh span {
  position: absolute; width: 60vw; height: 60vw; border-radius: 50%;
  background: var(--accent); opacity: 0.08; filter: blur(110px);
  bottom: -45vw; left: 50%; transform: translateX(-50%);
}
.footer-statement {
  position: relative; z-index: 1; text-align: center;
  font-size: clamp(2rem, 5.5vw, 4.5rem); margin-bottom: clamp(3rem, 8vh, 6rem);
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-bar {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 2rem;
}
.footer-links { display: flex; gap: 1.75rem; font-size: 0.92rem; }
.footer-legal { font-size: 0.8rem; color: var(--text-muted); text-align: end; }
.license { margin-top: 0.25rem; font-size: 0.72rem; }

/* ============ floating whatsapp ============ */
.floating-wa {
  position: fixed; bottom: 1.75rem; inset-inline-end: 1.75rem; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.5rem; text-decoration: none;
  box-shadow: 0 8px 30px rgba(242, 107, 58, 0.4);
  transition: transform 0.4s var(--ease-out);
}
.floating-wa:hover { transform: scale(1.1); }

/* ============ custom cursor ============ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none;
  z-index: 9998; transform: translate(-50%, -50%); opacity: 0;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-ring { width: 36px; height: 36px; border: 1px solid rgba(15, 31, 61, 0.3); transition: width 0.3s, height 0.3s, border-color 0.3s; }
.cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--accent); }
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ responsive ============ */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .about-grid, .agent-grid, .contact-grid, .how-grid { grid-template-columns: 1fr; }
  .how-sticky { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-legal { text-align: start; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .brands-cta { justify-content: center; text-align: center; }
  .mesh span { filter: blur(60px); }
  .nav { padding-inline: 1rem; }
  .logo em { display: none; }
  .btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .scroll-cue { display: none; }
}
