/* =============================================================
   Styles for react-bits island components.
   Loaded alongside the main styles.css on pages that use islands.
   ============================================================= */

/* ---------- CountUp ---------- */
.rb-countup {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- RotatingText ---------- */
.rb-rot {
  position: relative;
  display: inline-block;
  min-width: 10ch;
  vertical-align: baseline;
}
.rb-rot__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.25em);
  transition: opacity 280ms var(--ease-out, cubic-bezier(.2,.8,.2,1)),
              transform 280ms var(--ease-out, cubic-bezier(.2,.8,.2,1));
  position: absolute;
  inset: 0;
  white-space: nowrap;
}
.rb-rot__word[data-active="true"] {
  opacity: 1;
  transform: translateY(0);
  position: relative;
}
@media (prefers-reduced-motion: reduce) {
  .rb-rot__word { transition: none; }
}

/* ---------- SpotlightCard ---------- */
.rb-spotlight {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.rb-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(27, 94, 254, 0.14),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 0;
}
.rb-spotlight:hover::before { opacity: 1; }
.rb-spotlight > * { position: relative; z-index: 1; }

/* ---------- ScrollStack ---------- */
.rb-stack__item {
  position: sticky;
  top: 72px;
  transform: translateY(calc(var(--stack-index, 0) * 8px))
             scale(calc(1 - var(--stack-progress, 0) * 0.05));
  transform-origin: top center;
  transition: transform 0s; /* driven manually per frame */
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .rb-stack__item { position: static; transform: none; }
}

/* ---------- DecryptedText ---------- */
.rb-decrypt {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

/* ---------- DotGrid (pure CSS, no JS island) ---------- */
.rb-dotgrid {
  position: relative;
}
.rb-dotgrid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(12, 12, 10, 0.08) 1px,
    transparent 0
  );
  background-size: 22px 22px;
  mask-image: linear-gradient(
    to bottom,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
  z-index: 0;
}
.rb-dotgrid > * { position: relative; z-index: 1; }
