/* ============================================================
   SULAYMAN COFFEE — animations.css  v5
   Mobile-first — CSS-only — صفر مكتبات
   ============================================================ */

/* ══ 1. GRAIN TEXTURE ══ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ══ 2. HERO GRADIENT — يتنفس ببطء ══ */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
      ellipse 60% 55% at 15% 50%,
      rgba(255, 255, 255, 0.13) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 60% at 88% 20%,
      rgba(180, 50, 20, 0.38) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 40% 40% at 72% 88%,
      rgba(140, 28, 8, 0.28) 0%,
      transparent 50%
    );
  animation: heroBreathe 8s ease-in-out infinite alternate;
}

@keyframes heroBreathe {
  0% {
    opacity: 0.65;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ══ 3. STEAM — بخار القهوة ══ */
.hero-steam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.18;
}

.hero-steam path {
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  animation: steamRise 5s ease-in-out infinite;
}
.hero-steam path:nth-child(2) {
  animation-delay: 1.4s;
  animation-duration: 6.2s;
}
.hero-steam path:nth-child(3) {
  animation-delay: 2.8s;
  animation-duration: 4.8s;
}
.hero-steam path:nth-child(4) {
  animation-delay: 0.7s;
  animation-duration: 5.6s;
}

@keyframes steamRise {
  0% {
    stroke-dashoffset: 450;
    opacity: 0;
    transform: translateY(0);
  }
  15% {
    opacity: 0.85;
  }
  75% {
    opacity: 0.2;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
    transform: translateY(-40px);
  }
}

/* ══ 4. HERO ENTRANCE ══ */
.hero-pre {
  animation: heroClip 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes heroClip {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-pre::before {
  content: '';
  width: 0;
  height: 1px;
  background: white;
  opacity: 0.5;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.8rem;
  animation: lineGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

@keyframes lineGrow {
  to {
    width: 36px;
    opacity: 0.5;
  }
}

.hero h1 {
  overflow: visible;
}

.hero h1 > * {
  animation: heroLineUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.hero h1 em {
  animation: heroLineUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

@keyframes heroLineUp {
  from {
    opacity: 0;
    transform: translateY(60%);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-desc {
  animation: heroFadeUp 0.9s ease 0.72s both;
}

.hero-btns {
  animation: heroFadeUp 0.8s ease 0.88s both;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-stats > div:nth-child(1) {
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}
.hero-stats > div:nth-child(2) {
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.85s both;
}
.hero-stats > div:nth-child(3) {
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.hero-scroll {
  animation: heroFadeUp 1s ease 1.2s both;
}

/* ══ 5. اللوغو — ثابت تماماً ══ */
.hero-deco img {
  animation: none !important;
  transform: none !important;
}

/* ══ 6. نبضة الزر ══ */
.hero-btns .btn-fill {
  animation: heroFadeUp 0.8s ease 0.88s both,
    btnGlow 3.5s ease-in-out 3s infinite;
}

@keyframes btnGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.09);
  }
}

/* ══ 7. SCROLL INDICATOR ══ */
.hero-scroll::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.45);
  vertical-align: middle;
  margin-left: 0.8rem;
  animation: scrollDrip 2.2s ease-in-out infinite;
}

@keyframes scrollDrip {
  0% {
    transform: scaleY(0);
    opacity: 0;
    transform-origin: top;
  }
  45% {
    transform: scaleY(1);
    opacity: 0.55;
    transform-origin: top;
  }
  55% {
    transform: scaleY(1);
    opacity: 0.55;
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    opacity: 0;
    transform-origin: bottom;
  }
}

/* ══ 8. PRODUCT CARDS ══ */
.pcard {
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.38s ease;
  will-change: transform;
}
.pcard:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 56px rgba(34, 40, 51, 0.22);
}

/* ══ 9. PROCESS STEPS ══ */
.pstep:nth-child(1) {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0s both paused;
}
.pstep:nth-child(2) {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both paused;
}
.pstep:nth-child(3) {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both paused;
}
.pstep:nth-child(4) {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both paused;
}
.pstep.in-view {
  animation-play-state: running;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pstep-ic {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pstep:hover .pstep-ic {
  transform: translateY(-7px) scale(1.2);
}

/* ══ 10. TIMELINE ══ */
.tl-row {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tl-row.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ══ 11. REVIEW CARDS ══ */
.rcard {
  overflow: hidden;
  position: relative;
}
.rcard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.rcard:hover::before {
  transform: translateX(120%);
}

/* ══ 12. SECTION LABELS ══ */
.slbl,
.sec-lbl {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}
.slbl.in-view,
.sec-lbl.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ══ 13. SECTION HEADINGS ══ */
.story-sec h2,
.sec-ttl,
.proc-sec h2 {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease 0.2s,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.story-sec h2.in-view,
.sec-ttl.in-view,
.proc-sec h2.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ══ 14. BUTTONS ══ */
.btn-fill,
.btn-line {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.25s, box-shadow 0.25s;
}
.btn-fill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34, 40, 51, 0.2);
}
.btn-line:hover {
  transform: translateY(-2px);
}

/* ══ 15. NAV LOGO ══ */
.nav-logo img {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s;
}
.nav-logo:hover img {
  transform: scale(1.07) rotate(-2deg);
}

/* ══ 16. NUMBAR ══ */
@keyframes numPop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
.nval.counted {
  animation: numPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ══ 17. MARQUEE ══ */
.marquee:hover .mtrack {
  animation-play-state: paused;
}

/* ══ تقليل الحركة ══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  body::after,
  #s-progress {
    display: none;
  }
}
