/* Backgrounds & decorative surfaces — restrained */

.topline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.45), transparent);
}

/* Hero geography layers */
.hero-layer-far {
  opacity: 0.55;
}

.hero-layer-mid {
  opacity: 0.78;
}

.hero-layer-fore {
  opacity: 1;
  filter: drop-shadow(0 -16px 40px hsl(var(--cyber-cyan) / 0.18));
}

.ridge-line {
  opacity: 0.85;
}

.hero-layer-fore [fill='url(#snowCap)'] {
  animation: cap-shimmer 10s ease-in-out infinite alternate;
}

@keyframes cap-shimmer {
  to {
    filter: brightness(1.08);
  }
}

@media (max-width: 767px) {
  .ridge-line {
    display: none;
  }
}

.hero-snow {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.hero-snow span {
  position: absolute;
  top: -8px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: hsl(0 0% 100% / 0.6);
  animation: snowfall linear infinite;
}

@keyframes snowfall {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(110vh) translateX(10px);
    opacity: 0;
  }
}

@keyframes haze-drift {
  0% {
    transform: translateX(-3%);
  }
  100% {
    transform: translateX(3%);
  }
}

@keyframes scroll-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(-50%) translateY(6px);
    opacity: 1;
  }
}

@keyframes scroll-breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.hero-scroll-cue {
  animation-name: scroll-breathe;
  animation-duration: 3s;
}

/* Section trace and contact finale */
.section--alt::before,
.section--alt-strong::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    hsl(var(--primary) / 0.55),
    hsl(var(--cyber-cyan) / 0.25),
    transparent 72%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-trace);
}

.section--alt.is-entered::before,
.section--alt-strong.is-entered::before {
  transform: scaleX(1);
}

#contact::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 60% 48% at 50% 36%,
    hsl(var(--primary) / 0.055),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 1s ease;
}

#contact.is-active::after {
  opacity: 1;
}

#contact > .container {
  position: relative;
  z-index: 1;
}

/* Status dots */
.dot {
  width: 8px;
  height: 8px;
  background: hsl(var(--primary));
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}

.dot.cyan {
  background: hsl(var(--cyber-cyan));
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Scroll progress & reveal */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--cyber-cyan)));
  z-index: 100;
  transition: width 0.1s linear;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-reveal) ease, transform var(--duration-reveal) ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Back to top */
#totop {
  position: fixed;
  bottom: calc(1.4rem + var(--safe-bottom));
  right: 1.4rem;
  z-index: 70;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--primary) / 0.5);
  color: hsl(var(--primary));
  cursor: pointer;
  box-shadow: 0 0 16px hsl(var(--primary) / 0.2);
}

#totop.show {
  display: flex;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  #hero .hero-snow,
  #hero .valley-haze {
    display: none;
  }

  .hero-layer-far,
  .hero-layer-mid,
  .hero-layer-fore {
    transform: none !important;
  }

  .hero-layer-fore [fill='url(#snowCap)'],
  .map-paths .map-signal,
  .map-pulse {
    animation: none !important;
  }

  .hero-spotlight {
    display: none;
  }
}
