/* ================================================================
   RAK Security — animations.css v3.0
   Author: Muklesur Rahman Oli | Senior Executive, SAK Consumer Products LTD
   ================================================================ */

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ================================================================
   1. PAGE PRELOADER
   ================================================================ */
#rak-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  transition: opacity .6s ease, visibility .6s ease;
}
#rak-preloader.hide {
  opacity: 0;
  visibility: hidden;
}
.rak-preloader__logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .06em;
  text-align: center;
  animation: preloaderPulse 1.5s ease-in-out infinite;
}
.rak-preloader__logo span { color: var(--gold); }
.rak-preloader__bar {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.rak-preloader__progress {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  animation: preloaderBar 1.8s ease forwards;
}
@keyframes preloaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(.97); }
}
@keyframes preloaderBar {
  0%   { width: 0; }
  100% { width: 100%; }
}

/* ================================================================
   2. SCROLL REVEAL BASE
   ================================================================ */
[data-rak-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
[data-rak-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-rak-reveal="left"] {
  transform: translateX(-40px);
}
[data-rak-reveal="left"].revealed {
  transform: translateX(0);
}
[data-rak-reveal="right"] {
  transform: translateX(40px);
}
[data-rak-reveal="right"].revealed {
  transform: translateX(0);
}
[data-rak-reveal="scale"] {
  transform: scale(.92);
}
[data-rak-reveal="scale"].revealed {
  transform: scale(1);
}

/* Stagger children */
[data-rak-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
[data-rak-stagger].revealed > *:nth-child(1) { transition-delay: .05s; }
[data-rak-stagger].revealed > *:nth-child(2) { transition-delay: .12s; }
[data-rak-stagger].revealed > *:nth-child(3) { transition-delay: .19s; }
[data-rak-stagger].revealed > *:nth-child(4) { transition-delay: .26s; }
[data-rak-stagger].revealed > *:nth-child(5) { transition-delay: .33s; }
[data-rak-stagger].revealed > *:nth-child(6) { transition-delay: .40s; }
[data-rak-stagger].revealed > *:nth-child(7) { transition-delay: .47s; }
[data-rak-stagger].revealed > *:nth-child(8) { transition-delay: .54s; }
[data-rak-stagger].revealed > *:nth-child(9) { transition-delay: .61s; }
[data-rak-stagger].revealed > *:nth-child(10){ transition-delay: .68s; }
[data-rak-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   3. DIAGONAL SECTION DIVIDERS
   ================================================================ */
.rak-diagonal-down {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%);
  padding-bottom: calc(var(--section-py) + 48px);
  margin-bottom: -2px;
}
.rak-diagonal-up {
  clip-path: polygon(0 48px, 100% 0, 100% 100%, 0 100%);
  padding-top: calc(var(--section-py) + 48px);
  margin-top: -2px;
}
.rak-diagonal-both {
  clip-path: polygon(0 48px, 100% 0, 100% calc(100% - 48px), 0 100%);
  padding-block: calc(var(--section-py) + 48px);
  margin-block: -2px;
}
@media (max-width: 768px) {
  .rak-diagonal-down  { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 0 100%); padding-bottom: calc(var(--section-py) + 28px); }
  .rak-diagonal-up    { clip-path: polygon(0 28px, 100% 0, 100% 100%, 0 100%); padding-top: calc(var(--section-py) + 28px); }
  .rak-diagonal-both  { clip-path: polygon(0 28px, 100% 0, 100% calc(100% - 28px), 0 100%); padding-block: calc(var(--section-py) + 28px); }
}

/* ================================================================
   4. SECTION HEADING UNDERLINE ANIMATION
   ================================================================ */
.rak-title::after {
  width: 0 !important;
  transition: width .8s cubic-bezier(.16,1,.3,1) .3s !important;
}
.rak-title.revealed::after,
.revealed .rak-title::after {
  width: 48px !important;
}
.rak-title.center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ================================================================
   5. BUTTON SHINE EFFECT
   ================================================================ */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn:hover::after { left: 150%; }

/* ================================================================
   6. SERVICE CARD ENHANCED HOVER
   ================================================================ */
.rak-service-card {
  transition: all .35s cubic-bezier(.16,1,.3,1) !important;
  transform-origin: center bottom;
}
.rak-service-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 20px 48px rgba(0,0,0,.15), 0 0 0 1px rgba(200,169,74,.2) !important;
}
.rak-service-card__icon {
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.rak-service-card:hover .rak-service-card__icon {
  transform: scale(1.12) rotate(-4deg);
}

/* ================================================================
   7. CARD 3D TILT EFFECT
   ================================================================ */
.rak-tilt {
  transition: transform .15s ease, box-shadow .15s ease;
  will-change: transform;
  transform-style: preserve-3d;
}

/* ================================================================
   8. PARTICLE DOT BACKGROUND
   ================================================================ */
.rak-particles {
  position: relative;
  overflow: hidden;
}
.rak-particles::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(200,169,74,.08) 1px, transparent 0);
  background-size: 28px 28px;
  animation: particleDrift 20s linear infinite;
  pointer-events: none;
}
@keyframes particleDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 28px 28px; }
}

/* ================================================================
   9. GOLD SHIMMER — STATS SECTION
   ================================================================ */
.rak-stats {
  position: relative;
  overflow: hidden;
}
.rak-stats::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(200,169,74,.06), transparent);
  animation: shimmerSweep 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmerSweep {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}

/* ================================================================
   10. ANIMATED VERTICAL TIMELINE
   ================================================================ */
.rak-timeline {
  position: relative;
  padding: 2rem 0 3rem;
}

