/* ============================================================
   FX — trendy motion layer (aurora, scroll-reveal, tilt,
   sheen, magic tab indicator, scroll-top, hero motion)
   Palette-locked: sage / blush / offwhite only.
   ============================================================ */

/* ── Aurora drifting blobs (behind everything, above body bg) ── */
.aurora {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: blur(48px);
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  /* no mix-blend-mode — blending every frame is costly on mobile */
  will-change: transform;
}

.aurora__blob--1 {
  width: 46vw; height: 46vw;
  top: -8%; right: -6%;
  background: radial-gradient(circle at 30% 30%, #B8D4CD, transparent 70%);
  animation: blobDrift1 26s ease-in-out infinite;
}

.aurora__blob--2 {
  width: 52vw; height: 52vw;
  top: 30%; left: -12%;
  background: radial-gradient(circle at 40% 40%, #F5DDD8, transparent 70%);
  animation: blobDrift2 32s ease-in-out infinite;
}

.aurora__blob--3 {
  width: 40vw; height: 40vw;
  bottom: -10%; right: 10%;
  background: radial-gradient(circle at 50% 50%, #88B5A8, transparent 70%);
  opacity: 0.4;
  animation: blobDrift3 38s ease-in-out infinite;
}

@keyframes blobDrift1 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%      { transform: translate3d(-6vw, 5vh, 0) scale(1.15); }
}
@keyframes blobDrift2 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%      { transform: translate3d(7vw, -4vh, 0) scale(1.1); }
}
@keyframes blobDrift3 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%      { transform: translate3d(-5vw, -6vh, 0) scale(1.2); }
}

/* When JS motion is active, the IntersectionObserver reveal replaces
   the eager CSS fade so cards don't flash before they scroll in. */
.fx-on .item-card { animation: none; }

/* ── Scroll-reveal — items start hidden, .is-in animates them in ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
  /* no persistent will-change — it was creating a layer per card */
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* gentle scale variant for cards */
.reveal--pop {
  transform: translateY(22px) scale(0.94);
}
.reveal--pop.is-in {
  transform: translateY(0) scale(1);
}

/* ── Card sheen sweep (diagonal light on hover) ──
   Hover-only devices: keeps the extra paint layer off mobile entirely. */
@media (hover: hover) and (pointer: fine) {
  .item-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
      115deg,
      transparent 30%,
      rgba(255,255,255,0.45) 48%,
      transparent 62%
    );
    background-size: 250% 100%;
    background-position: 150% 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
  }
  .item-card:not(.item-card--unavailable):hover::before {
    opacity: 1;
    animation: sheenSweep 0.85s ease;
  }
}
@keyframes sheenSweep {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}

/* ── Pointer tilt (set via JS, desktop only) ── */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}

/* ── Hero: Ken-Burns slow zoom + parallax hook ── */
.hero-bg-img {
  animation: kenBurns 18s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenBurns {
  from { transform: scale(1)    translateY(0); }
  to   { transform: scale(1.12) translateY(-2%); }
}

/* Hero title shimmer sweep */
.hero-title {
  position: relative;
  animation: titleShimmer 6s ease-in-out infinite;
}
@keyframes titleShimmer {
  0%, 100% { background-position: 120% 0; }
  50%      { background-position: -20% 0; }
}

/* Hero background parallax — driven by the scroll timeline so it lives on
   the compositor and stays perfectly in sync (no lag/jump on a fast fling).
   The 140px max shift stays within the 150px overscan in hero.css, so it
   never reveals a gap. Unsupported browsers just get a static hero. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-bg {
      animation: heroParallax linear both;
      animation-timeline: scroll(root);
      animation-range: 0 520px;
    }
    @keyframes heroParallax {
      from { transform: translate3d(0, 0, 0); }
      to   { transform: translate3d(0, 140px, 0); }
    }
  }
}

/* Floating logo */
.hero-logo-wrap {
  animation: logoFloat 5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ── Sliding "magic" tab indicator ── */
#category-tabs { position: sticky; }   /* keep, set in tabs.css */
.tab-indicator {
  position: absolute;
  top: 14px;
  left: 0;                /* anchor so translateX(offsetLeft) lands correctly */
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--sage);
  box-shadow: var(--shadow-btn);
  z-index: 0;
  opacity: 0;            /* shown by JS once measured, avoids first-paint flash */
  transition:
    transform 0.4s cubic-bezier(.34,1.4,.5,1),
    width 0.4s cubic-bezier(.34,1.4,.5,1),
    opacity 0.3s ease;
  pointer-events: none;
  will-change: transform, width;
}
/* The flex scroll-fade hint reserves 32px even without overflow,
   leaving a stray sliver — drop it once the sliding pill is active. */
#category-tabs.has-indicator::after { content: none; }

/* When indicator is active, neutralise the per-tab solid bg so the
   pill shows through; keep text legible above it. */
#category-tabs.has-indicator .cat-tab {
  background: var(--white);
  position: relative;
  z-index: 1;
}
#category-tabs.has-indicator .cat-tab.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: var(--white);
}
#category-tabs.has-indicator .cat-tab.active::after { display: none; }

