/* =====================================================
   Happy Dashain greeting — Home page (Bijaya Dashami 2083)
   Self-contained: remove this file + the <section id="dashain">
   block in index.html once the festival is over.
   Motifs: sayapatri (marigold) garlands, flying kites (changa),
   jamara (barley shoots), tika, Durga's crimson & gold.
   ===================================================== */

.dashain {
  --d-crimson:   #8E0F1E;
  --d-crimson-2: #B5162A;
  --d-deep:      #4A0610;
  --d-gold:      #FECE00;
  --d-gold-soft: #FFE38A;
  --d-marigold:  #FF9F1C;
  --d-marigold-2:#F77F00;
  --d-jamara:    #C8D94A;
  --d-jamara-2:  #8FB339;

  position: relative;
  overflow: hidden;
  color: #FFF8E7;
  text-align: center;
  padding: 120px 20px 150px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(254, 206, 0, 0.20) 0%, rgba(254, 206, 0, 0) 55%),
    radial-gradient(circle at 12% 85%, rgba(255, 159, 28, 0.18) 0%, rgba(255, 159, 28, 0) 40%),
    radial-gradient(circle at 88% 20%, rgba(255, 159, 28, 0.14) 0%, rgba(255, 159, 28, 0) 38%),
    linear-gradient(160deg, var(--d-deep) 0%, var(--d-crimson) 45%, var(--d-crimson-2) 100%);
  isolation: isolate;
}

/* Faint mandala rings behind the text */
.dashain-mandala {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(760px, 120vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.16;
  pointer-events: none;
  animation: dashainSpin 120s linear infinite;
}

/* ---------- Marigold garland (toran) ---------- */
.dashain-garland {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  background:
    radial-gradient(circle at 9px 9px, var(--d-marigold) 0 6px, var(--d-marigold-2) 6.5px 8px, transparent 8.5px) repeat-x;
  background-size: 18px 18px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
  z-index: 2;
}
.dashain-strands {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  z-index: 2;
}
.dashain-strand {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  animation: dashainSway 5s ease-in-out infinite;
}
.dashain-strand:nth-child(even) { animation-delay: -2.5s; }
.dashain-strand span {
  width: 16px;
  height: 16px;
  margin-top: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--d-gold-soft) 0 15%, var(--d-marigold) 40%, var(--d-marigold-2) 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}
.dashain-strand span:nth-child(even) {
  background: radial-gradient(circle at 40% 35%, #fff4b0 0 15%, var(--d-gold) 45%, #E0A800 100%);
}
.dashain-strand i {            /* little leaf at the end of each strand */
  width: 10px;
  height: 16px;
  margin-top: -1px;
  background: #3E8E41;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
/* Vary strand lengths for a natural drape */
.dashain-strand:nth-child(3n+1) span:nth-of-type(n+5) { display: none; }
.dashain-strand:nth-child(3n+2) span:nth-of-type(n+4) { display: none; }

/* ---------- Kites (changa) ---------- */
.dashain-kite {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3));
  animation: dashainKite 7s ease-in-out infinite;
}
.dashain-kite-1 { width: 74px;  top: 22%; left: 6%;  animation-delay: 0s; }
.dashain-kite-2 { width: 58px;  top: 14%; right: 9%; animation-delay: -2.2s; }
.dashain-kite-3 { width: 44px;  top: 56%; right: 4%; animation-delay: -4.4s; }
.dashain-kite-4 { width: 40px;  top: 62%; left: 10%; animation-delay: -1.2s; }

/* ---------- Content ---------- */
.dashain-content {
  position: relative;
  z-index: 3;
  max-width: 760px;
  margin: 0 auto;
}

.dashain-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border: 1px solid rgba(254, 206, 0, 0.55);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--d-gold);
  background: rgba(0, 0, 0, 0.18);
}

/* Tika: red dot topped with rice grains */
.dashain-tika {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 26px auto 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #FF4D5A 0%, #D3112A 55%, #8A0718 100%);
  box-shadow: 0 0 0 4px rgba(254, 206, 0, 0.35), 0 0 30px rgba(254, 206, 0, 0.45);
}
.dashain-tika::before,
.dashain-tika::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 3px;
  border-radius: 50%;
  background: #FFF6E0;
  box-shadow:
    8px -4px 0 #FFF6E0, 15px 3px 0 #FFF6E0, 4px 8px 0 #FFF6E0,
    -6px 4px 0 #FFF6E0, 12px 12px 0 #FFF6E0, -2px -8px 0 #FFF6E0;
}
.dashain-tika::before { top: 16px; left: 14px; transform: rotate(25deg); }
.dashain-tika::after  { top: 22px; left: 20px; transform: rotate(-35deg); opacity: 0.85; }

.dashain-title {
  font-family: "Lora", serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 1.02;
  margin: 0 0 0.4rem;
  color: #FFF8E7;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}
.dashain-title em {
  font-style: italic;
  background: linear-gradient(180deg, #FFF0A8 0%, var(--d-gold) 55%, #E7A100 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dashain-nepali {
  font-family: "Noto Serif Devanagari", "Lora", serif;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  font-weight: 600;
  color: var(--d-gold-soft);
  margin-bottom: 1.4rem;
}

.dashain-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 1.4rem;
  color: var(--d-gold);
  font-size: 0.9rem;
}
.dashain-divider::before,
.dashain-divider::after {
  content: "";
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--d-gold));
}
.dashain-divider::after { transform: scaleX(-1); }

