/*!
 * MSIIA — Performance Intelligence page styles (2026-07-20).
 * Combines the redesign's inline helmet <style> block with the
 * shared motion.css keyframes the redesign author uses for scroll-
 * reveal + page-in animations.
 * Paired with assets/pages/performance.js.
 */

/* ── Redesign helmet inline styles ──────────────────────────── */
body { margin: 0; }
    main.performance-main a { color: var(--gold); }
    main.performance-main a:hover { color: var(--gold-bright); }

    /* Italic gold accent inside performance headings.
     * The redesign shipped inline style="..." on every <em>, but the
     * i18n runtime replaces innerHTML with the translated value which
     * strips those inline styles. This scoped rule guarantees the
     * accent word keeps its serif italic + gold treatment across all
     * locales without needing per-translation style attributes. */
    main.performance-main h1 em,
    main.performance-main h2 em {
      font-family: var(--font-serif);
      font-style: italic;
      font-weight: 500;
      color: var(--gold);
      text-transform: none;
      letter-spacing: 0.01em;
    }
    @keyframes pfPulse { 0%,100% { opacity:1; } 50% { opacity:0.35; } }
    @keyframes pfDrift { 0%,100% { transform:translateY(0); opacity:0.85; } 50% { transform:translateY(-10px); opacity:1; } }
    @keyframes pfSweep { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
    /* shell compat for header/footer variants not in this site.css build */
    .header-auth-btn--register { background: rgba(200,169,110,0.14); border-color: rgba(200,169,110,0.4); color: var(--gold-bright); }
    .footer-legal-bar { display:flex; flex-wrap:wrap; gap:10px 26px; justify-content:center; padding:18px 24px 0; border-top:1px solid rgba(200,169,110,0.1); margin-top:34px; }
    .footer-legal-bar a { font-family:var(--font-mono); font-size:0.58rem; letter-spacing:0.18em; text-transform:uppercase; color:var(--text-muted); text-decoration:none; }
    .footer-legal-bar a:hover { color: var(--gold); }
    @media (max-width: 960px) {
      .pf-split { grid-template-columns: 1fr !important; align-items: start !important; }
      .pf-two { grid-template-columns: 1fr !important; }
      .pf-hide-sm { display: none !important; }
    }
    @media (prefers-reduced-motion: reduce) {
      .pf-anim { animation: none !important; }
    }

/* ── Motion runtime CSS (from the redesign's assets/motion.css) ── */
/* ──────────────────────────────────────────────────────────
   MSIIA · motion.css
   Page-load · scroll-reveal · hover · background motion.
   Cooperates with site.js (which already adds .reveal +
   .is-visible to [data-reveal] / [data-reveal-children]).

   Motion philosophy: subtle, measured, institutional.
   No bounces, no springs, no overshoot. Always honors
   prefers-reduced-motion.
   ────────────────────────────────────────────────────────── */

/* ── A. Page load — fade + slight upward drift ──── */
@keyframes msiia-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes msiia-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes msiia-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

@keyframes msiia-scale-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* Background — slow gold glow breathing */
@keyframes msiia-glow-breath {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.025); }
}

/* Status dot — 2.4s pulse */
@keyframes msiia-pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Hover icon — quarter rotate (used on system-card icons) */
@keyframes msiia-icon-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(8deg); }
}

/* Scroll progress — gold strip at the very top */
.msiia-scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: var(--z-header, 50);
  pointer-events: none;
  background: transparent;
}
.msiia-scroll-progress::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--scroll-progress, 0%);
  background: linear-gradient(90deg,
    rgba(200,169,110,0.0) 0%,
    rgba(200,169,110,0.65) 50%,
    rgba(229,203,140,0.95) 100%);
  box-shadow: 0 0 12px rgba(229,203,140,0.45);
  transition: width 80ms linear;
}

/* ── B. Scroll-reveal helpers (additive to site.css) ──
   site.css already styles [data-reveal] + [data-reveal-children];
   these utility classes give finer-grained control on individual
   nodes inside an existing reveal block.
   ──────────────────────────────────────────────────── */
.animate-fade-in {
  opacity: 0;
  animation: msiia-fade-in var(--reveal-duration, 720ms) var(--ease) forwards;
}
.animate-fade-up {
  opacity: 0;
  animation: msiia-fade-up var(--reveal-duration, 720ms) var(--ease) forwards;
}
.animate-scale-in {
  opacity: 0;
  animation: msiia-scale-in var(--reveal-duration, 720ms) var(--ease) forwards;
}
.animate-glow-pulse {
  animation: msiia-glow-breath 6.4s var(--ease) infinite;
}

/* Stagger delays (use on sibling .animate-* nodes) */
.animate-delay-1 { animation-delay: 80ms;  }
.animate-delay-2 { animation-delay: 160ms; }
.animate-delay-3 { animation-delay: 240ms; }
.animate-delay-4 { animation-delay: 320ms; }
.animate-delay-5 { animation-delay: 400ms; }
.animate-delay-6 { animation-delay: 480ms; }

/* ── C. Hover motion — applied via utility classes ── */
.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
  border-color: var(--gold-border-strong);
}
.hover-lift-strong:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-gold-intense);
}

.hover-glow {
  transition: box-shadow var(--transition), filter var(--transition);
}
.hover-glow:hover {
  box-shadow: 0 0 0 1px var(--gold-border-strong),
              0 0 24px var(--gold-glow);
  filter: drop-shadow(0 0 12px rgba(200,169,110,0.25));
}

.hover-icon-rotate svg {
  transition: transform var(--transition);
}
.hover-icon-rotate:hover svg {
  transform: rotate(8deg) scale(1.04);
}

/* ── D. Background motion — radial glow breathing ── */
.bg-glow-breathing::before {
  animation: msiia-glow-breath 8s var(--ease) infinite;
}

/* ── Reduced motion override ───────────────────────
   Always honor user preference. We don't strip transitions
   entirely — institutional UI still benefits from gentle
   color/border transitions — but disable all transforms
   and looping animations.
   ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .animate-fade-in,
  .animate-fade-up,
  .animate-scale-in {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .hover-lift:hover,
  .hover-lift-strong:hover {
    transform: none !important;
  }

  .msiia-scroll-progress::after {
    transition: none !important;
  }
}

/* Respect the explicit data-reduced-motion="true" toggle
   site.js may set on <html>. */
html[data-reduced-motion="true"] .animate-fade-in,
html[data-reduced-motion="true"] .animate-fade-up,
html[data-reduced-motion="true"] .animate-scale-in {
  opacity: 1;
  transform: none;
  animation: none;
}
html[data-reduced-motion="true"] .animate-glow-pulse,
html[data-reduced-motion="true"] .bg-glow-breathing::before {
  animation: none;
}
