/* Iron Elite — cinematic CSS motion (no JS required for core effects) */

/* Hero — raw intensity motion */
@media (prefers-reduced-motion: no-preference) {
  .hero--intense.no-video .hero-poster,
  .hero--intense.has-video .hero-video {
    animation: heroKen 18s ease-in-out infinite alternate;
  }
  .hero-chalk {
    animation: chalkDrift 14s ease-in-out infinite alternate;
  }
  .hero-streak {
    animation: streakSlide 6s ease-in-out infinite;
  }
  .hero--intense .hero-light-leak--blue {
    animation: cinematicGlow 7s ease-in-out infinite alternate;
  }
  .hero--intense .hero-light-leak--orange {
    animation: cinematicGlow 9s ease-in-out infinite alternate-reverse;
  }
  .hero-title--impact .hero-title__main {
    animation: titlePulse 4s ease-in-out infinite alternate;
  }
}
@keyframes heroKen {
  from { transform: scale(1.06); filter: contrast(1.1) saturate(1.05); }
  to { transform: scale(1.14) translate(-1.2%, -0.8%); filter: contrast(1.18) saturate(1.12); }
}
@keyframes chalkDrift {
  from { transform: translateY(0); opacity: 0.55; }
  to { transform: translateY(-16px); opacity: 0.9; }
}
@keyframes streakSlide {
  0%, 100% { transform: rotate(-4deg) translateX(-8%); opacity: 0.25; }
  50% { transform: rotate(-4deg) translateX(12%); opacity: 0.8; }
}
@keyframes titlePulse {
  from { text-shadow: 0 4px 40px rgba(0,0,0,.8), 0 0 60px rgba(242,140,0,.12); }
  to { text-shadow: 0 4px 48px rgba(0,0,0,.9), 0 0 100px rgba(255,138,0,.18); }
}

/* Hero entrance */
.hero-inner > * {
  opacity: 0;
  animation: heroIn 0.9s var(--ease) forwards;
}
.hero-kicker { animation-delay: 0.1s; }
.hero-title { animation-delay: 0.22s; }
.hero-sub { animation-delay: 0.38s; }
.hero-acts { animation-delay: 0.5s; }
.hero-stats--inline,
.hero-metrics { animation-delay: 0.62s; }
.hero-wall-panel[aria-hidden="true"] {
  display: none;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroPanelIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

.hero-scroll {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--w40);
  animation: heroIn 0.8s var(--ease) 0.85s forwards;
  opacity: 0;
}
.hero-scroll__line {
  width: 1px; height: 28px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Film grain overlay (hero + store) — skip bright card hero */
.hero:not(.hero--bright):not(.hero--impact)::after,
.store-hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Gradient fallback when poster + video missing */
.hero.no-video.hero--no-poster .hero-fallback { opacity: 1; }
.hero.no-video:not(.hero--no-poster) .hero-fallback { opacity: 0; }

/* Ken-burns on placeholder backgrounds */
.media-frame.is-missing .media-ph::before {
  animation: kenBurns 18s ease-in-out infinite alternate;
}
@keyframes kenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Staggered scroll reveals */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.is-in > * {
  opacity: 1;
  transform: none;
}

/* Performance lab section */
.performance {
  position: relative;
  padding: var(--section-y) clamp(24px, 5vw, 56px);
  background: var(--bg);
  overflow: hidden;
}
.performance::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(0, 51, 255, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 85% 30%, rgba(224, 140, 36, 0.08), transparent);
  pointer-events: none;
}
.perf-scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 51, 255, 0.03) 50%,
    transparent 100%
  );
  background-size: 100% 200%;
  animation: perfScan 8s linear infinite;
}
@keyframes perfScan {
  from { background-position: 0 -100%; }
  to { background-position: 0 100%; }
}
.perf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
}
.perf-card {
  background: var(--p1);
  padding: 32px 24px 36px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid transparent;
  transition: border-color 0.35s, background 0.35s;
}
.perf-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.perf-card:hover {
  background: var(--p2);
  border-bottom-color: var(--blue);
}
.perf-card:hover::after { transform: scaleX(1); }
.perf-icon {
  width: 40px; height: 40px;
  border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.perf-icon svg { width: 18px; height: 18px; stroke: var(--blue-hi); }
.perf-name {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  margin-bottom: 8px;
}
.perf-desc {
  font-size: 13px; color: var(--w40); line-height: 1.55;
  margin-bottom: 20px;
}
.perf-meter {
  height: 3px; background: var(--p3); overflow: hidden;
}
.perf-meter span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  transition: width 1.4s var(--ease);
}
.reveal.is-in .perf-card:nth-child(1) .perf-meter span { transition-delay: 0.2s; width: 88%; }
.reveal.is-in .perf-card:nth-child(2) .perf-meter span { transition-delay: 0.35s; width: 94%; }
.reveal.is-in .perf-card:nth-child(3) .perf-meter span { transition-delay: 0.5s; width: 91%; }
.reveal.is-in .perf-card:nth-child(4) .perf-meter span { transition-delay: 0.65s; width: 86%; }

