/* Movimento no ritmo da AuthKit: intro escalonada do hero (1.5s ease), holofotes
   que respiram, luz orbitando as bordas, trilhos que acendem em sequência e
   hovers de 0.45s. Estados .on/.live/.rv vêm do main.js; sem JS tudo fica estático. */
:root {
  --ease-ui: cubic-bezier(0.6, 0.6, 0, 1);
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --intro: 0.1s;
  interpolate-size: allow-keywords;
}
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--y, 10px));
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* ── Intro do hero (só CSS: roda sem esperar o JS e não pisca) ──────────── */
.top {
  --y: -10px;
  animation: rise 1.5s ease calc(var(--intro) + 0.2s) both;
}
.frame::before,
.frame::after {
  animation: fade 3s ease both;
}
.spot {
  animation: fade 1.5s ease 0.5s both;
}
.stars {
  animation: fade 2s ease both;
}
.tick {
  animation: pop 1.5s ease 0.4s both;
}
.hero .eyebrow {
  --y: -5px;
  animation: rise 1.5s ease calc(var(--intro) + 0.2s) both;
}
h1 {
  animation: rise 1.5s ease calc(var(--intro) + 0.5s) both;
}
h1 em {
  animation: rise 1.5s ease calc(var(--intro) + 0.75s) both;
}
.lead {
  animation: rise 1.5s ease calc(var(--intro) + 0.9s) both;
}
.hero .cta-row {
  animation: rise 1.5s ease calc(var(--intro) + 1.1s) both;
}
.phone {
  --y: 48px;
  animation: rise 1.8s var(--ease-out) calc(var(--intro) + 1.2s) both;
}
.ghost.l {
  animation: fan-l 1.8s var(--ease-out) calc(var(--intro) + 1.6s) both;
}
.ghost.r {
  animation: fan-r 1.8s var(--ease-out) calc(var(--intro) + 1.6s) both;
}
@keyframes fan-l {
  from {
    opacity: 0;
    transform: translateX(110px) rotate(0deg) scale(0.92);
  }
}
@keyframes fan-r {
  from {
    opacity: 0;
    transform: translateX(-110px) rotate(0deg) scale(0.92);
  }
}
.facts,
.lang,
.lang-note {
  animation: rise 1.5s ease calc(var(--intro) + 2s) both;
}

/* Feixes do holofote: opacidade alternando + balanço lento, cada um no seu tempo. */
.spot i {
  animation:
    beam-fade calc(var(--d) * 1.2) linear var(--dl) infinite alternate,
    beam-sway calc(var(--d) * 1.7) ease-in-out var(--dl) infinite both;
}
@keyframes beam-fade {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.45;
  }
  95% {
    opacity: 0.6;
  }
}
@keyframes beam-sway {
  50% {
    transform: translateX(-50%) rotate(calc(var(--r) * 1.2)) scale(calc(var(--s, 1) * 1.1));
  }
}
/* Estrelas piscando devagar numa segunda camada. */
.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 55% 75%, rgba(0, 240, 255, 0.9), transparent),
    radial-gradient(1px 1px at 82% 50%, #fff, transparent);
  background-size: 360px 300px;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from {
    opacity: 0.15;
  }
  to {
    opacity: 0.9;
  }
}

