/* =========================================================
   سپیده‌دم ساکورا — روشن، لطیف و امیدوار
   ========================================================= */

:root {
  --bg-deep: #f8d7c7;
  --bg-mid: #fce9da;
  --bg-warm: #fff7e9;
  --rose: #e99aaa;
  --rose-deep: #bd6678;
  --blush: #fbd2d2;
  --champagne: #f5daa0;
  --gold: #dfb867;
  --mist: rgba(255, 250, 241, 0.62);
  --text: #754f51;
  --text-soft: rgba(117, 79, 81, 0.76);
  --font-fa: "Vazirmatn", sans-serif;
  --font-display: "Great Vibes", cursive;
}

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

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-fa);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

/* ---------- لودر ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 72% 20%, rgba(255,255,230,.88) 0 7%, transparent 27%),
    radial-gradient(ellipse 80% 55% at 50% 100%, #fff8e8 0%, transparent 67%),
    linear-gradient(165deg, #f7c9ba 0%, #fbe1d0 48%, #fff3df 100%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 72%, rgba(246, 164, 173, 0.24), transparent 38%),
    radial-gradient(circle at 82% 18%, rgba(255, 234, 171, 0.42), transparent 32%);
  animation: veilDrift 8s ease-in-out infinite alternate;
}

@keyframes veilDrift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-2%, 2%); }
}

.loader__content {
  position: relative;
  text-align: center;
  padding: 2rem;
  max-width: 28rem;
}

.loader__orb {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.75rem;
}

.loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--rose);
  border-right-color: var(--champagne);
  animation: spin 1.6s linear infinite;
}

.loader__ring:nth-child(2) {
  inset: 10px;
  border-top-color: var(--blush);
  border-right-color: transparent;
  animation-duration: 2.2s;
  animation-direction: reverse;
}

.loader__ring:nth-child(3) {
  inset: 22px;
  border-top-color: var(--gold);
  border-left-color: var(--rose);
  animation-duration: 1.1s;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader__heart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  color: #cf7b8a;
  text-shadow: 0 6px 20px rgba(184, 101, 112, .18);
  animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}

.loader__text {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 400;
  line-height: 1.9;
  color: var(--text);
  min-height: 3.6em;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.loader__text.is-swap {
  opacity: 0;
  transform: translateY(8px);
}

.loader__bar {
  margin: 1.5rem auto 0.75rem;
  width: min(240px, 70vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(154, 94, 94, 0.12);
  overflow: hidden;
}

.loader__bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--champagne), var(--rose));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.35s ease;
}

@keyframes shimmer {
  to { background-position: 200% 0; }
}

.loader__status {
  font-size: 0.8rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

/* ---------- گیت شروع (برای آنلاک موزیک) ---------- */

.start-gate {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 250, 220, 0.82), transparent 42%),
    rgba(250, 221, 207, 0.7);
  backdrop-filter: blur(13px);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.start-gate[hidden] {
  display: none;
}

.start-gate.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-gate__btn {
  position: relative;
  font-family: var(--font-fa);
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 500;
  color: #80585a;
  background: linear-gradient(135deg, #fffaf0, #f9ced0, #f8e6b2);
  background-size: 200% 200%;
  border: none;
  padding: 1.1rem 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.78),
    0 18px 50px rgba(181, 116, 109, 0.2);
  animation: btnGlow 3s ease-in-out infinite alternate;
  overflow: hidden;
}

@keyframes btnGlow {
  from {
    background-position: 0% 50%;
    transform: scale(1);
  }
  to {
    background-position: 100% 50%;
    transform: scale(1.03);
  }
}

.start-gate__btn:hover,
.start-gate__btn:focus-visible {
  outline: none;
  transform: scale(1.05);
}

.start-gate__sparkle {
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 40%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 60%
  );
  animation: sweep 2.8s ease-in-out infinite;
}

@keyframes sweep {
  from { transform: translateX(-30%) rotate(12deg); }
  to { transform: translateX(30%) rotate(12deg); }
}

/* ---------- صحنه اصلی ---------- */

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  opacity: 0;
}

.stage.is-ready {
  opacity: 1;
}