/* Program card shimmer */
.prog-card--feat {
  animation: featGlow 4s ease-in-out infinite alternate;
}
@keyframes featGlow {
  from { box-shadow: inset 0 0 0 transparent; }
  to { box-shadow: inset 0 0 60px rgba(0, 51, 255, 0.06); }
}

/* Dev pillars pulse number */
.dev-pillar-n {
  animation: pillarPop 0.6s var(--ease) backwards;
}
.reveal.is-in .dev-pillar:nth-child(1) .dev-pillar-n { animation-delay: 0.15s; }
.reveal.is-in .dev-pillar:nth-child(2) .dev-pillar-n { animation-delay: 0.28s; }
.reveal.is-in .dev-pillar:nth-child(3) .dev-pillar-n { animation-delay: 0.41s; }
@keyframes pillarPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}

/* Collage cell hover lift */
.collage-cell {
  transition: transform 0.45s var(--ease);
}
.collage-cell:hover {
  transform: translateY(-6px);
}

/* Results lab scan */
.results-lab__visual::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-hi), transparent);
  opacity: 0.5;
  animation: perfScan 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

/* Cinematic band */
@media (prefers-reduced-motion: no-preference) {
  .cinematic-band__media .cinematic-band__poster,
  .cinematic-band.has-video .cinematic-band__video {
    animation: cinematicKen 22s ease-in-out infinite alternate;
  }
  .cinematic-band__glow--blue {
    animation: cinematicGlow 8s ease-in-out infinite alternate;
  }
  .cinematic-band__glow--orange {
    animation: cinematicGlow 10s ease-in-out infinite alternate-reverse;
  }
  .cinematic-band.is-in .cinematic-band__line {
    animation: heroIn 0.85s var(--ease) forwards;
    opacity: 0;
  }
  .cinematic-band.is-in .cinematic-band__line:nth-child(1) { animation-delay: 0.12s; }
  .cinematic-band.is-in .cinematic-band__line:nth-child(2) { animation-delay: 0.28s; }
  .cinematic-band.is-in .cinematic-band__eyebrow { animation: heroIn 0.75s var(--ease) forwards; opacity: 0; }
  .cinematic-band.is-in .cinematic-band__lead { animation: heroIn 0.85s var(--ease) 0.42s forwards; opacity: 0; }
}
@keyframes cinematicKen {
  from { transform: scale(1.04); }
  to { transform: scale(1.1) translate(-1.2%, -0.8%); }
}
@keyframes cinematicGlow {
  from { opacity: 0.35; transform: scale(0.95); }
  to { opacity: 0.65; transform: scale(1.05); }
}

/* Lab identity — scan line & HUD pulse */
@media (prefers-reduced-motion: no-preference) {
  .lab-scan {
    animation: labScanSweep 5s ease-in-out infinite;
  }
  .hero--lab .lab-grid {
    animation: labGridDrift 18s ease-in-out infinite alternate;
  }
  .home-flow .page-section.reveal.is-in .lab-scan {
    animation: labScanReveal 0.9s var(--ease, ease) forwards, labScanSweep 5s ease-in-out 0.9s infinite;
  }
  .telemetry-chip {
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
  }
  .hero--lab .telemetry-chip:hover {
    border-color: rgba(0, 174, 239, 0.45);
    box-shadow: 0 0 16px rgba(0, 174, 239, 0.15);
  }
  .telemetry-chip--orange:hover {
    border-color: rgba(255, 160, 60, 0.5);
    box-shadow: 0 0 16px rgba(255, 160, 60, 0.12);
  }
}
@keyframes labScanSweep {
  0%, 100% { opacity: 0.35; transform: scaleX(0.92); }
  50% { opacity: 0.75; transform: scaleX(1); }
}
@keyframes labScanReveal {
  from { opacity: 0; transform: scaleX(0.4); }
  to { opacity: 0.55; transform: scaleX(1); }
}
@keyframes labGridDrift {
  from { opacity: 0.28; transform: translate(0, 0); }
  to { opacity: 0.42; transform: translate(-6px, 4px); }
}

/* CTA ambient pulse */
.cta-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 40% at 50% 0%, rgba(242, 140, 0, 0.15), transparent);
  animation: ctaPulse 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes ctaPulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .perf-grid { grid-template-columns: 1fr; }
  .hero-scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lab-scan,
  .hero--lab .lab-grid {
    animation: none !important;
  }
  .hero-inner > *,
  .hero-scroll,
  .hero--intense .hero-poster,
  .hero--intense .hero-video,
  .hero-chalk,
  .hero-streak,
  .hero-light-leak--blue,
  .hero-light-leak--orange,
  .hero-title--impact .hero-title__main,
  .cinematic-band__poster,
  .cinematic-band__video,
  .cinematic-band__glow--blue,
  .cinematic-band__glow--orange,
  .cinematic-band__line,
  .cinematic-band__eyebrow,
  .cinematic-band__lead,
  .results-lab__visual::after,
  .media-frame.is-missing .media-ph::before,
  .perf-scan,
  .perf-meter span,
  .prog-card--feat,
  .dev-pillar-n,
  .cta-bg::after {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
