/* ============================================================
   SARBAH RICHMOND — SITE-WIDE ANIMATIONS
   animations.css — include in all pages via <link>
   ============================================================ */

/* ── Custom cursor disabled: keep the browser default pointer ── */
*, *::before, *::after { cursor: auto; }

#cursor {
  display: none;
}

/* ── Noise overlay ── */
#noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: noiseShift 10s steps(1) infinite;
}
@keyframes noiseShift {
  0%   { background-position: 0 0; }
  10%  { background-position: -5% -10%; }
  20%  { background-position: -15% 5%; }
  30%  { background-position: 7% -25%; }
  40%  { background-position: 20% 25%; }
  50%  { background-position: -25% 10%; }
  60%  { background-position: 15% 5%; }
  70%  { background-position: 0 15%; }
  80%  { background-position: 3% 35%; }
  90%  { background-position: -10% 10%; }
  100% { background-position: 0 0; }
}

/* ── Nav entrance ── */
nav {
  animation: navSlide .8s cubic-bezier(.22,1,.36,1) .1s both;
}
@keyframes navSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  color: var(--black, #0A0A0A);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.nav-toggle:hover {
  background: var(--blue, #2222FF);
  color: #fff;
  border-color: var(--blue, #2222FF);
  box-shadow: 0 10px 24px rgba(34,34,255,.18);
  transform: translateY(-1px);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span + span {
  margin-top: 4px;
}
nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Scroll-reveal: extra variants ── */
.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
}
.reveal-left.on { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
}
.reveal-right.on { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(.94);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal-scale.on { opacity: 1; transform: scale(1); }

/* ── Stagger children ── */
.stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
}
.stagger.on > *:nth-child(1) { transition-delay: 0ms; }
.stagger.on > *:nth-child(2) { transition-delay: 80ms; }
.stagger.on > *:nth-child(3) { transition-delay: 160ms; }
.stagger.on > *:nth-child(4) { transition-delay: 240ms; }
.stagger.on > *:nth-child(5) { transition-delay: 320ms; }
.stagger.on > *:nth-child(6) { transition-delay: 400ms; }
.stagger.on > * { opacity: 1; transform: translateY(0); }

/* ── Hover magnetic effect (JS-driven via data attr) ── */
.magnetic { display: inline-block; transition: transform .35s cubic-bezier(.22,1,.36,1); }

/* ── Tilt cards (JS) ── */
.tilt {
  transition: transform .18s ease-out, box-shadow .18s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Text split / char animation ── */
.split-word .char {
  display: inline-block;
  overflow: hidden;
}
.split-word .char-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(105%);
  animation: charUp .6s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes charUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Page transition wipe ── */
#page-wipe {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--blue, #2222FF) 0%, #1515df 45%, #08081f 100%);
  z-index: 99997;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
#page-wipe.out {
  animation: wipeOut .45s cubic-bezier(.76,0,.24,1) forwards;
}
#page-wipe.in {
  transform: scaleX(1);
  animation: wipeIn .45s cubic-bezier(.76,0,.24,1) forwards;
}
@keyframes wipeOut {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}
@keyframes wipeIn {
  from { transform: scaleX(1); transform-origin: right; }
  to   { transform: scaleX(0); transform-origin: right; }
}

/* ── Nav link underline slide ── */
.nav-links a {
  position: relative;
  overflow: hidden;
}
.nav-links a:not(.active)::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 16px; right: 16px;
  height: 1px;
  background: var(--blue, #2222FF);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.nav-links a:not(.active):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── Stat cards: count-up glow ── */
.sn {
  transition: color .3s;
}
.stat:hover .sn {
  text-shadow: 0 0 24px rgba(34,34,255,.35);
}

/* ── Project card shimmer ── */
.pc,
.bc,
.reel-card,
.jr-card,
.signal-card,
.process-card {
  position: relative;
  overflow: hidden;
}
.pc::before,
.bc::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  transition: left .7s ease;
  z-index: 10;
  pointer-events: none;
}
.pc:hover::before,
.bc:hover::before {
  left: 160%;
}

/* ── Skills bar enhanced ── */
.sk-fill {
  position: relative;
  overflow: hidden;
}
.sk-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: skillShimmer 2.4s ease-in-out infinite;
}
@keyframes skillShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ── Marquee pause on hover ── */
.mq:hover .mq-t { animation-play-state: paused; }

