/* Wild Rift Boost — animations.css (motion system, load AFTER style.css).
   THEME: calm premium Rift — slow drifting neon light (cyan +
   magenta, the glow pair from style.css), never frantic. Transform/opacity only, so nothing shifts layout or
   blocks tapping. No new keyframes that duplicate style.css — the two
   new ones below (anim-fade-in, anim-sheen-sweep) are unique to this
   file; the gold shimmer reuses style.css's rift-sheen.
   HOW TO WIRE UP (HTML/JS agents):
   - Add class "reveal" to any section/card/table wrapper you want to
     fade in on scroll; JS adds "visible" via IntersectionObserver.
   - Add class "reveal" to #priceTable and to .ladder for their
     staggered rows / emblem glow (they pick up .visible the same way).
   - Toasts: JS creates <div class="toast">…</div>, adds "show" to
     display it, swaps "show" for "leaving" to dismiss, then removes it.
   - Loading buttons: JS adds "btn-loading" (and disabled) while an
     async action runs, removes it after.
   - Page-load fade applies automatically to <main> — no class needed.
   Deliberately NOT overridden here: style.css already lifts .svc-card
   (-4px) and .btn (-1px) on hover; this file adds the glow/shadow
   around those lifts instead of fighting them. */

/* ============ 1. Scroll-reveal ============ */
/* P-6: the hidden state is gated behind html.js (motion.js adds it
   synchronously on load), so content is never invisible when JS is
   off, blocked, or motion.js fails to load. Without JS, .reveal
   elements render normally. motion.js also adds .visible to every
   .reveal when IntersectionObserver is unavailable. */
html.js .reveal{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .5s ease, transform .5s ease;
}
html.js .reveal.visible{opacity:1;transform:translateY(0)}
/* Stagger: JS/HTML sets data-delay="1".."5" (80ms steps). */
.reveal[data-delay="1"]{transition-delay:.08s}
.reveal[data-delay="2"]{transition-delay:.16s}
.reveal[data-delay="3"]{transition-delay:.24s}
.reveal[data-delay="4"]{transition-delay:.32s}
.reveal[data-delay="5"]{transition-delay:.4s}
/* Stagger alternative: children of a .reveal-group reveal in order. */
.reveal-group > .reveal:nth-child(1){transition-delay:0s}
.reveal-group > .reveal:nth-child(2){transition-delay:.08s}
.reveal-group > .reveal:nth-child(3){transition-delay:.16s}
.reveal-group > .reveal:nth-child(4){transition-delay:.24s}
.reveal-group > .reveal:nth-child(5){transition-delay:.32s}
.reveal-group > .reveal:nth-child(6){transition-delay:.4s}
/* Stagger children note: the transition-delay rules below only delay
   a reveal that html.js already gated — they hide nothing on their own. */

