/* VocaJunior — Coming soon */
:root {
  --ink: #2a1848;
  --ink-soft: #4a3a78;
  --brand: #5b3adf;
  --brand-deep: #4c2eb8;
  --lilac: #e4dcf8;
  --bg: #f4efff;
  --px: 0;
  --py: 0;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100svh;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Sky ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #efe8ff 0%, #f7f2ff 45%, #fff6fb 100%); }
.px { will-change: transform; }
.px-far  { position: absolute; inset: -10%; transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0); }
.px-mid  { position: absolute; inset: 0;   transform: translate3d(calc(var(--px) * -28px), calc(var(--py) * -18px), 0); }
.px-near { transform: translate3d(calc(var(--px) * 10px), calc(var(--py) * 8px), 0); }
.px-friends { position: absolute; inset: 0; transform: translate3d(calc(var(--px) * 18px), calc(var(--py) * 6px), 0); }

.aurora { position: absolute; border-radius: 50%; opacity: 0; transition: opacity 1.6s ease; will-change: transform; }
body:not(.is-loading) .aurora { opacity: 1; }
.a1 { width: 70vmax; height: 46vmax; left: -12%; top: -14%;
  background: radial-gradient(closest-side, rgba(160,132,255,.55), rgba(160,132,255,0));
  animation: drift1 18s ease-in-out infinite alternate; }
.a2 { width: 60vmax; height: 40vmax; right: -14%; top: 4%;
  background: radial-gradient(closest-side, rgba(255,160,205,.45), rgba(255,160,205,0));
  animation: drift2 22s ease-in-out infinite alternate; }
.a3 { width: 64vmax; height: 38vmax; left: 10%; bottom: -12%;
  background: radial-gradient(closest-side, rgba(110,225,210,.38), rgba(110,225,210,0));
  animation: drift3 26s ease-in-out infinite alternate; }
.a4 { width: 46vmax; height: 30vmax; right: 6%; bottom: 8%;
  background: radial-gradient(closest-side, rgba(255,214,140,.42), rgba(255,214,140,0));
  animation: drift4 20s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(14vw, 8vh, 0) scale(1.15) rotate(8deg); } }
@keyframes drift2 { to { transform: translate3d(-16vw, 10vh, 0) scale(.9) rotate(-10deg); } }
@keyframes drift3 { to { transform: translate3d(12vw, -10vh, 0) scale(1.2) rotate(6deg); } }
@keyframes drift4 { to { transform: translate3d(-14vw, -6vh, 0) scale(1.1); } }

#fx { position: absolute; inset: 0; width: 100%; height: 100%; }

.floaters { position: absolute; inset: 0; }
.floater { position: absolute; bottom: -12vh; font-family: "Fredoka", sans-serif; font-weight: 600;
  color: rgba(91,58,223,.20); white-space: nowrap; will-change: transform, opacity;
  animation: rise var(--dur, 24s) linear var(--delay, 0s) infinite; }
.floater.page { width: 34px; height: 42px; border-radius: 6px 10px 10px 6px; background: rgba(255,255,255,.7);
  box-shadow: 0 6px 18px rgba(91,58,223,.12); }
.floater.page::before, .floater.page::after { content: ""; position: absolute; left: 7px; right: 7px; height: 3px; border-radius: 3px; background: rgba(91,58,223,.18); }
.floater.page::before { top: 12px; } .floater.page::after { top: 21px; right: 13px; }
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--r0, -8deg)); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate3d(var(--sway, 30px), -60vh, 0) rotate(var(--r1, 8deg)); }
  90%  { opacity: 1; }
  100% { transform: translate3d(0, -125vh, 0) rotate(var(--r0, -8deg)); opacity: 0; }
}

/* ---------- Header ---------- */
.top { position: relative; z-index: 3; display: flex; justify-content: center; padding: max(18px, env(safe-area-inset-top)) 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding: 8px 18px 8px 10px;
  border-radius: 999px; background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(91,58,223,.12), inset 0 0 0 1px rgba(255,255,255,.8);
  opacity: 0; transform: translateY(-16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-pop); }