/* ── WhatsApp float pulse ── */
.wa-btn,
.wa-float .wa-btn {
  animation: waPop 3s ease-in-out 3s infinite;
}
@keyframes waPop {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* ── Bento grid: stagger reveal ── */
.grid.reveal.on .bc:nth-child(1) { transition-delay: 0ms; }
.grid.reveal.on .bc:nth-child(2) { transition-delay: 70ms; }
.grid.reveal.on .bc:nth-child(3) { transition-delay: 140ms; }
.grid.reveal.on .bc:nth-child(4) { transition-delay: 210ms; }
.grid.reveal.on .bc:nth-child(5) { transition-delay: 280ms; }

/* ── Stat stagger ── */
.stats .stat:nth-child(1) { transition-delay: 0ms; }
.stats .stat:nth-child(2) { transition-delay: 70ms; }
.stats .stat:nth-child(3) { transition-delay: 140ms; }
.stats .stat:nth-child(4) { transition-delay: 210ms; }

/* ── Section heading underline draw ── */
.s-ttl, .feat-ttl, .jr-ttl, .sc-ttl, .bento-ttl, .ws-ttl, .reel-title,
.pt-title, .h-title, .hero-title, .ph-title, .av-title {
  position: relative;
}

/* ── Button ripple ── */
.ha-p, .ha-g, .av-btn, .nav-cta, .brief-btn, .brief-btn-alt,
.btn-p, .btn-o, .sc-btn, .sub-btn, .print-btn, .modal-cta {
  position: relative;
  overflow: hidden;
}
.ha-p::after, .ha-g::after, .av-btn::after, .nav-cta::after,
.brief-btn::after, .btn-p::after, .sc-btn::after, .sub-btn::after,
.print-btn::after, .modal-cta::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  transform: translate(-50%, -50%);
  transition: width .55s ease, height .55s ease, opacity .55s ease;
  opacity: 0;
  pointer-events: none;
}
.ha-p:active::after, .av-btn:active::after, .nav-cta:active::after,
.brief-btn:active::after, .btn-p:active::after, .sc-btn:active::after,
.sub-btn:active::after, .print-btn:active::after, .modal-cta:active::after {
  width: 340px; height: 340px;
  opacity: 0;
}

/* ── Pill hover float ── */
.pill {
  transition: transform .25s cubic-bezier(.22,1,.36,1),
              background .25s, color .25s, border-color .25s,
              box-shadow .25s;
}
.pill:hover {
  box-shadow: 0 8px 20px rgba(255,255,255,.12);
}

/* ── Song row hover ── */
.sr {
  position: relative;
  overflow: hidden;
}
.sr::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--blue, #2222FF);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .25s;
}
.sr:hover::before { transform: scaleY(1); transform-origin: top; }

/* ── Footer links ── */
.ft-links a {
  position: relative;
}
.ft-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--blue, #2222FF);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s;
}
.ft-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── Scroll-progress bar ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue, #2222FF), #7b7bff);
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
  box-shadow: 0 0 12px rgba(34,34,255,.45);
}

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  right: 28px;
  bottom: 94px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  color: var(--black, #0A0A0A);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  backdrop-filter: blur(16px);
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
#back-to-top svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
#back-to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--blue, #2222FF);
  color: #fff;
  border-color: var(--blue, #2222FF);
  box-shadow: 0 12px 30px rgba(34,34,255,.22);
  transform: translateY(-3px) scale(1);
}

@media (max-width: 600px) {
  #back-to-top {
    right: 18px;
    bottom: 86px;
  }
}

