/* Background bubbles */
.bubble-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  left: var(--left, 50%);
  bottom: -12%;
  width: var(--size, 24px);
  height: var(--size, 24px);
  border-radius: 50%;
  animation: bubble-rise-pop var(--dur, 12s) var(--delay, 0s) linear infinite;
  will-change: transform, opacity;
}

.bubble::before {
  content: "";
  position: absolute;
  inset: 18% 22% 28% 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(1px);
}

.bubble::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  animation: bubble-pop-ring var(--dur, 12s) var(--delay, 0s) linear infinite;
}

.bubble--green {
  color: rgba(45, 155, 74, 0.45);
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(134, 239, 172, 0.35) 35%,
    rgba(45, 155, 74, 0.12) 70%
  );
  border: 1px solid rgba(45, 155, 74, 0.22);
  box-shadow:
    inset 0 -6px 14px rgba(45, 155, 74, 0.08),
    0 6px 20px rgba(45, 155, 74, 0.1);
}

.bubble--gold {
  color: rgba(201, 162, 39, 0.5);
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(253, 230, 138, 0.4) 38%,
    rgba(201, 162, 39, 0.1) 72%
  );
  border: 1px solid rgba(201, 162, 39, 0.25);
  box-shadow:
    inset 0 -6px 14px rgba(201, 162, 39, 0.08),
    0 6px 18px rgba(201, 162, 39, 0.1);
}

.bubble--sky {
  color: rgba(56, 189, 248, 0.45);
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(186, 230, 253, 0.42) 38%,
    rgba(56, 189, 248, 0.1) 72%
  );
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow:
    inset 0 -6px 14px rgba(56, 189, 248, 0.06),
    0 6px 18px rgba(56, 189, 248, 0.08);
}

@keyframes bubble-rise-pop {
  0% {
    transform: translate3d(0, 0, 0) scale(0.45);
    opacity: 0;
  }
  6% {
    opacity: 0.55;
  }
  78% {
    transform: translate3d(var(--drift, 0), -108vh, 0) scale(1);
    opacity: 0.48;
  }
  86% {
    transform: translate3d(var(--drift, 0), -112vh, 0) scale(1.08);
    opacity: 0.35;
  }
  92% {
    transform: translate3d(var(--drift, 0), -114vh, 0) scale(1.35);
    opacity: 0.12;
  }
  100% {
    transform: translate3d(var(--drift, 0), -116vh, 0) scale(1.85);
    opacity: 0;
  }
}

@keyframes bubble-pop-ring {
  0%,
  82% {
    transform: scale(1);
    opacity: 0;
  }
  88% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 1000;
  background: var(--gradient-brand);
  box-shadow: 0 0 16px var(--accent-glow);
  transition: width 0.08s linear;
}

/* Header scroll */
.header {
  transition: padding 0.4s ease;
}

.header--scrolled {
  padding: 0.5rem 0;
}

.header--scrolled .header__inner {
  background: var(--header-bg-scrolled);
  box-shadow: var(--shadow-card);
}

/* Hero mesh grid */
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 155, 74, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 155, 74, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 75%);
  animation: grid-drift 24s linear infinite;
}

@keyframes grid-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(56px); }
}

/* Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: orb-float 14s ease-in-out infinite;
  pointer-events: none;
}

.orb--1 {
  width: 480px;
  height: 480px;
  background: #86efac;
  top: -15%;
  right: -5%;
  opacity: 0.35;
}

.orb--2 {
  width: 360px;
  height: 360px;
  background: #fde68a;
  bottom: 0;
  left: -10%;
  animation-delay: -5s;
  opacity: 0.3;
}

.orb--3 {
  width: 280px;
  height: 280px;
  background: #bae6fd;
  top: 40%;
  right: 30%;
  animation-delay: -9s;
  opacity: 0.25;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.04); }
  66% { transform: translate(-16px, 20px) scale(0.96); }
}

/* Entrance */
.anim-fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero title — letter reveal */
.hero-title__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(1.1em);
  filter: blur(8px);
  animation: hero-char-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--char-delay, 0s);
  will-change: opacity, transform, filter;
}

@keyframes hero-char-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes signature-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0s);
}

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

/* Button shine */
.btn--shine {
  position: relative;
  overflow: hidden;
}

.btn--shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-18deg);
  animation: btn-shine 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes btn-shine {
  0%, 100% { left: -120%; }
  45%, 55% { left: 140%; }
}

/* Lot card entrance */
.lot-card.is-entering {
  animation: lot-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

@keyframes lot-pop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Burger */
.burger span {
  transition: transform 0.32s ease, opacity 0.22s ease;
}

.burger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero panels stagger */
.hero-panel:nth-child(1) { animation: fade-up 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero-panel:nth-child(2) { animation: fade-up 0.8s 0.25s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero-panel:nth-child(3) { animation: fade-up 0.8s 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero-panel:nth-child(4) { animation: fade-up 0.8s 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

/* Toast */
.toast.is-visible {
  animation: toast-pop 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes toast-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .bubble:nth-child(n + 11) {
    display: none;
  }

  .orb--1 {
    width: 220px;
    height: 220px;
    top: -8%;
    right: -20%;
    opacity: 0.22;
  }

  .orb--2 {
    width: 180px;
    height: 180px;
    left: -25%;
    opacity: 0.18;
  }

  .orb--3 {
    width: 140px;
    height: 140px;
    top: 55%;
    right: 10%;
    opacity: 0.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-bg {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .anim-fade-up {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero-title__char {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }

  .brand-signature--active .brand-signature__reveal {
    animation: none;
    clip-path: inset(0 0 0 0);
  }

  .journey-path__marker-icon {
    animation: none;
  }

  .journey-path {
    --journey-p: 1;
  }

  .lot-card.is-entering {
    animation: none;
  }
}
