@font-face { font-family: "Inter"; src: url("../fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root { --fg: #1f1d3a; --bg: #7A82DE; --cell: #F38A78; --ease: cubic-bezier(.2,.7,.2,1);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif; font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; touch-action: none; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1 { font-weight: 800; letter-spacing: -.045em; line-height: .9; }
.artist { font-weight: 500; letter-spacing: .02em; opacity: .6; }

/* start screen: title only, tap anywhere */
#intro { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; text-align: center; gap: 1.1rem; outline: none;
  --intro-bg: #FFB547; --intro-bg2: #FFE15A; --intro-ink: #1f1d3a; --intro-accent: #7A82DE; --fg: var(--intro-ink);
  color: var(--intro-ink); background: linear-gradient(135deg, var(--intro-bg), var(--intro-bg2));
  transition: opacity 1.2s var(--ease), visibility 0s 1.2s, --intro-bg .45s ease, --intro-bg2 .45s ease, --intro-ink .45s ease; }
/* registered so the cover palette can crossfade (covers.js) */
@property --intro-bg { syntax: '<color>'; inherits: true; initial-value: #FFB547; }
@property --intro-bg2 { syntax: '<color>'; inherits: true; initial-value: #FFE15A; }
@property --intro-ink { syntax: '<color>'; inherits: true; initial-value: #1f1d3a; }
#intro .cv { margin: 0; display: grid; justify-items: center; gap: .5rem; }
#nextCover { width: 40px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--intro-ink); opacity: .6; cursor: pointer; border-radius: 999px; transition: opacity .2s, transform .2s; }
#nextCover[hidden] { display: none; }
#nextCover:hover, #nextCover:focus-visible { opacity: 1; transform: translateX(3px); outline: none; }
#nextCover:focus-visible { box-shadow: 0 0 0 2px var(--intro-ink); }
#intro .cover.swap { opacity: 0; }
#intro .cover { transition: opacity .22s ease; }
/* album cover + title. Landscape: side by side; portrait: cover on top. Never scrolls. */
#intro { grid-template-columns: auto auto; align-items: center; gap: clamp(1.5rem, 5vw, 5rem); padding: 4vmin; box-sizing: border-box; overflow: hidden; }
#intro .cover { display: block; width: min(78vh, 52vw); height: auto; aspect-ratio: 1; object-fit: cover; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 18px 50px -20px color-mix(in srgb, var(--intro-ink) 45%, transparent); animation: fadein 1.4s var(--ease) both; }
#intro .txt { display: grid; gap: 1.1rem; text-align: left; }
#intro .txt #startBtn { justify-self: start; }
#intro.gone .cover { transform: scale(.985); transition: transform 1.2s var(--ease); }
@media (orientation: portrait) {
  #intro { grid-template-columns: auto; grid-template-rows: auto auto; gap: clamp(1rem, 4vh, 2.5rem); }
  #intro .cover { width: min(88vw, 52vh); }
  #intro .cv { justify-self: center; }
  #intro .txt { text-align: center; gap: .6rem; }
  #intro .txt #startBtn { justify-self: center; margin-top: .6rem; }
}
@keyframes fadein { from { opacity: 0; } }
#grain { position: fixed; inset: 0; pointer-events: none; z-index: 20; mix-blend-mode: multiply; opacity: .55; background-size: 160px; }
#intro h1 { font-size: clamp(2.6rem, min(7vw, 11vh), 7rem); line-height: 1; margin: 0; animation: rise 1.6s var(--ease) both; }
#intro .artist { opacity: .75; margin: 0; font-size: clamp(1rem, 2.4vw, 1.5rem); animation: rise 1.6s .25s var(--ease) both; }
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
#intro.gone h1 { transform: translateY(-.15em) scale(.98); transition: transform 1.2s var(--ease); }
#startBtn { justify-self: center; margin-top: 1.4rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); opacity: .75; animation: rise 1.6s .5s var(--ease) both;
  transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .3s; }
#startBtn:hover, #startBtn:focus-visible { opacity: 1; transform: scale(1.06); border-color: var(--fg); outline: none; }
#startBtn svg { margin-left: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(.3em); } }

/* overlay */
#ui { position: fixed; inset: 0; pointer-events: none; transition: opacity .9s var(--ease), transform .9s var(--ease);
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; }
body.idle #ui { opacity: 0; transform: translateY(6px); }
body.idle #ui * { pointer-events: none !important; }
.panel { pointer-events: auto; padding: .8rem 1rem; border-radius: 14px;
  background: color-mix(in srgb, color-mix(in srgb, var(--bg) 70%, #fff) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1);
  }
header { justify-self: start; display: flex; gap: .9rem; align-items: baseline; }
header h1 { font-size: 1.05rem; }
header .artist { font-size: .8rem; }
#now { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; opacity: .9; }
aside { align-self: center; justify-self: end; width: min(16rem, 62vw); }
ol { list-style: none; padding: 0; }
ol button { width: 100%; display: flex; justify-content: space-between; padding: .38rem 0; opacity: .45; font-size: .88rem; font-weight: 600; letter-spacing: -.01em;
  transition: opacity .3s var(--ease), transform .3s var(--ease); }
ol button:hover { opacity: .8; }
ol button.active { opacity: 1; font-weight: 800; transform: translateX(4px); }
.dur { font-weight: 500; opacity: .7; }
.toggle { display: flex; gap: .5rem; align-items: center; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.toggle input { accent-color: var(--fg); }
footer { justify-self: end; display: flex; align-items: center; gap: 1rem; padding: .45rem .9rem .45rem .5rem; border-radius: 999px; }
.ctrl { display: flex; align-items: center; gap: .1rem; }
.ctrl button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; transition: background .25s var(--ease), transform .25s var(--ease); }
.ctrl button:hover { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.ctrl button:active { transform: scale(.92); }
.ctrl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#play svg { width: 20px; height: 20px; }
#play .i-pause, #play.playing .i-play { display: none; }
#play.playing .i-pause { display: inline; }
.pos { display: flex; align-items: center; gap: .7rem; }
#time { font-size: .7rem; font-weight: 500; opacity: .65; letter-spacing: .04em; white-space: nowrap; }
#progress { width: 7.5rem; height: 14px; display: flex; align-items: center; cursor: pointer; position: relative; }
#progress::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor; opacity: .2; }
#bar { height: 2px; background: currentColor; width: 0; border-radius: 2px; }
@media (max-width: 600px) {
  aside { align-self: end; justify-self: stretch; width: auto; margin-bottom: 0; }
  ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; }
  header .artist { display: none; }
  footer { justify-self: stretch; justify-content: space-between; }
  .pos { flex: 1; justify-content: flex-end; }
  #progress { width: auto; flex: 1; max-width: 9rem; }
}
.back { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: -10px -.4rem -10px -.5rem; align-self: center; border-radius: 50%; color: inherit; text-decoration: none; opacity: .5; font-size: 1.1rem; line-height: 1; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.back:hover, .back:focus-visible { opacity: 1; background: color-mix(in srgb, var(--fg) 10%, transparent); transform: translateX(-2px); outline: none; }

@media (prefers-reduced-motion: reduce) { #intro, #intro .cover { transition: opacity 1.2s var(--ease), visibility 0s 1.2s; } #intro .cover { transition: none; } }

/* back to landing on the start screen (the GoL screen has its own in the header panel) */
#intro .intro-back { position: fixed; top: max(.8rem, env(safe-area-inset-top)); left: max(.8rem, env(safe-area-inset-left)); z-index: 2; width: 44px; height: 44px;
  display: grid; place-items: center; font-size: 1.35rem; line-height: 1; color: var(--intro-ink); opacity: .7; text-decoration: none; transition: opacity .2s, transform .2s; }
#intro .intro-back:hover, #intro .intro-back:focus-visible { opacity: 1; transform: translateX(-2px); outline: none; }
#intro .intro-back:focus-visible { box-shadow: 0 0 0 2px var(--intro-ink); border-radius: 50%; }

#startBtn:focus:not(:focus-visible) { outline: none; }
