/* ═══════════════════════════════════════════════════════════
   ORBITECH — Scroll-Driven Experience (v2)
   Monochrome on off-black · footage carries the color
   Display: Syne · Body: Manrope · Arabic: Cairo
   ═══════════════════════════════════════════════════════════ */

/* ── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  /* surfaces (cool off-black — never pure #000) */
  --bg:         #08090b;
  --bg-2:       #0c0e11;
  --near-black: #0c0e11;
  --dark:       #121419;
  --black:      #000000;   /* reserved: scrims, selection ink */

  /* ink ramp (monochrome) */
  --ink:        #ffffff;
  --ink-2:      rgba(255,255,255,0.78);
  --ink-3:      rgba(255,255,255,0.60);
  --ink-4:      rgba(255,255,255,0.42);
  --off-white:  #f5f5f7;

  /* single functional accent — focus + form states only */
  --focus:      #5fd0ec;
  --danger:     #ff6b6b;

  --font-display: 'Syne', sans-serif;
  --font-body:    'Manrope', sans-serif;

  /* motion */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index scale */
  --z-canvas: 1;
  --z-service: 3;
  --z-nav: 1000;
  --z-fab: 1200;            /* above content/nav, below modal so dialogs cover it */
  --z-modal-backdrop: 9990;
  --z-modal: 9991;
  --z-cursor: 9998;
  --z-loader: 9999;
}

/* ── 2. RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; }
body { overflow-x: hidden; cursor: none; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--black); }

/* Keyboard focus is always visible, even though the pointer cursor is custom.
   :focus-visible only triggers for keyboard nav, so it never clutters mouse use. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Arabic: cursive script — never letter-space (it breaks joining), give it air */
html[lang="ar"] { --font-display: 'Cairo', sans-serif; --font-body: 'Cairo', sans-serif; }
html[lang="ar"] body, html[lang="ar"] body *:not(.stat-num) { letter-spacing: normal !important; }
html[lang="ar"] { line-height: 1.7; }
html[lang="ar"] .hero-title { line-height: 1.12; }
html[lang="ar"] .svc-title, html[lang="ar"] .modal-title, html[lang="ar"] .cta-title, html[lang="ar"] .team-title { line-height: 1.18; }

/* ── 3. LOADER ─────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: var(--z-loader);
  display: flex; align-items: center; justify-content: center;
}
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.loader-logo  { height: clamp(60px, 9vw, 100px); width: auto; display: block; }
.loader-bar-wrap { width: 200px; height: 1px; background: rgba(255,255,255,0.15); overflow: hidden; }
.loader-bar   { height: 100%; width: 0%; background: var(--ink); transition: width 0.1s linear; }
.loader-label {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--font-body); font-weight: 300; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.2em; text-transform: uppercase;
}
.loader-pct { font-variant-numeric: tabular-nums; }

/* ── 4. NAV ────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; height: 84px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; z-index: var(--z-nav);
  opacity: 0; transition: opacity 0.5s ease, background 0.4s ease;
}
#nav.shown { opacity: 1; }                 /* links + lang switch reachable on the hero */
/* legibility scrim behind the transparent hero nav; fades out once the solid bar arrives */
#nav::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(8,9,11,0.6), rgba(8,9,11,0));
  transition: opacity 0.4s ease;
}
#nav.visible {
  background: rgba(8,9,11,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#nav.visible::before { opacity: 0; }
.nav-logo { display: flex; align-items: center; opacity: 0; transition: opacity 0.4s ease; }
#nav.visible .nav-logo { opacity: 1; }     /* hero has its own big logo → reveal nav logo only after scroll */
.nav-logo-img { height: 52px; width: auto; filter: drop-shadow(0 0 8px rgba(255,255,255,0.3)); }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-family: var(--font-body); font-weight: 400; font-size: 12px;
  letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase;
  transition: color 0.2s; position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
/* animated underline-grow (skip the bordered CTA) */
.nav-link:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav-link:not(.nav-cta):hover::after,
.nav-link:not(.nav-cta).active::after { transform: scaleX(1); }
.nav-cta {
  border: 1px solid rgba(255,255,255,0.3); padding: 8px 20px;
  color: var(--ink); transition: background 0.2s, border-color 0.2s, color 0.2s; cursor: none;
}
.nav-cta:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav-progress {
  position: absolute; bottom: -1px; inset-inline-start: 0;
  height: 1px; width: 0%; background: var(--ink);
}

/* language switch */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-opt {
  font-family: var(--font-body); font-weight: 500; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: none; border: none; cursor: none;
  color: var(--ink-3); padding: 8px 8px; min-width: 34px; min-height: 34px;
  transition: color 0.2s;
}
.lang-opt:hover { color: var(--ink); }
.lang-opt.active { color: var(--ink); }
.lang-opt + .lang-opt { border-inline-start: 1px solid rgba(255,255,255,0.14); }

/* services dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; padding: 0; cursor: none;   /* button reset; inherits .nav-link look */
}
.nav-dropdown-toggle::after {                    /* caret (replaces .nav-link underline pseudo) */
  content: '▾' !important;
  position: static !important; width: auto !important; height: auto !important;
  background: none !important; transform: none !important;
  font-size: 9px; line-height: 1; color: currentColor;
  transition: transform 0.25s var(--ease-out);
}
.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown.open .nav-dropdown-toggle::after { transform: rotate(180deg) !important; }

