@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -150% 0;
  }
  100% {
    background-position: 250% 0;
  }
}

@keyframes floatOrb {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(16px, -24px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes auroraSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes auroraFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -2.4vh, 0);
  }
}

@keyframes causticDrift {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.orb-one,
.orb-two {
  animation: none;
  will-change: transform, opacity;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 550ms var(--ease-out),
    transform 550ms var(--ease-smooth);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   HERO HALFTONE DITHER ANIMATIONS
   ============================================ */

@keyframes ditherFloat {
  0%, 100% {
    transform: translate(0, 0);
    background-position: 0 0;
  }
  50% {
    transform: translate(-10px, 6px);
    background-position: 6px 3px;
  }
}

@keyframes ditherWave {
  0%, 100% {
    transform: translate(0, 0);
    background-position: 0 0;
  }
  50% {
    transform: translate(10px, -8px);
    background-position: 9px 3px;
  }
}

@keyframes ditherDrift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    background-position: 0 0;
  }
  50% {
    transform: translate(-6px, 4px) scale(1.04);
    background-position: 4px 4px;
  }
}

/* ============================================
   HERO ENTRANCE ANIMATIONS
   ============================================ */

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

@keyframes heroFadeScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Hero copy children - initial hidden state */
.hero-copy .kicker,
.hero-copy .hero-title,
.hero-copy .hero-text,
.hero-copy .hero-actions,
.hero-copy .hero-metrics {
  opacity: 0;
}

/* Hero copy children - animated state when parent is visible */
.hero-copy.is-visible .kicker {
  animation: heroSlideRight 450ms var(--ease-out) forwards;
  animation-delay: 50ms;
}

.hero-copy.is-visible .hero-title {
  animation: heroFadeUp 550ms var(--ease-out) forwards;
  animation-delay: 120ms;
}

.hero-copy.is-visible .hero-text {
  animation: heroFadeUp 500ms var(--ease-out) forwards;
  animation-delay: 220ms;
}

.hero-copy.is-visible .hero-actions {
  animation: heroFadeUp 450ms var(--ease-out) forwards;
  animation-delay: 320ms;
}

.hero-copy.is-visible .hero-metrics {
  animation: heroFadeScale 500ms var(--ease-out) forwards;
  animation-delay: 420ms;
}

/* Hero metrics items staggered entrance */
.hero-copy.is-visible .hero-metrics li {
  opacity: 0;
  animation: heroFadeUp 400ms var(--ease-out) forwards;
}

.hero-copy.is-visible .hero-metrics li:nth-child(1) {
  animation-delay: 480ms;
}

.hero-copy.is-visible .hero-metrics li:nth-child(2) {
  animation-delay: 560ms;
}

.hero-copy.is-visible .hero-metrics li:nth-child(3) {
  animation-delay: 640ms;
}

/* Hero buttons staggered */
.hero-copy.is-visible .hero-actions .button {
  opacity: 0;
  animation: heroFadeUp 400ms var(--ease-out) forwards;
}

.hero-copy.is-visible .hero-actions .button:nth-child(1) {
  animation-delay: 360ms;
}

.hero-copy.is-visible .hero-actions .button:nth-child(2) {
  animation-delay: 440ms;
}

/* Hero 3D stage fade in */
.hero-3d-stage {
  opacity: 0;
  animation: heroFadeScale 800ms 50ms var(--ease-out) forwards;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-copy .kicker,
  .hero-copy .hero-title,
  .hero-copy .hero-text,
  .hero-copy .hero-actions,
  .hero-copy .hero-metrics,
  .hero-copy .hero-metrics li,
  .hero-copy .hero-actions .button,
  .hero-3d-stage {
    opacity: 1;
    animation: none;
    transform: none;
    filter: none;
  }

  .hero-dither,
  .hero-dither::before,
  .hero-dither::after {
    animation: none;
  }
}

.tilt-card {
  transform-style: preserve-3d;
  transition:
    transform var(--time-fast) var(--ease-snappy),
    box-shadow var(--time-fast) var(--ease-snappy);
}

.tilt-card:hover {
  box-shadow: 0 30px 90px color-mix(in srgb, var(--accent) 14%, transparent);
}

body.theme-switching .liquid-glass {
  box-shadow:
    var(--shadow-glass),
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    inset 0 -18px 26px rgba(255, 255, 255, 0.05);
}

body.theme-switching .caustic,
body.theme-switching .orb {
  opacity: 0.45;
}

.hero-3d-stage,
.styles-hero,
.offer-card,
.timeline li,
.contact-wrap {
  transition:
    border-color var(--time-base) var(--ease-smooth),
    background var(--time-base) var(--ease-smooth),
    box-shadow var(--time-base) var(--ease-smooth);
}

.scroll-progress {
  will-change: width;
}

/* ============================================
   SHOWCASE ANIMATIONS
   ============================================ */

