/* =========================================================
   Caixinha Quântica — sistema de motion
   Drop-in. Sem dependências. Não muda layout — só anima.
   ========================================================= */

/* ---- Respeito a quem prefere menos movimento ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 1. Scroll reveal ----------
   Coloque data-reveal="fade-up" (ou "fade", "fade-left", "fade-right",
   "scale-in") em qualquer elemento. O motion.js dispara quando o
   elemento entra na tela. */
[data-reveal] {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity .9s cubic-bezier(0.22, 1, 0.36, 1),
    transform .9s cubic-bezier(0.22, 1, 0.36, 1),
    filter .9s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal="fade-up"]    { transform: translateY(28px); }
[data-reveal="fade-left"]  { transform: translateX(-28px); }
[data-reveal="fade-right"] { transform: translateX(28px); }
[data-reveal="scale-in"]   { transform: scale(0.96); }
[data-reveal="blur-in"]    { filter: blur(8px); transform: translateY(14px); }

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Cascata: data-reveal-delay="1" / "2" / "3" / "4" */
[data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal-delay="3"] { transition-delay: .24s; }
[data-reveal-delay="4"] { transition-delay: .32s; }
[data-reveal-delay="5"] { transition-delay: .40s; }
[data-reveal-delay="6"] { transition-delay: .48s; }

/* ---------- 2. Pulso de brasa contínuo (no logo, no d20) ---------- */
@keyframes cqEmberPulse {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(249,115,22,0.45)); }
  50%      { filter: drop-shadow(0 0 32px rgba(249,115,22,0.85)); }
}
.cq-brand-mark {
  animation: cqEmberPulse 5s ease-in-out infinite;
}

/* ---------- 3. Glow lento que respira (atrás de heros) ---------- */
@keyframes cqGlowBreathe {
  0%, 100% { opacity: 0.85; transform: translate3d(0,0,0) scale(1); }
  50%      { opacity: 1;    transform: translate3d(0,-12px,0) scale(1.05); }
}
.cq-bg-glow::before {
  animation: cqGlowBreathe 10s ease-in-out infinite;
}

/* ---------- 4. Hover ascensional pra cards (sutil, já tinha; reforça) ---------- */
.cq-card { will-change: transform, box-shadow; }
.cq-card:hover {
  transform: translateY(-4px);
}

/* ---------- 5. Underline desliza nos links da nav e no rodapé ---------- */
.cq-nav-links a,
.cq-footer-col a {
  position: relative;
}
.cq-nav-links a::after,
.cq-footer-col a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 6px;
  height: 2px;
  background: var(--cq-ember);
  border-radius: 2px;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(249,115,22,0.5);
}
.cq-footer-col a::after {
  left: 0; right: 0; bottom: -3px;
}
.cq-nav-links a:hover::after,
.cq-footer-col a:hover::after {
  transform: scaleX(1);
}
/* Hide the underline-slide when the nav link is already active — the
   active state already shows its own bar. */
.cq-nav-links a.is-active::after { display: none; }

/* ---------- 6. Botão com brilho que percorre ao passar o mouse ---------- */
.cq-btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cq-btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255,255,255,0.4) 50%,
    transparent 70%);
  transform: translateX(-120%);
  transition: transform .9s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}
.cq-btn-primary:hover::before {
  transform: translateX(120%);
}

/* ---------- 7. Ícones com mini-bounce ao passar o mouse no botão ---------- */
.cq-btn svg {
  transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cq-btn:hover svg {
  transform: translateX(3px);
}
.cq-btn-primary:hover svg {
  transform: scale(1.15);
}

/* ---------- 8. Chips/tags piscam no hover ---------- */
.cq-chip {
  transition: color .25s, background .25s, box-shadow .25s, transform .25s var(--ease-out-quint);
}
.cq-chip:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--border-ember);
  color: var(--fg);
}

/* ---------- 9. Linhas de episódio: barra ember surge à esquerda ---------- */
.ep-row {
  position: relative;
  overflow: hidden;
}
.ep-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cq-ember);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(249,115,22,0.6);
}
.ep-row:hover::before { transform: scaleY(1); }

/* ---------- 10. Floating action: setinha "voltar ao topo" ---------- */
.cq-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--cq-graphite);
  color: var(--fg-muted);
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--inner-ring), var(--shadow-2);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease-out-quint), color .2s;
}
.cq-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.cq-to-top:hover {
  color: var(--cq-ember);
  box-shadow: inset 0 0 0 1px var(--border-ember), var(--shadow-2);
}

/* ---------- 11. Estrelas no fundo se mexem MUITO devagar ---------- */
@keyframes cqStarDrift {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
  100% { background-position: 0% -30px, 0% 30px, 0% -20px, 0% 20px, 0% -10px; }
}
.cq-bg-stars {
  animation: cqStarDrift 60s linear infinite alternate;
}

/* ---------- 12. Stagger pra grids de cards ---------- */
.cq-grid > [data-reveal] {
  /* já tratado pelos delays acima */
}