.svc-menu {
  position: absolute; top: 100%; inset-inline-start: 0; margin: 0; padding: 8px;
  min-width: 240px; list-style: none;
  background: rgba(8,9,11,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: var(--z-nav);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out), visibility 0s linear 0.28s;
}
.svc-menu::before {                              /* invisible hover bridge to the toggle */
  content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.nav-dropdown:hover .svc-menu,
.nav-dropdown:focus-within .svc-menu,
.nav-dropdown.open .svc-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}
.svc-menu-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 4px; cursor: none; white-space: nowrap;
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
  transition: background 0.2s, color 0.2s;
}
.svc-menu-link:hover, .svc-menu-link:focus-visible { background: rgba(255,255,255,0.06); color: var(--ink); }
.svc-menu-n {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums; color: var(--ink-4);
}

/* ── 5. HERO ───────────────────────────────────────────────── */
#hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); overflow: hidden;
  display: flex; align-items: center;
}
.hero-bg-video { position: absolute; inset: 0; z-index: 0; }
.hero-bg-video canvas { width: 100%; height: 100%; display: block; opacity: 0.6; }
/* legibility scrim: stronger on the text side, soft vignette around */
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(8,9,11,0.94) 0%, rgba(8,9,11,0.62) 38%, rgba(8,9,11,0.22) 72%, rgba(8,9,11,0.42) 100%),
    radial-gradient(130% 120% at 28% 52%, transparent 42%, rgba(8,9,11,0.55) 100%);
}
.hero-content { position: relative; z-index: 2; padding-inline-start: clamp(40px, 8vw, 120px); max-width: 82vw; }
.hero-logo-img {
  height: clamp(80px, 11vw, 148px);
  width: auto; display: block; margin-bottom: 30px;
  filter: drop-shadow(0 0 32px rgba(255,255,255,0.3));
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 22px;
}
.hero-eyebrow::before { content: ''; width: 28px; height: 1px; flex: 0 0 28px; background: rgba(255,255,255,0.6); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 112px);
  font-weight: 800; line-height: 0.9; letter-spacing: -0.02em;
  text-transform: uppercase; color: var(--ink); margin-bottom: 26px;
}
.hero-line { display: flex; flex-wrap: wrap; gap: 0 0.3em; }
/* kinetic word reveal — JS wraps each word in .hero-word > span */
.hero-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; }
.hero-word > span { display: inline-block; will-change: transform; }
.hero-sub {
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(15px, 1.4vw, 19px); color: var(--ink-2);
  line-height: 1.65; letter-spacing: 0.01em;
  margin-bottom: 40px; max-width: 46ch; text-wrap: pretty;
}
.hero-cta-row { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-scroll-hint {
  position: absolute; inset-inline-end: 52px; bottom: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2;
}
.scroll-line {
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--ink-3), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ── 5b. ABOUT ─────────────────────────────────────────────── */
#aboutSection {
  position: relative; z-index: 5;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center;
  padding: clamp(84px, 11vh, 120px) clamp(24px, 8vw, 130px);
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% -15%, rgba(255,255,255,0.07), transparent 58%),
    var(--bg);
}
/* oversized brand watermark, clipped at the bottom edge — editorial flourish */
#aboutSection::before {
  content: 'ORBITECH';
  position: absolute; inset-inline-start: -0.06em; bottom: -0.30em;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(120px, 24vw, 360px); line-height: 0.8;
  letter-spacing: -0.04em; color: rgba(255,255,255,0.035);
  white-space: nowrap; pointer-events: none; z-index: 0;
}
.about-inner { position: relative; z-index: 1; width: 100%; max-width: 1120px; margin: 0 auto; }
.about-eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: clamp(16px, 2.4vh, 26px);
}
.about-eyebrow::before { content: ''; width: 32px; height: 1px; flex: 0 0 32px; background: rgba(255,255,255,0.6); }
.about-statement {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 5.4vw, 84px);
  line-height: 1.0; letter-spacing: -0.025em; color: var(--ink);
  max-width: 16ch; margin-bottom: clamp(18px, 2.8vh, 30px); text-wrap: balance;
}
.about-accent {
  font-style: italic; color: var(--ink); position: relative;
  white-space: nowrap; padding-bottom: 0.04em;
}
.about-accent::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease-out) 0.5s;
}
#aboutSection.revealed .about-accent::after { transform: scaleX(1); }
html[dir="rtl"] .about-accent::after { transform-origin: right; }
.about-lead {
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(15px, 1.4vw, 18px); line-height: 1.65;
  color: var(--ink-2); max-width: 60ch; text-wrap: pretty;
}
.about-pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin-top: clamp(32px, 5vh, 52px); border-top: 1px solid rgba(255,255,255,0.12);
}
.about-pillar { padding: clamp(20px, 2.6vh, 28px) 32px 0; }
.about-pillar + .about-pillar { border-inline-start: 1px solid rgba(255,255,255,0.12); }
.about-pillar-k {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.06em; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.about-pillar h3 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.7vw, 22px);
  letter-spacing: -0.01em; color: var(--ink); margin: 14px 0 10px; text-transform: uppercase;
}
.about-pillar p {
  font-family: var(--font-body); font-weight: 300; font-size: 14px;
  line-height: 1.65; color: var(--ink-3); max-width: 32ch;
}
/* scroll reveal (toggled by initAbout) */
.about-eyebrow, .about-statement, .about-lead, .about-pillar {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
#aboutSection.revealed .about-eyebrow   { opacity: 1; transform: none; transition-delay: 0.00s; }
#aboutSection.revealed .about-statement { opacity: 1; transform: none; transition-delay: 0.10s; }
#aboutSection.revealed .about-lead      { opacity: 1; transform: none; transition-delay: 0.22s; }
#aboutSection.revealed .about-pillar    { opacity: 1; transform: none; }
#aboutSection.revealed .about-pillar:nth-child(1) { transition-delay: 0.34s; }
#aboutSection.revealed .about-pillar:nth-child(2) { transition-delay: 0.44s; }
#aboutSection.revealed .about-pillar:nth-child(3) { transition-delay: 0.54s; }

/* ── 6. BUTTONS ────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 32px; display: inline-flex; align-items: center; gap: 8px;
  cursor: none; border: none; outline: none;
  transition: transform 0.2s var(--ease-out), background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); background: var(--off-white); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(255,255,255,0.32); }
.btn-ghost:hover  { border-color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-large { padding: 16px 40px; font-size: 14px; }

/* ── 7. SCROLL CONTAINER + CANVAS ─────────────────────────── */
#scrollContainer { position: relative; height: 1000vh; }
#mainCanvas {
  position: sticky; top: 0; width: 100%; height: 100vh;
  display: block; z-index: var(--z-canvas);
  opacity: 0; /* JS controls crossfade */
}