body:not(.is-loading) .brand { opacity: 1; transform: none; }
.brand-mark { width: 34px; height: 34px; }
.wordmark { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.45rem; letter-spacing: .2px; color: var(--brand); }
.brand:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ---------- Stage ---------- */
.stage { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 8px 22px 7vh; }

.hero-wrap { position: relative; }
.hero-art { position: relative; width: clamp(230px, 64vw, 340px); display: grid; justify-items: center; margin-top: 4px; }
.halo { position: absolute; left: 50%; top: 46%; width: 120%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(228,220,248,.55) 55%, rgba(228,220,248,0));
  transition: transform 1.2s var(--ease-pop), opacity 1.2s; transform: scale(.75); opacity: .6; }
body.awake .halo { transform: scale(1); opacity: 1; animation: halo 4s ease-in-out 1.2s infinite; }
@keyframes halo { 50% { transform: scale(1.06); } }

.lumi-btn { position: relative; z-index: 1; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%;
  width: clamp(160px, 46vw, 240px); aspect-ratio: 1; margin-bottom: calc(clamp(160px, 46vw, 240px) * -.36); touch-action: manipulation; }
.lumi-btn:focus-visible { outline: 3px dashed var(--brand); outline-offset: 4px; }
.lumi { width: 100%; height: 100%; overflow: visible; }
.lumi * { transform-box: fill-box; }
.l-bounce { transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(1.5px) scale(1.03, .97); } }
body.awake .l-bounce { animation: float 3.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.l-squish { transform-origin: 50% 100%; }
.lumi.hop .l-squish { animation: hop .9s var(--ease-out); }
@keyframes hop {
  0% { transform: none; } 18% { transform: scale(1.12, .84); } 45% { transform: translateY(-22px) scale(.92, 1.1); }
  70% { transform: translateY(0) scale(1.08, .92); } 85% { transform: scale(.97, 1.03); } 100% { transform: none; }
}
.lumi.giggle .l-squish { animation: giggle .6s var(--ease-out); }
@keyframes giggle { 20% { transform: rotate(-8deg) scale(1.05); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } 100% { transform: none; } }
.ear { transform-origin: 50% 80%; }
body.awake .ear-l { animation: earL 5s ease-in-out 1s infinite; }
body.awake .ear-r { animation: earR 5s ease-in-out 1.15s infinite; }
@keyframes earL { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-16deg); } 96% { transform: rotate(6deg); } }
@keyframes earR { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(16deg); } 96% { transform: rotate(-6deg); } }

.eyes-open, .m-smile, .m-talk, .eye-peek { opacity: 0; }
.eyes-open { transform-origin: center; transition: opacity .2s; }
.eye { transition: transform .25s var(--ease-out); }
.lumi.peek .eyes-closed path:last-child { opacity: 0; }
.lumi.peek .eye-r { opacity: 1; }
.lumi.peek .eyes-open { opacity: 1; }
.lumi.peek .eye-l { opacity: 0; }
body.awake .eyes-closed, body.awake .m-sleep { opacity: 0; }
body.awake .eyes-open { opacity: 1; }
body.awake .eye-l { opacity: 1; }
body.awake .m-smile { opacity: 1; }
.lumi.blink .eyes-open { animation: blink .22s ease-in-out; }
@keyframes blink { 50% { transform: scaleY(.08); } }
.lumi.talking .m-smile { opacity: 0; }
.lumi.talking .m-talk { opacity: 1; animation: talk .24s ease-in-out infinite alternate; transform-origin: 50% 30%; }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.cheek { transition: opacity .3s; }
.lumi.giggle .cheek { opacity: 1; }