/* ── Section title: animated accent dot + underline grow ── */
.section-title-box {
  position: relative;
  overflow: hidden;
}
.section-title-box::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  height: 3px; width: 0;
  background: linear-gradient(to left, var(--sage), var(--blush-dark));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.reveal.is-in .section-title-box::after,
.section-title-box.is-in::after { width: 60%; }

/* ── Price pulse on featured active card ── */
.feat-card.c-active .price-new {
  animation: pricePulse 2.4s ease-in-out infinite;
}
@keyframes pricePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* ── Scroll-to-top button with progress ring ── */
.scroll-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px; height: 50px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.16);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 90;
  opacity: 0;
  transform: translateY(20px) scale(0.7);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.34,1.56,.64,1);
}
.scroll-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top:active { transform: scale(0.9); }
.scroll-top svg.arrow {
  width: 20px; height: 20px;
  stroke: var(--sage-dark);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 1;
}
.scroll-top .ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.scroll-top .ring circle {
  fill: none;
  stroke-width: 3;
}
.scroll-top .ring .ring-bg    { stroke: rgba(136,181,168,0.2); }
.scroll-top .ring .ring-prog  {
  stroke: var(--sage);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

/* ============================================================
   MODAL — cinematic staggered reveal
   Children animate in after the sheet slides up. Using `backwards`
   fill so per-element :hover/:active transforms still work.
   ============================================================ */
@keyframes modalItemUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes modalImgIn {
  from { opacity: 0; transform: scale(1.14); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes modalCloseIn {
  from { opacity: 0; transform: scale(0.4) rotate(-90deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

#item-modal.open .modal-img-wrap img {
  animation: modalImgIn 0.8s cubic-bezier(0.22,1,0.36,1) backwards;
}
#item-modal.open .modal-close {
  animation: modalCloseIn 0.45s 0.3s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
#item-modal.open .modal-category { animation: modalItemUp 0.5s 0.14s cubic-bezier(0.22,1,0.36,1) backwards; }
#item-modal.open .modal-name     { animation: modalItemUp 0.5s 0.20s cubic-bezier(0.22,1,0.36,1) backwards; }
#item-modal.open .modal-desc     { animation: modalItemUp 0.5s 0.27s cubic-bezier(0.22,1,0.36,1) backwards; }
#item-modal.open .modal-divider  { animation: modalItemUp 0.5s 0.33s cubic-bezier(0.22,1,0.36,1) backwards; }
#item-modal.open .modal-price-row{ animation: modalItemUp 0.5s 0.40s cubic-bezier(0.22,1,0.36,1) backwards; }

/* Price gets a gentle attention pop at the end of the cascade */
#item-modal.open .modal-price-new {
  animation: pricePulse 2.6s 1s ease-in-out infinite;
}

/* ── Hero meta chips: staggered entrance ── */
.fx-on .hero-meta-item {
  animation: fadeUp 0.5s both;
}
.fx-on .hero-meta-item:nth-child(1) { animation-delay: 0.35s; }
.fx-on .hero-meta-item:nth-child(2) { animation-delay: 0.45s; }
.fx-on .hero-meta-item:nth-child(3) { animation-delay: 0.55s; }
.fx-on .hero-meta-item:nth-child(4) { animation-delay: 0.65s; }

/* ============================================================
   "درباره ما" — animated About band
   ============================================================ */
.experience {
  position: relative;
  margin: 44px 0 10px;
  padding: 44px 0 38px;
  border-radius: 36px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #9ec8bc 0%, transparent 55%),
    linear-gradient(155deg, #7FA99B 0%, #88B5A8 50%, #97c0b4 100%);
  box-shadow: 0 26px 60px rgba(127,169,155,0.4);
  isolation: isolate;
}
/* soft highlight along the top edge so it melts into the page */
.experience::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 120px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
  z-index: 1;
}

/* subtle low-opacity dot pattern */
.experience::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.9) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

/* floating blurred orbs (no blend-mode — cheaper on mobile) */
.exp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  z-index: 0;
  pointer-events: none;
}
.exp-orb--1 {
  width: 220px; height: 220px;
  top: -60px; right: -40px;
  background: radial-gradient(circle, rgba(245,221,216,0.9), transparent 70%);
  opacity: 0.8;
  animation: orbFloat1 14s ease-in-out infinite;
}
.exp-orb--2 {
  width: 180px; height: 180px;
  bottom: -40px; left: -30px;
  background: radial-gradient(circle, rgba(255,255,255,0.85), transparent 70%);
  opacity: 0.5;
  animation: orbFloat2 18s ease-in-out infinite;
}
.exp-orb--3 {
  width: 150px; height: 150px;
  top: 38%; left: 28%;
  background: radial-gradient(circle, rgba(184,212,205,0.9), transparent 70%);
  opacity: 0.45;
  animation: orbFloat3 22s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-24px,20px)} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(26px,-18px)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(18px,16px) scale(1.18)} }