/* ── 8. SERVICE SECTIONS ───────────────────────────────────── */
.service-section {
  position: sticky; top: 0; width: 100%; height: 100vh;
  z-index: var(--z-service); opacity: 0; pointer-events: none;
}
.svc-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top,  rgba(0,0,0,0.82) 0%,  rgba(0,0,0,0.3) 40%,  transparent 70%),
    linear-gradient(to right, rgba(0,0,0,0.55) 0%, transparent 55%);
}
.service-section:has(.svc-content--right) .svc-vignette {
  background:
    linear-gradient(to top,  rgba(0,0,0,0.82) 0%,  rgba(0,0,0,0.3) 40%,  transparent 70%),
    linear-gradient(to left,  rgba(0,0,0,0.55) 0%, transparent 55%);
}
.svc-content {
  position: absolute; inset-inline-start: 8vw; bottom: 12%;
  max-width: min(680px, 60vw); z-index: 4; text-align: start;
}
.svc-content--right {
  inset-inline-start: auto; inset-inline-end: 8vw; text-align: end;
}
.svc-content--right .svc-desc { margin-inline-start: auto; }

.svc-number {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-family: var(--font-body); font-weight: 500;
}
.svc-num-n {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.06em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.svc-num-cat {
  position: relative; padding-inline-start: 38px;
  font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-2);
}
.svc-num-cat::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 50%;
  width: 26px; height: 1px; background: rgba(255,255,255,0.6); transform: translateY(-50%);
}
.svc-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.92; letter-spacing: -0.025em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 2px 24px rgba(0,0,0,0.6); margin-bottom: 20px;
  overflow-wrap: break-word; hyphens: none; text-wrap: balance;
}
.svc-desc {
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(14px, 1.1vw, 16px); line-height: 1.72;
  color: var(--ink-2);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  max-width: 42ch; margin-bottom: 26px;
  text-wrap: pretty;
}
.svc-link {
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink); border: none; background: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 0; min-height: 44px; cursor: none; outline: none;
}
.svc-link::after { content: '→'; transition: transform 0.25s var(--ease-out); }
html[dir="rtl"] .svc-link::after { content: '←'; }
.svc-link span.svc-link-rule, .svc-link::before {
  content: ''; width: 28px; height: 1px; background: rgba(255,255,255,0.4);
  display: inline-block; transition: width 0.25s var(--ease-out), background 0.25s;
}
.svc-link:hover::before { width: 40px; background: var(--ink); }
.svc-link:hover::after { transform: translateX(4px); }
html[dir="rtl"] .svc-link:hover::after { transform: translateX(-4px); }

