/* Layout: full-bleed sticky sky stage scrubbed by scroll, then a single 520px column of day, song and the five mornings */
:root {
  --ink: #1B1440;
  --cream: #FFF6E0;
  --sun: #FFC83D;
  --pink: #FF3D7F;
  --violet: #7B5CFF;
  --night: #2E1E78;
  --muted: #5E557F;
  --display: "Black Han Sans", "Apple SD Gothic Neo", system-ui, sans-serif;
  --body: "Gothic A1", "Apple SD Gothic Neo", system-ui, sans-serif;
  --gutter: max(18px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); line-height: 1.6; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.app { max-width: 560px; margin: 0 auto; background: var(--cream); min-height: 100svh; overflow-x: clip; }

/* ---------- stage ---------- */
.track { height: 300svh; position: relative; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cd { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 26px); text-align: center; color: #fff;
  opacity: calc(1 - var(--p, 0) * 1.8); transform: translateY(calc(var(--p, 0) * -40px)); pointer-events: none; }
.cd small { display: block; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.cd b { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 13vw, 58px); line-height: 1.05; }
.cd b i { font-style: normal; font-size: .42em; margin: 0 .12em 0 .04em; opacity: .85; }
.cd.revealed b { color: var(--sun); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.05); } }

.meta { position: absolute; left: var(--gutter); right: var(--gutter); top: var(--meta-top, 70%); text-align: center; display: grid; justify-items: center; gap: 12px;
  opacity: var(--c, 0); transform: translateY(calc((1 - var(--c, 0)) * 14px)); pointer-events: none; }
.meta.on { pointer-events: auto; }
.verse-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.meta cite { font-style: normal; font-weight: 900; font-size: 14px; color: var(--pink); }
.to-song { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 14px; text-decoration: none; }
.to-song:active { transform: scale(.97); }

.hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); display: grid; justify-items: center; gap: 0; color: #fff;
  font-weight: 900; font-size: 15px; opacity: calc(1 - var(--p, 0) * 6); pointer-events: none; }
.hint svg { animation: nudge 1.3s cubic-bezier(.3, .7, .3, 1) infinite; }
.hint svg + svg { margin-top: -16px; opacity: .55; animation-delay: .12s; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- day ---------- */
.day, .song, .mornings, .foot { padding-left: var(--gutter); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.day { padding-block: 40px 8px; display: grid; gap: 18px; }
.day-head h1 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 0; text-wrap: balance; }
.day-head p { margin: 4px 0 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.note { margin: 0; font-size: 16.5px; max-width: 36em; }
.media { margin: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 5; position: relative; background: var(--violet);
  box-shadow: 0 22px 40px -22px rgba(27, 20, 64, .55); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(calc(1.18 - var(--k, 0) * .18)) translateY(calc((var(--k, 0) - .5) * -6%)); will-change: transform; }

/* ---------- song ---------- */
.song { padding-block: 34px 8px; display: grid; gap: 14px; }
h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; }
.song-card { background: var(--ink); color: var(--cream); border-radius: 22px; padding: 18px; display: grid; gap: 14px; }
.song-info b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.song-info span { font-size: 14px; opacity: .8; }
.song-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { appearance: none; border: 2px solid rgba(255, 246, 224, .35); background: transparent; color: var(--cream); font: 700 14.5px var(--body);
  border-radius: 999px; padding: 10px 16px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn:active { transform: scale(.97); }
.player { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- mornings ---------- */
.mornings { padding-block: 40px 10px; display: grid; gap: 18px; }
.days { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding-top: 6px; }
.thread { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 64px; overflow: visible; color: var(--pink); }
.orb-btn { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; display: grid; justify-items: center; gap: 6px; position: relative; z-index: 1; cursor: pointer; }
.orb-btn:disabled { cursor: default; }
.orb { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 16px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.orb-btn small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.orb-btn.open .orb { background: radial-gradient(circle at 35% 35%, #FFF6E0, var(--sun)); }
.orb-btn.open:active .orb { transform: scale(.92); }
.orb-btn.current .orb { outline: 3px solid var(--pink); outline-offset: 3px; animation: pulse 2.2s ease-in-out infinite; }
.orb-btn { gap: 10px; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.orb-btn.locked .orb { background: var(--ink); color: var(--cream); }
.orb-btn.locked .orb::after { content: ""; position: absolute; }
.next { margin: 0; text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.next b { color: var(--ink); }

.foot { padding-block: 40px calc(env(safe-area-inset-bottom, 0px) + 40px); text-align: center; color: var(--muted); font-size: 13px; }
.foot p { margin: 0; }
.foot-cd { font-weight: 700; color: var(--pink); }

@media (min-width: 600px) {
  body { background: var(--night); }
  .app { box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
