/* After Ye's digital work (the Stem Player and Yeezy sites, Donda): black, plain Helvetica, small
   capitals, no decoration. The disc is the only thing with colour; everything else is type. */
:root {
  --bg: #000;
  --ink: #fff;
  --ink-2: #8c8c8c;
  --ink-3: #4a4a4a;
  --line: #262626;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --track: 0.06em;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 11px/1.4 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; gap: 24px;
  padding: 18px 24px; pointer-events: none;
}
.top h1 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
#status { margin: 0; color: var(--ink-2); text-align: right; }

.labels { position: fixed; inset: 0; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s, opacity 0.2s;
}
.label i { width: 5px; height: 5px; background: var(--c); }
.label .pct { opacity: 0.7; display: none; }
.label.focus { color: var(--ink); }
.label.focus .pct { display: inline; }
.label.muted, .label.silenced { opacity: 0.4; }
.label.solo { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.fx .label i { background: var(--ink); }
.fx .label .pct { display: inline; }

#hint {
  /* Plain words on a black block, so they read over a label or the disc. */
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%);
  margin: 0; max-width: min(440px, calc(100vw - 32px));
  padding: 6px 10px; background: var(--bg);
  text-align: center; text-transform: none; letter-spacing: 0.01em;
  font-size: 12px; color: var(--ink); z-index: 2;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
#hint.show { opacity: 1; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 22px;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
}
.spacer { flex: 1; }

/* The timeline: a hairline that fills as the song plays; drag anywhere on it to move. */
#scrub {
  flex: 1; min-width: 80px; height: 20px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
  --p: 0%;
}
#scrub::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--ink-3) var(--p));
}
#scrub::-moz-range-track { height: 1px; background: var(--ink-3); }
#scrub::-moz-range-progress { height: 1px; background: var(--ink); }
#scrub::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1px; height: 11px; margin-top: -5px;
  background: var(--ink); border: none; transition: width 0.12s;
}
#scrub::-moz-range-thumb { width: 1px; height: 11px; border-radius: 0; background: var(--ink); border: none; }
#scrub:hover::-webkit-slider-thumb, #scrub:active::-webkit-slider-thumb { width: 3px; }
#time { color: var(--ink-2); }

/* Buttons are words. Grey until you point at them; white when on. */
button, .btn {
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--ink-2);
  background: none; border: 0; border-radius: 0;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
button:hover, .btn:hover { color: var(--ink); }
button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; cursor: progress; }
#play { min-width: 44px; text-align: left; color: var(--ink); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
/* On words, focus is an underline, the same mark as "on", so it stays in the type. */
button:focus-visible, .btn:focus-visible, .btn:has(+ #file:focus-visible) {
  outline: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

#cam {
  position: fixed; right: 24px; bottom: 60px;
  width: 200px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
#video { position: absolute; width: 1px; height: 1px; opacity: 0; }
#preview { display: block; width: 100%; aspect-ratio: 4 / 3; }
#cam-status { margin: 0; padding: 7px 9px 8px; font-size: 10px; color: var(--ink-2); display: flex; gap: 7px; align-items: center; }
#cam-status::before { content: ""; flex: none; width: 5px; height: 5px; background: var(--ink-3); transition: background 0.15s; }
#cam[data-state="found"] #cam-status { color: var(--ink); }
#cam[data-state="found"] #cam-status::before { background: var(--ink-2); }
#cam[data-state="held"] { border-color: var(--ink-2); }
#cam[data-state="held"] #cam-status { color: var(--ink); }
#cam[data-state="held"] #cam-status::before { background: var(--ink); }

.drop {
  position: fixed; inset: 0; z-index: 6;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.86);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  text-align: center; font-size: 11px; line-height: 2;
}
.drop small { display: block; color: var(--ink-2); font-size: 10px; }
.dragging .drop { opacity: 1; }

.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;
}

/* ---------------------------------------------------------------- entry screen */

/* The object alone in the middle of the frame, like a product page; a name and two words below. */
#intro {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 24px clamp(32px, 9vh, 96px);
  text-align: center;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
body:not(.intro) #intro { opacity: 0; visibility: hidden; pointer-events: none; }
body.intro .top, body.intro .bar, body.intro .labels, body.intro #hint, body.intro #cam { opacity: 0; pointer-events: none; }
.top, .bar, .labels { transition: opacity 0.6s ease 0.35s; }

.intro-inner > * { margin: 0; animation: appear 1.2s ease both; }
.intro-inner > :nth-child(2) { animation-delay: 0.15s; }
.intro-inner > :nth-child(3) { animation-delay: 0.3s; }
@keyframes appear { from { opacity: 0; } }

#intro-title { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; }
.actions { margin-top: 22px; display: flex; justify-content: center; gap: 32px; }
.btn.primary { color: var(--ink); }
.note:empty { display: none; }
.note { margin-top: 18px; font-size: 10px; color: var(--ink-2); }
.note.error { color: var(--ink); }

@media (max-width: 560px) {
  .top { padding: 16px; }
  .bar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 18px; flex-wrap: wrap; }
  #time { display: none; }
  #scrub { order: -1; flex-basis: 100%; margin: 0 0 2px; }
  #hint { bottom: 96px; }
  #cam { right: 16px; bottom: 64px; width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  #hint, .label, .drop, #intro, .top, .bar, .labels { transition: none; }
  .intro-inner > * { animation: none; }
}