/* ── 9. STATS (hidden) ─────────────────────────────────────── */
#statsSection {
  position: sticky; top: 0; width: 100%; height: 100vh;
  background: var(--bg); z-index: 8;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
}
.stats-content { width: min(860px, calc(100vw - 80px)); text-align: center; }
.stats-eyebrow {
  font-family: var(--font-body); font-weight: 300; font-size: 11px;
  letter-spacing: 0.3em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 72px;
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; width: 100%; }
.stat-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 0 24px; text-align: center; }
.stat-block + .stat-block { border-inline-start: 1px solid rgba(255,255,255,0.1); }
.stat-num-row { display: flex; align-items: flex-start; justify-content: center; gap: 4px; }
.stat-num {
  font-family: var(--font-display); font-size: clamp(48px, 5.5vw, 88px);
  font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-unit { font-family: var(--font-display); font-size: clamp(24px, 3vw, 44px); font-weight: 700; color: var(--ink-2); line-height: 1.15; margin-top: 6px; }
.stat-lbl { font-family: var(--font-body); font-weight: 300; font-size: 12px; color: var(--ink-3); letter-spacing: 0.2em; text-transform: uppercase; }

/* ── 10. TEAM SECTION ──────────────────────────────────────── */
#teamSection {
  background: var(--dark);
  padding: 120px 0 100px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
#teamSection.visible { opacity: 1; transform: translateY(0); }
.team-header { text-align: center; padding: 0 48px; margin-bottom: 64px; }
.team-eyebrow {
  font-family: var(--font-body); font-weight: 400; font-size: 11px;
  letter-spacing: 0.3em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 16px;
}
.team-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(36px, 5vw, 72px);
  color: var(--ink); text-transform: uppercase; line-height: 0.9; letter-spacing: -0.02em;
}
.team-carousel-wrap { position: relative; }
.team-carousel { overflow: hidden; position: relative; }
.team-carousel-inner {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: teamScroll 48s linear infinite;
}
.team-carousel-inner:hover,
.team-carousel-inner:focus-within { animation-play-state: paused; }
@keyframes teamScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
html[dir="rtl"] .team-carousel-inner { animation-name: teamScrollRtl; }
@keyframes teamScrollRtl {
  0%   { transform: translateX(0); }
  100% { transform: translateX(50%); }
}
.team-card {
  flex: 0 0 clamp(240px, 22vw, 300px);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 12px;
  transition: background 0.3s, border-color 0.3s;
  transform-style: preserve-3d; will-change: transform;
  text-decoration: none; color: inherit;
}
.team-card:hover, .team-card:focus-visible { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.2); }
.team-photo {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.18);
  filter: grayscale(1) contrast(1.02);
  transition: filter 0.4s var(--ease-out);
}
.team-card:hover .team-photo, .team-card:focus-visible .team-photo { filter: grayscale(0) contrast(1); }
.team-name {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--ink); line-height: 1.2;
}
.team-role {
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase;
}
.team-bio {
  font-family: var(--font-body); font-weight: 300; font-size: 14px;
  color: var(--ink-2); line-height: 1.65; margin-top: 4px;
}
.team-linkedin {
  margin-top: auto; padding-top: 16px;
  font-family: var(--font-body); font-weight: 500; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); transition: color 0.3s;
  display: inline-flex; align-items: center; gap: 6px;
}
.team-linkedin::after { content: '↗'; }
.team-card:hover .team-linkedin, .team-card:focus-visible .team-linkedin { color: var(--ink); }

