/* Subtle motion */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-animate {
  opacity: 0;
  animation: fade-up 0.65s var(--ease) forwards;
}

.hero-animate-d1 {
  animation-delay: 0.08s;
}
.hero-animate-d2 {
  animation-delay: 0.16s;
}
.hero-animate-d3 {
  animation-delay: 0.24s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Global map animation system */
.map-image {
  transform: scale(1.01);
}

.map-frame.is-animated .map-image {
  animation: map-image-in 0.95s var(--ease) forwards;
}

@keyframes map-image-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.map-arc {
  fill: none;
  stroke-dasharray: 2 4;
  stroke-dashoffset: 100;
  opacity: 0;
}

.map-frame.is-animated .map-arc {
  animation: map-draw 1.8s var(--ease) forwards,
    map-dash 7.5s linear 1.85s infinite;
}

.map-frame.is-animated .map-arc--b {
  animation-delay: 0.2s, 2.05s;
}

.map-frame.is-animated .map-arc--c {
  animation-delay: 0.4s, 2.25s;
}

.map-frame.is-animated .map-arc--d {
  animation-delay: 0.55s, 2.4s;
}

.map-frame.is-animated .map-arc--e {
  animation-delay: 0.7s, 2.55s;
}

.map-frame.is-animated .map-arc--f {
  animation-delay: 0.85s, 2.7s;
}

.map-frame.is-animated .map-arc--g {
  animation-delay: 1s, 2.85s;
}

@keyframes map-draw {
  0% {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes map-dash {
  to {
    stroke-dashoffset: -100;
  }
}

.map-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.map-frame.is-animated .map-nodes > g:nth-child(1) .map-node {
  animation: map-node-in 0.5s var(--ease) 0.7s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(2) .map-node {
  animation: map-node-in 0.5s var(--ease) 0.85s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(3) .map-node {
  animation: map-node-in 0.5s var(--ease) 0.95s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(4) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.05s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(5) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.15s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(6) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.25s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(7) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.35s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(8) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.45s forwards;
}
.map-frame.is-animated .map-nodes > g:nth-child(9) .map-node {
  animation: map-node-in 0.5s var(--ease) 1.55s forwards;
}

@keyframes map-node-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.map-node__pulse {
  transform-origin: center;
  transform-box: fill-box;
}

.map-frame.is-animated .map-node__pulse {
  animation: map-pulse 2.4s var(--ease) 1.4s infinite;
}

@keyframes map-pulse {
  0% {
    opacity: 0.45;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(3.2);
  }
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

.map-traveler {
  opacity: 0;
}

.map-frame.is-animated .map-traveler {
  animation: map-traveler-fade 0.4s ease 1.8s forwards;
}

@keyframes map-traveler-fade {
  to {
    opacity: 1;
  }
}

.map-frame.is-reduced .map-image,
.map-frame.is-reduced .map-node,
.map-frame.is-reduced .map-arc {
  opacity: 1;
  transform: none;
  stroke-dashoffset: 0;
  animation: none;
}

.map-frame.is-reduced .map-traveler,
.map-frame.is-reduced .map-node__pulse {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-animate,
  .hero-animate-d1,
  .hero-animate-d2,
  .hero-animate-d3 {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .map-image,
  .map-arc,
  .map-node,
  .map-node__pulse,
  .map-traveler {
    animation: none !important;
  }

  .map-image,
  .map-node,
  .map-arc {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: none;
  }

  .map-traveler,
  .map-node__pulse {
    display: none;
  }

  .btn,
  .commodity-card,
  .product-card,
  .product-row,
  .commodity-card__media img,
  .product-card__media img,
  .text-link .arrow,
  .icon-card,
  .photo-card img,
  .float-btn,
  .float-btn__pulse {
    transition: none !important;
    animation: none !important;
  }
}