.stage__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 14%, rgba(255, 249, 204, .98) 0 5%, rgba(255, 235, 173, .38) 14%, transparent 32%),
    radial-gradient(ellipse 85% 36% at 50% 100%, rgba(255, 252, 231, .95), transparent 75%),
    radial-gradient(ellipse 45% 30% at 12% 38%, rgba(255, 201, 191, .35), transparent 60%),
    linear-gradient(180deg, #f6c5b7 0%, #fad8c6 30%, #fce9d7 62%, #fff7e8 100%);
  z-index: 0;
}

.stage__mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 77%, var(--mist), transparent 52%),
    linear-gradient(110deg, transparent 20%, rgba(255,255,240,.22) 48%, transparent 72%);
  animation: mistPulse 7s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes mistPulse {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 0.9; transform: scale(1.06); }
}

.stage__bloom-glow {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(85vw, 520px);
  height: min(85vw, 520px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 251, 223, 0.82) 0%, rgba(247, 194, 187, 0.31) 43%, transparent 70%);
  filter: blur(28px);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s ease-out;
}

.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.5rem, 5vh, 3rem) 1.25rem 2rem;
  text-align: center;
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  line-height: 1;
  color: #a85f6c;
  text-shadow: 0 3px 0 rgba(255,255,255,.5), 0 14px 34px rgba(168,95,108,.16);
  opacity: 0;
  letter-spacing: 0.02em;
}

.hero__headline {
  margin-top: 0.35rem;
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  max-width: 22rem;
  line-height: 1.7;
}

.hero__subtitle {
  margin-top: 0.5rem;
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  font-weight: 300;
  color: var(--text-soft);
  opacity: 0;
  max-width: 24rem;
  line-height: 1.9;
}

/* ---------- گل ---------- */

.flower-wrap {
  position: relative;
  margin-top: clamp(0.25rem, 1.5vh, 1rem);
  width: min(92vw, 430px);
  filter: drop-shadow(0 24px 36px rgba(147, 90, 82, 0.18));
}

.flower-aura {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 78%;
  height: 78%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 252, 221, 0.72) 0%, transparent 58%),
    conic-gradient(from 0deg, rgba(240, 167, 176, 0.15), transparent, rgba(245, 218, 160, 0.28), transparent, rgba(240, 167, 176, 0.15));
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.flower-wrap.is-bloomed .flower-aura {
  opacity: 1;
  animation: auraSpin 18s linear infinite, auraPulse 3.5s ease-in-out infinite alternate;
}

@keyframes auraSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes auraPulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.flower {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  overflow: visible;
  transform-origin: 50% 85%;
  transition: transform 0.45s ease-out;
}

.flower__stem,
.flower__leaf-unit,
.flower__bud,
.flower__blossom,
.blossom-face,
.flower__core,
.flower__sparkles {
  transform-box: fill-box;
  transform-origin: center;
}

.flower__stem,
.flower__leaf-unit,
.flower__bud,
.flower__blossom,
.flower__core,
.flower__sparkles {
  opacity: 0;
}

.petal-scaler {
  transform-box: fill-box;
  transform-origin: 0 0;
}

.flower.is-alive .blossom-face {
  animation: blossomSway 4.8s ease-in-out infinite alternate;
  transform-origin: 0 0;
}

.flower.is-alive .flower__blossom:nth-of-type(2n) .blossom-face {
  animation-duration: 5.7s;
  animation-direction: alternate-reverse;
}

.flower.is-alive .flower__blossom:nth-of-type(3n) .blossom-face {
  animation-duration: 4.2s;
}

@keyframes blossomSway {
  from { rotate: -1.8deg; translate: 0 0; }
  to { rotate: 1.8deg; translate: 0 -1.5px; }
}

.flower.is-alive .flower__core-shine {
  animation: corePulse 2.4s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.15); }
}

.flower.is-alive .stamen {
  animation: stamenWiggle 3.2s ease-in-out infinite;
  transform-origin: 0 0;
}

.flower.is-alive .stamen:nth-child(odd) {
  animation-duration: 2.7s;
  animation-direction: reverse;
}

@keyframes stamenWiggle {
  0%, 100% { rotate: -2deg; }
  50% { rotate: 2deg; }
}

.flower.is-alive .dew {
  animation: dewGlimmer 2.8s ease-in-out infinite;
}