.zzz { position: absolute; z-index: 3; right: 14%; top: 4%; font-family: "Fredoka", sans-serif; font-weight: 600; color: #7c6bd6; pointer-events: none; transition: opacity .5s; }
.zzz span { position: absolute; opacity: 0; animation: zz 3s ease-out infinite; }
.zzz span:nth-child(1) { font-size: 1rem; }
.zzz span:nth-child(2) { font-size: 1.3rem; animation-delay: 1s; }
.zzz span:nth-child(3) { font-size: 1.6rem; animation-delay: 2s; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 10px) rotate(-10deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -36px) rotate(12deg); } }
body.awake .zzz { opacity: 0; }

.book { position: relative; z-index: 2; pointer-events: none; width: 100%; filter: drop-shadow(0 12px 18px rgba(76,46,184,.22)); }
.book .flip { transform-origin: 0% 50%; transform-box: view-box; transform-origin: 120px 45px; opacity: 0; }
body.awake .book .flip { animation: flip 7s var(--ease-out) 2.4s infinite; }
@keyframes flip {
  0%, 70% { transform: scaleX(1); opacity: 0; }
  71% { opacity: 1; transform: scaleX(1); }
  85% { transform: scaleX(0); }
  86% { transform: scaleX(-.02); }
  99% { transform: scaleX(-1); opacity: 1; }
  100% { transform: scaleX(-1); opacity: 0; }
}

.bubble { position: absolute; z-index: 4; left: 50%; top: -6px; translate: -50% -100%; white-space: nowrap;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--brand-deep);
  background: #fff; padding: 9px 16px; border-radius: 18px; box-shadow: 0 10px 24px rgba(91,58,223,.18);
  opacity: 0; transform: scale(.6) translateY(10px); transform-origin: 50% 100%; transition: opacity .25s, transform .35s var(--ease-pop); pointer-events: none; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.bubble.show { opacity: 1; transform: none; }

/* ---------- Text ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 26px 0 6px; padding: 6px 14px; border-radius: 999px;
  font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-deep);
  background: rgba(228,220,248,.75); opacity: 0; transform: translateY(8px); transition: opacity .6s .3s, transform .6s .3s var(--ease-out); }
body:not(.is-loading) .eyebrow { opacity: 1; transform: none; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #b39dff; box-shadow: 0 0 0 0 rgba(139,108,255,.6); animation: pulse 2s infinite; }
body.awake .eyebrow .dot { background: #2ec4b6; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(139,108,255,0); } 100% { box-shadow: 0 0 0 0 rgba(139,108,255,0); } }
#eyebrowText { display: inline-block; transition: opacity .25s, transform .25s; }
#eyebrowText.swap { opacity: 0; transform: translateY(-6px); }

.headline { margin: 4px 0 0; font-family: "Fredoka", sans-serif; font-weight: 700; line-height: .95; letter-spacing: -.01em;
  font-size: clamp(3.6rem, 17.5vw, 8.4rem); }
.letters { display: inline-flex; flex-wrap: wrap; justify-content: center; column-gap: .28em; }
.hw { display: inline-flex; cursor: pointer; border-radius: .2em; position: relative; }
/* background-clip:text only paints inside the box; pad it so descenders (g) and stroke edges render, then cancel the padding with negative margins */
.ch { display: inline-block; position: relative; padding: .08em .06em .26em; margin: -.08em -.06em -.26em; color: rgba(91,58,223,.14); -webkit-text-stroke: 2px rgba(91,58,223,.22);
  transform: translateY(.12em) scale(.9); transition: color .35s, -webkit-text-stroke-color .35s, transform .5s var(--ease-pop); }
