/* ═══════════════════════════════════════════════════════════════════════════════
   QNSQY Animation Layer - Mama Claude 8-Agent Synthesis
   Hero choreography, section reveals, micro-interactions, content animations
   Depends on: styles.css (design tokens + animation infrastructure)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────────
   Keyframes
   ───────────────────────────────────────────────────────────────────────────────── */

@keyframes highlight-glow {
  0%, 100% { text-shadow: none; }
  50% {
    text-shadow:
      0 0 16px rgba(255, 107, 0, 0.7),
      0 0 36px rgba(255, 107, 0, 0.3);
  }
}

@keyframes pulse-dot-enhanced {
  0%, 100% {
    opacity: 1; transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 0, 0);
  }
  40% {
    opacity: 0.85; transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.18);
  }
  60% {
    opacity: 0.6; transform: scale(0.92);
    box-shadow: 0 0 0 5px rgba(255, 107, 0, 0.06);
  }
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes pricing-primary-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--color-accent), 0 20px 40px -10px rgba(255, 107, 0, 0.15); }
  50%  { box-shadow: 0 0 0 1px var(--color-accent), 0 20px 40px -10px rgba(255, 107, 0, 0.28), 0 0 32px -4px rgba(255, 107, 0, 0.14); }
}

@keyframes trust-dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(40, 200, 64, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(40, 200, 64, 0); }
}

@keyframes branding-shimmer {
  0%, 100% { color: var(--color-accent); text-shadow: none; }
  50% { color: #ff8c33; text-shadow: 0 0 12px rgba(255, 107, 0, 0.7), 0 0 24px rgba(255, 107, 0, 0.3); }
}

@keyframes timeline-point-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(255, 107, 0, 0); }
}

@keyframes compare-row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cell-accent-pulse {
  0%   { background-color: var(--color-accent-dim); }
  40%  { background-color: rgba(255, 107, 0, 0.22); }
  100% { background-color: var(--color-accent-dim); }
}

@keyframes yes-glow {
  0%, 100% { text-shadow: none; }
  50%  { text-shadow: 0 0 8px rgba(40, 200, 64, 0.6); }
}

@keyframes terminal-poweron {
  0%   { opacity: 0.4; border-color: var(--color-border); box-shadow: none; }
  30%  { opacity: 0.7; border-color: rgba(255, 107, 0, 0.4); box-shadow: 0 0 16px rgba(255, 107, 0, 0.12); }
  100% { opacity: 1; border-color: var(--color-border); box-shadow: none; }
}

