/* ============================================================
   ANIMATIONS — cursor · scroll bar · nav dots · reveal · parallax
   ============================================================ */

/* ── custom cursor ── */
@media (hover: hover) and (pointer: fine) {
  html, body, a, button { cursor: none; }

  .cursor {
    position: fixed;
    left: 0; top: 0;
    pointer-events: none;
    z-index: 9999;
  }
  .cursor .dot {
    position: fixed;
    left: 0; top: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--navy);
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  }
  .cursor .ring {
    position: fixed;
    left: 0; top: 0;
    width: 34px; height: 34px;
    border: 1.5px solid rgba(10,23,51,0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
      width 0.3s cubic-bezier(0.22,0.7,0.2,1),
      height 0.3s cubic-bezier(0.22,0.7,0.2,1),
      border-color 0.3s,
      background 0.3s;
  }
  .cursor.is-hover .dot  { width: 0; height: 0; opacity: 0; }
  .cursor.is-hover .ring { width: 56px; height: 56px; background: rgba(79,211,163,0.14); border-color: var(--mint); }
  .cursor.is-down  .ring { width: 24px; height: 24px; }
  .cursor.is-text  .ring { width: 3px; height: 40px; border-radius: 2px; border-color: var(--navy); }

  /* light variant — dark background sections */
  .cursor.is-light .dot  { background: #fff; }
  .cursor.is-light .ring { border-color: rgba(255,255,255,0.50); }
  .cursor.is-light.is-hover .ring { background: rgba(79,211,163,0.22); border-color: var(--mint); }
  .cursor.is-light.is-text  .ring { border-color: rgba(255,255,255,0.80); }
}

/* ── scroll progress bar ── */
.scroll-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 100%;
  z-index: 100;
  pointer-events: none;
}
.scroll-bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--mint), var(--mint-soft));
  box-shadow: 0 0 10px var(--mint-glow);
  transition: transform 0.1s linear;
}

/* ── side nav dots ── */
.nav-dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}
.nav-dots a {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(10,23,51,0.18);
  transition: all 0.3s ease;
  position: relative;
}
.nav-dots a.act {
  background: var(--navy);
  transform: scale(1.4);
}
.nav-dots a span {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--navy-55);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}
html[lang="ar"] .nav-dots a span { right: auto; left: 18px; }
.nav-dots a:hover span,
.nav-dots a.act  span { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 880px) { .nav-dots { display: none; } }

/* ── reveal — blur + lift ── */
.reveal {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  filter: blur(6px);
  transition:
    opacity  0.9s cubic-bezier(0.22, 0.7, 0.2, 1),
    transform 1s  cubic-bezier(0.22, 0.7, 0.2, 1),
    filter   0.9s ease;
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ── cascade ── */
.cascade > * {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity   0.9s cubic-bezier(0.22, 0.7, 0.2, 1),
    transform 1s  cubic-bezier(0.22, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.cascade.in > * { opacity: 1; transform: none; }
.cascade.in > *:nth-child(1) { transition-delay: 0.04s; }
.cascade.in > *:nth-child(2) { transition-delay: 0.12s; }
.cascade.in > *:nth-child(3) { transition-delay: 0.20s; }
.cascade.in > *:nth-child(4) { transition-delay: 0.28s; }
.cascade.in > *:nth-child(5) { transition-delay: 0.36s; }
.cascade.in > *:nth-child(6) { transition-delay: 0.44s; }
.cascade.in > *:nth-child(7) { transition-delay: 0.52s; }
.cascade.in > *:nth-child(8) { transition-delay: 0.60s; }
.cascade.in > *:nth-child(9) { transition-delay: 0.68s; }

/* ── word reveal ── */
.word-reveal { display: inline; }
.word-reveal .w {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.4em, 0) rotate(1.5deg);
  filter: blur(5px);
  transition:
    opacity   0.9s cubic-bezier(0.22, 0.7, 0.2, 1),
    transform 1s  cubic-bezier(0.22, 0.7, 0.2, 1),
    filter    0.9s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}
.word-reveal.in .w { opacity: 1; transform: none; filter: none; }

/* ── parallax helper ── */
[data-parallax] {
  will-change: transform;
  transform: translate3d(0, var(--y, 0), 0);
}

/* ── page transition overlay ── */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--paper);
  pointer-events: none;
  opacity: 0;
}
.page-transition.out { opacity: 1; transition: opacity 0.35s ease; }
.page-transition.in  { opacity: 0; transition: opacity 0.35s 0.1s ease; }

/* ── hero entrance ── */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 {
    opacity: 0;
    transform: translateY(20px);
    animation: hero-rise 1.2s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-sub {
    opacity: 0;
    transform: translateY(16px);
    animation: hero-rise 1.2s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-cta-row {
    opacity: 0;
    transform: translateY(14px);
    animation: hero-rise 1.2s 0.60s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-side {
    opacity: 0;
    transform: translateY(40px);
    animation: hero-rise 1.4s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-meta {
    opacity: 0;
    animation: fade-in 1s 0.05s ease forwards;
  }
  .nav-inner {
    opacity: 0;
    transform: translateY(-10px);
    animation: hero-rise 0.9s 0.1s cubic-bezier(0.16,1,0.3,1) forwards;
  }
@keyframes hero-rise { to { opacity: 1; transform: none; } }
  @keyframes fade-in   { to { opacity: 1; } }
}

/* ── floating card drift ── */
.float-card { animation: float-drift 8s ease-in-out infinite; }
.fc-1 { animation-delay: -1.0s; }
.fc-2 { animation-delay: -3.2s; }
.fc-3 { animation-delay: -5.5s; }
.fc-4 { animation-delay: -7.0s; }
@keyframes float-drift {
  0%, 100% { transform: var(--fc-base, none) translateY(0); }
  50%       { transform: var(--fc-base, none) translateY(-10px); }
}

/* ── reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .cascade > *, .word-reveal .w {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .float-card { animation: none !important; }
}
