body.intro-active {
  overflow: hidden;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  transition: opacity 0.48s ease, transform 0.48s ease;
}

.intro.leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.intro-glow {
  position: absolute;
  width: min(84vw, 560px);
  height: min(84vw, 560px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(2, 191, 210, 0.24), transparent 55%),
    radial-gradient(circle at 72% 32%, rgba(235, 87, 126, 0.26), transparent 55%),
    radial-gradient(circle at 52% 76%, rgba(255, 208, 117, 0.2), transparent 58%);
  filter: blur(42px);
  opacity: 0;
}

.intro-stage {
  --intro-mark-size: 168px;
  position: relative;
  width: min(80vw, 360px);
  height: 340px;
}

.intro-studio,
.intro-game {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.intro-studio {
  gap: 20px;
}

.studio-symbol {
  width: calc(var(--intro-mark-size) * 1.52);
  height: calc(var(--intro-mark-size) * 1.16);
  overflow: hidden;
}

.studio-symbol img {
  display: block;
  width: 100%;
  height: auto;
}

.intro-studio > span {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 1.2px;
}

.intro-studio strong {
  font-weight: 800;
}

.intro-mark {
  width: var(--intro-mark-size);
  height: var(--intro-mark-size);
  margin-bottom: 24px;
  overflow: visible;
}

.mark-frame {
  stroke-dasharray: 820;
  stroke-dashoffset: 820;
}

.mark-m {
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
}

.mark-bar {
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
}

.mark-spark {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.intro-wordmark {
  text-align: center;
  font-family: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 4.5px;
  opacity: 0;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-property {
  position: absolute;
  bottom: max(36px, env(safe-area-inset-bottom));
  left: 64px;
  right: 64px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.intro-skip {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  right: max(22px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.intro-skip svg {
  width: 16px;
  height: 16px;
}

.intro-skip:hover {
  transform: translateY(-1px);
  border-color: var(--accent-coral);
}

/* Playback timeline */
.intro.playing .intro-glow {
  animation: glow-bloom 2.6s 0.2s ease both;
}

.intro.playing .intro-studio {
  animation: studio-arrive 1.25s ease both;
}

.intro.playing .intro-game {
  animation: game-arrive 0.55s 1.05s ease both;
}

.intro.playing .mark-frame {
  animation: stroke-draw 0.72s 1.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro.playing .mark-m {
  animation: stroke-draw 0.76s 1.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro.playing .mark-bar {
  animation: stroke-draw 0.42s 1.56s ease both;
}

.intro.playing .mark-spark-main {
  animation: spark-pop 0.5s 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.intro.playing .mark-spark-left {
  animation: spark-pop 0.45s 1.62s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.intro.playing .mark-spark-right {
  animation: spark-pop 0.45s 1.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.intro.playing .intro-wordmark {
  animation: wordmark-land 0.65s 1.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes glow-bloom {
  0% { opacity: 0; transform: scale(0.7); }
  45% { opacity: 0.9; transform: scale(1.06); }
  100% { opacity: 0.65; transform: scale(1); }
}

@keyframes studio-arrive {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  28%, 66% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

@keyframes game-arrive {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes stroke-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes spark-pop {
  0% { opacity: 0; transform: scale(0.2); }
  70% { opacity: 1; transform: scale(1.22); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes wordmark-land {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-height: 480px) {
  .intro-stage {
    --intro-mark-size: 112px;
    height: 240px;
  }
  .intro-mark { margin-bottom: 14px; }
  .intro-wordmark { font-size: 22px; }
  .intro-property { bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { transition: none; }
  .intro.playing * { animation: none !important; }
  .intro.playing .intro-game,
  .intro.playing .intro-wordmark,
  .intro.playing .mark-spark { opacity: 1; }
  .intro.playing .mark-frame,
  .intro.playing .mark-m,
  .intro.playing .mark-bar { stroke-dashoffset: 0; }
}
