/* =====================================================================
   ONYX LABS — Animations
   Only transform and opacity are animated, so they stay cheap on
   low-end machines. Everything is disabled with prefers-reduced-motion.
   ===================================================================== */

/* ---------- Hero load sequence (the one orchestrated moment) ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes terminal-in {
  from { opacity: 0; transform: translateY(24px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.hero__title    { animation: rise-in .8s var(--ease) both; }
.hero__subtitle { animation: rise-in .8s .12s var(--ease) both; }
.hero__actions  { animation: rise-in .8s .22s var(--ease) both; }
.hero__products { animation: rise-in .8s .32s var(--ease) both; }
.terminal       { animation: terminal-in 1s .15s var(--ease) both; }

/* ---------- Terminal caret + status ---------- */
@keyframes blink { 50% { opacity: 0; } }
.t-caret { animation: blink 1s steps(1) infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
.pulse-dot { animation: pulse 2.4s ease-in-out infinite; }

/* ---------- Scroll reveal (only when JS is active) ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .product-grid .reveal:nth-child(2) { transition-delay: .1s; }

/* ---------- Tab panel entrance ---------- */
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.tabs__panel.is-entering { animation: panel-in .35s var(--ease); }

/* ---------- Download button: arrow drops on hover ---------- */
@keyframes arrow-drop {
  0%   { transform: translateY(0); }
  45%  { transform: translateY(3px); }
  100% { transform: translateY(0); }
}
.btn--download:hover .btn__icon,
.nav-cta:hover .btn__icon { animation: arrow-drop .6s var(--ease); }

/* Light sweep across primary buttons */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn--primary:hover::after { transform: translateX(120%); }
.btn--download.is-soon::after { display: none; }

/* ---------- Dialogs ---------- */
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
dialog[open] { animation: dialog-in .3s var(--ease); }
dialog[open]::backdrop { animation: fade-in .3s ease; }

/* ---------- Mobile menu ---------- */
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js-reveal .reveal { opacity: 1; transform: none; }
  .product-card:hover,
  .gallery__item:hover { transform: none; }
}
