/* =========================================================
   Effects — moonlight cursor, reveals, contact headline
   ========================================================= */

/* ---------- Moonlight: soft light that follows the cursor ----------
   Sits behind all content. Only transforms change, so it stays cheap. */
.moonlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.moonlight.is-on { opacity: 1; }

.moonlight__glow {
  position: absolute;
  left: 0; top: 0;
  width: 1000px; height: 1000px;
  margin: -500px 0 0 -500px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgb(155 225 93 / 0.07), transparent 22%),
    radial-gradient(closest-side, rgb(139 92 246 / 0.17), rgb(139 92 246 / 0.06) 45%, transparent 72%);
  will-change: transform;
}

/* A "lens" around the cursor that reveals a fine grid hidden in the dark. */
.moonlight__lens {
  position: absolute;
  left: 0; top: 0;
  width: 560px; height: 560px;
  margin: -280px 0 0 -280px;
  overflow: hidden;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  will-change: transform;
}
.moonlight__grid {
  position: absolute;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background-image:
    radial-gradient(circle, rgb(198 255 138 / 0.35) 1px, transparent 1.6px),
    linear-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -0.5px -0.5px, 0 0, 0 0;
  will-change: transform;
}

/* Content must paint above the moonlight layer. */
main, .site-footer { position: relative; z-index: 1; }

/* ---------- Headline reveal: words rise out of a mask ---------- */
.rv-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.06em 0 0.1em;
  margin: -0.06em 0 -0.1em;
}
.rv-word__in {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms + var(--rv-delay, 0ms));
}
.is-revealed .rv-word__in { transform: none; }

/* Neon line drawn under the accent word(s). */
.rv-accent {
  position: relative;
  width: fit-content;
}
.rv-accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -0.04em;
  height: 2px;
  border-radius: 2px;
  background: var(--c-green);
  box-shadow: var(--glow-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(var(--rv-delay, 0ms) + 650ms);
}
.is-revealed .rv-accent::after { transform: scaleX(1); }
.contact__title .rv-accent { margin-inline: auto; }

/* Soft fade-up for paragraphs, cards and list rows. */
.rv-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.rv-up.is-revealed { opacity: 1; transform: none; }

/* ---------- Contact headline: letters react to the cursor ---------- */
.rv-char { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .rv-word__in, .rv-up { transform: none !important; opacity: 1 !important; transition: none !important; }
  .rv-accent::after { transform: scaleX(1); transition: none; }
}
