/* =========================================================
   ALIVE LAYER: extra motion that makes the whole site move.
   Everything here is skipped for visitors who ask their
   device for reduced motion.
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {

  /* ---------- Page entry wipe (once per visit) ---------- */
  .alive-wipe {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .alive-wipe i {
    display: block;
    background: var(--accent);
    transform-origin: top;
    animation: wipe-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards;
    animation-delay: calc(var(--n) * 70ms + 150ms);
  }
  .alive-wipe i:nth-child(2n) { background: var(--money); }
  .alive-wipe i:nth-child(3) { background: var(--hot); }
  .alive-wipe b {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-weight: 900;
    font-stretch: 125%;
    font-size: clamp(42px, 9vw, 120px);
    color: var(--accent-ink);
    letter-spacing: -0.02em;
    animation: wipe-word 0.55s cubic-bezier(0.7, 0, 0.2, 1) forwards;
  }
  @keyframes wipe-out {
    to { transform: scaleY(0); }
  }
  @keyframes wipe-word {
    0% { scale: 0.6; opacity: 0; }
    40% { scale: 1.05; opacity: 1; }
    100% { scale: 1.4; opacity: 0; }
  }

  /* ---------- Dramatic scroll reveals (overrides the gentle default) ---------- */
  .reveal {
    opacity: 0;
    transform: translateY(46px) scale(0.94) rotate(-1.2deg);
    filter: blur(6px);
  }
  .reveal:nth-child(3n + 2) { transform: translateY(46px) scale(0.94) rotate(1.2deg); }
  .reveal:nth-child(3n) { transform: translateX(-40px) scale(0.95); }
  .reveal.in {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity 0.7s var(--ease), transform 0.9s var(--spring), filter 0.7s var(--ease);
    transition-delay: var(--d, 0s);
  }

  /* Generic auto-reveal for everything else */
  [data-alive] {
    opacity: 0;
    transition: opacity 0.8s var(--ease), translate 0.9s var(--spring), scale 0.9s var(--spring), rotate 0.9s var(--spring), filter 0.8s var(--ease), clip-path 1s var(--ease);
    transition-delay: var(--ad, 0ms);
  }
  [data-alive="up"] { translate: 0 50px; }
  [data-alive="left"] { translate: -60px 0; }
  [data-alive="right"] { translate: 60px 0; }
  [data-alive="zoom"] { scale: 0.8; filter: blur(8px); }
  [data-alive="spin"] { scale: 0.4; rotate: -25deg; }
  [data-alive="flip"] { rotate: x 70deg; transform-origin: 50% 100%; }
  [data-alive="clip"] { clip-path: inset(0 100% 0 0 round 14px); opacity: 1; }
  [data-alive].alive-in {
    opacity: 1;
    translate: 0 0;
    scale: 1;
    rotate: 0deg;
    filter: none;
    clip-path: inset(0 0 0 0 round 0);
  }

  /* ---------- Kinetic headlines ---------- */
  .kw {
    display: inline-block;
    white-space: pre;
  }
  .kw > span {
    display: inline-block;
    translate: 0 0.9em;
    rotate: 8deg;
    opacity: 0;
    transition: translate 0.7s var(--spring), rotate 0.7s var(--spring), opacity 0.5s var(--ease);
    transition-delay: calc(var(--w) * 55ms);
  }
  .kinetic.alive-in .kw > span {
    translate: 0 0;
    rotate: 0deg;
    opacity: 1;
  }
  .kinetic .kw:hover > span {
    animation: kw-jump 0.5s var(--spring);
    color: var(--accent);
  }
  @keyframes kw-jump {
    40% { translate: 0 -0.18em; scale: 1.08; }
  }

  /* Hero headline: letters bounce in, then shimmer forever */
  .hero h1 .h1-line {
    background-image: linear-gradient(100deg, currentColor 0 40%, var(--accent) 48%, #fff 50%, var(--accent) 52%, currentColor 60% 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: h1-shine 5.5s ease-in-out 1.8s infinite;
  }
  .hero h1 .h1-line + .h1-line { animation-delay: 2.1s; }
  @keyframes h1-shine {
    0%, 55% { background-position: 100% 0; }
    90%, 100% { background-position: 0% 0; }
  }
  .hero h1 .tick {
    animation: tick-pop 0.8s var(--spring) 1.1s both, tick-spin 6s ease-in-out 3s infinite;
  }
  @keyframes tick-pop {
    from { scale: 0; rotate: -180deg; }
  }
  @keyframes tick-spin {
    0%, 85% { rotate: 0deg; scale: 1; }
    92% { rotate: 20deg; scale: 1.25; }
    100% { rotate: 0deg; scale: 1; }
  }

  /* ---------- Coupons: marching ants + glint ---------- */
  .copy {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    animation: coupon-breathe 3.2s ease-in-out infinite;
    animation-delay: calc(var(--cd, 0) * -400ms);
  }
  .copy::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 35%, rgba(184, 247, 255, 0.55) 50%, transparent 65%);
    translate: -120% 0;
    animation: coupon-glint 3.8s ease-in-out infinite;
    animation-delay: calc(var(--cd, 0) * 300ms);
    pointer-events: none;
  }
  .copy:hover {
    animation: coupon-shake 0.45s ease-in-out;
  }
  .copy.copied {
    animation: coupon-win 0.6s var(--spring);
  }
  @keyframes coupon-glint {
    0%, 60% { translate: -120% 0; }
    100% { translate: 120% 0; }
  }
  @keyframes coupon-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(62, 232, 255, 0); }
    50% { box-shadow: 0 0 18px 0 rgba(62, 232, 255, 0.28); }
  }
  @keyframes coupon-shake {
    20% { rotate: -2deg; }
    40% { rotate: 2deg; }
    60% { rotate: -1deg; }
    80% { rotate: 1deg; }
  }
  @keyframes coupon-win {
    0% { scale: 1; }
    35% { scale: 1.14; rotate: -3deg; }
    100% { scale: 1; rotate: 0deg; }
  }

  /* ---------- Discount stickers: idle wobble, big pop on hover ---------- */
  .dr-deal,
  .offer,
  .hc-off {
    animation: sticker-wobble 4s ease-in-out infinite;
    animation-delay: calc(var(--cd, 0) * -0.7s);
    transition: scale 0.3s var(--spring);
  }
  .dr-deal:hover,
  .offer:hover,
  .hc-off:hover,
  .drow:hover .dr-deal,
  .fcard:hover .offer {
    scale: 1.15;
    rotate: -6deg;
  }
  @keyframes sticker-wobble {
    0%, 100% { rotate: 0deg; translate: 0 0; }
    25% { rotate: 2.5deg; translate: 0 -2px; }
    75% { rotate: -2.5deg; translate: 0 1px; }
  }
  .dr-deal.hot,
  .offer.hot {
    animation: sticker-wobble 4s ease-in-out infinite, hot-flash 1.6s ease-in-out infinite;
  }
  @keyframes hot-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 242, 0.7); }
    60% { box-shadow: 0 0 0 10px rgba(255, 61, 242, 0); }
  }

  /* ---------- Section number badges ---------- */
  .section-num {
    animation: badge-swing 3.5s ease-in-out infinite;
    transform-origin: 50% 0;
  }
  .section-head:hover .section-num {
    animation: badge-spin 0.7s var(--spring);
  }
  @keyframes badge-swing {
    0%, 100% { rotate: -4deg; }
    50% { rotate: 4deg; }
  }
  @keyframes badge-spin {
    from { rotate: -360deg; scale: 0.5; }
  }

  /* ---------- Buttons: shine sweep, idle nudge, press squish ---------- */
  .btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .btn:not(.primary)::after {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: 1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
    translate: -130% 0;
    pointer-events: none;
    transition: none;
  }
  .btn:not(.primary):hover::after {
    translate: 130% 0;
    transition: translate 0.7s var(--ease);
  }
  .btn.primary.lg,
  .head-cta {
    animation: cta-nudge 5s ease-in-out 3s infinite;
  }
  @keyframes cta-nudge {
    0%, 86%, 100% { scale: 1; rotate: 0deg; }
    89% { scale: 1.08; rotate: -2deg; }
    92% { scale: 0.97; rotate: 2deg; }
    95% { scale: 1.04; rotate: -1deg; }
  }
  .btn:active,
  .cta:active,
  .copy:active {
    scale: 0.94;
  }

  /* Claim buttons: arrow keeps pointing */
  .cta svg,
  .head-link svg,
  .dr-go svg {
    animation: arrow-poke 1.6s ease-in-out infinite;
  }
  @keyframes arrow-poke {
    0%, 100% { translate: 0 0; }
    50% { translate: 3px -3px; }
  }

  /* ---------- Firm logos bob and spin on hover ---------- */
  .logo {
    transition: rotate 0.6s var(--spring), scale 0.6s var(--spring);
  }
  .drow:hover .logo,
  .fcard:hover .logo,
  .su-card:hover .logo,
  .hc:hover .logo {
    rotate: 360deg;
    scale: 1.12;
  }

  /* ---------- Rows: slide and glow ---------- */
  .drow {
    transition: translate 0.35s var(--spring), box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
  }
  .drow:hover {
    translate: 8px 0;
    box-shadow: -6px 0 0 0 var(--accent), 0 10px 30px -10px rgba(62, 232, 255, 0.35);
  }

  /* ---------- 3D tilt cards ---------- */
  .alive-tilt {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
  }
  .alive-tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
  }
  .alive-tilt:hover::after { opacity: 1; }

  /* ---------- Stats tiles: bounce in + numbers glow ---------- */
  .stat {
    transition: translate 0.4s var(--spring), rotate 0.4s var(--spring);
  }
  .stat:hover {
    translate: 0 -8px;
    rotate: -2deg;
  }
  .stat b,
  .count {
    display: inline-block;
  }
  .count.alive-pop {
    animation: count-pop 0.6s var(--spring);
  }
  @keyframes count-pop {
    50% { scale: 1.25; }
  }

  /* ---------- Steps: numbers spin on hover ---------- */
  .step-n {
    display: inline-block;
    transition: rotate 0.6s var(--spring), scale 0.6s var(--spring);
  }
  .step:hover .step-n {
    rotate: 360deg;
    scale: 1.2;
  }

  /* ---------- Ticker: leans into your scroll ---------- */
  .marquee {
    transition: skew 0.3s var(--ease);
  }
  .marquee .marquee-track li {
    transition: scale 0.3s var(--spring);
  }
  .marquee .marquee-track li:hover {
    scale: 1.12;
  }

  /* ---------- Payout images + general images ---------- */
  .payouts-teaser img,
  .payout img {
    transition: scale 0.6s var(--ease), rotate 0.6s var(--ease), filter 0.6s var(--ease);
  }
  .payouts-teaser img:hover,
  .payout:hover img {
    scale: 1.06;
    rotate: -1deg;
    filter: saturate(1.3) brightness(1.05);
  }

  /* ---------- Gift icons wiggle everywhere ---------- */
  .i-gift {
    animation: gift-wiggle 2.4s ease-in-out infinite;
    transform-origin: 50% 80%;
  }
  @keyframes gift-wiggle {
    0%, 70%, 100% { rotate: 0deg; }
    75% { rotate: -14deg; }
    80% { rotate: 12deg; }
    85% { rotate: -8deg; }
    90% { rotate: 5deg; }
  }

  /* ---------- Links: animated underline ---------- */
  .sub-link,
  .site-foot a,
  .head-link {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.35s var(--ease), color 0.2s;
  }
  .sub-link:hover,
  .site-foot a:hover,
  .head-link:hover {
    background-size: 100% 2px;
  }

  /* ---------- Floating money layer ---------- */
  .alive-float {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
  }
  .alive-float span {
    position: absolute;
    top: 0;
    left: var(--x);
    font-family: var(--display);
    font-weight: 900;
    font-size: var(--s);
    color: var(--c);
    opacity: 0.09;
    animation: float-up var(--t) linear infinite;
    animation-delay: var(--w);
    translate: 0 var(--py, 0px);
  }
  @keyframes float-up {
    from { transform: translateY(110vh) rotate(0deg); }
    to { transform: translateY(-20vh) rotate(var(--r)); }
  }

  /* ---------- Cursor glow + trail ---------- */
  .alive-cursor,
  .alive-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    pointer-events: none;
    border-radius: 50%;
  }
  .alive-cursor {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent);
    mix-blend-mode: difference;
  }
  .alive-ring {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 2px solid var(--accent);
    opacity: 0.6;
    transition: width 0.25s var(--spring), height 0.25s var(--spring), margin 0.25s var(--spring), background-color 0.25s, border-color 0.25s;
  }
  .alive-ring.hot {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    background: rgba(62, 232, 255, 0.12);
    border-color: var(--money);
  }
  .alive-trail {
    position: fixed;
    z-index: 9997;
    pointer-events: none;
    font-family: var(--display);
    font-weight: 900;
    font-size: 14px;
    color: var(--c);
    animation: trail-fade 0.9s var(--ease) forwards;
  }
  @keyframes trail-fade {
    from { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + 30px)) scale(0.3) rotate(var(--tr)); }
  }

  /* ---------- Portrait parallax ---------- */
  .portrait {
    translate: 0 var(--alive-par, 0px);
  }

  /* ---------- Giveaway panel + endcap pulse ---------- */
  .gpanel,
  .endcap {
    background-size: 200% 200%;
  }
  .gp-big,
  .endcap em {
    display: inline-block;
    animation: big-throb 2s ease-in-out infinite;
  }
  @keyframes big-throb {
    0%, 100% { scale: 1; rotate: 0deg; }
    50% { scale: 1.06; rotate: -1.5deg; }
  }

  /* ---------- Live dots: radar ping ---------- */
  .live-dot {
    position: relative;
  }
  .live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: radar 1.5s ease-out infinite;
  }
  @keyframes radar {
    to { scale: 3.2; opacity: 0; }
  }

  /* ---------- Scroll-progress bar gets a glowing tip ---------- */
  .alive-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9995;
    height: 4px;
    width: 100%;
    transform-origin: 0 50%;
    scale: var(--p, 0) 1;
    background: linear-gradient(90deg, var(--hot), var(--accent), var(--money));
    box-shadow: 0 0 12px var(--accent);
    pointer-events: none;
  }
}

/* Hide the real cursor only on fine pointers where the custom one runs */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html.alive-cursor-on,
  html.alive-cursor-on a,
  html.alive-cursor-on button {
    cursor: none;
  }
  html.alive-cursor-on input,
  html.alive-cursor-on textarea,
  html.alive-cursor-on select,
  html.alive-cursor-on canvas {
    cursor: auto;
  }
}