.ch.lit { color: transparent; -webkit-text-stroke-color: transparent; transform: none;
  background: linear-gradient(170deg, #7a55f5 0%, #5b3adf 45%, #4c2eb8 100%); -webkit-background-clip: text; background-clip: text; }
.ch.lit.w2 { background: linear-gradient(170deg, #ef5a9d 0%, #c44ab0 40%, #5b3adf 100%); -webkit-background-clip: text; background-clip: text; }
.ch.now { animation: say .5s var(--ease-pop); }
@keyframes say { 0% { transform: translateY(.1em) scale(.9); } 40% { transform: translateY(-.18em) scale(1.16, 1.08); } 100% { transform: none; } }
.ch.now::after { content: ""; position: absolute; left: 50%; bottom: .18em; width: .5em; height: .5em; translate: -50% 0; border-radius: 50%;
  border: 3px solid rgba(139,108,255,.6); animation: ring .6s ease-out forwards; pointer-events: none; }
@keyframes ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
/* karaoke underline that tracks the current word */
.hw::before { content: ""; position: absolute; left: 0; right: 0; bottom: -.04em; height: .09em; border-radius: 1em;
  background: linear-gradient(90deg, #ffc94d, #ff8fb1); transform: scaleX(0); transform-origin: left; transition: transform var(--sweep, .6s) linear, opacity .4s; opacity: 0; }
.hw.sweeping::before { transform: scaleX(1); opacity: 1; }
.hw.done::before { opacity: 0; transform: scaleX(1); }

.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 44px; margin: 22px 0 0; }
.wave i { display: block; width: 5px; height: 34px; border-radius: 4px; background: linear-gradient(180deg, #ff8fb1, #8d6bff);
  transform: scaleY(.12); transform-origin: center; opacity: .85; will-change: transform; }


/* ---------- Friends ---------- */
.friends { position: fixed; inset: auto 0 0 0; height: 0; z-index: 1; pointer-events: none; }
.friend { position: absolute; width: clamp(62px, 15vw, 128px); height: auto; overflow: visible; transition: transform 1s var(--ease-pop); }
.friend .f-open { opacity: 0; transition: opacity .3s; }
body.friends-awake .friend .f-open { opacity: 1; }
body.friends-awake .friend .f-closed { opacity: 0; }
.pobble  { left: -1.5%;  bottom: calc(-1 * clamp(62px, 15vw, 128px) * .3); transform: translateY(40%) rotate(14deg); }
.kitsu   { right: -1.5%; bottom: calc(-1 * clamp(62px, 15vw, 128px) * .3); transform: translateY(40%) rotate(-14deg); }
.loudpip { right: 13%;   bottom: calc(-1 * clamp(62px, 15vw, 128px) * .5); transform: translateY(60%); width: clamp(48px, 10vw, 92px); }
body.friends-awake .pobble  { transform: rotate(14deg);  animation: peekL 4.5s ease-in-out 1s infinite; }
body.friends-awake .kitsu   { transform: rotate(-14deg); animation: peekR 5.2s ease-in-out 1.4s infinite; transition-delay: .15s; }
body.friends-awake .loudpip { transform: none; animation: bob 3.4s ease-in-out 1.8s infinite; transition-delay: .3s; }
@keyframes peekL { 50% { transform: rotate(8deg) translateY(-6px); } }
@keyframes peekR { 50% { transform: rotate(-8deg) translateY(-8px); } }
@keyframes bob { 50% { transform: translateY(-7px); } }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 2; text-align: center; padding: 10px 20px max(18px, env(safe-area-inset-bottom)); font-size: .85rem; font-weight: 700; color: #5f5390; }

/* ---------- Larger screens ---------- */
@media (min-width: 900px) {
  .top { padding-top: 28px; }
  .wordmark { font-size: 1.7rem; }
  .brand-mark { width: 40px; height: 40px; }
  .eyebrow { margin-top: 30px; }
  .letters { flex-wrap: nowrap; }
  .headline { font-size: clamp(5rem, 9.5vw, 9rem); }
  .wave i { width: 6px; }
}
@media (max-height: 700px) and (max-width: 600px) {
  .lumi-btn { width: 130px; margin-bottom: -47px; } .hero-art { width: 190px; } .headline { font-size: 14vw; }
}

/* ---------- Calm mode ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .px { transform: none !important; }
  .floaters { display: none; }
}