/* ============ 2. Hover lift / glow ============ */
/* .card has no hover lift in style.css, so it gets the full -2px. */
.card{
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover{
  transform:translateY(-2px);
  border-color:rgba(34,211,238,.35);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 16px 36px rgba(0,0,0,.38),
    0 0 24px rgba(34,211,238,.10);
}
/* .svc-card already lifts -4px in style.css — add glow only, keep its lift. */
.svc-card:hover{
  border-color:rgba(34,211,238,.4);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 16px 36px rgba(0,0,0,.36),
    0 0 24px rgba(34,211,238,.12);
}
/* Buttons: style.css already lifts .btn -1px; add glow + a -2px lift
   for .btn-buy (which has no lift yet). Shared glow for both. */
.btn, .btn-buy{
  transition:background .2s ease, border-color .2s ease, transform .2s ease,
    box-shadow .2s ease;
}
.btn:hover, .btn-buy:hover{
  box-shadow:0 6px 18px rgba(0,0,0,.35), 0 0 22px rgba(34,211,238,.28), 0 0 34px rgba(240,86,200,.14);
}
.btn-buy:hover{transform:translateY(-2px)}
.btn.ghost:hover{box-shadow:0 4px 14px rgba(0,0,0,.3), 0 0 16px rgba(34,211,238,.16)}
/* Guide/pro cards get the same calm lift as .card. */
.guide-card, .pro-card, .order, .stat-grid .stat{
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.guide-card:hover, .pro-card:hover, .order:hover{
  transform:translateY(-2px);
  border-color:rgba(34,211,238,.3);
}

/* ============ 3. Animated rank ladder ============ */
/* style.css already rises each step in on load (rift-rise). This adds
   the emblem glow once the ladder is .visible (JS adds it, same as
   .reveal), staggered gold -> blue down the ladder. */
.ladder-step .emblem{
  transition:transform .2s ease, filter .45s ease;
}
.ladder.visible .ladder-step .emblem,
.ladder.reveal.visible .ladder-step .emblem{
  filter:drop-shadow(0 0 10px rgba(34,211,238,.45))
         drop-shadow(0 0 22px rgba(240,86,200,.18));
}
.ladder.visible .ladder-step:nth-child(1) .emblem{transition-delay:0s}
.ladder.visible .ladder-step:nth-child(2) .emblem{transition-delay:.06s}
.ladder.visible .ladder-step:nth-child(3) .emblem{transition-delay:.12s}
.ladder.visible .ladder-step:nth-child(4) .emblem{transition-delay:.18s}
.ladder.visible .ladder-step:nth-child(5) .emblem{transition-delay:.24s}
.ladder.visible .ladder-step:nth-child(6) .emblem{transition-delay:.3s}
.ladder.visible .ladder-step:nth-child(7) .emblem{transition-delay:.36s}
.ladder.visible .ladder-step:nth-child(8) .emblem{transition-delay:.42s}
.ladder.visible .ladder-step:nth-child(9) .emblem{transition-delay:.48s}
.ladder.visible .ladder-step:nth-child(10) .emblem{transition-delay:.54s}
.ladder.visible .ladder-step:nth-child(11) .emblem{transition-delay:.6s}

/* ============ 4. Animated price table ============ */
/* #priceTable is filled by app.js, so the reveal classes live on the
   wrapper; rows inherit the stagger. .price-table covers the static
   ETA table in the same section. */
/* Rows are hidden only under html.js (same P-6 rule as .reveal):
   if JS never runs, the price table renders normally. */
html.js #priceTable.reveal tr, html.js .price-table.reveal tr{
  opacity:0;
  transform:translateY(8px);
  transition:opacity .45s ease, transform .45s ease;
}
#priceTable.reveal.visible tr, .price-table.reveal.visible tr{
  opacity:1;
  transform:translateY(0);
}
#priceTable.reveal.visible tr:nth-child(1), .price-table.reveal.visible tr:nth-child(1){transition-delay:0s}
#priceTable.reveal.visible tr:nth-child(2), .price-table.reveal.visible tr:nth-child(2){transition-delay:.06s}
#priceTable.reveal.visible tr:nth-child(3), .price-table.reveal.visible tr:nth-child(3){transition-delay:.12s}
#priceTable.reveal.visible tr:nth-child(4), .price-table.reveal.visible tr:nth-child(4){transition-delay:.18s}
#priceTable.reveal.visible tr:nth-child(5), .price-table.reveal.visible tr:nth-child(5){transition-delay:.24s}
#priceTable.reveal.visible tr:nth-child(6), .price-table.reveal.visible tr:nth-child(6){transition-delay:.3s}
#priceTable.reveal.visible tr:nth-child(7), .price-table.reveal.visible tr:nth-child(7){transition-delay:.36s}
#priceTable.reveal.visible tr:nth-child(8), .price-table.reveal.visible tr:nth-child(8){transition-delay:.42s}
#priceTable.reveal.visible tr:nth-child(n+9), .price-table.reveal.visible tr:nth-child(n+9){transition-delay:.48s}
/* Row hover: gentle highlight, no layout shift (background only). */
#priceTable tbody tr, .price-table tbody tr{transition:background-color .2s ease}
#priceTable tbody tr:hover, .price-table tbody tr:hover{background-color:rgba(34,211,238,.04)}
/* Price numbers: subtle gold shimmer on hover (reuses rift-sheen). */
.price{transition:color .2s ease}
.price:hover{
  background:linear-gradient(100deg, var(--gold) 35%, #fff3d0 50%, var(--gold) 65%);
  background-size:200% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  animation:rift-sheen 2s linear infinite;
}

/* ============ 5. Focus states, dropdowns, toggles ============ */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible,
.linkbtn:focus-visible{
  outline:3px solid var(--gold);
  outline-offset:2px;
  border-radius:4px;
}
input, select, textarea{
  transition:border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input:focus, select:focus, textarea:focus{
  border-color:var(--neon);
  box-shadow:0 0 0 3px rgba(34,211,238,.16);
}
select{cursor:pointer}
select:hover{border-color:rgba(34,211,238,.45)}
/* Checkbox / radio press states (transform only, no layout shift). */
input[type="checkbox"], input[type="radio"]{
  accent-color:var(--gold);
  transition:transform .15s ease;
  cursor:pointer;
}
input[type="checkbox"]:active, input[type="radio"]:active{transform:scale(.88)}
input[type="checkbox"]:hover, input[type="radio"]:hover{transform:scale(1.08)}
/* Tabs + details: calm press feedback. */
.tabs button{transition:background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease}
.tabs button:active{transform:scale(.97)}
.tabs button.on{box-shadow:0 0 14px rgba(34,211,238,.22)}
details{transition:border-color .2s ease}
details:hover{border-color:rgba(34,211,238,.3)}
summary{transition:color .2s ease}
summary:hover{color:var(--gold-soft)}

/* ============ 6. Press + disabled / loading buttons ============ */
.btn:active, .btn-buy:active, .tabs button:active{transform:scale(.98)}
.btn:disabled, .btn-buy:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}
.btn-loading, .btn-buy.btn-loading{
  position:relative;
  overflow:hidden;
  pointer-events:none;
  opacity:.8;
  cursor:wait;
}
.btn-loading::after, .btn-buy.btn-loading::after{
  content:"";
  position:absolute;
  top:0; bottom:0; left:0;
  width:45%;
  background:linear-gradient(100deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation:anim-sheen-sweep 2s ease-in-out infinite;
}
@keyframes anim-sheen-sweep{
  from{transform:translateX(-140%) skewX(-12deg)}
  to{transform:translateX(320%) skewX(-12deg)}
}

/* ============ 7. Toasts ============ */
.toast{
  position:fixed;
  left:50%;
  bottom:24px;
  z-index:100;
  transform:translate(-50%, 16px);
  opacity:0;
  pointer-events:none;
  max-width:min(92vw, 480px);
  background:rgba(10,13,19,.97);
  color:var(--text);
  border:1px solid var(--gold);
  border-radius:10px;
  padding:12px 18px;
  font-size:14px;
  line-height:1.45;
  box-shadow:0 12px 32px rgba(0,0,0,.45), 0 0 20px rgba(217,179,106,.12);
  transition:opacity .3s ease, transform .3s ease;
}
.toast.show{
  opacity:1;
  transform:translate(-50%, 0);
  pointer-events:auto;
}
.toast.leaving{
  opacity:0;
  transform:translate(-50%, 8px);
  pointer-events:none;
}
.toast.toast-ok{border-color:var(--green)}
.toast.toast-err{border-color:var(--red)}

/* ============ 7b. Integrator additions (animation upgrade) ============ */
/* .emblem-swap: brief fade/scale pulse motion.js adds to a rank emblem
   when its select changes. Transform/opacity only; the box never moves. */
#rankFromEmblem, #rankToEmblem, #fromEmblem, #toEmblem{
  transition:opacity .18s ease, transform .18s ease;
}
.emblem-swap{opacity:.2;transform:scale(.92)}
/* .toast-wrap: persistent live-region container (one per page, in HTML,
   aria-live="polite" role="status"). Toasts stack upward from the
   bottom; the wrap itself never takes pointer input, toasts do once shown. */
.toast-wrap{
  position:fixed;left:0;right:0;bottom:0;z-index:100;
  display:flex;flex-direction:column-reverse;align-items:center;gap:8px;
  padding:0 12px 24px;pointer-events:none;
}
.toast-wrap .toast{position:static;transform:translateY(16px)}
.toast-wrap .toast.show{transform:translateY(0)}
.toast-wrap .toast.leaving{transform:translateY(8px)}
/* P-1: pause the fixed background layers when the hero is off-screen
   (motion.js toggles body.bg-paused) or the tab is hidden. */
body.bg-paused::before, body.bg-paused::after{animation-play-state:paused}
html:has(body.bg-paused)::before, html:has(body.bg-paused)::after{animation-play-state:paused}
/* P-2: hero sheen as a transform sweep, not background-position
   (paint every frame). The band sweeps back and forth over the same
   9 s cycle; rift-sheen itself is untouched so the .price:hover
   text shimmer still works. */
@keyframes anim-sheen-move{0%,100%{transform:translateX(-14%)}50%{transform:translateX(14%)}}
.hero-rift::before{animation:anim-sheen-move 9s ease-in-out infinite}
/* P-4: keep the calculator price box stable while motion.js counts:
   tabular figures + room for the widest price (£136 / £2.50). */
.calc-total .price{font-variant-numeric:tabular-nums;min-width:5ch;display:inline-block}
/* P-5: the Rift art box is reserved by the <img> width/height
   attributes (1190x739) in the HTML, so the services section never
   jumps while rift-map.webp loads. No aspect-ratio rule on .rift-art:
   one used to sit here and, combined with the card's overflow:hidden,
   could crop the map on narrow screens. */

/* ============ 8. Page-load fade (opacity only, < 0.4s) ============ */
@keyframes anim-fade-in{from{opacity:0}to{opacity:1}}
main{animation:anim-fade-in .35s ease-out both}
.page-fade{animation:anim-fade-in .35s ease-out both}

/* ============ 10. Mobile: GPU-friendly, tap-safe ============ */
@media (max-width:700px){
  .reveal{transform:translateY(8px)}
  .card:hover, .guide-card:hover, .pro-card:hover, .order:hover{transform:translateY(-1px)}
  /* Toasts sit ABOVE the fixed bottom bar (~46px + safe-area),
     never on top of it (the "Welcome back"-style pills used to
     land right across the bar), and the wrap leaves the helper
     fab's right-hand column clear so a toast never slides under
     the ? button either. */
  .toast{bottom:calc(62px + env(safe-area-inset-bottom, 0px));padding:11px 14px}
  .toast-wrap{align-items:flex-start;padding:0 76px calc(62px + env(safe-area-inset-bottom, 0px)) 12px}
  .btn-loading::after{animation-duration:2.2s}
}

/* ============ 9. Reduced motion: kill everything in this file ============ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation:none !important;
    transition:none !important;
  }
  .reveal,
  #priceTable.reveal tr, .price-table.reveal tr{
    opacity:1 !important;
    transform:none !important;
  }
  .ladder.visible .ladder-step .emblem,
  .ladder.reveal.visible .ladder-step .emblem{
    filter:none !important;
  }
  .toast{transform:translate(-50%, 0)}
  .price:hover{animation:none;color:var(--gold)}
  main, .page-fade{animation:none}
}