/* inner content */
.exp-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 22px;
}

/* circular brand emblem at the top */
.about-emblem {
  width: 76px; height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 10px 26px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.5);
}
.about-emblem-img { width: 100%; height: 100%; object-fit: cover; }
.about-emblem svg { width: 38px; height: 38px; stroke: #fff; fill: none; }
.about-emblem-img,
.about-emblem svg { animation: logoFloat 5s ease-in-out infinite; }

/* staggered entrance for the inner blocks when the band scrolls in */
.experience .exp-inner > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s cubic-bezier(0.22,1,0.36,1),
    transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.experience.is-in .exp-inner > * { opacity: 1; transform: none; }
.experience.is-in .exp-inner > *:nth-child(1) { transition-delay: 0.05s; }
.experience.is-in .exp-inner > *:nth-child(2) { transition-delay: 0.13s; }
.experience.is-in .exp-inner > *:nth-child(3) { transition-delay: 0.21s; }
.experience.is-in .exp-inner > *:nth-child(4) { transition-delay: 0.29s; }
.experience.is-in .exp-inner > *:nth-child(5) { transition-delay: 0.37s; }
.experience.is-in .exp-inner > *:nth-child(6) { transition-delay: 0.45s; }

.exp-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.88);
  margin-bottom: 12px;
}
.exp-title {
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background-image: linear-gradient(100deg, #ffffff 0%, #ffffff 40%, #fff2ec 50%, #ffffff 60%, #ffffff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShimmer 5s ease-in-out infinite;
}
.exp-sub {
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 24px;
}

/* stats */
.exp-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.exp-stat {
  min-width: 96px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.exp-stat-num {
  display: block;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}
.exp-stat-text { font-size: clamp(1rem, 3.5vw, 1.3rem); }
.exp-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  margin-top: 4px;
}

/* CTA */
.exp-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--sage-dark);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
  cursor: pointer;
}
.exp-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.24);
}
.exp-cta:active { transform: scale(0.96); }
.exp-cta svg { stroke: var(--sage-dark); }
/* shine sweep on the CTA */
.exp-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(136,181,168,0.35) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: ctaShine 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ctaShine {
  0%, 100% { background-position: 150% 0; }
  55%      { background-position: -50% 0; }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .aurora__blob,
  .hero-bg-img,
  .hero-title,
  .hero-logo-wrap,
  .feat-card.c-active .price-new,
  .exp-orb,
  .about-emblem-img,
  .about-emblem svg,
  .exp-title,
  .exp-cta::after,
  .fx-on .hero-meta-item,
  #item-modal.open .modal-price-new,
  #item-modal.open .modal-img-wrap img,
  #item-modal.open .modal-close,
  #item-modal.open .modal-category,
  #item-modal.open .modal-name,
  #item-modal.open .modal-desc,
  #item-modal.open .modal-divider,
  #item-modal.open .modal-price-row { animation: none !important; }

  .reveal,
  .experience .exp-inner > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-title,
  .exp-title { -webkit-text-fill-color: #fff; }
}
