/* ================================================================
   Lotly · Visual upgrade pass 1
   - Hero aurora + noise
   - Raffle cards: HOT glow, hover tilt, progress fill-on-scroll
   - How-it-works: horizontal rail, numbered badges
   - Fairness: animated VRF flow diagram
   Loaded after style.css so selectors override cleanly.
================================================================ */

/* ---------- 1. Hero aurora --------------------------------- */
.hero__aurora {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  overflow: hidden;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, black 40%, transparent 100%);
}
.hero__aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.hero__aurora-blob--a {
  width: 640px; height: 640px;
  left: -8%; top: -10%;
  background: radial-gradient(circle, rgba(75,255,176,0.55), transparent 65%);
  animation: aurora-drift-a 22s ease-in-out infinite alternate;
}
.hero__aurora-blob--b {
  width: 720px; height: 720px;
  right: -12%; top: 8%;
  background: radial-gradient(circle, rgba(64,180,255,0.32), transparent 65%);
  animation: aurora-drift-b 28s ease-in-out infinite alternate;
}
.hero__aurora-blob--c {
  width: 520px; height: 520px;
  left: 35%; top: 55%;
  background: radial-gradient(circle, rgba(255,120,220,0.22), transparent 65%);
  animation: aurora-drift-c 32s ease-in-out infinite alternate;
}
@keyframes aurora-drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(80px, 40px, 0) scale(1.12); }
}
@keyframes aurora-drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(-60px, 60px, 0) scale(0.92); }
}
@keyframes aurora-drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.5; }
  100% { transform: translate3d(-40px, -80px, 0) scale(1.15); opacity: 0.7; }
}

/* Subtle grain — kills flat-gradient banding */
.hero__noise {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.8 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  .hero__aurora-blob { animation: none; }
}

/* ---------- 2. Raffle card upgrades ------------------------ */
/* Stronger HOT glow */
.hot-chip {
  box-shadow:
    0 8px 24px rgba(255, 90, 90, 0.45),
    0 0 0 1px rgba(255, 180, 180, 0.35),
    0 0 24px rgba(255, 90, 90, 0.55);
  animation: hot-pulse 1.8s ease-in-out infinite;
}
@keyframes hot-pulse {
  0%, 100% {
    box-shadow:
      0 8px 24px rgba(255, 90, 90, 0.45),
      0 0 0 1px rgba(255, 180, 180, 0.35),
      0 0 20px rgba(255, 90, 90, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 10px 28px rgba(255, 90, 90, 0.55),
      0 0 0 2px rgba(255, 180, 180, 0.5),
      0 0 32px rgba(255, 90, 90, 0.7);
    transform: scale(1.04);
  }
}

/* Smoother progress-bar reveal (JS still sets width from data-target) */
.raffle-card .progress__bar {
  transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover tilt (desktop only, respects reduced motion) */
@media (hover: hover) and (pointer: fine) {
  .raffle-card {
    transform-style: preserve-3d;
    transition:
      transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
      border-color var(--dur),
      box-shadow var(--dur);
  }
  .raffle-card:hover {
    transform:
      translateY(-6px)
      perspective(900px)
      rotateX(var(--tilt-x, 0deg))
      rotateY(var(--tilt-y, 0deg));
    box-shadow:
      0 30px 60px -25px rgba(75, 255, 176, 0.4),
      0 0 0 1px rgba(75, 255, 176, 0.18),
      0 0 60px -10px rgba(75, 255, 176, 0.25);
  }
  .raffle-card__media img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .raffle-card, .raffle-card__media img { transition: none !important; }
  .hot-chip { animation: none; }
}

/* ---------- 3. How-it-works with connector rail ------------ */
.steps--rail {
  position: relative;
}
.steps--rail .steps__rail {
  position: absolute;
  top: 88px;                /* aligns with the icon-block center */
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(75, 255, 176, 0.35) 15%,
    rgba(75, 255, 176, 0.35) 85%,
    transparent 100%
  );
  z-index: 0;
  pointer-events: none;
}
.steps--rail .steps__rail::before {
  content: "";
  position: absolute; top: -3px; left: 0;
  width: 40%; height: 7px;
  background: radial-gradient(circle, rgba(75, 255, 176, 0.9), transparent 70%);
  filter: blur(6px);
  animation: rail-sweep 6s linear infinite;
}
@keyframes rail-sweep {
  0%   { transform: translateX(-20%); opacity: 0; }
  20%  { opacity: 0.9; }
  80%  { opacity: 0.9; }
  100% { transform: translateX(160%); opacity: 0; }
}
@media (max-width: 900px) {
  .steps--rail .steps__rail { display: none; }
}

.steps--rail .step {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--space-6) + 12px);
}
.step__badge {
  position: absolute;
  top: -18px; left: var(--space-6);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0e1a15 0%, #06110d 100%);
  border: 1.5px solid rgba(75, 255, 176, 0.6);
  color: #7bffd0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 24px rgba(75, 255, 176, 0.4),
    inset 0 0 0 1px rgba(75, 255, 176, 0.18);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  z-index: 2;
}
.step:hover .step__badge {
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 0 32px rgba(75, 255, 176, 0.55);
}

/* Slight stagger on reveal so the 4 cards cascade in */
.steps .step:nth-child(2) { transition-delay: 0.08s; }
.steps .step:nth-child(3) { transition-delay: 0.16s; }
.steps .step:nth-child(4) { transition-delay: 0.24s; }
.steps .step:nth-child(5) { transition-delay: 0.32s; }

/* ---------- 4. Fairness VRF flow diagram ------------------- */
.vrf-flow {
  position: relative;
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, rgba(75, 255, 176, 0.06), transparent 70%),
    var(--color-surface);
  overflow: hidden;
}
.vrf-flow__svg {
  display: block;
  width: 100%;
  height: 70px;
  overflow: visible;
}
.vrf-flow.is-visible .vrf-flow__wire {
  animation: wire-draw 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes wire-draw {
  to { stroke-dashoffset: 0; }
}
.vrf-flow__packet {
  filter: drop-shadow(0 0 10px rgba(75, 255, 176, 0.9));
}
.vrf-flow.is-visible .vrf-flow__packet {
  animation: packet-travel 3.2s cubic-bezier(0.65, 0, 0.35, 1) 1.6s infinite;
}
@keyframes packet-travel {
  0%   { transform: translateX(0) scale(1); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translateX(220px) scale(1.15); opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateX(440px) scale(1); opacity: 0; }
}
.vrf-flow__nodes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: var(--space-2);
  text-align: center;
  gap: var(--space-2);
}
.vrf-flow__node {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.vrf-flow__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-strong);
  letter-spacing: 0.02em;
}
.vrf-flow__sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vrf-flow__node:first-child  { text-align: left;  padding-left: 4px; }
.vrf-flow__node:last-child   { text-align: right; padding-right: 4px; }

@media (prefers-reduced-motion: reduce) {
  .vrf-flow__wire { stroke-dashoffset: 0 !important; animation: none !important; }
  .vrf-flow__packet { animation: none !important; opacity: 0; }
  .steps--rail .steps__rail::before { animation: none; opacity: 0.5; }
}
