/* Scroll-scrubbed cinematic hero (v11 stardust variation).
   Everything here is scoped to the hero; no other section is touched. */

.hero-scroll {
  position: relative;
  height: 560vh;                 /* the scroll track that drives the journey */
  background: var(--bg);
}

/* Sticky full-viewport stage. Same visual behavior as a fixed video, but it
   releases automatically when the track ends, so the next section arrives
   with zero unpin jump and no z-index fights with the fixed nav. */
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hero-journey-poster,
.hero-journey {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Video sits above the poster and fades in once it can play through. */
.hero-journey { z-index: 1; opacity: 0; transition: opacity 0.45s ease; }
.hero-journey.is-ready { opacity: 1; }

/* Lighter vignette than the main site: the journey video stays clearly visible.
   A gentle floor of shade remains at top and bottom so the nav and beats read. */
.hero-scroll .hero-vignette {
  z-index: 2;
  background: linear-gradient(
    rgba(7, 7, 12, 0.34) 0%,
    rgba(7, 7, 12, 0.06) 38%,
    rgba(7, 7, 12, 0.10) 68%,
    rgba(7, 7, 12, 0.42) 100%
  );
}

/* Minimal on-brand loading state: pulsing wordmark near the bottom. */
.hero-journey-loading {
  position: absolute;
  z-index: 3;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Poppins", var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  opacity: 0.85;
  animation: journey-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
.hero-journey-loading.is-hidden { display: none; }
@keyframes journey-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.3; }
}

/* Overlay copy: the existing hero text block, centered in the stage.
   Fades out over the first part of the journey (driven from JS). */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: opacity, transform;
}
/* Text clarity without any visible shape: layered per-letter shadows.
   A tight contact shadow defines the edges, a mid shadow lifts the letterforms,
   and a wide soft shadow settles them into the scene. */
.hero-overlay .hero-content,
.hero-overlay .hero-content .hero-title {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 14px 48px rgba(0, 0, 0, 0.45);
}
/* Over video, gradient-filled glyphs go muddy and can't take clean shadows.
   Render them solid white here so every hero word shares the same crisp
   layered shadow; the brand gradient lives on in the rest of the page. */
.hero-overlay .grad-text,
.hero-beat .grad-text {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
  filter: none;
}

/* Engine points: gradient-clipped headings render with different antialiasing
   and read as a mismatched font. Solid ink matches the rest of the type. */
.engine-point h4 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
}
.hero-overlay.is-passed { pointer-events: none; }

.hero-scroll .scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}

/* Journey beats: three headlines that appear one by one as you scroll.
   Opacity and lift are driven from hero-scroll.js. */
.hero-beat {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.hero-beat h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 14px 48px rgba(0, 0, 0, 0.45);
  max-width: 16ch;
  padding: 0 24px;
}
html[lang="ar"] .hero-beat h2 { letter-spacing: 0; line-height: 1.3; }

/* ---------- Light sections (preview theme) ----------
   The page alternates: dark video hero > light manifesto + services >
   dark mascot films > light training > dark engine + contact. */
.theme-light {
  position: relative;
  z-index: 0;
  color: #17141f;
}
/* Full-bleed light background: sections keep their max-width for content,
   but the light surface spans the whole viewport width. */
