/* ==================== KEYFRAMES ==================== */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

@keyframes bar-fill {
  from { width: 0%; }
  to   { width: var(--fill-width, 75%); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes scan-line {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(400%); }
}

@keyframes hero-title-in {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
  0%   { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes type-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-14px); }
}

@keyframes float-y-slow {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes showcase-main-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px) scale(1); }
  50%       { transform: translate(-50%, -50%) translateY(-10px) scale(1.01); }
}

@keyframes showcase-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,200,255,0.12), 0 8px 40px rgba(0,0,0,0.55), 0 0 40px rgba(0,200,255,0.08); }
  50%       { box-shadow: 0 0 0 1px rgba(0,200,255,0.28), 0 12px 50px rgba(0,0,0,0.6), 0 0 80px rgba(0,200,255,0.2); }
}

@keyframes bg-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 10px) scale(0.98); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ==================== HERO CONTENT ENTRANCE ==================== */

.hero-title    { animation: hero-title-in 0.9s cubic-bezier(0.22,1,0.36,1) 0.1s  both; }
.hero-eyebrow  { animation: fade-in-up    0.7s cubic-bezier(0.22,1,0.36,1) 0s    both; }
.hero-subtitle { animation: fade-in-up    0.7s cubic-bezier(0.22,1,0.36,1) 0.2s  both; }
.hero-actions  { animation: fade-in-up    0.7s cubic-bezier(0.22,1,0.36,1) 0.35s both; }
.hero-stats    { animation: fade-in-up    0.7s cubic-bezier(0.22,1,0.36,1) 0.5s  both; }

/* ==================== HERO CARD STACK ==================== */
/*
  ARCHITECTURE — clean separation of concerns:
  ┌──────────────────────────────────────────────────┐
  │ .hero-cards-stack  → parallax via JS inline      │
  │                      style.transform only        │
  │                      NO CSS transform here       │
  │                                                  │
  │ .hero-card         → transition rule only        │
  │                      NO transform/opacity here   │
  │                                                  │
  │ .hero-card.front   → full visual definition      │
  │ .hero-card.middle  → full visual definition      │
  │ .hero-card.back    → full visual definition      │
  │                                                  │
  │ JS assigns .front/.middle/.back classes only     │
  │ JS writes parallax to stack's style.transform    │
  │ ZERO conflicts possible                          │
  └──────────────────────────────────────────────────┘
*/

/* Stack wrapper: NO CSS transform — JS writes it directly via style.transform */
.hero-cards-stack {
  /* intentionally no transform here */
}

/* Base card: transition only — no visual properties */
.hero-card {
  will-change: transform, opacity, filter;
  transition:
    transform  0.9s cubic-bezier(0.22, 1, 0.36, 1),
    opacity    0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter     0.9s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* FRONT: full presence, forward, glowing */
.hero-card.front {
  transform: translate(0px, 0px) scale(1) rotate(-1.5deg);
  opacity: 1;
  filter: blur(0px) brightness(1);
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.2),
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 70px rgba(0, 200, 255, 0.14);
  z-index: 3;
}

/* MIDDLE: receding, slightly blurred */
.hero-card.middle {
  transform: translate(30px, 42px) scale(0.92) rotate(1.8deg);
  opacity: 0.65;
  filter: blur(0.8px) brightness(0.8);
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.07),
    0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* BACK: furthest, most faded, most blurred */
.hero-card.back {
  transform: translate(58px, 80px) scale(0.84) rotate(4.5deg);
  opacity: 0.32;
  filter: blur(2px) brightness(0.65);
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.03),
    0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* ==================== BG GLOWS ==================== */
.bg-glow--1 { animation: bg-drift   18s ease-in-out infinite; }
.bg-glow--2 { animation: bg-drift   22s ease-in-out infinite reverse; }
.bg-glow--3 { animation: glow-pulse  8s ease-in-out infinite; }

/* ==================== GRADIENT ANIMATED BG ==================== */
.gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

/* ==================== TYPING CURSOR ==================== */
.cursor-blink::after {
  content: '|';
  animation: type-cursor 0.8s ease-in-out infinite;
  color: var(--color-accent);
}

/* ==================== SCAN LINE ==================== */
.has-scan-line { overflow: hidden; position: relative; }
.has-scan-line::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.3), transparent);
  animation: scan-line 4s linear infinite;
  pointer-events: none;
}

/* ==================== REDUCED MOTION ==================== */
@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;
  }
  .hero-card { transition: none !important; will-change: auto; }
  .bg-glow--1, .bg-glow--2, .bg-glow--3 { animation: none !important; }
}

/* ==================== SHOWCASE CARD ANIMATIONS ==================== */

.showcase-card--main {
  animation:
    showcase-main-float  6s ease-in-out infinite,
    showcase-glow-pulse  4s ease-in-out infinite;
}

.showcase-card--floating-1 {
  animation: float-y      4s ease-in-out infinite;
}

.showcase-card--floating-2 {
  animation: float-y-slow 5.5s ease-in-out infinite reverse;
}

@media (prefers-reduced-motion: reduce) {
  .showcase-card--main,
  .showcase-card--floating-1,
  .showcase-card--floating-2 {
    animation: none !important;
  }
}

/* ==================== SHOWCASE TYPEWRITER ==================== */
.tw-cursor {
  display: inline-block;
  width: 2px;
  background: var(--color-accent);
  color: transparent;
  animation: type-cursor 0.7s ease-in-out infinite;
  margin-left: 1px;
  vertical-align: text-bottom;
  font-size: 0.9em;
}

.tw-line {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.tw-line:last-child {
  margin-bottom: 0;
}