*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: transparent;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.preview-mode {
  background: radial-gradient(ellipse 110% 75% at 50% 45%, #1a1408 0%, #0c0a06 100%);
}

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.nfa-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nfa-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(92vw, 720px);
  padding: 4px 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  transform: translateY(28px) scale(0.94);
  filter: blur(6px);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s ease;
}

.nfa-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.nfa-card.is-hiding {
  opacity: 0;
  transform: translateY(-18px) scale(0.96);
  filter: blur(4px);
  transition-duration: 0.6s;
}

.nfa-card.is-electric .headline .word.is-visible {
  animation: textElectric 2.8s ease-in-out infinite;
}

.nfa-card.is-electric .word.accent.is-visible {
  animation: textElectricAccent 2.2s ease-in-out infinite;
}

.nfa-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #1a1408;
  background: linear-gradient(160deg, #f0d878 0%, #d4af37 100%);
  border-radius: 50%;
  box-shadow:
    0 0 16px rgba(212, 175, 55, 0.65),
    0 0 32px rgba(255, 255, 200, 0.25);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.4s ease,
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
}

.nfa-card.is-electric .nfa-icon.is-visible {
  animation: iconElectric 1.4s ease-in-out infinite;
}

.nfa-icon.is-visible {
  opacity: 1;
  transform: scale(1);
}

.headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.45em;
  font-size: clamp(1.35rem, 4.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff8e7;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.8),
    0 0 24px rgba(212, 175, 55, 0.35);
}

.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s ease,
    color 0.35s ease,
    text-shadow 0.35s ease;
}

.word.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.word.accent.is-visible {
  color: #f0d878;
  text-shadow:
    0 0 20px rgba(212, 175, 55, 0.75),
    0 2px 12px rgba(0, 0, 0, 0.8);
}

/* Percikan listrik di sekitar teks */
.electric-sparks {
  position: absolute;
  inset: -40px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

.nfa-wrap:has(.nfa-card.is-electric) .electric-sparks {
  opacity: 1;
}

.spark {
  position: absolute;
  width: 2px;
  height: 28px;
  background: linear-gradient(
    to bottom,
    transparent,
    #fffef0 35%,
    #f0d878 55%,
    transparent
  );
  border-radius: 2px;
  opacity: 0;
  filter: drop-shadow(0 0 6px #f0d878);
  transform-origin: center bottom;
}

.nfa-wrap:has(.nfa-card.is-electric) .spark {
  animation: sparkFlicker 0.35s ease-out infinite;
}

.spark--1 {
  left: 8%;
  top: 20%;
  transform: rotate(-25deg);
  animation-delay: 0s;
}

.spark--2 {
  right: 10%;
  top: 15%;
  transform: rotate(20deg);
  animation-delay: 0.12s;
}

.spark--3 {
  left: 22%;
  bottom: 18%;
  height: 22px;
  transform: rotate(-8deg);
  animation-delay: 0.22s;
}

.spark--4 {
  right: 18%;
  bottom: 22%;
  height: 24px;
  transform: rotate(12deg);
  animation-delay: 0.08s;
}

@keyframes textElectric {
  0%,
  100% {
    text-shadow:
      0 2px 12px rgba(0, 0, 0, 0.8),
      0 0 12px rgba(212, 175, 55, 0.3);
  }
  45% {
    text-shadow:
      0 2px 12px rgba(0, 0, 0, 0.8),
      0 0 22px rgba(255, 255, 220, 0.85),
      0 0 36px rgba(212, 175, 55, 0.55);
  }
  48% {
    text-shadow:
      0 2px 12px rgba(0, 0, 0, 0.8),
      0 0 8px rgba(212, 175, 55, 0.2);
  }
  50% {
    text-shadow:
      0 2px 12px rgba(0, 0, 0, 0.8),
      0 0 28px rgba(255, 255, 255, 0.95),
      0 0 48px rgba(212, 175, 55, 0.7);
  }
}

@keyframes textElectricAccent {
  0%,
  100% {
    color: #f0d878;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.6);
  }
  50% {
    color: #fffef0;
    text-shadow:
      0 0 28px rgba(255, 255, 255, 0.95),
      0 0 48px rgba(212, 175, 55, 0.85);
  }
}

@keyframes iconElectric {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(212, 175, 55, 0.5),
      0 0 28px rgba(255, 255, 200, 0.2);
  }
  50% {
    box-shadow:
      0 0 24px rgba(255, 255, 220, 0.9),
      0 0 48px rgba(212, 175, 55, 0.65);
  }
}

@keyframes sparkFlicker {
  0%,
  100% {
    opacity: 0;
    transform: scaleY(0.4);
  }
  8% {
    opacity: 1;
    transform: scaleY(1);
  }
  20% {
    opacity: 0;
  }
}
