/* =========================================================
   GALACTIC BUTTERFLY™ INTRO JOURNEY
   This is a presentation layer only. The existing app stays
   underneath and is revealed after the journey is complete.
========================================================= */

.butterfly-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(111, 76, 180, .24), transparent 25%),
    radial-gradient(circle at 20% 20%, rgba(212, 175, 55, .12), transparent 28%),
    linear-gradient(145deg, #070914 0%, #11152a 48%, #080a16 100%);
  color: #fffaf0;
  opacity: 1;
  visibility: visible;
  transition: opacity .9s ease, visibility .9s ease;
}

.butterfly-intro.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-stars,
.intro-stars::before,
.intro-stars::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.intro-stars {
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 32% 74%, rgba(255,255,255,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 68%, rgba(255,255,255,.45) 0 1px, transparent 1.5px);
  background-size: 190px 190px, 260px 260px, 230px 230px, 310px 310px;
  animation: introDrift 24s linear infinite;
  opacity: .55;
}

.intro-stars::before {
  background: radial-gradient(circle at 50% 50%, transparent 0 28%, rgba(212,175,55,.04) 48%, transparent 70%);
  animation: introPulse 6s ease-in-out infinite;
}

.intro-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,.08);
}

#introProgressBar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #d4af37, #f5df7a);
  transition: width .6s ease;
}

.intro-stage {
  position: relative;
  width: min(760px, 90vw);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 20px 80px;
}

.intro-symbol {
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.18), rgba(212,175,55,0) 68%);
  animation: introFloat 5s ease-in-out infinite;
}

.intro-butterfly-glow {
  font-size: 86px;
  filter: drop-shadow(0 0 28px rgba(212,175,55,.45));
  transform: scale(1);
  transition: transform .6s ease, filter .6s ease;
}

.intro-chapter {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 5px;
  opacity: .55;
  margin-bottom: 16px;
}

#introTitle {
  margin: 0;
  max-width: 760px;
  font-family: 'Cinzel', serif;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: 1px;
  font-weight: 500;
  color: #fffaf0;
}

.intro-text {
  max-width: 650px;
  margin-top: 24px;
  min-height: 116px;
  font-size: clamp(16px, 2.2vw, 21px);
  line-height: 1.8;
  color: rgba(255,250,240,.82);
}

.intro-text strong {
  color: #f5df7a;
  font-weight: 600;
}

.intro-button {
  margin-top: 22px;
  padding: 14px 28px;
  border: 1px solid rgba(245,223,122,.7);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244,208,63,.95), rgba(212,175,55,.95));
  color: #332600;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 10px 35px rgba(212,175,55,.22);
  transition: transform .25s ease, box-shadow .25s ease;
}

.intro-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 42px rgba(212,175,55,.32);
}

.intro-skip {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: rgba(255,250,240,.42);
  font-size: 11px;
  cursor: pointer;
}

.intro-skip:hover {
  color: rgba(255,250,240,.72);
}

.intro-footer {
  position: absolute;
  bottom: 22px;
  left: 20px;
  right: 20px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 3px;
  opacity: .32;
}

.butterfly-intro.chapter-change .intro-stage {
  animation: introChapterIn .65s ease both;
}

.butterfly-intro.chapter-change .intro-butterfly-glow {
  transform: scale(1.12);
  filter: drop-shadow(0 0 40px rgba(212,175,55,.65));
}

@keyframes introChapterIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes introPulse {
  0%,100% { opacity: .35; transform: scale(1); }
  50% { opacity: .8; transform: scale(1.08); }
}

@keyframes introDrift {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(-40px,20px,0); }
}

@media (max-width: 600px) {
  .intro-stage {
    min-height: 520px;
    padding: 35px 18px 70px;
  }
  .intro-symbol {
    width: 130px;
    height: 130px;
    margin-bottom: 18px;
  }
  .intro-butterfly-glow { font-size: 68px; }
  .intro-text { min-height: 150px; line-height: 1.65; }
}
