/* Small, finite CSS interactions; no animation libraries or scroll listeners. */
:root { --interaction-ease: cubic-bezier(.22, 1, .36, 1); }

.brand-logo { transition: transform 300ms var(--interaction-ease); }
.nav-shell, .card {
  transition: border-color 260ms ease, box-shadow 260ms ease;
}
.nav-shell:focus-within {
  border-bottom-color: rgba(108,99,255,0.3);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), inset 0 -1px 0 rgba(108,99,255,0.2);
}
.card:focus-within {
  border-color: rgba(108,99,255,0.2);
  box-shadow: 0 12px 40px rgba(108,99,255,0.08);
}

/* Crossfade hover effect for nav links */
.nav-links a {
  position: relative;
  isolation: isolate;
  background: transparent;
  box-shadow: none;
  transition: color 220ms ease, box-shadow 280ms ease,
    transform 280ms var(--interaction-ease);
}
.nav-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(108,99,255,0.2), rgba(44,184,169,0.12));
  box-shadow: inset 0 0 0 1px rgba(108,99,255,0.15);
  opacity: 0;
  transition: opacity 280ms ease;
}
.nav-links a:hover, .nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.nav-links a:hover::before, .nav-links a:focus-visible::before,
.nav-links a[aria-current="page"]::before { opacity: 1; }

.btn, .source-tabs button, .segmented button, .menu-button,
.text-btn, .dialog-close, .citation-actions button, .footer-links a {
  transition: color 220ms ease, background-color 240ms ease,
    border-color 240ms ease, box-shadow 280ms ease,
    transform 280ms var(--interaction-ease);
}
.btn:hover:not(:disabled), .btn:focus-visible {
  box-shadow: 0 6px 22px rgba(108,99,255,0.12);
}
.btn.primary:hover:not(:disabled), .btn.primary:focus-visible {
  background: linear-gradient(135deg,#5b52f0,#4840c8);
  border-color: #5046d6;
  color: #fff;
  box-shadow: 0 8px 28px rgba(108,99,255,0.3);
}
.source-tabs button:hover:not(:disabled) {
  box-shadow: 0 5px 18px rgba(108,99,255,0.1);
}
.menu-button:hover, .menu-button[aria-expanded="true"] {
  background: rgba(108,99,255,0.2);
  border-color: rgba(108,99,255,0.3);
  color: #fff;
}
.btn:disabled { transform: none; }

/* Entrance animations */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .brand:hover .brand-logo { transform: rotate(-3deg) scale(1.05); }
  .nav-links a:hover { transform: translateY(-1px); }
  .btn:hover:not(:disabled), .source-tabs button:hover:not(:disabled),
  .menu-button:hover { transform: translateY(-2px); }
  .segmented button:hover:not(:disabled), .text-btn:hover,
  .dialog-close:hover { transform: translateY(-1px); }
  .footer-links a:hover { transform: translateX(4px); }
  .feature-card:hover { transform: translateY(-4px); }
  .source-type-card:hover { transform: translateY(-2px); }
  .trust-badge:hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn:active:not(:disabled), .source-tabs button:active:not(:disabled),
  .segmented button:active:not(:disabled), .nav-links a:active,
  .menu-button:active, .text-btn:active, .dialog-close:active {
    transform: translateY(0) scale(.98);
    transition-duration: 100ms;
  }
  .tool-grid > .card { animation: fade-up 500ms var(--interaction-ease) both; }
  .tool-grid > .card:nth-child(2) { animation-delay: 80ms; }
  .hero h1 { animation: fade-up 600ms var(--interaction-ease) both; }
  .hero .eyebrow { animation: fade-up 400ms var(--interaction-ease) both; }
  .hero .intro { animation: fade-up 500ms 100ms var(--interaction-ease) both; }
  .faq-list details[open] p { animation: fade-up 180ms ease-out; }
  .nav-links.open { animation: fade-up 240ms var(--interaction-ease); }

  /* New section animations */
  .trust-badges { animation: fade-up 500ms 200ms var(--interaction-ease) both; }
  .feature-card { animation: fade-up 500ms var(--interaction-ease) both; }
  .feature-card:nth-child(2) { animation-delay: 100ms; }
  .feature-card:nth-child(3) { animation-delay: 200ms; }
  .step-card { animation: scale-in 450ms var(--interaction-ease) both; }
  .step-card:nth-child(2) { animation-delay: 120ms; }
  .step-card:nth-child(3) { animation-delay: 240ms; }
  .source-type-card { animation: fade-up 400ms var(--interaction-ease) both; }
  .source-type-card:nth-child(2) { animation-delay: 60ms; }
  .source-type-card:nth-child(3) { animation-delay: 120ms; }
  .source-type-card:nth-child(4) { animation-delay: 180ms; }
  .source-type-card:nth-child(5) { animation-delay: 240ms; }
  .source-type-card:nth-child(6) { animation-delay: 300ms; }
  .why-trust-card { animation: fade-up 600ms var(--interaction-ease) both; }
}
@keyframes settle-in {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-logo, .nav-shell, .card, .btn, .btn:active, .source-tabs button,
  .segmented button, .nav-links, .nav-links a, .nav-links a::before,
  .menu-button, .text-btn, .dialog-close, .citation-actions button,
  .footer-links a, .faq-list details[open] p, .feature-card, .step-card,
  .source-type-card, .trust-badge, .why-trust-card {
    transition: none;
    animation: none;
    transform: none;
  }
  html { scroll-behavior: auto; }
}
