/* ===== Custom Animations ===== */

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Letter reveal animation */
@keyframes letterReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Continuous rotation animation */
@keyframes rotateLoop {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 1s ease-out forwards;
}

.animate-letter-reveal {
  display: inline-block;
  overflow: hidden;
  opacity: 0; /* ensures we start hidden even before animation kicks in */
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* Rendering hints (best-effort across browsers/OS) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  animation: letterReveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-letter-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

.animate-rotate-slow {
  animation: rotateLoop 10s linear infinite;
}

/* Scroll-triggered animations */
.animate-fade-in-scroll {
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.animate-fade-in-scroll:not(.animate-visible) {
  opacity: 0;
  transform: translateY(20px);
}

.animate-fade-in-scroll.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Parallax effect */
.nectar-parallax-element {
  transform: translateZ(0);
  will-change: transform;
}

/* Wave border animation for milestone section */
.wave-border {
  position: relative;
  overflow: hidden;
}

.wave-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: waveSlide 8s linear infinite;
}

@keyframes waveSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Alternative wave effect using SVG-like path animation */
.wave-path {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%23ffffff'%3E%3C/path%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' opacity='.5' fill='%23ffffff'%3E%3C/path%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%23ffffff'%3E%3C/path%3E%3C/svg%3E");
  background-size: 1200px 100%;
  animation: waveMove 15s linear infinite;
}

@keyframes waveMove {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: 1200px;
  }
}

/* Enhanced wave with multiple layers */
.wave-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  overflow: hidden;
}

.wave-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: waveMotion 20s linear infinite;
}

.wave-layer:nth-child(1) {
  animation-duration: 20s;
  opacity: 0.3;
  bottom: -10px;
}

.wave-layer:nth-child(2) {
  animation-duration: 25s;
  opacity: 0.2;
  bottom: -5px;
  animation-delay: -5s;
}

.wave-layer:nth-child(3) {
  animation-duration: 30s;
  opacity: 0.15;
  animation-delay: -10s;
}

@keyframes waveMotion {
  0% {
    transform: translateX(-25%) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(-25%) translateY(-10px) rotate(180deg);
  }
  100% {
    transform: translateX(-25%) translateY(0) rotate(360deg);
  }
}

/* Hero section responsive sizing */
.hero-title {
  font-size: clamp(2.25rem, 5vw, 6.875rem);
  /* 36px min, scales with viewport, 110px max */
}

/* Hero section centering fix */
.hero-section {
  display: grid;
  place-items: center;
  height: 100vh;
  width: 100%;
}

.scroll-indicator {
  width: clamp(8.75rem, 10vw, 13.75rem);
  height: clamp(8.75rem, 10vw, 13.75rem);
  /* 140px min, scales with viewport, 220px max */
}

/* Animated wave drift for milestone section */
@keyframes waveDrift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.animate-wave-drift {
  animation: waveDrift 20s linear infinite;
}

/* ===== Looping marquee gallery (services page) ===== */
.SimpSeeker-marquee {
  --gap: 10px;
  --duration: 112.5s; /* 25% slower */
  overflow: hidden;
}

.SimpSeeker-marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: SimpSeekerMarquee var(--duration) linear infinite;
}

/* Each group is duplicated for a seamless loop; padding-right provides the "gap" at the seam. */
.SimpSeeker-marquee__group {
  display: flex;
  gap: var(--gap);
  padding-right: var(--gap);
}

.SimpSeeker-marquee__cell {
  flex: 0 0 auto;
  width: min(560px, 80vw);
  height: 60vh;
  border-radius: 0.5rem;
  overflow: hidden;
}

.SimpSeeker-marquee__cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.SimpSeeker-marquee__cell picture {
  display: block;
  width: 100%;
  height: 100%;
}

.SimpSeeker-marquee__cell picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.SimpSeeker-marquee__btn {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

@media only screen and (max-width: 1000px) {
  .SimpSeeker-marquee__cell {
    height: 40vh;
  }
}

@media only screen and (max-width: 690px) {
  .SimpSeeker-marquee__cell {
    /* Portrait-ish tiles on mobile to avoid top/bottom cropping of portrait photos */
    width: min(320px, 80vw);
    height: auto;
    aspect-ratio: 3 / 4;
  }
}

@keyframes SimpSeekerMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .SimpSeeker-marquee__track {
    animation: none;
    transform: none;
  }
}