/* AstraViamo motion layer — keep animations subtle and respect user preferences */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal],
  [data-reveal-hero],
  .welcome-toast,
  .site-nav,
  .motion-cta,
  .motion-card,
  .motion-icon-wrap,
  .hero-float,
  .texture-drift {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

[data-reveal],
[data-reveal-hero] {
  opacity: 0;
  transform: translate3d(0, 1.25rem, 0);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--rv-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].reveal-visible,
[data-reveal-hero].reveal-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.site-nav {
  transition:
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease;
}

.site-nav.site-nav--scrolled {
  box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.12);
}

.dark .site-nav.site-nav--scrolled {
  box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.45);
}

.site-nav-links a {
  position: relative;
}

.site-nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.85;
}

.site-nav-links a:hover::after,
.site-nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.site-nav-links a[class*="border-b-2"]::after {
  display: none;
}

.motion-cta {
  transition:
    transform 0.22s ease,
    box-shadow 0.28s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    opacity 0.2s ease;
}

.motion-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -10px rgba(128, 21, 21, 0.38);
}

.motion-cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -8px rgba(128, 21, 21, 0.28);
}

.motion-card {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.25s ease;
}

.motion-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.18);
}

.motion-icon-wrap {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .motion-icon-wrap {
  transform: scale(1.06) rotate(-3deg);
}

.hero-float {
  animation: hero-float 7s ease-in-out infinite;
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.texture-drift {
  animation: texture-drift 80s linear infinite;
}

@keyframes texture-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 800px 400px;
  }
}

.welcome-toast {
  position: fixed;
  z-index: 100;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 22rem;
  margin-right: auto;
  padding: 1rem 1.1rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #801515 0%, #5d0005 100%);
  color: #fff;
  box-shadow: 0 18px 48px -12px rgba(45, 0, 5, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translate3d(0, 120%, 0) scale(0.96);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

@media (min-width: 640px) {
  .welcome-toast {
    left: 1.5rem;
    right: auto;
  }
}

.welcome-toast.welcome-toast--show {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.welcome-toast p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.95;
}

.welcome-toast strong {
  font-weight: 600;
}

.welcome-toast__row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.welcome-toast__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.welcome-toast__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.welcome-toast button {
  cursor: pointer;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease, transform 0.15s ease;
}

.welcome-toast button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.welcome-toast button:active {
  transform: scale(0.97);
}

.motion-input:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(234, 227, 198, 0.65);
}
