/* ── Cursor blink ───────────────────────────────────────── */

@keyframes typing {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Entrance: fade up ──────────────────────────────────── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Stat bar change pulse ──────────────────────────────── */

@keyframes statPulse {
  0%   { transform: scaleX(1); }
  50%  { transform: scaleX(1.05); }
  100% { transform: scaleX(1); }
}

/* ── Burnout flicker (use when burnout > 80%) ───────────── */

@keyframes burnoutFlicker {
  0%,  100% { opacity: 1;   background-color: var(--color-accent-red); }
  20%        { opacity: 0.6; background-color: #ff6b6b; }
  40%        { opacity: 1;   background-color: var(--color-accent-red); }
  60%        { opacity: 0.4; background-color: #ff2e2e; }
  80%        { opacity: 0.9; background-color: var(--color-accent-red); }
}

/* ── Feedback slide in from right ───────────────────────── */

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Credits slow scroll ────────────────────────────────── */

@keyframes creditsScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-100%); }
}

/* ── Burnout: background gradient pulse ─────────────────── */

@keyframes burnoutBg {
  0%,  100% { background-position: 0% 0%;   }
  50%        { background-position: 0% 100%; }
}

/* ── Burnout: emoji scale pulse ─────────────────────────── */

@keyframes burnoutPulse {
  0%,  100% { transform: scale(1);    opacity: 1;   }
  40%        { transform: scale(1.2); opacity: 0.9; }
  60%        { transform: scale(0.9); opacity: 1;   }
}

/* ── Confetti dot falling ────────────────────────────────── */

@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(340px) rotate(720deg); opacity: 0; }
}

/* ── Disaster: red border flicker ────────────────────────── */

@keyframes disasterBorderFlicker {
  0%,  100% { border-color: var(--color-accent-red);  box-shadow: 0 0 12px rgba(248,81,73,0.5); }
  25%        { border-color: #ff2e2e;                  box-shadow: 0 0 24px rgba(248,81,73,0.8); }
  50%        { border-color: var(--color-accent-red);  box-shadow: 0 0  6px rgba(248,81,73,0.3); }
  75%        { border-color: #cc2200;                  box-shadow: 0 0 20px rgba(248,81,73,0.7); }
}

/* ── Utility classes ────────────────────────────────────── */

.animate-fadeInUp {
  animation: fadeInUp 0.3s ease both;
}

.animate-typing-cursor::after {
  content: '|';
  display: inline-block;
  margin-left: 2px;
  animation: typing 1s step-end infinite;
}

.animate-stat-pulse {
  animation: statPulse 0.4s ease;
}

.animate-burnout-flicker {
  animation: burnoutFlicker 1.2s ease-in-out infinite;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease both;
}

@keyframes flickerLoop {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Level-up card: springs in from below with slight overshoot */
@keyframes levelUpCard {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Level-up emoji: bounces in */
@keyframes levelUpEmoji {
  from { opacity: 0; transform: scale(0.4) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1)   rotate(0deg); }
}

/* ── Vendor ad: badge pulse (incident) ───────────────────── */

@keyframes vendorAdBadgePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.animate-vendor-ad-badge-pulse {
  animation: vendorAdBadgePulse 1.5s ease-in-out infinite;
}

/* ── Vendor ad: phone call ring ─────────────────────────── */

@keyframes vendorAdPhoneRing {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.animate-vendor-ad-phone-ring {
  animation: vendorAdPhoneRing 1s ease-in-out infinite;
}

/* ── Intro overlay ───────────────────────────────────────── */

#intro-overlay {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.intro-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-beat.active { opacity: 1; }

/* Beat 1 — consulting firm logo */
.intro-beat1-line1,
.intro-beat1-line2 {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #A0A0A0;
  font-size: 0.9rem;
  transition: opacity 0.4s ease;
}

.intro-beat1-line2 {
  margin-top: 12px;
  font-size: 0.7rem;
  color: #989898;
  opacity: 0;
}

/* Beat 2 — loading bar */
.intro-beat2-host {
  font-family: monospace;
  color: #00ff41;
  font-size: 0.7rem;
}

.intro-beat2-status {
  font-family: monospace;
  color: #00ff41;
  font-size: 0.7rem;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.intro-loadbar-track {
  width: 280px;
  height: 3px;
  background: #1a1a1a;
  margin-top: 12px;
  border-radius: 2px;
  overflow: hidden;
}

.intro-loadbar-fill {
  height: 100%;
  width: 0%;
  background: #00ff41;
  transition: width 1.2s linear;
  border-radius: 2px;
}

/* Beat 3 — notifications */
.intro-notification-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  width: 100%;
  max-width: 360px;
}

.intro-notification {
  background: white;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 4px 0;
  font-size: 0.82rem;
  width: 320px;
  max-width: calc(100vw - 48px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.intro-notification.visible {
  transform: translateX(0);
}

.intro-notification.shake {
  animation: notifShake 0.3s ease;
}

@keyframes notifShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* Beat 4 — task lines */
.intro-beat4-line1 {
  color: white;
  font-size: 1.4rem;
  font-weight: normal;
}

.intro-beat4-line2 {
  color: #E8622A;
  font-size: 1rem;
  font-style: italic;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-beat4-line3 {
  color: #A0A0A0;
  font-size: 0.85rem;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Beat 5 — Dieter typing (bottom right) */
.intro-beat5 {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

.intro-beat5-text {
  color: #989898;
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.4s ease, color 0.3s ease;
}

/* Beat 6 & 7 — title card */
.intro-beat6-byline {
  color: #989898;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-title-wrap {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-title {
  font-weight: bold;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: white;
  letter-spacing: 0.1em;
  margin: 0;
  opacity: 0;
  transform: translateY(40px);
}

@keyframes titleSlam {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.intro-beat6-subtitle {
  color: #A0A0A0;
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-title-line {
  height: 2px;
  background: #E8622A;
  width: 0;
  transition: width 0.4s ease;
  margin: 16px 0 12px;
}

.intro-title-line.drawn { width: 200px; }

.intro-beat6-copy {
  color: #B0B0B0;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.intro-beat6-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intro-beat6-content .intro-beat6-byline,
.intro-beat6-content .intro-beat6-subtitle,
.intro-beat6-content .intro-beat6-copy {
  opacity: 1;
}

.intro-press-hint {
  position: absolute;
  bottom: 32px;
  color: #989898;
  font-size: 0.75rem;
  animation: introPulse 1.2s ease-in-out infinite;
}

@keyframes introPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
