/* ════════════════════════════════════════════════════════════════════════════
   PREMIUM ANIMATIONS LAYER  ·  v1.0  ·  2026-04-25
   Tasteful, performant motion for marketing sites. GPU-accelerated transforms
   only. Honors prefers-reduced-motion.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Reveal on scroll (IntersectionObserver-driven; see premium-animations.js) ── */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
[data-reveal="up"]    { transform: translate3d(0, 32px, 0); }
[data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
[data-reveal="right"] { transform: translate3d(32px, 0, 0); }
[data-reveal="zoom"]  { transform: scale(0.96); }
[data-reveal="fade"]  { transform: none; }
[data-reveal].is-revealed { transform: translate3d(0, 0, 0) scale(1); }

/* Stagger delays */
[data-reveal-delay="50"]  { transition-delay: 50ms; }
[data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal-delay="150"] { transition-delay: 150ms; }
[data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal-delay="300"] { transition-delay: 300ms; }
[data-reveal-delay="400"] { transition-delay: 400ms; }
[data-reveal-delay="500"] { transition-delay: 500ms; }

/* ── Hero entrance — runs once on load, no JS required ── */
.ag-hero h1,
.ag-hero .hero-eyebrow,
.ag-hero .eyebrow,
.ag-hero p,
.ag-hero .cta-row {
  animation: agHeroIn 900ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.ag-hero .hero-eyebrow,
.ag-hero .eyebrow { animation-delay: 80ms; }
.ag-hero h1       { animation-delay: 160ms; }
.ag-hero p        { animation-delay: 280ms; }
.ag-hero .cta-row { animation-delay: 400ms; }
@keyframes agHeroIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ── Brand-mark soft float (very subtle, premium feel) ── */
.brand-mark img,
.site-header .brand-mark,
.hero img[src*="emblem"],
.hero img[src*="shield"] {
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), filter 400ms ease;
}
.site-header .brand-mark:hover,
.brand-mark:hover img {
  transform: translateY(-2px);
}

/* ── Hero shield breathing animation ── */
.hero-emblem,
.hero-shield,
.hero img[src*="emblem"],
[data-hero-emblem] {
  animation: agShieldBreathe 6s ease-in-out infinite;
}
@keyframes agShieldBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-3px) scale(1.015); }
}

/* ── Button micro-motion ── */
.btn-primary,
.btn-secondary,
.ag-btn,
.cta-row > a,
.cta-row > button {
  position: relative;
  transition:
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
  will-change: transform;
}
.btn-primary:hover,
.cta-row > a:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 119, 34, 0.28);
}
.btn-primary:active,
.cta-row > a:first-child:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

/* Shimmer pass on primary CTA — runs once */
.btn-primary,
.cta-row > a:first-child {
  overflow: hidden;
}
.btn-primary::after,
.cta-row > a:first-child::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  pointer-events: none;
}
.btn-primary:hover::after,
.cta-row > a:first-child:hover::after {
  animation: agShimmer 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes agShimmer {
  to { transform: translateX(100%); }
}

/* ── Card hover lift ── */
.ag-card,
.brand-card,
[data-card],
.tier-card,
.role-card {
  transition:
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 280ms ease,
    box-shadow 280ms ease;
  will-change: transform;
}
.ag-card:hover,
.brand-card:hover,
[data-card]:hover,
.tier-card:hover,
.role-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 119, 34, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(232, 119, 34, 0.2);
}

/* ── Authority-grid pill stagger ── */
.authority-grid > *,
.ag-authority-grid > *,
[data-authority-grid] > * {
  opacity: 0;
  transform: translateY(8px);
  animation: agAuthIn 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.authority-grid > *:nth-child(1) { animation-delay: 100ms; }
.authority-grid > *:nth-child(2) { animation-delay: 180ms; }
.authority-grid > *:nth-child(3) { animation-delay: 260ms; }
.authority-grid > *:nth-child(4) { animation-delay: 340ms; }
.authority-grid > *:nth-child(5) { animation-delay: 420ms; }
.authority-grid > *:nth-child(6) { animation-delay: 500ms; }
[data-authority-grid] > *:nth-child(1) { animation-delay: 100ms; }
[data-authority-grid] > *:nth-child(2) { animation-delay: 180ms; }
[data-authority-grid] > *:nth-child(3) { animation-delay: 260ms; }
[data-authority-grid] > *:nth-child(4) { animation-delay: 340ms; }
@keyframes agAuthIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Eyebrow pulse dot ── */
.ag-eyebrow::before,
.eyebrow::before,
.hero-eyebrow::before {
  animation: agPulseDot 2.4s ease-in-out infinite;
}
@keyframes agPulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 119, 34, 0.55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 119, 34, 0); transform: scale(1.15); }
}

/* ── Loss-band warning icon attention pulse ── */
.loss-band::before,
.ag-loss-band::before,
[data-loss-band]::before {
  animation: agWarn 3s ease-in-out infinite;
}
@keyframes agWarn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ── Section underline grow on scroll-into-view ── */
[data-section-rule] {
  position: relative;
}
[data-section-rule]::after {
  content: '';
  position: absolute;
  left: 0; bottom: -8px;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--ag-accent, #E87722), transparent);
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1) 200ms;
}
[data-section-rule].is-revealed::after { width: 80px; }

/* ── Form input focus glow ── */
.ag-form input:focus,
.ag-form textarea:focus,
.ag-form select:focus,
input.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: var(--ag-accent, #E87722) !important;
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.18);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* ── Link underline expand ── */
a.link-anim,
.prose a:not(.btn-primary):not(.btn-secondary) {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
a.link-anim:hover,
.prose a:not(.btn-primary):not(.btn-secondary):hover {
  background-size: 100% 1px;
}

/* ── Page-load crossfade ── */
body { animation: agPageIn 600ms ease-out; }
@keyframes agPageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Scanline pass (one-shot on hero entry) ── */
.ag-hero__scanline { will-change: top, opacity; }

/* ── Reduced-motion: disable all decorative animation ── */
@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;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
