/**
 * Tacot site motion — entrance, scroll reveal, ambient float, hover polish.
 * Disabled automatically when prefers-reduced-motion is set.
 */

/* ── Keyframes ─────────────────────────────────────────── */
@keyframes tacot-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes tacot-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes tacot-scale-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes tacot-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -12px, 0); }
}
@keyframes tacot-float-slow {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(8px, -18px, 0) rotate(2deg); }
}
@keyframes tacot-glow-pulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.06);
  }
}
@keyframes tacot-shimmer-text {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes tacot-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -24px) scale(1.08); }
  66% { transform: translate(-20px, 16px) scale(0.95); }
}
@keyframes tacot-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes tacot-dash-glow {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 1px rgba(var(--accent-rgb), 0.08), 0 0 40px rgba(var(--accent-rgb), 0.12); }
  50% { box-shadow: var(--shadow), 0 0 0 1px rgba(var(--accent-rgb), 0.18), 0 0 60px rgba(var(--accent2-rgb), 0.18); }
}

/* ── Page boot ─────────────────────────────────────────── */
html.motion-ready body {
  animation: tacot-fade-in 0.45s ease both;
}

/* Ambient orbs behind content */
.motion-orbs {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.motion-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.35;
  animation: tacot-orb 18s ease-in-out infinite;
}
.motion-orbs span:nth-child(1) {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: -8%;
  left: -6%;
  background: rgba(var(--accent-rgb), 0.45);
  animation-duration: 22s;
}
.motion-orbs span:nth-child(2) {
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  top: 35%;
  right: -8%;
  background: rgba(var(--accent2-rgb), 0.35);
  animation-duration: 26s;
  animation-delay: -6s;
}
.motion-orbs span:nth-child(3) {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  bottom: 5%;
  left: 30%;
  background: rgba(0, 212, 255, 0.22);
  animation-duration: 20s;
  animation-delay: -3s;
}
/* Keep content above orbs */
body > .nav,
body > header,
body > main,
body > footer,
body > .site-chat,
.site-chat-root {
  position: relative;
  z-index: 1;
}
html[data-theme="light"] .motion-orbs,
html.theme-white .motion-orbs {
  opacity: 0.45;
}

/* ── Scroll reveal ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.reveal-left {
  opacity: 0;
  transform: translate3d(-36px, 0, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}
/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.26s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.32s; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 0.38s; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 0.44s; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 0.5s; }
.reveal-stagger > .reveal:nth-child(10) { transition-delay: 0.56s; }
.reveal-stagger > .reveal:nth-child(11) { transition-delay: 0.62s; }
.reveal-stagger > .reveal:nth-child(12) { transition-delay: 0.68s; }

/* ── Hero polish ───────────────────────────────────────── */
.hero .pill {
  animation: tacot-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.hero h1 {
  animation: tacot-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.hero-lead {
  animation: tacot-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
.hero-cta {
  animation: tacot-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}
.hero-meta {
  animation: tacot-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both;
}
.hero h1 .grad {
  background-size: 200% 200%;
  animation: tacot-shimmer-text 8s ease infinite;
}
.hero-visual,
.hero .dash {
  animation: tacot-fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}
.hero .dash {
  animation:
    tacot-fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both,
    tacot-float 7s ease-in-out 1.2s infinite,
    tacot-dash-glow 5s ease-in-out 1.2s infinite;
}
.logo.logo-img,
.brand .logo {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand:hover .logo {
  transform: rotate(-8deg) scale(1.06);
  animation: tacot-glow-pulse 1.6s ease infinite;
}

/* ── Cards / interactive ───────────────────────────────── */
.feat-card,
.card,
.cmd-card,
.step-card,
.bot-card,
.stat-pill,
.preset-card,
.preview-line {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.2s ease;
}
.feat-card:hover,
.card:hover,
.cmd-card:hover,
.bot-card:hover,
.preset-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(var(--accent-rgb), 0.18);
}
.feat-icon,
.card .icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-block;
}
.feat-card:hover .feat-icon,
.card:hover .icon {
  transform: scale(1.12) rotate(-4deg);
}
.cmd-chip {
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.cmd-chip:hover {
  transform: translateY(-2px) scale(1.04);
}
.btn {
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease !important;
}
.btn:hover {
  transform: translateY(-2px) scale(1.02);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn-primary:hover {
  box-shadow: var(--btn-shadow), 0 0 28px rgba(var(--accent-rgb), 0.35);
}
.nav-links a {
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.nav-links a:hover {
  transform: translateY(-1px);
}

/* Soft underline grow on section titles */
.section-head h2,
.sec-title,
main h2 {
  background-image: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), rgba(var(--accent2-rgb), 0.35));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: 0.15rem;
}
.section-head h2.is-visible,
.sec-title.is-visible,
main h2.is-visible,
.reveal.is-visible.section-head h2,
.reveal.is-visible h2 {
  background-size: 56% 2px;
}

/* Floating badge on live dash */
.dash .badge {
  animation: tacot-glow-pulse 2.4s ease infinite;
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal-left,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .motion-orbs { display: none !important; }
  .hero .dash {
    animation: none !important;
  }
}