.theme-light::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #f6f4fa;
  z-index: -1;
}
.theme-light h2,
.theme-light h3,
.theme-light h4,
.theme-light summary { color: #17141f; }
.theme-light .section-sub,
.theme-light p { color: rgba(23, 20, 31, 0.68); }
.theme-light .eyebrow { color: rgba(23, 20, 31, 0.5); }

/* Manifesto on light */
.theme-light .manifesto-text { color: #17141f; }
.theme-light .manifesto-text .word { opacity: 0.14; }

/* Tighten the seam between the manifesto and services: both are light,
   so the double section padding read as a hole. */
#manifesto.theme-light { padding-bottom: clamp(28px, 4vw, 56px); }
#services.theme-light { padding-top: clamp(28px, 4vw, 56px); }

/* Heading sits close to its cards; the light surface exposes big gaps. */
#services .section-head { margin-bottom: clamp(12px, 2vw, 22px); }

/* Mobile: the contact section's social icons and the footer's stack right on
   top of each other and read as a duplicate row. Keep one. */
@media (max-width: 768px) {
  .footer-socials { display: none; }
}

/* Service pillars on light */
.theme-light .pillar {
  background: #ffffff;
  border-color: rgba(23, 20, 31, 0.08);
  box-shadow: 0 10px 34px rgba(23, 20, 31, 0.07);
}
.theme-light .pillar:hover { border-color: rgba(243, 38, 184, 0.4); }
.theme-light .pillar p { color: rgba(23, 20, 31, 0.62); }
.theme-light .pillar li {
  border-top-color: rgba(23, 20, 31, 0.08);
  color: rgba(23, 20, 31, 0.55);
}

/* Training modules and case cards on light */
.theme-light .module {
  background: #ffffff;
  border-color: rgba(23, 20, 31, 0.09);
}
.theme-light .module[open] { border-color: rgba(243, 38, 184, 0.4); }
.theme-light .module p { color: rgba(23, 20, 31, 0.62); }
.theme-light .module-plus { color: rgba(23, 20, 31, 0.4); }
.theme-light .case {
  background: #ffffff;
  border-color: rgba(23, 20, 31, 0.09);
}
.theme-light .case p { color: rgba(23, 20, 31, 0.62); }

/* ---------- Customer feedback carousel (white section) ---------- */
.feedback {
  position: relative;
  z-index: 0;
  color: #0b0a10;
  padding: clamp(32px, 6vw, 96px) clamp(24px, 8vw, 120px);
  overflow: hidden;
}
.feedback::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #ffffff;
  z-index: -1;
}
.fb-title {
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  color: #0b0a10;
}
.fb-divider {
  width: 100%;
  height: 1px;
  background: #d9d9d9;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.fb-divider.in { transform: scaleX(1); }
.fb-top { margin-bottom: clamp(48px, 6vw, 80px); }
.fb-bottom { margin-top: clamp(48px, 6vw, 80px); margin-bottom: 32px; }
.fb-stage {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: center;
}
.fb-slide { width: 100%; }
.fb-quote {
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.3;
  text-align: right;
  letter-spacing: -0.015em;
  color: #0b0a10;
}
.fb-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.fb-author { display: flex; align-items: center; gap: 16px; width: 100%; }
.fb-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.fb-author h3 { font-size: 1.125rem; font-weight: 500; color: #0b0a10; margin: 0; }
.fb-author p { font-size: 0.875rem; color: #6b7280; margin: 2px 0 0; }
.fb-arrows { display: flex; gap: 8px; width: 100%; justify-content: flex-end; }
.fb-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #d9d9d9;
  border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.fb-btn:hover { background: #c9c9c9; }
.fb-btn:active { transform: scale(0.96); }
.fb-btn svg { width: 24px; height: 24px; stroke: #0b0a10; fill: none; }
@media (min-width: 640px) {
  .fb-row { flex-direction: row; }
  .fb-author, .fb-arrows { width: auto; }
}
@media (min-width: 768px) {
  .fb-stage { min-height: 250px; }
}
/* staggered section reveal */
.fb-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fb-reveal.in { opacity: 1; transform: none; }
/* typewriter characters */
.tw-char { opacity: 0; transition: opacity 0.02s linear; }
.tw-run .tw-char { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .fb-reveal, .fb-divider { opacity: 1; transform: none; transition: none; }
  .tw-char { opacity: 1; transition: none; }
}

/* Reduced motion: the hero collapses to a normal static poster viewport. */
.hero-scroll.is-static { height: 100vh; height: 100dvh; }
.hero-scroll.is-static .hero-journey,
.hero-scroll.is-static .hero-journey-loading,
.hero-scroll.is-static .hero-beat { display: none; }
