:root 
{
  --bg-small: #FADADD; 
  --bg-mid: #FFC2D1;  
  --bg-large: #FB6F92; 
  --text-light: #fff;
  --text-dark: #222;
}

html, body { height: 100%; }

body {
  margin: 0;
  padding: 4rem;
  box-sizing: border-box;
  font-family: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  text-align: center;
  transition: background-color 700ms ease, color 400ms ease;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-large); /* 기본 큰 화면 배경 */
  color: var(--text-light);
}

h1, h2, h3, p {
  margin: 0 0 1.2rem;
  transition: transform 700ms ease, opacity 700ms ease;
}
h1 { font-size: clamp(28px, 5vw, 48px); }
h2 { font-size: clamp(18px, 3.2vw, 28px); font-weight: 500; }
h3 { font-size: clamp(14px, 2.4vw, 18px); font-weight: 400; color: rgba(0,0,0,0.6); }
p  { font-size: clamp(13px, 2.2vw, 16px); line-height: 1.6; max-width: 820px; margin: 0 auto; }

.stage {
  display: none;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity 600ms ease, transform 600ms ease;
  padding: 2rem;
  z-index: 3;
}
.stage.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media screen and (max-width: 992px) {
  body { 
    background-color: var(--bg-mid);
    color: var(--text-dark);
  }
  .stage2.active h1, .stage2.active h2, .stage2.active p {
    animation: heartbeat 1.4s ease-in-out infinite;
    transform-origin: center;
  }
  .stage1.active h1,
  .stage1.active h2,
  .stage1.active h3,
  .stage1.active p,
  .love-text {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


@media screen and (max-width: 600px) {
  body { 
    background-color: var(--bg-small);
    color: var(--text-dark);
  }
  .stage3 h1, .stage3 h2, .stage3 p { animation: none; transform: none; }
  .love-text { 
    opacity: 1; 
    pointer-events: none;
    animation: none !important;
    transform: none !important;
  }
}


.stage1.active h1,
.stage1.active h2,
.stage1.active h3,
.stage1.active p {
  animation: explode 2400ms ease-in-out infinite;
  transform-origin: center;
  color: var(--text-light);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.love-text {
  margin-top: 2.4rem;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms ease;
  z-index: 4;
  color: var(--text-light);
  font-size: clamp(28px, 6vw, 64px);
  font-weight: 700;
  animation: screenBoom 3.5s ease-in-out infinite;
}
.love-text.visible { opacity: 1; transform: translateY(0); }
.love-text .char { display: inline-block; transform-origin: center; }


.bg-hearts {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1;
}
.bg-heart {
  position: absolute;
  bottom: -12vh;
  color: rgba(255,255,255,0.95);
  mix-blend-mode: screen;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.18));
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}


@keyframes heartbeat {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes explode {
  0% { transform: scale(1) rotate(0deg); letter-spacing: normal; opacity: 1; }
  30% { transform: scale(1.12) rotate(-1deg); letter-spacing: 0.18em; opacity: 0.95; }
  60% { transform: scale(1.02) rotate(1deg); letter-spacing: 0.06em; opacity: 1; }
  100% { transform: scale(1) rotate(0deg); letter-spacing: normal; opacity: 1; }
}
@keyframes screenBoom {
  0% { transform: translateY(0) scale(1); opacity: 1; text-shadow: none; }
  40% { transform: translateY(-20px) scale(1.4); opacity: 1; text-shadow: 0 0 24px rgba(255, 100, 150, 0.7); }
  70% { transform: translateY(-40px) scale(6); opacity: 0.8; text-shadow: 0 0 48px rgba(255, 80, 130, 0.9); }
  100% { transform: translateY(0) scale(1); opacity: 0; text-shadow: none; }
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.9) translateX(0); opacity: 0; }
  25% { transform: translateY(-20vh) scale(1.0) translateX(20px); opacity: 1; }
  50% { transform: translateY(-45vh) scale(1.1) translateX(-20px); }
  75% { transform: translateY(-70vh) scale(1.2) translateX(20px); }
  100% { transform: translateY(-120vh) scale(1.25) translateX(0); opacity: 0; }
}
.cursor-heart {
  position: fixed;
  pointer-events: none;
  font-size: 18px;
  color: rgba(255,255,255,0.95);
  transform: translate(-50%, -50%) scale(0.95);
  animation: cursorFloat 900ms forwards;
  z-index: 5;
}
@keyframes cursorFloat {
  from { opacity: 1; transform: translate(-50%, -50%) translateY(0) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -50%) translateY(-26px) scale(1.05); }
}


.no-js .stage {
  display: block;
  opacity: 1;
  transform: none;
}