/* ── 11. CTA ───────────────────────────────────────────────── */
#ctaSection {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.06), transparent 60%),
    var(--near-black);
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
  padding: 120px 40px 0;
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
#ctaSection::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  z-index: 2;
}
#ctaSection.visible { opacity: 1; transform: translateY(0); }
.cta-content { text-align: center; max-width: 680px; width: 100%; position: relative; z-index: 1; }
.cta-eyebrow {
  font-family: var(--font-body); font-weight: 400; font-size: 11px;
  letter-spacing: 0.35em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 28px;
}
.cta-title {
  font-family: var(--font-display); font-size: clamp(26px, 4vw, 52px);
  font-weight: 800; line-height: 1.05; text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 20px; text-wrap: balance;
}
.cta-accent { font-style: italic; color: var(--ink); position: relative; padding-bottom: 0.04em; }
.cta-accent::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.9s var(--ease-out) 0.55s;
}
#ctaSection.visible .cta-accent::after { transform: scaleX(1); }
.cta-sub {
  font-family: var(--font-body); font-weight: 300; font-size: 15px;
  color: var(--ink-2); line-height: 1.7; margin-bottom: 40px; max-width: 56ch;
  margin-inline: auto;
}
.cta-form { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.cta-label {
  font-family: var(--font-body); font-weight: 400; font-size: 12px;
  letter-spacing: 0.06em; color: var(--ink-3);
}
.cta-form-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; width: 100%; max-width: 480px; }
.cta-input {
  font-family: var(--font-body); font-size: 15px; font-weight: 300; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.32);
  padding: 12px 2px; outline: none; width: 260px; transition: border-color 0.2s; cursor: none;
  text-align: center;
}
.cta-input::placeholder { color: var(--ink-4); }
.cta-input:focus { border-color: var(--ink); }
.cta-input[aria-invalid="true"] { border-color: var(--danger); }
.cta-formmsg {
  min-height: 18px; font-family: var(--font-body); font-size: 12.5px; letter-spacing: 0.02em;
}
.cta-formmsg.is-error { color: var(--danger); }
.cta-formmsg.is-ok { color: var(--ink); }
.cta-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }   /* honeypot */
.cta-contact-row { display: flex; align-items: center; justify-content: center; gap: 16px; }
.cta-contact-link {
  font-family: var(--font-body); font-weight: 300; font-size: 12px;
  color: var(--ink-3); letter-spacing: 0.08em; transition: color 0.2s;
}
.cta-contact-link:hover { color: var(--ink); }
.cta-sep { color: var(--ink-4); }