/* ── Luz orbitando a borda (conic + máscara de 1px) ─────────────────────── */
.card,
.btn-ghost {
  position: relative;
}
.card::after,
.tier::after,
.panel::after,
.btn-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: conic-gradient(
    from calc(var(--angle) + var(--a0, 0deg)),
    transparent 0%,
    var(--lc, rgba(120, 250, 255, 0.9)) 20%,
    transparent 25%
  );
  mask:
    linear-gradient(#fff 0 0) content-box exclude,
    linear-gradient(#fff 0 0);
  opacity: 0;
  animation: orbit 12s linear infinite;
  transition: opacity 0.45s var(--ease-ui);
}
@keyframes orbit {
  to {
    --angle: 360deg;
  }
}
.card {
  --lc: var(--c);
}
.card::after {
  animation-duration: 8s;
}
.tier.hl::after {
  opacity: 0.8;
  animation:
    orbit 12s linear infinite,
    line-breath 3s ease-in-out infinite;
}
@keyframes line-breath {
  50% {
    opacity: 0.45;
  }
}
.panel::after {
  opacity: 0.5;
}
.panel {
  --a0: 180deg;
}
.btn-ghost::after {
  opacity: 0.25;
  animation-duration: 16s;
  background: conic-gradient(from var(--angle), transparent 0%, var(--accent) 40%, transparent 45%);
}
.btn[aria-disabled="true"]::after {
  display: none;
}

/* ── Hovers e cliques (0.2s nos botões, 0.45s nas superfícies) ──────────── */
.top {
  transition:
    background 0.45s var(--ease-ui),
    border-color 0.45s var(--ease-ui);
}
.top nav a,
footer a {
  transition: color 0.2s ease-out;
}
.btn {
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background-color 0.1s ease-out,
    color 0.2s ease-out;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px) scale(0.97);
}
.btn:hover::after {
  opacity: 0.7;
}
.btn[aria-disabled="true"]:hover,
.btn[aria-disabled="true"]:active {
  transform: none;
}
.card,
.tier,
.panel,
.faq details {
  transition:
    box-shadow 0.45s var(--ease-ui),
    background-color 0.45s var(--ease-ui);
}
.card:hover::after,
.tier:hover::after,
.panel:hover::after {
  opacity: 1;
}
.card:hover,
.tier:not(.hl):hover,
.faq details:hover {
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 0 0 1px var(--edge),
    inset 0 -48px 64px -40px color-mix(in srgb, var(--c, var(--accent)) 30%, transparent),
    0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.panel:hover {
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 0 0 1px var(--edge),
    inset 0 32px 48px rgba(0, 240, 255, 0.12),
    0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.panel h2 {
  transition: filter 0.45s var(--ease-ui);
}
.panel:hover h2 {
  filter: drop-shadow(0 2px 16px rgba(0, 240, 255, 0.45));
}
.mark {
  transition: transform 0.6s var(--ease-out);
}
.panel:hover .mark {
  transform: translateY(-3px) scale(1.04);
}
.shots img {
  transition:
    transform 0.45s var(--ease-ui),
    box-shadow 0.45s var(--ease-ui);
}
.shots figure:hover img {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.35),
    0 0 40px rgba(0, 240, 255, 0.14),
    0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
tbody tr {
  transition: background-color 0.2s ease-out;
}
.lang::before {
  transition:
    transform 0.6s var(--ease-out),
    width 0.6s var(--ease-out);
}
.lang button {
  transition: color 0.2s var(--ease-out);
}
.rail [data-plain] {
  transition:
    opacity 0.2s ease-out,
    filter 0.2s ease-out;
}
.rail .swap {
  opacity: 0;
  filter: blur(4px);
}

/* FAQ abre e fecha com altura animada (onde ::details-content existir). */
.faq details::details-content {
  block-size: 0;
  overflow: hidden;
  transition:
    block-size 0.45s var(--ease-ui),
    content-visibility 0.45s allow-discrete;
}
.faq details[open]::details-content {
  block-size: auto;
}
.faq summary::after {
  transition: transform 0.45s var(--ease-out);
}

/* ── Trilhos que acendem em sequência (.on, --i vêm do main.js) ─────────── */
.rail.on li + li::before,
.steps.on li + li::after {
  animation: fill 0.6s ease-in-out calc(var(--i) * 0.6s - 0.4s) forwards;
}
@keyframes fill {
  to {
    background-size:
      100% 100%,
      auto;
  }
}
.rail.on li + li::after {
  animation: node-on 0.4s ease-out calc(var(--i) * 0.6s - 0.1s) forwards;
}
@keyframes node-on {
  to {
    box-shadow:
      inset 0 0 0 1px rgba(0, 240, 255, 0.85),
      0 0 12px rgba(0, 240, 255, 0.55);
  }
}
.rail.on .tile {
  animation: shine 1.5s linear calc(var(--i) * 0.6s + 0.2s) both;
}
.steps.on li::before {
  animation: shine 1.5s linear calc(var(--i) * 0.6s + 0.2s) both;
}
@keyframes shine {
  10%,
  20% {
    filter: brightness(160%);
  }
  80% {
    filter: brightness(100%);
  }
}

/* ── Mini HUDs ganham vida quando o card entra na tela (.live) ──────────── */
.live .macros span::after {
  animation: grow 1s var(--ease-ui) both;
}
.live .macros span:nth-of-type(2)::after {
  animation-delay: 0.12s;
}
.live .macros span:nth-of-type(3)::after {
  animation-delay: 0.24s;
}
@keyframes grow {
  from {
    width: 0;
  }
}
.live .sets span,
.live .chat > *,
.live .ranks span,
.live .slots i {
  --y: 8px;
  animation: rise 0.6s var(--ease-out) both;
}
.live .sets span:nth-child(2),
.live .chat > :nth-child(2),
.live .ranks span:nth-child(2),
.live .slots i:nth-child(2) {
  animation-delay: 0.15s;
}
.live .sets span:nth-child(3),
.live .ranks span:nth-child(3),
.live .slots i:nth-child(3) {
  animation-delay: 0.3s;
}
.live .ranks span:nth-child(5),
.live .slots i:nth-child(5) {
  animation-delay: 0.6s;
}
.live .ranks span:nth-child(6),
.live .slots i:nth-child(6) {
  animation-delay: 0.75s;
}
.live .slots i:nth-child(7) {
  animation-delay: 0.9s;
}
.live .slots i:nth-child(8) {
  animation-delay: 1.05s;
}
.live .slots i:nth-child(4) {
  animation-delay: 0.45s;
}
.live .chat > :nth-child(2) {
  animation-delay: 0.7s;
}
.live .chat > :nth-child(3) {
  animation-delay: 1.1s;
}
.live .ranks .on {
  animation:
    pop 0.6s var(--ease-out) 0.5s both,
    rank-breath 3s ease-in-out 1.1s infinite;
}
@keyframes rank-breath {
  50% {
    box-shadow: 0 0 34px rgba(0, 255, 102, 0.8);
  }
}
.live .xp i {
  animation: grow 1.2s var(--ease-ui) 0.9s both;
}
.live .slots .on {
  animation:
    rise 0.6s var(--ease-out) both,
    shine 3s linear 1.4s infinite;
}
.live .slots .on:nth-child(2) {
  animation-delay: 0.15s, 1.7s;
}
.live .slots .on:nth-child(3) {
  animation-delay: 0.3s, 2s;
}
.live .slots .on:nth-child(4) {
  animation-delay: 0.45s, 2.3s;
}
.pace polyline {
  stroke-dasharray: 100;
}
.live .pace polyline {
  animation: draw 1.6s var(--ease-ui) 0.1s both;
}
@keyframes draw {
  from {
    stroke-dashoffset: 100;
  }
}
.live .pace b,
.live .macros b {
  animation: fade 1s ease 0.4s both;
}

/* ── Revelação ao rolar ─────────────────────────────────────────────────── */
.rv {
  opacity: 0;
  transform: translateY(20px);
}
.rv.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.2s ease var(--rd, 0s),
    transform 1.2s var(--ease-out) var(--rd, 0s);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .rv {
    opacity: 1;
    transform: none;
  }
}