@keyframes terminal-content-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes trust-item-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes blog-card-appear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes copy-flash-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes checksum-copy-ring {
  0%   { box-shadow: 0 0 0 0 rgba(40, 200, 64, 0.6); }
  30%  { box-shadow: 0 0 0 6px rgba(40, 200, 64, 0); }
  100% { box-shadow: 0 0 12px rgba(40, 200, 64, 0.15); }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   1. Hero Entrance Choreography
   ───────────────────────────────────────────────────────────────────────────────── */

.hero--animating .hero__label,
.hero--animating .hero__title-line,
.hero--animating .hero__subtitle,
.hero--animating .hero__actions,
.hero--animating .hero__meta,
.hero--animating .hero__visual {
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
}

.hero--animating .hero__visual {
  transform: translateX(24px);
}

.hero__label.hero-revealed {
  opacity: 1; transform: translateY(0);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
}

.hero__title-line.hero-revealed:nth-child(1) {
  opacity: 1; transform: translateY(0);
  transition: opacity 550ms var(--ease-out-expo), transform 550ms var(--ease-out-expo);
  transition-delay: 120ms;
}
.hero__title-line.hero-revealed:nth-child(2) {
  opacity: 1; transform: translateY(0);
  transition: opacity 550ms var(--ease-out-expo), transform 550ms var(--ease-out-expo);
  transition-delay: 220ms;
}
.hero__title-line.hero-revealed:nth-child(3) {
  opacity: 1; transform: translateY(0);
  transition: opacity 550ms var(--ease-out-expo), transform 550ms var(--ease-out-expo);
  transition-delay: 320ms;
}
.hero__title-line.hero-revealed:nth-child(4) {
  opacity: 1; transform: translateY(0);
  transition: opacity 550ms var(--ease-out-expo), transform 550ms var(--ease-out-expo);
  transition-delay: 420ms;
}

.hero__subtitle.hero-revealed {
  opacity: 1; transform: translateY(0);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
  transition-delay: 580ms;
}
.hero__actions.hero-revealed {
  opacity: 1; transform: translateY(0);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
  transition-delay: 720ms;
}
.hero__meta.hero-revealed {
  opacity: 1; transform: translateY(0);
  transition: opacity 450ms var(--ease-out-quart), transform 450ms var(--ease-out-quart);
  transition-delay: 880ms;
}
.hero__visual.hero-revealed {
  opacity: 1; transform: translateX(0);
  transition: opacity 700ms var(--ease-out-expo), transform 700ms var(--ease-out-expo);
  transition-delay: 320ms;
}

/* Hero title highlight glow */
.hero__title-highlight {
  animation: highlight-glow 3.5s var(--ease-out-quart) infinite;
}
.hero__title-line:nth-child(4) .hero__title-highlight:nth-of-type(1) { animation-delay: 1166ms; }
.hero__title-line:nth-child(4) .hero__title-highlight:nth-of-type(2) { animation-delay: 2333ms; }

/* Hero label dot enhanced */
.hero__label-dot { animation: pulse-dot-enhanced 2.4s ease-in-out infinite; }

/* Algorithm strip marquee */
.hero__strip {
  overflow: hidden;
  display: block;
  padding: 0;
  position: relative;
}
.hero__strip::before,
.hero__strip::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.hero__strip::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg-alt), transparent);
}
.hero__strip::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg-alt), transparent);
}
.hero__strip-track {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: max-content;
  padding: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  animation: marquee-scroll 28s linear infinite;
}
.hero__strip-set {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   2. Button & CTA Micro-interactions
   ───────────────────────────────────────────────────────────────────────────────── */

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 200ms var(--ease-out-quart),
    box-shadow 200ms var(--ease-out-quart),
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.btn--primary:hover {
  background: #ff8c2a;
  color: var(--color-bg);
  border-color: #ff8c2a;
  transform: scale(1.03);
  box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.25), 0 8px 24px -4px rgba(255, 107, 0, 0.35);
}
.btn--primary svg,
.btn--primary .btn__arrow { transition: transform 250ms var(--ease-out-expo); }
.btn--primary:hover svg,
.btn--primary:hover .btn__arrow { transform: translateX(4px); }

.btn--primary:active:not(.btn--loading):not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 2px 8px -2px rgba(255, 107, 0, 0.2);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

/* Ghost button fill from left */
.btn--ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-bg-elevated);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms var(--ease-out-quart);
  z-index: -1;
}
.btn--ghost:hover {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: scale(1.02);
  box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.15);
}
.btn--ghost:hover::before { transform: scaleX(1); }
.btn--ghost svg,
.btn--ghost .btn__arrow { transition: transform 250ms var(--ease-out-expo); }
.btn--ghost:hover svg,
.btn--ghost:hover .btn__arrow { transform: translateX(4px); }
.btn--ghost:active:not(.btn--loading):not(:disabled) {
  transform: scale(0.97);
  transition: transform 100ms ease;
}

/* XL buttons: more dramatic */
.btn--xl:hover { transform: scale(1.045); }
.btn--xl:active:not(.btn--loading):not(:disabled) {
  transform: scale(0.965);
  transition: transform 100ms ease;
}
.btn--xl:hover svg { transform: translateX(6px); }

/* Focus ring */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent), 0 0 12px 2px rgba(255, 107, 0, 0.25);
}
.btn--loading:hover,
.btn--loading:active { transform: none !important; box-shadow: none !important; }
.btn:disabled:hover { transform: none; box-shadow: none; }

/* Prose-link underline slide */
.prose-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 250ms var(--ease-out-quart), color 200ms ease;
}
.prose-link:hover {
  opacity: 1;
  color: #ff8c2a;
  background-size: 100% 1px;
}
.prose-link:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
}

