/* Starmelo — candy-daydream cosmos.
   Palette: dream-blue #4656D8 · bright-violet #8A5CE8 · candy-pink #E86BBE
            sunny-peach #FFB870 · candy-rose #FF9EC0 · melody-gold #FFD98A
            starlight-cream #FFF6E8 · mint-sparkle #A5F0DC */

@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('../fonts/fredoka-500.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('../fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Nunito';  font-weight: 400; font-display: swap; src: url('../fonts/nunito-400.woff2')  format('woff2'); }
@font-face { font-family: 'Nunito';  font-weight: 600; font-display: swap; src: url('../fonts/nunito-600.woff2')  format('woff2'); }
@font-face { font-family: 'Nunito';  font-weight: 700; font-display: swap; src: url('../fonts/nunito-700.woff2')  format('woff2'); }

:root {
  --plum: #3A46C8;
  --plum-deep: #3240C4;
  --violet: #8A5CE8;
  --mauve: #E86BBE;
  --peach: #FFB870;
  --rose: #FF9EC0;
  --gold: #FFD98A;
  --cream: #FFF6E8;
}

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

html, body { height: 100%; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--cream);
  background: linear-gradient(180deg,
    #4656D8 0%,
    #5C55E0 24%,
    var(--violet) 52%,
    #C466D0 72%,
    var(--mauve) 84%,
    #F98BA2 94%,
    var(--peach) 106%);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- sky layers ---------- */

#nebula,
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.glow-horizon {
  position: fixed;
  left: 50%;
  bottom: -32vh;
  width: 130vw;
  height: 62vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(255, 217, 138, 0.7) 0%,
    rgba(255, 158, 192, 0.35) 45%,
    transparent 72%);
  animation: breathe 5s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

@keyframes breathe {
  from { opacity: 0.75; transform: translateX(-50%) scale(1); }
  to   { opacity: 1;    transform: translateX(-50%) scale(1.1); }
}

.cloud {
  position: fixed;
  border-radius: 50%;
  filter: blur(46px);
  pointer-events: none;
  z-index: 1;
}

.cloud-1 {
  width: 55vw; height: 24vh; left: -12vw; top: 14vh;
  background: radial-gradient(ellipse at center, rgba(255,158,192,0.4), transparent 70%);
  animation: drift-a 34s ease-in-out infinite alternate;
}

.cloud-2 {
  width: 48vw; height: 22vh; right: -14vw; top: 40vh;
  background: radial-gradient(ellipse at center, rgba(165,240,220,0.28), transparent 70%);
  animation: drift-b 42s ease-in-out infinite alternate;
}

.cloud-3 {
  width: 62vw; height: 26vh; left: 18vw; bottom: -6vh;
  background: radial-gradient(ellipse at center, rgba(255,217,138,0.32), transparent 70%);
  animation: drift-a 50s ease-in-out infinite alternate-reverse;
}

@keyframes drift-a { from { transform: translateX(0); } to { transform: translateX(9vw); } }
@keyframes drift-b { from { transform: translateX(0); } to { transform: translateX(-11vw); } }

/* ---------- header ---------- */

.top {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(18px, 3vw, 32px) clamp(20px, 4vw, 44px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: 0.02em;
}

.wordmark-star {
  width: 1.15em;
  height: 1.15em;
  fill: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 217, 138, 0.8));
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wordmark:hover .wordmark-star { transform: rotate(72deg) scale(1.15); }

.mute {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 246, 232, 0.45);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, transform 0.2s;
}

.mute:hover { border-color: rgba(255, 246, 232, 0.7); transform: scale(1.06); }

.mute svg { width: 20px; height: 20px; fill: var(--cream); stroke: var(--cream); }
.mute .icon-off { display: none; }
.mute[aria-pressed="true"] .icon-on { display: none; }
.mute[aria-pressed="true"] .icon-off { display: block; }

/* ---------- star buddy ---------- */

.buddy {
  position: fixed;
  top: 15vh;
  right: clamp(24px, 9vw, 140px);
  width: clamp(64px, 8vw, 96px);
  height: clamp(64px, 8vw, 96px);
  border: none;
  background: none;
  cursor: pointer;
  z-index: 3;
  animation: bounce-buddy 2.6s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.buddy:hover { transform: scale(1.18) rotate(10deg); }
.buddy svg { width: 100%; height: 100%; overflow: visible; }
.buddy-body {
  fill: var(--gold);
  filter: drop-shadow(0 0 22px rgba(255, 217, 138, 0.75));
}
.buddy-eye { fill: #7a4a20; }
.buddy-cheek { fill: rgba(255, 130, 160, 0.55); }
.buddy-smile { stroke: #7a4a20; stroke-width: 2.6; }

.buddy.singing { animation: buddy-bop 0.32s ease-in-out infinite; }

@keyframes bounce-buddy {
  0%, 100% { translate: 0 0; rotate: -4deg; }
  50% { translate: 0 -16px; rotate: 6deg; }
}

@keyframes buddy-bop {
  0%, 100% { transform: rotate(-7deg) scale(1.04); }
  50% { transform: rotate(7deg) scale(1.14); }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 22px;
  pointer-events: none;          /* let taps fall through to the singing sky */
}

.hero > * { pointer-events: none; }

.eyebrow {
  font-weight: 700;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 217, 138, 0.45);
  animation: rise 0.9s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

h1 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.9rem);
  line-height: 1.12;
  margin: 20px 0 22px;
  text-shadow: 0 2px 30px rgba(58, 40, 150, 0.5);
  animation: rise 0.8s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.amp {
  font-weight: 500;
  color: var(--rose);
  font-style: italic;
}

.sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.6;
  color: rgba(255, 246, 232, 0.88);
  max-width: 34em;
  animation: rise 0.9s 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pill {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  letter-spacing: 0.04em;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 246, 232, 0.55);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(58, 40, 150, 0.3);
  animation: pop 0.8s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pill-star {
  color: var(--gold);
  animation: twinkle-pill 2.2s ease-in-out infinite;
}

@keyframes twinkle-pill {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8) rotate(20deg); }
}

.hint {
  margin-top: 30px;
  font-size: clamp(0.82rem, 1.5vw, 0.92rem);
  font-weight: 600;
  color: rgba(255, 217, 138, 0.85);
  animation: rise 0.9s 1.1s cubic-bezier(0.22, 1, 0.36, 1) both, hint-pulse 3.2s 2.2s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

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

@keyframes pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0 20px clamp(20px, 3.5vh, 34px);
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  font-weight: 700;
  color: #33204d;
}

.mail {
  color: #33204d;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(51, 32, 77, 0.4);
  transition: border-color 0.2s;
}

.mail:hover { border-color: #33204d; }

.dot { opacity: 0.6; }

/* ---------- a11y ---------- */

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .glow-horizon, .cloud, .buddy, .pill-star, .hint { animation: none; }
  .eyebrow, h1, .sub, .pill { animation: none; opacity: 1; transform: none; }
  .wordmark-star, .buddy, .mute { transition: none; }
}

@media (max-width: 560px) {
  .wide-only { display: none; }
  .buddy { top: 11vh; right: 16px; }
}