/* ── 12. FOOTER ────────────────────────────────────────────── */
.footer {
  width: 100%; margin-top: 80px;
  min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 48px; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-logo-img { height: 22px; width: auto; opacity: 0.5; }
.footer-copy { font-family: var(--font-body); font-weight: 300; font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; }

/* Back-to-top FAB — glass circle echoing the nav bar; arrow only, fixed bottom-end.
   inset-inline-end → bottom-right in LTR, bottom-left in RTL (matches .hero-scroll-hint). */
.scroll-top-fab {
  position: fixed; bottom: 28px; inset-inline-end: 28px;
  z-index: var(--z-fab);
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(8,9,11,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--ink-2);
  cursor: none; outline: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.32);
  opacity: 0; visibility: hidden;
  transform: translateY(12px) scale(0.92);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out),
              visibility 0s linear 0.4s, color 0.25s, border-color 0.25s, background 0.25s;
}
.scroll-top-fab.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out),
              color 0.25s, border-color 0.25s, background 0.25s;
}
.scroll-top-fab:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,0.5);
  background: rgba(18,20,25,0.82);
}
.fab-arrow { font-size: 20px; line-height: 1; display: inline-block; transition: transform 0.25s var(--ease-out); }
.scroll-top-fab:hover .fab-arrow { transform: translateY(-3px); }

/* ── 13. CUSTOM CURSOR ─────────────────────────────────────── */
#cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid rgba(0,0,0,0.75);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
  pointer-events: none; z-index: var(--z-cursor);
  transition: width 0.22s var(--ease-out), height 0.22s var(--ease-out),
              background 0.22s, border-color 0.22s;
}
#cursorDot {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(0,0,0,0.55);
}
#cursor.cursor-hover {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
}
#cursor.cursor-hover #cursorDot { display: none; }

/* ── 14. SERVICE MODALS ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.modal-backdrop.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.35s ease;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  /* fixed-size shell — never grows with content; the text column scrolls inside */
  display: flex; align-items: stretch;
  width: min(1180px, calc(100vw - 40px));
  height: min(600px, 86vh);
  max-height: 86vh;
  overflow: hidden;
  background: var(--near-black);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  z-index: var(--z-modal);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.38s ease, transform 0.38s var(--ease-out-quint), visibility 0s linear 0.38s;
}
.modal--reverse { flex-direction: row-reverse; }
.modal.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.38s ease, transform 0.38s var(--ease-out-quint);
}

/* media panel — placeholder for now; drop in <img class="modal-media-img"> / canvas / video later */
.modal-media {
  flex: 0 0 42%; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 100% at 30% 20%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(135deg, var(--dark), var(--near-black));
  display: grid; place-items: center;
}
/* seamless blend: the inner edge of the media fades into the text column's bg
   (no hard line). Direction follows the panel side — works for placeholder & real images. */
.modal-media::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to right, transparent 58%, var(--near-black) 100%);
}
.modal--reverse .modal-media::after {
  background: linear-gradient(to left, transparent 58%, var(--near-black) 100%);
}
.modal-media-ph { width: 46%; max-width: 160px; opacity: 0.10; filter: grayscale(1); }
.modal-media-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.modal-close {
  position: absolute; top: 22px; inset-inline-end: 26px; z-index: 2;
  background: none; border: none; cursor: none;
  color: var(--ink-3);
  font-size: 22px; line-height: 1;
  transition: color 0.2s ease;
  padding: 6px; min-width: 36px; min-height: 36px;
}
.modal-close:hover { color: var(--ink); }
/* scrollable text column — only this scrolls, the window stays fixed */
.modal-inner {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 56px 48px 48px;
}
.modal-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
}
.modal-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(22px, 3.5vw, 36px);
  line-height: 1.08; letter-spacing: -0.02em; text-transform: uppercase;
  color: var(--ink);
}
.modal-desc {
  font-family: var(--font-body); font-weight: 300;
  font-size: 14px; line-height: 1.75;
  color: var(--ink-2);
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; }
.ml-row {
  display: grid; grid-template-columns: minmax(110px, 150px) 1fr; gap: 6px 22px; align-items: baseline;
}
.ml-row dt {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
}
.ml-row dd {
  margin: 0; font-family: var(--font-body); font-weight: 300; font-size: 13px;
  line-height: 1.6; color: var(--ink-2);
}
.modal-cta { align-self: flex-start; margin-top: 8px; }
.modal-inner::-webkit-scrollbar { width: 3px; }
.modal-inner::-webkit-scrollbar-track { background: transparent; }
.modal-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── 14b. ARTICLE MODAL (rich, full-width, alternating image/text rows) ── */
.modal--article .modal-inner { padding: 56px clamp(28px, 4vw, 60px) 52px; gap: 0; }
.modal-lead {
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(15px, 1.15vw, 17px); line-height: 1.75; color: var(--ink-2);
  max-width: 70ch; margin-top: 18px;
}
.modal-lead + .modal-lead { margin-top: 14px; }