/* Checksum copy feedback */
.checksum__copy {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 150ms ease;
}
.checksum__copy:hover { transform: scale(1.02); }
.checksum__copy:active { transform: scale(0.97); transition: transform 100ms ease; }
.checksum__copy.copied {
  background: var(--color-success) !important;
  border-color: var(--color-success) !important;
  color: #000 !important;
  animation: checksum-copy-ring 1.8s var(--ease-out-expo) forwards;
}

/* Nav link focus */
.nav__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px rgba(255, 107, 0, 0.5);
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   3. Feature Cards & Grid Animations
   ───────────────────────────────────────────────────────────────────────────────── */

.feature {
  transition: border-color var(--duration-normal) var(--ease-out-quart),
              background var(--duration-normal) var(--ease-out-quart),
              transform var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.feature__index {
  transition: border-color var(--duration-normal) var(--ease-out-quart),
              color var(--duration-normal) var(--ease-out-quart);
}

/* Feature scroll reveal */
.feature-card--animate {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--duration-slower) var(--ease-out-expo), transform var(--duration-slower) var(--ease-out-expo);
}
.feature-card--animate.is-visible { opacity: 1; transform: translateY(0); }
.feature-card--animate[data-stagger="1"] { transition-delay: 0ms; }
.feature-card--animate[data-stagger="2"] { transition-delay: 80ms; }
.feature-card--animate[data-stagger="3"] { transition-delay: 160ms; }
.feature-card--animate[data-stagger="4"] { transition-delay: 240ms; }
.feature-card--animate[data-stagger="5"] { transition-delay: 320ms; }
.feature-card--animate[data-stagger="6"] { transition-delay: 400ms; }