.flower.is-alive .dew:nth-child(2n) { animation-delay: 0.4s; }
.flower.is-alive .dew:nth-child(3n) { animation-delay: 0.9s; }

@keyframes dewGlimmer {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.flower.is-alive .spark {
  animation: sparkTwinkle 2s ease-in-out infinite;
}

.flower.is-alive .spark:nth-child(2) { animation-delay: 0.25s; }
.flower.is-alive .spark:nth-child(3) { animation-delay: 0.5s; }
.flower.is-alive .spark:nth-child(4) { animation-delay: 0.75s; }
.flower.is-alive .spark:nth-child(5) { animation-delay: 1s; }
.flower.is-alive .spark:nth-child(6) { animation-delay: 1.25s; }
.flower.is-alive .spark:nth-child(7) { animation-delay: 1.5s; }

@keyframes sparkTwinkle {
  0%, 100% { opacity: 0.2; scale: 0.75; }
  50% { opacity: 1; scale: 1.4; }
}

/* ---------- خطوط عاشقانه ---------- */

.love-lines {
  margin-top: clamp(1rem, 3vh, 1.75rem);
  max-width: 28rem;
  min-height: 4.5em;
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
  font-weight: 300;
  line-height: 2;
  color: var(--text-soft);
  text-shadow: 0 1px 0 rgba(255,255,255,.65);
}

.love-lines__line {
  opacity: 0;
  transform: translateY(14px);
}

.love-lines__line.is-on {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ---------- دکمه میوت ---------- */

.mute-btn {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 50;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(172, 104, 111, 0.18);
  background: rgba(255, 248, 235, 0.72);
  color: #a86470;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(130, 79, 72, .12);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mute-btn[hidden] {
  display: none;
}

.mute-btn:hover {
  transform: scale(1.08);
}

.mute-btn.is-muted {
  opacity: 0.5;
}

/* ---------- موبایل ---------- */

@media (max-width: 480px) {
  .flower-wrap {
    width: min(92vw, 360px);
  }

  .hero {
    padding-top: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- جا شدن در یک صفحه بدون اسکرول ---------- */
html {
  height: 100%;
}

html,
body {
  max-height: 100dvh;
  overflow: hidden;
}

.stage {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
}

.hero {
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  justify-content: center;
  padding: clamp(0.35rem, 1.3vh, 0.85rem) 1rem clamp(0.4rem, 1vh, 0.65rem);
  gap: clamp(0.1rem, 0.55vh, 0.35rem);
  overflow: hidden;
}

.hero__brand {
  font-size: clamp(1.7rem, 6vh, 3rem) !important;
  line-height: 1.05;
}

.hero__headline {
  margin-top: 0.08rem;
  font-size: clamp(0.76rem, 1.95vh, 1rem) !important;
  line-height: 1.42;
}

.hero__subtitle {
  margin-top: 0.06rem;
  font-size: clamp(0.7rem, 1.7vh, 0.88rem) !important;
  line-height: 1.42;
}

.flower-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(41dvh, 305px);
  width: min(77vw, 368px);
  margin-top: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flower {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.love-lines {
  flex-shrink: 0;
  margin-top: 0 !important;
  min-height: 0;
  max-width: 26rem;
  font-size: clamp(0.66rem, 1.55vh, 0.82rem) !important;
  line-height: 1.42;
}

.love-lines__line + .love-lines__line {
  margin-top: 0.1em;
}

.stage__bloom-glow {
  top: 56%;
}

@media (max-height: 640px) {
  .flower-wrap {
    max-height: min(36dvh, 252px);
    width: min(71vw, 328px);
  }

  .hero__brand {
    font-size: clamp(1.45rem, 5.2vh, 2.35rem) !important;
  }
}

/* ---------- شکفتن نرم‌تر — کمتر فشار روی GPU ---------- */
.flower-wrap.is-blooming {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.2));
}

.flower.is-blooming .petal-scaler,
.flower.is-blooming .blossom-face,
.flower.is-blooming .flower__pads,
.flower.is-blooming .flower__core {
  will-change: transform, opacity;
}

.flower-wrap.is-blooming .flower-aura {
  animation: none;
  opacity: 0.45;
}