.dashain-message {
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  line-height: 1.75;
  color: rgba(255, 248, 231, 0.92);
  margin: 0 auto 1.6rem;
  max-width: 640px;
}

.dashain-sign {
  font-family: "Lora", serif;
  font-style: italic;
  color: var(--d-gold-soft);
  font-size: 1.05rem;
  margin-bottom: 1.6rem;
}

.dashain-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.dashain-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--d-deep);
  background: linear-gradient(180deg, #FFE98A 0%, var(--d-gold) 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.dashain-pill-ghost {
  color: #FFF8E7;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 248, 231, 0.35);
  box-shadow: none;
}

/* ---------- Jamara (barley shoots) along the bottom ---------- */
.dashain-jamara {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 110px;
  z-index: 2;
  pointer-events: none;
}

/* ---------- Animations ---------- */
@keyframes dashainSway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
@keyframes dashainKite {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  25%      { transform: translate(8px, -12px) rotate(4deg); }
  50%      { transform: translate(-4px, -20px) rotate(-2deg); }
  75%      { transform: translate(-10px, -6px) rotate(6deg); }
}
@keyframes dashainSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dashain-strand,
  .dashain-kite,
  .dashain-mandala { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .dashain { padding: 110px 16px 130px; }
  .dashain-strand:nth-child(n+9) { display: none; }
  .dashain-kite-3, .dashain-kite-4 { display: none; }
  .dashain-kite-1 { width: 52px; top: 10%; left: 3%; }
  .dashain-kite-2 { width: 44px; top: 8%; right: 4%; }
  .dashain-jamara { height: 80px; }
}

/* ---------- Animated Linge Ping scene ---------- */
.dashain-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 18px auto 6px;
}
.dashain-stage-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Speech bubble — HTML so the Devanagari stays crisp and readable */
.dashain-bubble {
  position: absolute;
  left: 50%;                 /* JS places it above the landed boy's head */
  top: 30%;
  transform: translate(-50%, calc(-100% + 12px)) scale(0.6);
  transform-origin: 50% 100%;
  opacity: 0;
  white-space: nowrap;
  padding: 0.55em 1em;
  border-radius: 18px;
  font-family: "Noto Serif Devanagari", "Lora", serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 3.2vw, 1.2rem);
  line-height: 1.4;
  color: #8E0F1E;
  background: linear-gradient(180deg, #FFFDF4 0%, #FFF1C2 100%);
  border: 2px solid #FECE00;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 4;
}
.dashain-bubble::after {          /* tail pointing down at the boy */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 18px;
  height: 18px;
  background: #FFF1C2;
  border-right: 2px solid #FECE00;
  border-bottom: 2px solid #FECE00;
  transform: translateX(-50%) rotate(45deg);
}
.dashain-bubble.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
}


/* ---------- Dashain Dhun music button (floating) ---------- */
.dashain-music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border: 2px solid #FECE00;
  border-radius: 999px;
  background: linear-gradient(160deg, #4A0610 0%, #8E0F1E 60%, #B5162A 100%);
  color: #FFF8E7;
  font: inherit;
  text-align: left;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dashain-music:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); }
.dashain-music:focus-visible { outline: 3px solid #FFE38A; outline-offset: 3px; }
.dashain-music .dm-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE98A 0%, #FECE00 100%);
  color: #8E0F1E;
  flex-shrink: 0;
}
.dashain-music:not(.is-playing) .dm-icon { animation: dmPulse 2.2s ease-in-out infinite; }
.dashain-music .dm-play { width: 20px; height: 20px; margin-left: 2px; }
.dashain-music .dm-text strong { display: block; font-size: 0.88rem; font-weight: 800; letter-spacing: 0.3px; }
.dashain-music .dm-text small { display: block; font-size: 0.72rem; color: #FFE38A; }
.dashain-music.is-error .dm-text small { color: #FFB3B3; }

/* equalizer bars while playing */
.dashain-music .dm-bars { display: none; align-items: flex-end; gap: 2px; height: 16px; }
.dashain-music .dm-bars i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: #8E0F1E;
  transform-origin: bottom;
  animation: dmBar 0.9s ease-in-out infinite;
}
.dashain-music .dm-bars i:nth-child(2) { animation-delay: -0.3s; }
.dashain-music .dm-bars i:nth-child(3) { animation-delay: -0.6s; }
.dashain-music .dm-bars i:nth-child(4) { animation-delay: -0.15s; }
.dashain-music.is-playing .dm-play { display: none; }
.dashain-music.is-playing .dm-bars { display: inline-flex; }

@keyframes dmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(254, 206, 0, 0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(254, 206, 0, 0); }
}
@keyframes dmBar {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dashain-music .dm-icon, .dashain-music .dm-bars i { animation: none; }
}
@media (max-width: 575px) {
  .dashain-music { left: 12px; bottom: 12px; padding: 6px 12px 6px 6px; }
  .dashain-music .dm-icon { width: 34px; height: 34px; }
}
