@font-face { font-family: Newsreader; src: url(../fonts/newsreader-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: Newsreader; src: url(../fonts/newsreader-latin-wght-italic.woff2) format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(../fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2'); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --foam: #f6efe0;
  --foam-dim: rgba(246, 239, 224, .62);
  --amber: #f4b860;
  --teal: #6fd6c9;
  --serif: Newsreader, Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #02060b; color: var(--foam); overflow: hidden; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }

#stage { position: fixed; inset: 0; background: #02060b; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
#stage.idle { cursor: none; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- gate ---------- */
.gate {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background:
    radial-gradient(40% 30% at 50% 70%, rgba(244, 184, 96, .14), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, rgba(24, 66, 90, .55), transparent 60%),
    #02060b;
  transition: opacity 1.2s ease, visibility 1.2s;
}
.gate.gone { opacity: 0; visibility: hidden; }
.gate-fluke { width: 64px; fill: var(--foam); opacity: .9; margin-bottom: 26px; }
/* beta badge: the song goes to the streaming stores on 23 Nov 2026 */
.gate-beta { display: inline-block; margin: 0 0 22px; padding: 5px 13px; border: 1px solid rgba(232, 176, 90, .55); border-radius: 999px;
  font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); background: rgba(20, 14, 8, .35); }
.gate-title { font: 400 clamp(44px, 8vw, 112px)/1 var(--serif); letter-spacing: -.01em; margin: 0; }
.gate-sub { font: italic 400 clamp(17px, 1.8vw, 23px)/1.4 var(--serif); color: var(--foam-dim); margin: 18px 0 38px; max-width: 34em; }
.gate-load { width: min(300px, 60vw); height: 1px; background: rgba(246, 239, 224, .14); overflow: hidden; }
.gate-load i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .25s ease; box-shadow: 0 0 12px var(--teal); }
.gate-status { font: 400 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--foam-dim); margin: 16px 0 28px; min-height: 1em; }
.gate-note { margin: 24px 0 0; font: 400 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(246, 239, 224, .42); }

button { font: inherit; color: inherit; cursor: pointer; }
.play {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 32px 14px 24px; border-radius: 999px;
  border: 1px solid rgba(111, 214, 201, .55); background: rgba(111, 214, 201, .08);
  font: 500 13px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--teal);
  transition: background .3s, border-color .3s, transform .3s, opacity .3s;
}
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play:not(:disabled):hover { background: rgba(111, 214, 201, .2); border-color: var(--teal); transform: translateY(-1px); }
.play:disabled { opacity: .3; cursor: progress; }
.play:focus-visible, .bar button:focus-visible, .scrub:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- control bar ---------- */
.bar {
  position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: 14px;
  background: rgba(2, 8, 14, .6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(246, 239, 224, .09);
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
#stage.ready:not(.idle) .bar, #stage.paused .bar, #stage.ready .bar:focus-within { opacity: 1; pointer-events: auto; }
.bar button {
  border: 0; background: transparent; padding: 6px 8px; border-radius: 8px;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--foam-dim);
  display: inline-grid; place-items: center;
}
.bar button:hover { color: var(--foam); background: rgba(246, 239, 224, .08); }
.bar button.on { color: var(--teal); }
.bar svg { width: 18px; height: 18px; fill: currentColor; }
.bar button[hidden] { display: none; }
@media (pointer: coarse) { .bar button { min-width: 40px; min-height: 40px; } .scrub { height: 36px; } }
#pp .i-pause { display: none; }
#stage.playing #pp .i-play { display: none; }
#stage.playing #pp .i-pause { display: block; }
.clock { font: 400 12px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--foam-dim); min-width: 92px; }
.scrub { position: relative; flex: 1; height: 22px; cursor: pointer; display: flex; align-items: center; touch-action: none; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(246, 239, 224, .16); border-radius: 2px; }
.scrub i { position: absolute; left: 0; height: 2px; background: var(--teal); border-radius: 2px; box-shadow: 0 0 8px rgba(111, 214, 201, .5); }
.scrub-chapters { position: absolute; inset: 0; pointer-events: none; }
.scrub-chapters b { position: absolute; top: 7px; width: 1px; height: 8px; background: rgba(246, 239, 224, .3); }

.toast {
  position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 4;
  padding: 10px 18px; border-radius: 10px; background: rgba(2, 8, 14, .78);
  border: 1px solid rgba(246, 239, 224, .12); font: 400 13px/1.3 var(--mono); color: var(--foam);
}
@media (max-width: 560px) {
  .bar { gap: 6px; padding: 8px 10px; }
  .clock { min-width: 0; font-size: 11px; }
}

/* ---------- Suno link and end card ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.suno {
  display: inline-block; margin-top: 18px; padding: 8px 4px;
  font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(244, 184, 96, .35);
}
.suno:hover { border-bottom-color: var(--amber); }
.suno:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.endcard {
  position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 3; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  animation: endcard-in 1.2s ease both;
}
.endcard[hidden] { display: none; }
.endcard-title { margin: 0; font: italic 400 clamp(18px, 2vw, 24px)/1.2 var(--serif); color: var(--foam-dim); }
.endcard-credit { margin: 0 0 10px; max-width: 34em; font: 400 12px/1.5 var(--mono); letter-spacing: .04em; color: rgba(246, 239, 224, .55); }
.endcard-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; }
.endcard .suno { margin-top: 0; }
@keyframes endcard-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .endcard { animation: none; } }