/* Process steps */
.process__step--animate {
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.process__step--animate.is-visible { opacity: 1; transform: translateY(0); }
.process__step--animate[data-stagger="1"] { transition-delay: 0ms; }
.process__step--animate[data-stagger="2"] { transition-delay: 120ms; }
.process__step--animate[data-stagger="3"] { transition-delay: 240ms; }
.process__step--animate[data-stagger="4"] { transition-delay: 360ms; }

.process__num { transition: color var(--duration-normal) var(--ease-out-quart); }
.process__step:hover .process__num { color: var(--color-accent); }

/* Process connecting line */
.process--has-line { position: relative; }
.process--has-line::before {
  content: '';
  position: absolute;
  top: calc(var(--space-xl) + 16px);
  left: calc(var(--space-xl) + 1rem);
  right: calc(var(--space-xl) + 1rem);
  height: 1px;
  background: var(--color-border);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 600ms var(--ease-out-expo);
  pointer-events: none; z-index: 0;
}
.process--has-line.line-visible::before { transform: scaleX(1); }

/* Use-case cards */
.use-case {
  position: relative;
  transition: background var(--duration-normal) var(--ease-out-quart), transform var(--duration-normal) var(--ease-out-quart);
}
.use-case::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.use-case:hover::before { transform: scaleY(1); }
.use-case:hover { background: var(--color-bg-alt); transform: scale(1.02); }
.use-case__number { transition: color var(--duration-normal) var(--ease-out-quart); }
.use-case:hover .use-case__number { color: var(--color-accent); }

.use-case--animate {
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.use-case--animate.is-visible { opacity: 1; transform: translateY(0); }
.use-case--animate[data-stagger="1"] { transition-delay: 0ms; }
.use-case--animate[data-stagger="2"] { transition-delay: 60ms; }
.use-case--animate[data-stagger="3"] { transition-delay: 120ms; }
.use-case--animate[data-stagger="4"] { transition-delay: 180ms; }
.use-case--animate[data-stagger="5"] { transition-delay: 240ms; }
.use-case--animate[data-stagger="6"] { transition-delay: 300ms; }
.use-case--animate[data-stagger="7"] { transition-delay: 360ms; }
.use-case--animate[data-stagger="8"] { transition-delay: 420ms; }

/* Specs grid */
.specs-category {
  transition: background var(--duration-normal) var(--ease-out-quart), box-shadow var(--duration-normal) var(--ease-out-quart);
  position: relative;
}
.specs-category::after {
  content: '';
  position: absolute; inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color var(--duration-normal) var(--ease-out-quart);
}
.specs-category:hover::after { border-color: var(--color-accent); }
.specs-category:hover { background: var(--color-bg-alt); box-shadow: inset 0 0 24px rgba(255, 107, 0, 0.04); }

.specs-category--animate {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.specs-category--animate.is-visible { opacity: 1; transform: translateY(0); }
.specs-category--animate[data-stagger="1"]  { transition-delay: 0ms; }
.specs-category--animate[data-stagger="2"]  { transition-delay: 70ms; }
.specs-category--animate[data-stagger="3"]  { transition-delay: 140ms; }
.specs-category--animate[data-stagger="4"]  { transition-delay: 210ms; }
.specs-category--animate[data-stagger="5"]  { transition-delay: 280ms; }
.specs-category--animate[data-stagger="6"]  { transition-delay: 350ms; }
.specs-category--animate[data-stagger="7"]  { transition-delay: 420ms; }
.specs-category--animate[data-stagger="8"]  { transition-delay: 490ms; }
.specs-category--animate[data-stagger="9"]  { transition-delay: 560ms; }
.specs-category--animate[data-stagger="10"] { transition-delay: 630ms; }

/* Trust signals slide-in */
.trust-signals span {
  opacity: 0; transform: translateX(-12px);
  transition: opacity var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo);
}
.trust-signals.signals-visible span { opacity: 1; transform: translateX(0); }
.trust-signals.signals-visible span:nth-child(1) { transition-delay: 0ms; }
.trust-signals.signals-visible span:nth-child(2) { transition-delay: 60ms; }
.trust-signals.signals-visible span:nth-child(3) { transition-delay: 120ms; }
.trust-signals.signals-visible span:nth-child(4) { transition-delay: 180ms; }
.trust-signals.signals-visible span:nth-child(5) { transition-delay: 240ms; }

/* ─────────────────────────────────────────────────────────────────────────────────
   4. Pricing Card Animations
   ───────────────────────────────────────────────────────────────────────────────── */

.pricing__card {
  transition: transform var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart),
              border-color var(--duration-normal) var(--ease-out-quart);
}
.pricing__card:not(.pricing__card--primary):hover {
  transform: translateY(-8px);
  border-color: var(--color-accent);
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--color-accent);
}
.pricing__card--primary:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px var(--color-accent), 0 28px 56px -12px rgba(255, 107, 0, 0.28), 0 0 40px -8px rgba(255, 107, 0, 0.18);
}

/* Pricing scroll reveal */
.pricing__card.pricing-animate {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--duration-slower) var(--ease-out-expo),
              transform var(--duration-slower) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-quart),
              border-color var(--duration-normal) var(--ease-out-quart);
}
.pricing__card.pricing-animate.is-visible { opacity: 1; transform: translateY(0); }
.pricing__card.pricing-animate:nth-child(1) { transition-delay: 0ms; }
.pricing__card.pricing-animate:nth-child(2) { transition-delay: 120ms; }
.pricing__card.pricing-animate:nth-child(3) { transition-delay: 60ms; }

.pricing__card--primary.is-visible {
  animation: pricing-primary-pulse 1.6s var(--ease-out-expo) 0.5s 1;
}