.modal-section { margin-top: 48px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.10); }
.modal-section-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(19px, 2vw, 26px); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink); margin-bottom: 8px; text-wrap: balance;
}
.modal-section-intro {
  font-family: var(--font-body); font-weight: 300; font-size: 14px; line-height: 1.7;
  color: var(--ink-2); max-width: 70ch; margin-bottom: 22px;
}

/* alternating two-column rows */
.marow {
  display: grid; grid-template-columns: minmax(0,0.85fr) minmax(0,1.15fr);
  gap: clamp(20px, 2.4vw, 38px); align-items: center;
  padding: 26px 0;
}
.marow + .marow { border-top: 1px solid rgba(255,255,255,0.06); }
.marow:nth-child(even) { direction: rtl; }       /* flip column order */
.marow:nth-child(even) > * { direction: ltr; }   /* keep content LTR */
html[dir="rtl"] .marow:nth-child(even) > * { direction: rtl; }
.marow-h {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px;
}
.marow-text p {
  font-family: var(--font-body); font-weight: 300; font-size: 14px; line-height: 1.7; color: var(--ink-2);
}
.marow-media { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma-img {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  border-radius: 5px; border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(120% 100% at 30% 20%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(135deg, var(--dark), var(--near-black));
  display: grid; place-items: center;
}
.ma-img::after {                                 /* faint watermark glyph for the placeholder */
  content: ''; width: 34%; height: 34%;
  background: url('../logo.svg') center / contain no-repeat;
  opacity: 0.10; filter: grayscale(1);
}
.ma-img-el { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ma-img:has(.ma-img-el)::after { display: none; }   /* hide watermark once a real image is set */

/* lists */
.modal-block { margin-top: 22px; }
.modal-ul { list-style: none; margin: 0; padding: 0; }
.modal-ul li {
  position: relative; padding-inline-start: 22px; margin-bottom: 12px;
  font-family: var(--font-body); font-weight: 300; font-size: 14px; line-height: 1.65; color: var(--ink-2);
  break-inside: avoid;
}
.modal-ul li::before {
  content: ''; position: absolute; inset-inline-start: 2px; top: 0.62em;
  width: 9px; height: 1px; background: var(--ink); opacity: 0.7;
}
.modal-ul--lead li b, .modal-ul li b { color: var(--ink); font-weight: 600; }
.modal-ul--cols { columns: 2; column-gap: 36px; }

.modal-ol { list-style: none; margin: 0; padding: 0; counter-reset: rend; }
.modal-ol > li { counter-increment: rend; position: relative; padding-inline-start: 44px; margin-bottom: 20px; }
.modal-ol > li::before {
  content: counter(rend, decimal-leading-zero);
  position: absolute; inset-inline-start: 0; top: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  color: var(--ink); width: 30px; height: 30px; border: 1px solid rgba(255,255,255,0.20);
  border-radius: 50%; display: grid; place-items: center;
}
.modal-ol-h {
  font-family: var(--font-body); font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  color: var(--ink); margin-bottom: 8px; padding-top: 5px;
}
.modal-ol .modal-ul { margin-top: 4px; }

/* ── 15. MOTION SUPPORT ────────────────────────────────────── */
.hero-bg-video,
.hero-logo-img, .hero-eyebrow, .hero-title, .hero-sub, .hero-cta-row,
.svc-content, #mainCanvas { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .team-carousel-inner { animation: none !important; }
  /* keep the strip reachable without auto-motion */
  .team-carousel { overflow-x: auto; scroll-snap-type: x proximity; }
  .team-card { scroll-snap-align: start; }
  .scroll-line { animation: none !important; }
  .hero-word > span { transform: none !important; }
  * { scroll-behavior: auto !important; }
}

/* ── 16. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .svc-content, .svc-content--right {
    inset-inline-start: 6vw; inset-inline-end: auto; text-align: start; max-width: 88vw;
  }
  .svc-content--right .svc-desc { margin-inline-start: 0; }
  .svc-vignette,
  .service-section:has(.svc-content--right) .svc-vignette {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%) !important;
  }
}
@media (max-width: 768px) {
  #nav { padding: 0 20px; height: 68px; }
  .nav-logo-img { height: 40px; }
  .nav-right { gap: 14px; }
  .nav-links { gap: 18px; }
  .nav-links li:not(:last-child) { display: none; } /* keep only Contact CTA + lang switch */
  .hero-content { padding-inline-start: 24px; max-width: 90vw; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-block + .stat-block { border-inline-start: none; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 32px; }
  .cta-form-row { flex-direction: column; align-items: center; }
  .cta-input { width: 100%; max-width: 320px; }
  .footer { padding: 16px 24px; }
  .team-carousel-wrap { padding: 0 24px; }
  .about-pillars { grid-template-columns: 1fr; }
  .about-pillar { padding: 26px 0 0; }
  .about-pillar + .about-pillar { border-inline-start: none; border-top: 1px solid rgba(255,255,255,0.12); }
  body { cursor: auto; }
  #cursor { display: none; }
  .scroll-top-fab { cursor: pointer; bottom: 18px; inset-inline-end: 18px; width: 48px; height: 48px; }

  /* modal: stack media on top, scrollable text below — still fixed-size + inner scroll */
  .modal, .modal--reverse {
    flex-direction: column;
    width: min(560px, calc(100vw - 32px));
    height: min(80vh, 680px);
  }
  .modal-media { flex: 0 0 38%; }
  .modal-media::after,
  .modal--reverse .modal-media::after {
    background: linear-gradient(to bottom, transparent 52%, var(--near-black) 100%);
  }
  .modal-inner { padding: 32px 26px 30px; }
  /* article modal: stack rows (image then text), single-column lists */
  .modal--article .modal-inner { padding: 36px 24px 32px; }
  .marow { grid-template-columns: 1fr; gap: 16px; }
  .marow:nth-child(even) { direction: ltr; }
  .modal-ul--cols { columns: 1; }
}
@media (max-width: 600px) {
  .modal-close { inset-inline-end: 18px; top: 18px; }
  .ml-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ── 17. HANDHELD (≤1024px) — flatten the scrub-deck into a native stack ──
   Phones + tablets ditch the 200-frame sticky-canvas experience for a simple,
   smooth, natively-scrolling pile of full-screen service sections, each backed
   by one lazy-loaded still (image injected by initMobileServices in app.js).
   Placed last so it wins the cascade over the 900/768px blocks above. */
@media (max-width: 1024px) {
  html { scroll-behavior: smooth; }            /* nav anchor links glide (reduced-motion forces auto) */

  #scrollContainer { height: auto; }
  #mainCanvas { display: none; }

  .service-section {
    position: relative; height: auto; min-height: 100svh;
    opacity: 1; pointer-events: auto;
    display: flex; align-items: flex-end;
    overflow: hidden; padding: 0 24px;
  }
  .svc-bg {                                     /* per-service still, injected + lazy-loaded by JS */
    position: absolute; inset: 0; z-index: 1;
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 0.6s var(--ease-out);
  }
  .svc-bg.loaded { opacity: 1; }
  .svc-vignette { z-index: 2; }
  .svc-content, .svc-content--right {           /* leave desktop's absolute bottom positioning */
    position: relative; inset: auto;
    inset-inline-start: auto; inset-inline-end: auto; bottom: auto;
    z-index: 4; max-width: 100%; padding-bottom: 14vh;
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  }
  .svc-content.revealed { opacity: 1; transform: none; }

  /* touch device → no custom cursor */
  body { cursor: auto; }
  #cursor { display: none; }
  .scroll-top-fab { cursor: pointer; }
}
