html {
  scroll-behavior: smooth;
}

:root {
  --anim-duration-fast: 420ms;
  --anim-duration-base: 720ms;
  --anim-duration-slow: 1400ms;
  --anim-duration-float: 24s;
  --anim-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --anim-ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --glow-blue: rgba(180, 83, 9, 0.14);
  --glow-blue-strong: rgba(180, 83, 9, 0.22);
  --grid-line: rgba(125, 94, 61, 0.05);
  --hero-void: #ebe4d6;
  --hero-deep: #f3efe8;
  --hero-accent: rgba(180, 83, 9, 0.08);
  --hero-accent-soft: rgba(180, 83, 9, 0.05);
}

/*
  Apply `.hero-animated` to the hero container.
  The pseudo-elements create slow, layered movement for a light, living background.
*/
.hero-animated {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.02) 0, rgba(0, 0, 0, 0) 26%),
    radial-gradient(circle at 80% 18%, rgba(180, 83, 9, 0.04) 0, rgba(180, 83, 9, 0) 28%),
    radial-gradient(circle at 50% 75%, rgba(180, 83, 9, 0.03) 0, rgba(180, 83, 9, 0) 32%),
    linear-gradient(180deg, var(--hero-deep) 0%, var(--hero-void) 48%, #e9dfcf 100%);
}

.hero-animated::before,
.hero-animated::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-animated::before {
  opacity: 0.7;
  background:
    radial-gradient(circle at 18% 24%, rgba(180, 83, 9, 0.1) 0 1px, transparent 1.8px),
    radial-gradient(circle at 68% 34%, rgba(180, 83, 9, 0.07) 0 1.4px, transparent 2px),
    radial-gradient(circle at 34% 74%, rgba(120, 91, 60, 0.05) 0 1.2px, transparent 2px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size:
    240px 240px,
    320px 320px,
    280px 280px,
    72px 72px,
    72px 72px;
  background-position:
    0 0,
    40px 60px,
    120px 140px,
    0 0,
    0 0;
  mask-image: radial-gradient(circle at 50% 50%, black 42%, transparent 100%);
  animation: hero-grid-float 28s linear infinite;
}

.hero-animated::after {
  opacity: 0.5;
  background:
    radial-gradient(circle at 22% 28%, rgba(180, 83, 9, 0.1), transparent 20%),
    radial-gradient(circle at 78% 24%, rgba(180, 83, 9, 0.07), transparent 18%),
    radial-gradient(circle at 42% 72%, rgba(120, 91, 60, 0.04), transparent 24%),
    radial-gradient(circle at 58% 52%, rgba(180, 83, 9, 0.05), transparent 28%);
  filter: blur(10px);
  transform: translate3d(0, 0, 0) scale(1);
  animation:
    hero-orb-drift 24s var(--anim-ease-soft) infinite alternate,
    hero-orb-pulse 9s ease-in-out infinite;
}

.hero-animated > * {
  position: relative;
  z-index: 1;
}

@keyframes hero-grid-float {
  0% {
    opacity: 0.4;
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    opacity: 0.65;
    transform: translate3d(-1.5%, -2%, 0) scale(1.035);
  }

  100% {
    opacity: 0.45;
    transform: translate3d(1.5%, 2%, 0) scale(1.06);
  }
}

@keyframes hero-orb-drift {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.04);
  }

  100% {
    transform: translate3d(-2%, 2.5%, 0) scale(1.08);
  }
}

@keyframes hero-orb-pulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 0.65;
  }
}

.reveal,
.reveal-up,
.reveal-fade,
.reveal-scale {
  opacity: 0;
  will-change: transform, opacity;
}

.reveal.is-visible,
.reveal.visible {
  animation: reveal-slide var(--anim-duration-base) var(--anim-ease) both;
}

.reveal-up.is-visible,
.reveal-up.visible {
  animation: reveal-up var(--anim-duration-base) var(--anim-ease) both;
}

.reveal-fade.is-visible,
.reveal-fade.visible {
  animation: reveal-fade var(--anim-duration-fast) ease-out both;
}

.reveal-scale.is-visible,
.reveal-scale.visible {
  animation: reveal-scale var(--anim-duration-base) var(--anim-ease-soft) both;
}

@keyframes reveal-slide {
  from {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes reveal-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes reveal-scale {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.965);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.hover-glow {
  transition:
    transform var(--anim-duration-fast) var(--anim-ease),
    box-shadow var(--anim-duration-fast) var(--anim-ease),
    border-color var(--anim-duration-fast) var(--anim-ease),
    background-color var(--anim-duration-fast) var(--anim-ease);
  will-change: transform;
}

.hover-glow:hover,
.hover-glow:focus-visible {
  transform: translate3d(0, -2px, 0);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 10px 30px -16px var(--glow-blue-strong),
    0 18px 44px -30px rgba(180, 83, 9, 0.08);
}

.text-shimmer {
  color: transparent;
  background-image: linear-gradient(
    92deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(17, 24, 39, 0.65) 24%,
    rgba(180, 83, 9, 0.7) 42%,
    rgba(180, 83, 9, 0.55) 56%,
    rgba(17, 24, 39, 0.65) 72%,
    rgba(0, 0, 0, 0.25) 100%
  );
  background-size: 220% 100%;
  background-position: 120% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: text-shimmer 9s ease-in-out infinite;
}

@keyframes text-shimmer {
  0% {
    background-position: 120% 50%;
  }

  50% {
    background-position: 0% 50%;
  }

  100% {
    background-position: -120% 50%;
  }
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #b45309, #e6a04b);
  box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.28);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(180, 83, 9, 0.3);
  opacity: 0.7;
  transform: scale(1);
  animation: pulse-ring 2.4s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    opacity: 0.7;
    transform: scale(0.8);
  }

  70% {
    opacity: 0;
    transform: scale(2.4);
  }

  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

.stagger-1 {
  animation-delay: 80ms;
}

.stagger-2 {
  animation-delay: 160ms;
}

.stagger-3 {
  animation-delay: 240ms;
}

.stagger-4 {
  animation-delay: 320ms;
}

.stagger-5 {
  animation-delay: 400ms;
}

.stagger-6 {
  animation-delay: 480ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-up,
  .reveal-fade,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}