/* Vertical center line */
.rak-timeline__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--gold) 10%, var(--gold) 90%, transparent);
  transform-origin: top center;
}

/* Animated draw effect */
.rak-timeline__line-inner {
  width: 100%;
  height: 0;
  background: var(--gold);
  transition: height 2s cubic-bezier(.16,1,.3,1);
}
.rak-timeline.line-drawn .rak-timeline__line-inner {
  height: 100%;
}

/* Timeline items */
.rak-timeline__item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 40px);
  margin-bottom: 3rem;
  position: relative;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1);
}
.rak-timeline__item.revealed {
  opacity: 1;
  transform: translateX(0);
}
.rak-timeline__item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 40px);
  transform: translateX(30px);
}
.rak-timeline__item:nth-child(even).revealed {
  transform: translateX(0);
}

/* Year badge */
.rak-timeline__year {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 64px;
  height: 64px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 0 0 6px rgba(200,169,74,.15), 0 4px 16px rgba(200,169,74,.3);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
}
.rak-timeline__item.revealed .rak-timeline__year {
  transform: translate(-50%, -50%) scale(1);
}

/* Connector line from badge to card */
.rak-timeline__connector {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: var(--gold);
  opacity: .4;
  width: 0;
  transition: width .5s ease .4s;
}
.rak-timeline__item .rak-timeline__connector {
  right: calc(50% + 32px);
}
.rak-timeline__item:nth-child(even) .rak-timeline__connector {
  left: calc(50% + 32px);
  right: auto;
}
.rak-timeline__item.revealed .rak-timeline__connector {
  width: 40px;
}

/* Timeline card */
.rak-timeline__card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  max-width: 320px;
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
  border-left: 3px solid var(--gold);
}
.rak-timeline__item:nth-child(even) .rak-timeline__card {
  border-left: none;
  border-right: 3px solid var(--gold);
}
.rak-timeline__card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--gold);
}
.rak-timeline__card h4 {
  font-size: .95rem;
  color: var(--navy);
  margin-bottom: .25rem;
  font-family: var(--font-head);
}
.rak-timeline__card p {
  font-size: .82rem;
  color: var(--gray-dark);
  margin: 0;
  line-height: 1.5;
}

/* Mobile timeline */
@media (max-width: 768px) {
  .rak-timeline__line { left: 20px; }
  .rak-timeline__item,
  .rak-timeline__item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 70px;
    padding-right: 0;
    transform: translateX(-20px);
  }
  .rak-timeline__item.revealed,
  .rak-timeline__item:nth-child(even).revealed {
    transform: translateX(0);
  }
  .rak-timeline__year {
    left: 20px;
    top: 1.5rem;
    transform: translate(-50%, 0) scale(0);
    width: 48px;
    height: 48px;
    font-size: .68rem;
  }
  .rak-timeline__item.revealed .rak-timeline__year,
  .rak-timeline__item:nth-child(even).revealed .rak-timeline__year {
    transform: translate(-50%, 0) scale(1);
  }
  .rak-timeline__connector,
  .rak-timeline__item:nth-child(even) .rak-timeline__connector {
    left: 44px;
    right: auto;
    width: 0;
  }
  .rak-timeline__item.revealed .rak-timeline__connector,
  .rak-timeline__item:nth-child(even).revealed .rak-timeline__connector {
    width: 26px;
  }
  .rak-timeline__card,
  .rak-timeline__item:nth-child(even) .rak-timeline__card {
    max-width: 100%;
    border-left: 3px solid var(--gold);
    border-right: none;
  }
}

/* ================================================================
   11. NAV HOVER UNDERLINE ANIMATION
   ================================================================ */
.rak-nav__menu > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s ease;
}
.rak-nav__menu > li > a:hover::after,
.rak-nav__menu > li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* ================================================================
   12. TESTIMONIAL CARD ENHANCED
   ================================================================ */
.rak-testi-card {
  transition: transform .35s ease, box-shadow .35s ease !important;
}
.rak-testi-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md) !important;
}

/* ================================================================
   13. FLOATING GOLD ORBS — HERO
   ================================================================ */
.rak-hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,74,.08) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(-20px,-30px) scale(1.05); }
}

/* ================================================================
   14. SCROLL TO TOP — ENHANCED
   ================================================================ */
#rak-scroll-top {
  transition: all .35s cubic-bezier(.16,1,.3,1) !important;
}
#rak-scroll-top:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(200,169,74,.4) !important;
}

/* ================================================================
   15. COUNTER PULSE
   ================================================================ */
.rak-counter.counting {
  animation: counterPop .3s ease;
}
@keyframes counterPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); color: var(--gold-light); }
  100% { transform: scale(1); }
}

/* ================================================================
   16. DEPARTMENT CARD HOVER
   ================================================================ */
.tm-dept-card {
  transition: all .35s cubic-bezier(.16,1,.3,1) !important;
}
.tm-dept-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
  border-color: rgba(200,169,74,.4) !important;
}

/* ================================================================
   17. CLIENT LOGO MARQUEE ENHANCED
   ================================================================ */
.rak-marquee__logo {
  transition: filter .4s ease, transform .4s ease !important;
}
.rak-marquee__logo:hover {
  filter: grayscale(0%) opacity(1) !important;
  transform: scale(1.05);
}

/* ================================================================
   18. HERO ARROWS PULSE
   ================================================================ */
.rak-hero__arrow {
  animation: arrowPulse 3s ease-in-out infinite;
}
.rak-hero__arrow--next { animation-delay: 1.5s; }
@keyframes arrowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,169,74,.3); }
  50%       { box-shadow: 0 0 0 8px rgba(200,169,74,0); }
}
