/* ========================================
   Reveal Effect – kiwebsites.com
   Scroll-driven water ripple transition
   ======================================== */

/* ---- CSS Custom Properties (set by JS) ---- */
:root {
  --reveal-progress: 0;
  --ripple-intensity: 0;
  --text-progress: 0;
}

/* ---- SVG Filter Overlay ---- */
.reveal-filter {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ---- Reveal Overlay: Ripple Effect ---- */
.reveal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

/* Canvas for the water ripple animation */
#ripple-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Canvas for particle splash effects */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Concentric ripple rings */
.reveal-overlay__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

.reveal-overlay__ring:nth-child(1) {
  width: 60vmax;
  height: 60vmax;
  transform: translate(-50%, -50%) scale(calc(var(--reveal-progress) * 1.8));
  opacity: calc(var(--ripple-intensity) * 0.6);
  border-color: rgba(223, 34, 50, 0.15);
}

.reveal-overlay__ring:nth-child(2) {
  width: 100vmax;
  height: 100vmax;
  transform: translate(-50%, -50%) scale(calc(var(--reveal-progress) * 1.5));
  opacity: calc(var(--ripple-intensity) * 0.4);
  border-color: rgba(223, 34, 50, 0.1);
}

.reveal-overlay__ring:nth-child(3) {
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%) scale(calc(var(--reveal-progress) * 1.2));
  opacity: calc(var(--ripple-intensity) * 0.25);
  border-width: 2px;
  border-color: rgba(223, 34, 50, 0.06);
}

/* ---- SVG distortion filter applied to main content ---- */
.page-content.is-distorting {
  filter: url(#ripple-filter);
}

/* ---- Reveal Message (shown during transition) ---- */
.reveal-overlay__message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 9999;
  pointer-events: none;
  width: 90vw;
  max-width: 1100px;
}

.reveal-text {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* Fill overlay: dark text, clipped by JS for wavy fill */
.reveal-text__fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
}

.reveal-text__fill .reveal-text {
  color: #111111;
}

#reveal-text-base {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);
}

/* ---- Hero Wrapper: provides scroll distance ---- */
.hero-wrapper {
  position: relative;
  height: 250vh;
}

/* ---- Hero Text Crossfade ---- */
.hero__text-dark {
  opacity: calc(1 - var(--text-progress));
  transform: translateY(calc(var(--text-progress) * -20px));
  transition: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.hero__text-light {
  opacity: var(--text-progress);
  transform: translateY(calc((1 - var(--text-progress)) * 20px));
  transition: none;
}

.hero__content-wrapper {
  position: relative;
}