/* ── Mobile usability pass ── */
@media (max-width: 900px) {
  nav {
    width: calc(100% - 20px) !important;
    padding: 12px 14px !important;
    border-radius: 24px !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap;
    box-shadow: 0 12px 32px rgba(0,0,0,.08);
  }
  nav .nav-logo {
    flex: 1 1 auto;
    min-width: 0;
  }
  nav .nav-toggle {
    display: inline-flex;
    margin-left: 0;
    order: 2;
    flex: 0 0 auto;
  }
  nav .nav-r {
    display: none;
    margin-left: 0;
    order: 3;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  nav.nav-open .nav-r {
    display: flex;
  }
  nav .nav-links {
    display: none !important;
    order: 4;
    width: 100%;
    gap: 8px;
    padding: 12px 0 4px;
    flex-direction: column;
    overflow: hidden;
    margin-top: 2px;
  }
  nav.nav-open .nav-links {
    display: flex !important;
  }
  nav .nav-links a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    width: 100%;
    padding: 12px 16px;
    font-size: 10px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(0,0,0,.05);
    border-radius: 14px;
  }
  nav .lang-sw {
    flex: 0 0 auto;
  }
  nav .nav-cta {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    padding: 10px 16px;
    font-size: 9px;
    min-height: 44px;
  }
  .lang-btn {
    padding: 6px 10px;
  }
  .lang-dd {
    right: auto;
    left: 0;
  }
  .wa {
    right: 16px;
    bottom: 16px;
  }
  .wa-btn {
    width: 50px;
    height: 50px;
  }
  .wa-tip {
    display: none;
  }
  .ft-links,
  .flinks {
    justify-content: center;
    gap: 12px;
  }
  .hero-title,
  .page-hero .pt-title,
  .s-ttl,
  .feat-ttl,
  .bento-ttl,
  .jr-ttl,
  .sc-ttl,
  .av-title,
  .hero-title .l1,
  .hero-title .l2 {
    letter-spacing: 0 !important;
    line-height: .9 !important;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger {
    transition-duration: .45s;
  }
}

@media (max-width: 640px) {
  nav {
    width: calc(100% - 16px) !important;
    padding: 10px 12px !important;
  }
  nav .nav-r {
    flex-wrap: wrap;
  }
  nav .lang-sw,
  nav .nav-cta {
    width: 100%;
  }
  nav .lang-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-actions,
  .spotlight-actions,
  .cta-btns,
  .cta-actions {
    width: 100%;
    flex-direction: column;
  }
  .hero-actions > *,
  .spotlight-actions > *,
  .cta-btns > *,
  .cta-actions > * {
    width: 100%;
    justify-content: center;
  }
  .ft,
  footer {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .wa {
    right: 14px;
    bottom: 14px;
  }
  #back-to-top {
    right: 14px;
    bottom: 76px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .pc:hover,
  .bc:hover,
  .jr-card:hover,
  .stat:hover,
  .signal-card:hover,
  .process-card:hover,
  .av-btn:hover,
  .nav-cta:hover,
  .feat-all:hover,
  .spotlight-card:hover .spotlight-media img {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
  }
  .nav-links a,
  .wa-btn,
  .feat-all,
  .av-btn,
  .spotlight-btn,
  .nav-cta {
    touch-action: manipulation;
  }
}

/* ── Active link glow ── */
.nav-links a.active {
  box-shadow: 0 0 16px rgba(34,34,255,.3);
}

/* ── Hero bg word parallax (JS moves it) ── */
.hero-bg-word {
  will-change: transform;
  transition: transform .08s linear;
}

/* ── Image hover overlay ripple ── */
.ph:hover img, .ws-cell:hover img, .stage-inner:hover img { filter: brightness(1) !important; }

/* ── Journal card border grow ── */
.jr-card {
  background-clip: padding-box;
}
.jr-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue,#2222FF), transparent 60%);
  opacity: 0;
  z-index: -1;
  transition: opacity .3s;
  pointer-events: none;
}
.jr-card:hover::after { opacity: 1; }

/* ── Floating label animation for form inputs ── */
.fg input:focus + label,
.fg textarea:focus + label {
  color: var(--blue, #2222FF);
}

/* ── CTA available card wave bg ── */
.avail-card {
  position: relative;
  overflow: hidden;
}
.avail-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 120%, rgba(0,255,136,.12) 0%, transparent 55%);
  animation: avWave 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes avWave {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-12px) scale(1.05); }
}

