/* PTAH REAL ESTATE — Motion System */

/* Page enter */
.page-enter main {
  animation: pageFade 0.7s var(--ease) both;
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Hero cinematic entrance */
.home-hero__media img,
.home-hero__media video {
  will-change: transform;
}

.home-hero:not(.home-hero--video) .home-hero__media img,
.home-hero--video:not(.is-playing) .home-hero__poster {
  animation: heroZoom 12s var(--ease) both;
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero-anim > * {
  opacity: 0;
  transform: translateY(28px);
  animation: heroIn 0.9s var(--ease) forwards;
}

.hero-anim > *:nth-child(1) { animation-delay: 0.15s; }
.hero-anim > *:nth-child(2) { animation-delay: 0.32s; }
.hero-anim > *:nth-child(3) { animation-delay: 0.48s; }
.hero-anim > *:nth-child(4) { animation-delay: 0.64s; }

@keyframes heroIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.page-hero__content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.75s var(--ease) forwards;
}
.page-hero__content > *:nth-child(1) { animation-delay: 0.1s; }
.page-hero__content > *:nth-child(2) { animation-delay: 0.25s; }
.page-hero__content > *:nth-child(3) { animation-delay: 0.4s; }

/* Reveal variants — only hide when JS is active */
.js .reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.85s var(--ease),
    transform 0.85s var(--ease);
  will-change: opacity, transform;
}

.js .reveal--left {
  transform: translateX(2rem);
}

.js .reveal--right {
  transform: translateX(-2rem);
}

.js .reveal--scale {
  transform: scale(0.96) translateY(1rem);
}

.js .reveal--fade {
  transform: none;
}

.reveal.is-visible,
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger children */
.js .stagger > .reveal,
.js .stagger > .property-card,
.js .stagger > .category-card,
.js .stagger > .service-card,
.js .stagger > .feature-item,
.js .stagger > .value-item,
.js .stagger > .process-step,
.js .stagger > .media-frame,
.js .stagger > .stat,
.js .stagger > .category-hub-card {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease);
}

.stagger.is-visible > *:nth-child(1),
.js .stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.is-visible > *:nth-child(2),
.js .stagger.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.is-visible > *:nth-child(3),
.js .stagger.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger.is-visible > *:nth-child(4),
.js .stagger.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger.is-visible > *:nth-child(5),
.js .stagger.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger.is-visible > *:nth-child(6),
.js .stagger.is-visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger.is-visible > *:nth-child(7),
.js .stagger.is-visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger.is-visible > *:nth-child(8),
.js .stagger.is-visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger.is-visible > *,
.js .stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

/* Gold line draw */
.gold-line {
  transform-origin: right center;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
}

.reveal:not(.is-visible) .gold-line,
.section-header:not(.is-visible) .gold-line {
  transform: scaleX(0);
  opacity: 0;
}

.reveal.is-visible .gold-line,
.section-header.is-visible .gold-line {
  transform: scaleX(1);
  opacity: 0.7;
}

/* Button micro polish */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    background var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(202, 175, 105, 0.28);
}

.btn--secondary:hover,
.btn--outline-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 44, 70, 0.12);
}

.btn--outline:hover {
  transform: translateY(-2px);
}

/* Card lift */
.property-card,
.service-card,
.value-item {
  transition:
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    border-color 0.35s var(--ease);
}

.property-card:hover,
.service-card:hover {
  transform: translateY(-6px);
}

.value-item:hover {
  transform: translateY(-4px);
  border-color: rgba(202, 175, 105, 0.45);
}

/* Feature underline grow */
.feature-item {
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.feature-item:hover {
  border-top-color: var(--color-gold-primary);
  transform: translateY(-3px);
}

.feature-item__icon {
  transition: transform 0.4s var(--ease), color 0.3s var(--ease);
}

.feature-item:hover .feature-item__icon {
  transform: scale(1.08);
  color: var(--color-gold-light);
}

/* Stats */
.stat__num {
  transition: transform 0.4s var(--ease);
}

.stat.is-visible .stat__num,
.stagger.is-visible .stat .stat__num {
  animation: statPop 0.6s var(--ease) both;
}

@keyframes statPop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Process connector pulse */
@media (min-width: 900px) {
  .process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0.85rem;
    inset-inline-start: calc(100% - 0.5rem);
    width: calc(100% - 1rem);
    height: 1px;
    background: linear-gradient(90deg, var(--color-gold-primary), transparent);
    opacity: 0.35;
    transform-origin: right center;
    transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
  }

  .stagger:not(.is-visible) .process-step::after {
    transform: scaleX(0);
    opacity: 0;
  }
}

.process-step {
  position: relative;
}

/* Nav link underline */
.nav-link::before {
  content: "";
  position: absolute;
  inset-inline: 0.7rem;
  bottom: 0.15rem;
  height: 1px;
  background: var(--color-gold-primary);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover::before,
.nav-link.is-active::before {
  transform: scaleX(1);
}

.nav-link.is-active::after {
  display: none;
}

/* Mobile menu stagger */
.mobile-nav.is-open .mobile-links > a,
.mobile-nav.is-open .mobile-sub a {
  animation: mobileLinkIn 0.45s var(--ease) both;
}

.mobile-nav.is-open .mobile-links > a:nth-child(1) { animation-delay: 0.05s; }
.mobile-nav.is-open .mobile-links > a:nth-child(2) { animation-delay: 0.1s; }
.mobile-nav.is-open .mobile-links > a:nth-child(3) { animation-delay: 0.15s; }
.mobile-nav.is-open .mobile-links > div { animation: mobileLinkIn 0.45s 0.18s var(--ease) both; }
.mobile-nav.is-open .mobile-links > a:nth-child(5) { animation-delay: 0.28s; }
.mobile-nav.is-open .mobile-links > a:nth-child(6) { animation-delay: 0.33s; }
.mobile-nav.is-open .mobile-links > a:nth-child(7) { animation-delay: 0.38s; }

@keyframes mobileLinkIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* WhatsApp gentle attention */
.float-btn--whatsapp {
  animation: floatPulse 3s var(--ease) infinite;
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.float-btn--whatsapp:hover {
  animation: none;
}

/* Gallery crossfade feel */
.gallery-main img {
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}

.gallery-main.is-switching img {
  opacity: 0.4;
  transform: scale(1.02);
}

/* Scroll indicator delay after hero */
.scroll-indicator {
  opacity: 0;
  animation: heroIn 0.8s 1.1s var(--ease) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__media img,
  .hero-anim > *,
  .page-hero__content > *,
  .page-enter main,
  .float-btn--whatsapp,
  .scroll-indicator {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .reveal,
  .stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