/* Staggered entrance for cards */
.sc-frame.is-active .sc-card:nth-child(1) { transition-delay: 280ms; }
.sc-frame.is-active .sc-card:nth-child(2) { transition-delay: 340ms; }
.sc-frame.is-active .sc-card:nth-child(3) { transition-delay: 400ms; }

/* Card hover lift effect */
.sc-card {
  transition:
    transform 220ms var(--ease-snappy),
    box-shadow 220ms var(--ease-snappy),
    border-color 220ms var(--ease-snappy);
}

.sc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 18%, transparent);
}

.sc-card--accent:hover {
  box-shadow: 0 20px 50px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Button micro-interactions */
.sc-btn,
.sc-cta-btn {
  position: relative;
  overflow: hidden;
}

.sc-btn::after,
.sc-cta-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 400ms ease;
}

.sc-btn:hover::after,
.sc-cta-btn:hover::after {
  transform: translateX(100%);
}

/* Interactive element scale on click */
.sc-chip:active,
.sc-slot:active,
.sc-map-pin:active,
.sc-material:active,
.sc-kpi:active,
.sc-proof-item:active,
.sc-care-step:active,
.sc-look-card:active {
  transform: scale(0.97);
}

/* Dashboard stats animation */
.sc-frame.is-active .sc-dash-fill {
  animation: fillBar 800ms 500ms ease forwards;
}

@keyframes fillBar {
  from { width: 0; }
}

/* Countdown pulse */
.sc-countdown-unit strong {
  animation: countPulse 1s ease-in-out infinite;
}

.sc-countdown-unit:nth-child(1) strong { animation-delay: 0ms; }
.sc-countdown-unit:nth-child(2) strong { animation-delay: 100ms; }
.sc-countdown-unit:nth-child(3) strong { animation-delay: 200ms; }

@keyframes countPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Map dots pulse */
.sc-map-dot {
  animation: mapPulse 2s ease-in-out infinite;
}

.sc-map-dot--1 { animation-delay: 0ms; }
.sc-map-dot--2 { animation-delay: 300ms; }
.sc-map-dot--3 { animation-delay: 600ms; }

@keyframes mapPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

/* Badge bounce on appear */
.sc-card-badge,
.sc-new-badge,
.sc-pricing-badge,
.sc-property-badge {
  animation: badgeBounce 400ms 600ms ease backwards;
}

@keyframes badgeBounce {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  60% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.sc-card-badge,
.sc-new-badge,
.sc-property-badge {
  animation-name: badgeBounceRight;
}

@keyframes badgeBounceRight {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slot grid stagger */
.sc-slot-grid .sc-slot:nth-child(1) { animation-delay: 100ms; }
.sc-slot-grid .sc-slot:nth-child(2) { animation-delay: 150ms; }
.sc-slot-grid .sc-slot:nth-child(3) { animation-delay: 200ms; }
.sc-slot-grid .sc-slot:nth-child(4) { animation-delay: 250ms; }

.sc-frame.is-active .sc-slot {
  animation: slotAppear 300ms var(--ease-snappy) backwards;
}

@keyframes slotAppear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Material swatch shimmer */
.sc-material-swatch {
  position: relative;
  overflow: hidden;
}

.sc-material-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255,255,255,0.3) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
}

.sc-material:hover .sc-material-swatch::after {
  animation: swatchShimmer 600ms ease forwards;
}

@keyframes swatchShimmer {
  to { transform: translateX(100%); }
}

/* Proof metric count up effect */
.sc-proof-metric {
  display: inline-block;
}

.sc-proof-item.is-active .sc-proof-metric {
  animation: metricPop 400ms ease backwards;
}

@keyframes metricPop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stylist avatar hover */
.sc-stylist:hover .sc-stylist-avatar {
  animation: avatarWiggle 400ms ease;
}

@keyframes avatarWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Nav item underline animation */
.sc-nav-item {
  position: relative;
}

.sc-nav-item::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 250ms var(--ease-snappy);
}

.sc-nav-item:hover::after,
.sc-nav-item.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Scroll indicator bounce */
.sc-intro-scroll span {
  animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% {
    transform: scaleY(0.5) translateY(-4px);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1) translateY(4px);
    opacity: 1;
  }
}

/* Price highlight on card select */
.sc-card.is-selected .sc-card-price,
.sc-card.is-selected .sc-beauty-price,
.sc-card.is-selected .sc-property-price {
  animation: priceGlow 600ms ease;
}

@keyframes priceGlow {
  0%, 100% {
    text-shadow: none;
  }
  50% {
    text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 60%, transparent);
  }
}

/* Counter number animation */
.sc-counter-number {
  display: inline-block;
}

.sc-frame.is-active .sc-counter-number {
  animation: counterRoll 800ms 400ms ease backwards;
}

@keyframes counterRoll {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .sc-countdown-unit strong,
  .sc-map-dot,
  .sc-live-indicator,
  .sc-stock-dot--live,
  .sc-intro-scroll span {
    animation: none !important;
  }

  .sc-btn::after,
  .sc-cta-btn::after {
    display: none;
  }
}
