/* ============================================================
   TRUVAD — Animations
   Hero sequence + scroll-triggered reveals + micro-interactions
   ============================================================ */

/* ---------- KEYFRAMES ---------- */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes strikeReveal {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes glowPop {
  0% {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes pulseGreen {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
}

@keyframes softFloat {
  0%,
  100% {
    transform: rotate(2deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-5px);
  }
}

@keyframes barGrow {
  from {
    width: 0;
  }
  to {
    width: var(--w);
  }
}

@keyframes countFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- HERO SEQUENCE ---------- */

/* Initial hidden state for hero elements */
.hero-copy .eyebrow,
.hero-copy > p,
.hero-actions,
.hero-notes {
  opacity: 0;
  transform: translateY(22px);
}

.hero-copy .eyebrow.anim-in,
.hero-copy > p.anim-in,
.hero-actions.anim-in,
.hero-notes.anim-in {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* h1 lines: each line animates separately */
.hero-line {
  display: inline;
  opacity: 0;
  transform: translateY(22px);
}
.hero-line.anim-in {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* "6 months" — strike-through morph */
.hero-months {
  position: relative;
  display: inline;
  white-space: nowrap;
}
.hero-months::after {
  content: "";
  position: absolute;
  left: 0;
  top: 52%;
  height: 3px;
  width: 0;
  background: currentColor;
  border-radius: 2px;
}
.hero-months.struck::after {
  animation: strikeReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-months.struck {
  color: #9ba8b4;
  transition: color 0.4s ease;
}

/* "7 days." — glow reveal */
.hero-days {
  display: inline;
  opacity: 0;
  transform: scale(0.85);
  filter: blur(6px);
}
.hero-days.anim-in {
  animation: glowPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-days.anim-in {
  color: #4a9ade;
  text-shadow: 0 0 30px rgba(126, 184, 240, 0.3);
}

/* ---------- GREEN PULSE DOT ---------- */

.hero-notes > span:first-child {
  position: relative;
  padding-left: 14px;
}
.hero-notes > span:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseGreen 2s ease-in-out infinite;
}

/* ---------- HERO VISUAL ---------- */

/* Floating note subtle float */
.floating-note {
  animation: softFloat 4s ease-in-out infinite;
}

/* Hero grid canvas sits behind everything */
#hero-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* Ensure hero-copy content is above canvas */
.hero-copy {
  position: relative;
  z-index: 1;
}
.hero-visual {
  position: relative;
}

/* ---------- MAGNETIC BUTTON HOVER ---------- */

.button {
  transition:
    background 0.2s,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}
.button:hover {
  box-shadow: 0 8px 25px rgba(15, 43, 74, 0.15);
}
.button-dark:hover {
  box-shadow: 0 8px 30px rgba(15, 43, 74, 0.25);
}

/* ---------- SCROLL-TRIGGERED REVEALS ---------- */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children (set via JS with --delay) */
.scroll-reveal-stagger {
  opacity: 0;
  transform: translateY(25px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--stagger, 0ms);
}
.scroll-reveal-stagger.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- ANIMATED STAT BARS ---------- */

.bar-row i {
  width: 0;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.bars.bars-animated .bar-row i {
  width: var(--w);
}

/* ---------- STAT BAND COUNTERS ---------- */

.stat-band div {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--stagger, 0ms);
}
.stat-band.stats-visible div {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- REGULATOR LOGOS MARQUEE FEEL ---------- */

.regulator-logo {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--stagger, 0ms);
}
.regulators.revealed .regulator-logo,
.regulators.revealed .regulator-more {
  opacity: 1;
  transform: translateY(0);
}
.regulator-more {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--stagger, 0ms);
}

/* ---------- HERO VISUAL ENTRY ---------- */

.hero-visual {
  opacity: 0;
  transform: translateY(35px) scale(0.97);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.3s;
}
.hero-visual.anim-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- FAQ DETAILS SMOOTH TOGGLE ---------- */

.faq-list summary > span {
  transition: transform 0.3s ease;
}
.faq-list details[open] summary > span {
  transform: rotate(45deg);
}

/* ---------- CLOSING SECTION ---------- */

.closing-word {
  transition: transform 3s ease;
}
.closing:hover .closing-word {
  transform: translateY(-8px);
}

/* ============================================================
   GRIP REGULATORY FEED ANIMATIONS
   ============================================================ */

/* ---------- MINI-ROW SLIDE-IN (hero feed cards) ---------- */

@keyframes feedSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-feed .mini-row {
  animation: feedSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-feed .mini-row:nth-child(1) {
  animation-delay: 0ms;
}
.hero-feed .mini-row:nth-child(2) {
  animation-delay: 120ms;
}
.hero-feed .mini-row:nth-child(3) {
  animation-delay: 240ms;
}

/* ---------- LIVE PULSE BADGE ---------- */

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 4px;
  padding: 4px 7px;
  white-space: nowrap;
  animation: livePulse 2s ease-in-out infinite;
}
.live-pulse-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

/* ---------- WINDOW-STATS COUNT-UP ---------- */

@keyframes statPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.window-stats.stats-counting div {
  animation: statPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.window-stats.stats-counting div:nth-child(1) {
  animation-delay: 0ms;
}
.window-stats.stats-counting div:nth-child(2) {
  animation-delay: 150ms;
}
.window-stats.stats-counting div:nth-child(3) {
  animation-delay: 300ms;
}

/* ---------- MINI-TABS SMOOTH FILTER ---------- */

.mini-tabs button {
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    font-weight 0.1s ease;
}

/* Feed content area smooth transitions on filter */
.hero-feed {
  transition: opacity 0.2s ease;
}
.hero-feed.feed-switching {
  opacity: 0.3;
}

/* ---------- VERTICAL SCANNING LINE ---------- */

@keyframes scanDown {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.hero-feed-wrap {
  position: relative;
  overflow: hidden;
}

.feed-scan-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(126, 184, 240, 0.4) 20%,
    rgba(126, 184, 240, 0.6) 50%,
    rgba(126, 184, 240, 0.4) 80%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgba(126, 184, 240, 0.3);
  z-index: 2;
  pointer-events: none;
  animation: scanDown 3s ease-in-out infinite;
}

/* ---------- WORKSPACE FEED-ROW SLIDE-IN ---------- */

@keyframes feedRowSlide {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#main-feed .feed-row {
  animation: feedRowSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#main-feed .feed-row:nth-child(1) { animation-delay: 0ms; }
#main-feed .feed-row:nth-child(2) { animation-delay: 60ms; }
#main-feed .feed-row:nth-child(3) { animation-delay: 120ms; }
#main-feed .feed-row:nth-child(4) { animation-delay: 180ms; }
#main-feed .feed-row:nth-child(5) { animation-delay: 240ms; }
#main-feed .feed-row:nth-child(6) { animation-delay: 300ms; }

/* ---------- RADAR ICON SPIN ---------- */

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-icon {
  display: inline-block;
  animation: radarSpin 6s linear infinite;
}