/* Feature list stagger */
.pricing__card.pricing-animate .pricing__features li {
  opacity: 0; transform: translateX(-6px);
  transition: opacity var(--duration-normal) var(--ease-out-quart), transform var(--duration-normal) var(--ease-out-quart);
}
.pricing__card.pricing-animate.is-visible .pricing__features li {
  opacity: 1; transform: translateX(0);
}
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(1) { transition-delay: 200ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(2) { transition-delay: 260ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(3) { transition-delay: 320ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(4) { transition-delay: 380ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(5) { transition-delay: 440ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(6) { transition-delay: 500ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(7) { transition-delay: 540ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(8) { transition-delay: 580ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(9) { transition-delay: 620ms; }
.pricing__card.pricing-animate.is-visible .pricing__features li:nth-child(n+10) { transition-delay: 660ms; }

/* Pricing button overrides */
.pricing__card .btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-dim);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   5. Scroll Progress Bar & Navigation
   ───────────────────────────────────────────────────────────────────────────────── */

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 2000;
  pointer-events: none;
}
.scroll-progress__bar {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--color-accent);
  transform-origin: left center;
  transform: scaleX(0);
}

/* Header scroll transition (flat, no glassmorphism) */
.header {
  transition: background var(--duration-normal) var(--ease-out-quart),
              border-color var(--duration-normal) var(--ease-out-quart);
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: var(--color-bg);
  border-bottom-color: var(--color-border);
}
[data-theme="light"] .header.scrolled {
  background: var(--color-bg);
}

/* Nav link underline: scaleX (GPU) */
.nav__link::after {
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}
.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
  transform: scaleX(1);
}

/* Mobile menu stagger */
@media (max-width: 900px) {
  .nav__links .nav__link {
    opacity: 0; transform: translateX(24px);
    transition: opacity var(--duration-normal) var(--ease-out-expo),
                transform var(--duration-normal) var(--ease-out-expo), color var(--duration-fast);
  }
  .nav__links.active .nav__link { opacity: 1; transform: translateX(0); }
  .nav__links.active .nav__link:nth-child(1) { transition-delay: 60ms; }
  .nav__links.active .nav__link:nth-child(2) { transition-delay: 110ms; }
  .nav__links.active .nav__link:nth-child(3) { transition-delay: 160ms; }
  .nav__links.active .nav__link:nth-child(4) { transition-delay: 210ms; }
  .nav__links.active .nav__link:nth-child(5) { transition-delay: 260ms; }
  .nav__links.active .nav__link:nth-child(6) { transition-delay: 310ms; }
  .nav__links:not(.active) .nav__link {
    transition-delay: 0ms !important;
    transition-duration: 150ms;
  }
}

/* Theme toggle rotation */
.nav__theme-indicator {
  transition: transform var(--duration-normal) var(--ease-out-quart), background var(--duration-fast);
}
.nav__theme--rotating .nav__theme-indicator { transform: rotate(180deg) scale(0.6); }

/* Section index reveal - opt-in via JS class */
.section__index.idx-animate {
  opacity: 0; transform: translateX(-8px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.section__index.idx-animate.is-revealed { opacity: 1; transform: translateX(0); }

/* ─────────────────────────────────────────────────────────────────────────────────
   6. Trust Bar, Comparison Table, Timeline, Terminals
   ───────────────────────────────────────────────────────────────────────────────── */

.trust-bar__dot { animation: trust-dot-pulse 2.8s ease-in-out infinite; }

.trust-bar--animated .trust-bar__item { opacity: 0; transform: translateX(-12px); }
.trust-bar--animated.trust-bar--visible .trust-bar__item {
  animation: trust-item-in 280ms var(--ease-out-quart) forwards;
}
.trust-bar--animated.trust-bar--visible .trust-bar__item:nth-child(1) { animation-delay: 0ms; }
.trust-bar--animated.trust-bar--visible .trust-bar__item:nth-child(2) { animation-delay: 60ms; }
.trust-bar--animated.trust-bar--visible .trust-bar__item:nth-child(3) { animation-delay: 120ms; }
.trust-bar--animated.trust-bar--visible .trust-bar__item:nth-child(4) { animation-delay: 180ms; }
.trust-bar--animated.trust-bar--visible .trust-bar__item:nth-child(5) { animation-delay: 240ms; }

/* Branding QNSQY shimmer */
.branding-simple--animated .branding-simple__hl { display: inline-block; }
.branding-simple--animated.branding-simple--visible .branding-simple__hl:nth-of-type(1) { animation: branding-shimmer 400ms var(--ease-out-quart) 200ms both; }
.branding-simple--animated.branding-simple--visible .branding-simple__hl:nth-of-type(2) { animation: branding-shimmer 400ms var(--ease-out-quart) 340ms both; }
.branding-simple--animated.branding-simple--visible .branding-simple__hl:nth-of-type(3) { animation: branding-shimmer 400ms var(--ease-out-quart) 480ms both; }
.branding-simple--animated.branding-simple--visible .branding-simple__hl:nth-of-type(4) { animation: branding-shimmer 400ms var(--ease-out-quart) 620ms both; }
.branding-simple--animated.branding-simple--visible .branding-simple__hl:nth-of-type(5) { animation: branding-shimmer 400ms var(--ease-out-quart) 760ms both; }

/* Timeline draw */
.timeline--animated .timeline__connector {
  transform-origin: left center; transform: scaleX(0);
}
.timeline--animated.timeline--visible .timeline__connector {
  animation: draw-line 600ms var(--ease-out-expo) 150ms forwards;
}
.timeline--animated.timeline--visible .timeline__point--active .timeline__year {
  animation: timeline-point-pulse 2.4s ease-in-out 800ms infinite;
}

/* Comparison table rows */
.compare__table--animated tbody tr { opacity: 0; transform: translateY(8px); }
.compare__table--animated tbody tr.compare-row--visible {
  animation: compare-row-in 240ms var(--ease-out-quart) forwards;
}
.compare__table--animated tbody tr.compare-row--visible .compare__highlight-col {
  animation: cell-accent-pulse 600ms var(--ease-out-quart) 100ms both;
}
.compare__table--animated tbody tr.compare-row--visible .compare__yes {
  animation: yes-glow 500ms ease-out 200ms both;
}

/* Terminal docs power-on - only on homepage terminals (max 3-4), not docs page (dozens) */
.hero ~ .section .terminal--docs.terminal-docs--animated { opacity: 0; }
.hero ~ .section .terminal--docs.terminal-docs--animated.terminal-docs--visible {
  animation: terminal-poweron 400ms var(--ease-out-quart) forwards;
}
.hero ~ .section .terminal--docs.terminal-docs--animated.terminal-docs--visible .terminal__body {
  animation: terminal-content-in 300ms var(--ease-out-quart) 120ms both;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   7a. Page Header & Content Section Entrances (ALL non-homepage pages)
   ───────────────────────────────────────────────────────────────────────────────── */

/* Page header entrance - title + description stagger */
.page-header--animate .page-header__title {
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
}
.page-header--animate .page-header__desc {
  opacity: 0; transform: translateY(12px);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
  transition-delay: 120ms;
}
.page-header--animate.page-header--visible .page-header__title,
.page-header--animate.page-header--visible .page-header__desc {
  opacity: 1; transform: translateY(0);
}

/* Content section scroll reveal (opt-in via JS) */
.content__section.section--animate {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.content__section.section--animate.section--visible { opacity: 1; transform: translateY(0); }

/* Blog cards: always visible on load. Legacy entrance rule intentionally neutralised
   - prior IntersectionObserver timing could leave above-the-fold cards invisible
   until the user scrolled. Cards now render fully on first paint. */
.blog-card.blog-card--animate,
.blog-card.blog-card--animate.blog-card--entered {
  opacity: 1; transform: none; transition: none;
}

/* FAQ item scroll reveal */
.faq__item.faq-animate {
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo);
}
.faq__item.faq-animate.faq-visible { opacity: 1; transform: translateY(0); }

/* Pricing card entrance on pricing page (reuse existing pricing-animate) */

/* Warning box / info box entrance */
.warning-box.warning-animate {
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo);
}
.warning-box.warning-animate.warning-visible { opacity: 1; transform: translateY(0); }

/* Terminal blocks on non-homepage pages */
.terminal--docs.terminal-animate {
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo);
}
.terminal--docs.terminal-animate.terminal-entered { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────────────────────────────────────────
   7b. Blog & Content Page Interactions
   ───────────────────────────────────────────────────────────────────────────────── */

/* Blog card hover */
.blog-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              border-color var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo),
              opacity 200ms var(--ease-out-expo);
}
.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 107, 0, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 107, 0, 0.12);
}
.blog-card__category {
  display: inline-block;
  transition: color var(--duration-fast), letter-spacing var(--duration-normal) var(--ease-out-expo);
}
.blog-card:hover .blog-card__category { color: #ff8533; letter-spacing: 0.13em; }

/* Blog filter transition */
.blog-card--hiding {
  opacity: 0; transform: translateY(6px) scale(0.98); pointer-events: none;
}
.blog-card--showing { animation: blog-card-appear 280ms var(--ease-out-expo) forwards; }

/* Blog article content: no animation - reading content must be immediately visible */

/* Contact form glow */
.feedback-form select:focus,
.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: rgba(255, 107, 0, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
  outline: none;
}
.contact-card {
  transition: border-color var(--duration-normal) var(--ease-out-expo), transform var(--duration-normal) var(--ease-out-expo);
}
.contact-card:hover { border-color: rgba(255, 107, 0, 0.35); transform: translateY(-2px); }

/* Download button press */
.download-btn {
  transition: background var(--duration-fast), border-color var(--duration-fast),
              transform 80ms ease, box-shadow 80ms ease;
}
.download-btn:active { transform: scale(0.97) translateY(1px); box-shadow: none; }

/* Security page hero reveal - opt-in via JS class */
.quantum-hero.qh-animate {
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--duration-slower) var(--ease-out-expo), transform var(--duration-slower) var(--ease-out-expo);
}
.quantum-hero.qh-animate.section--visible { opacity: 1; transform: translateY(0); }

/* Content section reveal - opt-in via JS class, NOT default opacity:0 */
.content__section.section--animate {
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
.content__section.section--animate.section--visible { opacity: 1; transform: translateY(0); }

/* Code copy buttons */
.code-block-wrapper { position: relative; }
.code-copy-btn {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 10px;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px; cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), transform 80ms ease;
  pointer-events: none;
}
.code-block-wrapper:hover .code-copy-btn,
.code-copy-btn:focus { opacity: 1; pointer-events: auto; }
.code-copy-btn:active { transform: scale(0.95); }
.code-copy-btn.copy-flash {
  background: rgba(255, 107, 0, 0.15);
  border-color: rgba(255, 107, 0, 0.5);
  color: var(--color-accent);
  animation: copy-flash-pulse 260ms var(--ease-out-expo);
}
.blog-post__content pre,
.terminal--docs { position: relative; }

/* ─────────────────────────────────────────────────────────────────────────────────
   8. Combined Reduced Motion Overrides
   ───────────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  /* Hero */
  .hero--animating .hero__label,
  .hero--animating .hero__title-line,
  .hero--animating .hero__subtitle,
  .hero--animating .hero__actions,
  .hero--animating .hero__meta,
  .hero--animating .hero__visual {
    opacity: 1; transform: none; will-change: auto;
  }
  .hero__label.hero-revealed,
  .hero__title-line.hero-revealed,
  .hero__subtitle.hero-revealed,
  .hero__actions.hero-revealed,
  .hero__meta.hero-revealed,
  .hero__visual.hero-revealed { transition: none; }
  .hero__title-highlight,
  .hero__label-dot { animation: none; }
  .hero__strip-track { animation: none; }

  /* Buttons */
  .btn, .btn::before, .btn svg,
  .prose-link, .checksum__copy { transition: none !important; animation: none !important; }

  /* Cards/grids */
  .feature-card--animate,
  .process__step--animate,
  .use-case--animate,
  .specs-category--animate {
    opacity: 1; transform: none; transition: none;
  }
  .feature:hover, .use-case:hover { transform: none; box-shadow: none; }
  .process--has-line::before { transform: scaleX(1); transition: none; }
  .trust-signals span { opacity: 1; transform: none; }

  /* Pricing */
  .pricing__card, .pricing__card.pricing-animate,
  .pricing__card.pricing-animate .pricing__features li { transition: none !important; animation: none !important; opacity: 1 !important; transform: none !important; }

  /* Nav/scroll */
  .header { transition: none; }
  .header.scrolled { background: var(--color-bg); }
  .scroll-progress__bar { transition: none; }
  .section__index.idx-animate { opacity: 1; transform: none; transition: none; }
  .nav__theme-indicator { transition: none; }

  /* Trust/comparison/timeline */
  .trust-bar__dot { animation: none; }
  .trust-bar--animated .trust-bar__item,
  .terminal--docs.terminal-docs--animated { opacity: 1 !important; transform: none !important; }
  .compare__table--animated tbody tr { opacity: 1 !important; transform: none !important; }
  .timeline--animated .timeline__connector { transform: scaleX(1) !important; }

  /* Blog/content */
  .blog-card, .blog-card--showing, .blog-card--hiding { transition: none; animation: none; opacity: 1; transform: none; }
  .quantum-hero.qh-animate, .content__section.section--animate { opacity: 1; transform: none; transition: none; }
  .page-header--animate .page-header__title,
  .page-header--animate .page-header__desc { opacity: 1; transform: none; transition: none; }
  .blog-card.blog-card--animate { opacity: 1; transform: none; transition: none; }
  .faq__item.faq-animate { opacity: 1; transform: none; transition: none; }
  .warning-box.warning-animate { opacity: 1; transform: none; transition: none; }
  .terminal--docs.terminal-animate { opacity: 1; transform: none; transition: none; }
  .code-copy-btn { transition: none; }

  /* Mobile menu */
  @media (max-width: 900px) {
    .nav__links .nav__link { opacity: 1; transform: none; transition: none; }
  }
}

/* ───────────────────────────────────────────────────────────────
   Nav dropdown groups (flat, click-toggle, no glass)

   IMPORTANT: styles.css:4960 applies `.header, main, footer {
   position: relative; z-index: 1 }` to keep the meteor-canvas layer
   at z-index 0 behind content. That override tied the header to
   the same z-index as main, which meant an absolutely-positioned
   submenu (child of header) painted UNDER main's hero section in
   document order. Bumping the header above main here fixes it.
   ─────────────────────────────────────────────────────────────── */

.header {
  z-index: 100 !important;
}

.nav__group {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.nav__group-toggle {
  background: transparent;
  border: 0;
  padding: 4px 2px;
  margin: -4px -2px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.nav__group-toggle:hover { color: var(--color-text); }

.nav__group-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav__arrow {
  transition: transform var(--duration-normal) var(--ease-out-quart);
  flex-shrink: 0;
  color: currentColor;
}

.nav__group-toggle[aria-expanded="true"] .nav__arrow {
  transform: rotate(180deg);
}

.nav__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 14px;
  min-width: 220px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 1100;
}

[data-theme="light"] .nav__submenu {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.nav__group[data-open="true"] .nav__submenu {
  display: block;
}

/* Invisible hover bridge so the 14px gap does not break cursor intent. */
.nav__group[data-open="true"] .nav__submenu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.nav__sublink {
  display: block;
  padding: 12px 20px;
  min-height: 44px;
  box-sizing: border-box;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.nav__sublink:hover,
.nav__sublink:focus-visible {
  color: var(--color-text);
  background: var(--color-bg-alt);
  outline: none;
}

/* Mobile: dropdowns inline-expand inside the overlay menu
   align with Home/About which are flex-centered text links */
@media (max-width: 900px) {
  .nav__group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav__group-toggle {
    width: auto;
    padding: 12px 8px;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
  }

  .nav__group-toggle:hover,
  .nav__group[data-open="true"] .nav__group-toggle {
    color: var(--color-text);
  }

  .nav__arrow {
    width: 14px;
    height: 9px;
  }

  .nav__submenu {
    position: static;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 4px 0 12px;
    display: none;
    min-width: 0;
    width: auto;
    z-index: auto;
    text-align: center;
  }

  .nav__group[data-open="true"] .nav__submenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .nav__group[data-open="true"] .nav__submenu::before {
    display: none;
  }

  .nav__sublink {
    padding: 10px 16px;
    min-height: 44px;
    font-size: 1.05rem;
    text-align: center;
  }
}

/* Narrow desktop / tablet landscape: keep dropdown from overflowing viewport */
@media (min-width: 901px) and (max-width: 1100px) {
  .nav__submenu {
    min-width: 180px;
    right: auto;
  }
  [data-nav-group="resources"] .nav__submenu {
    left: auto;
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav__arrow { transition: none; }
  .nav__submenu { transition: none; }
}