/* ── Contact card hover ── */
.cc {
  transition: border-color .3s, box-shadow .3s, transform .3s cubic-bezier(.22,1,.36,1) !important;
}
.ptq-link {
  transition: border-color .3s, transform .3s cubic-bezier(.22,1,.36,1);
}

/* ── Role row left indicator ── */
.role-row {
  position: relative;
}
.role-row::before {
  content: '';
  position: absolute;
  left: -12px; top: 28px; bottom: 28px;
  width: 2px;
  background: var(--blue, #2222FF);
  transform: scaleY(0);
  transform-origin: top;
  border-radius: 2px;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.role-row.open::before { transform: scaleY(1); }

/* ── Reel card entrance stagger ── */
.reel-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1),
              box-shadow .4s, border-color .3s;
}
.reel-card.visible { opacity: 1; transform: translateY(0); }
.reel-card:nth-child(1).visible { transition-delay: 0ms; }
.reel-card:nth-child(2).visible { transition-delay: 60ms; }
.reel-card:nth-child(3).visible { transition-delay: 120ms; }
.reel-card:nth-child(4).visible { transition-delay: 180ms; }
.reel-card:nth-child(5).visible { transition-delay: 240ms; }
.reel-card:nth-child(6).visible { transition-delay: 300ms; }
.reel-card:nth-child(7).visible { transition-delay: 360ms; }
.reel-card:nth-child(8).visible { transition-delay: 420ms; }
/* Override hidden when filtered */
.reel-card.hidden { display: none !important; }

/* ── Sprocket animation ── */
.sprocket {
  animation: sprocketFade 2s ease-in-out infinite alternate;
}
.sprocket:nth-child(odd)  { animation-delay: 0s; }
.sprocket:nth-child(even) { animation-delay: .4s; }
@keyframes sprocketFade {
  from { opacity: .25; }
  to   { opacity: .07; }
}

/* ── Signal cards stagger ── */
.signal-grid .signal-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s;
}
.signal-grid .signal-card.visible { opacity: 1; transform: translateY(0); }
.signal-grid .signal-card:nth-child(1) { transition-delay: 0ms; }
.signal-grid .signal-card:nth-child(2) { transition-delay: 70ms; }
.signal-grid .signal-card:nth-child(3) { transition-delay: 140ms; }
.signal-grid .signal-card:nth-child(4) { transition-delay: 210ms; }

/* ── Process cards stagger ── */
.process-grid .process-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s;
}
.process-grid .process-card.visible { opacity: 1; transform: translateY(0); }
.process-grid .process-card:nth-child(1) { transition-delay: 0ms; }
.process-grid .process-card:nth-child(2) { transition-delay: 80ms; }
.process-grid .process-card:nth-child(3) { transition-delay: 160ms; }
.process-grid .process-card:nth-child(4) { transition-delay: 240ms; }

/* ── Hero image subtle zoom ── */
.h-r img, .stage-inner img {
  animation: heroImgBreath 8s ease-in-out infinite alternate;
}
@keyframes heroImgBreath {
  from { transform: scale(1); }
  to   { transform: scale(1.025); }
}

/* ── Modal open animation enhancement ── */
.modal-backdrop.open .modal {
  animation: modalPop .45s cubic-bezier(.22,1,.36,1) forwards !important;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Photo grid images ── */
.pg .pc {
  opacity: 0;
  transform: scale(.96);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s;
}
.pg .pc.visible { opacity: 1; transform: scale(1); }
.pg .pc:nth-child(2) { transition-delay: 80ms; }
.pg .pc:nth-child(3) { transition-delay: 160ms; }

/* ── Lang dropdown smooth ── */
.lang-dd, .lang-dropdown {
  transition: opacity .22s cubic-bezier(.22,1,.36,1),
              transform .22s cubic-bezier(.22,1,.36,1) !important;
}

/* ── Reduce motion support ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  #cursor { display: none; }
  #noise  { display: none; }
}
