/* scrap, in the crush look of the hub, the map and junk: "frost" (light) and "slate" (dark) */

@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("/fonts/DejaVuSansMono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("/fonts/DejaVuSansMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --canvas: #f4f6f9;
  --ink: #141a22;
  --dim: #5d6876;
  --faint: #d6dde6;
  --tile: #e8edf3;
  --hover: rgba(26, 43, 74, 0.063);
  --bar: #28303b;
  --bar-ink: #edf1f6;
  --bar-dim: #95a1b1;
  --live: #2452c4;
  color-scheme: light;
}
[data-theme="dark"] {
  --canvas: #25282e;
  --ink: #e2e4e8;
  --dim: #979ca5;
  --faint: #3b3f48;
  --tile: #2d3038;
  --hover: rgba(255, 255, 255, 0.063);
  --bar: #1b1d22;
  --bar-ink: #e2e4e8;
  --bar-dim: #8d929b;
  --live: #8aa8ff;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  font: 12px/1.5 "DejaVu Sans Mono", ui-monospace, monospace;
  background: var(--canvas);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.dim { color: var(--dim); }
.ln { color: var(--live); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--canvas); }

/* top bar */
.topbar { flex: none; display: flex; align-items: center; height: 26px; padding: 0 4px; border-bottom: 1px solid var(--faint); }
.tab { padding: 0 6px; height: 18px; line-height: 18px; white-space: nowrap; }
a.tab:hover, button.tab:hover { background: var(--hover); }
.tab.sel { background: var(--ink); color: var(--canvas); }
.spacer { flex: 1; }

/* page */
.view { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 56px 16px 32px; }
.intro { margin: 0 0 36px 22px; max-width: 620px; }
.intro h1 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

/* listening */
.stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.listen {
  position: relative;
  width: 280px;
  height: 64px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  overflow: hidden;
}
.listen:hover { background: var(--hover); }
.listen.on { background: var(--ink); color: var(--canvas); }
.listen .meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.listen .meter span { display: block; height: 100%; width: 0; background: var(--live); transition: width 0.1s linear; }
.hint { text-align: center; min-height: 18px; }
/* how loud the microphone hears it, while listening */
.level { display: block; width: 280px; height: 4px; background: var(--faint); }
.level span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.08s linear; }
.hint.warn { color: var(--live); }
/* waiting for the answer: "searching" with dots running */
.wait .dots { display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { to { width: 4ch; } }
.drop.busy { opacity: 0.5; pointer-events: none; }
.drop {
  display: block;
  width: 280px;
  margin-top: 6px;
  padding: 12px 10px;
  border: 1px dashed var(--faint);
  color: var(--dim);
  text-align: center;
  cursor: pointer;
}
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop:hover, .drop.over { border-color: var(--ink); color: var(--ink); background: var(--hover); }
.drop:focus-within { outline: 1px solid var(--ink); outline-offset: 2px; }

/* the answer */
.result { max-width: 560px; margin: 34px auto 0; }
.verdict { font-weight: 700; margin-bottom: 8px; }
.verdict.maybe { color: var(--dim); }
.card { display: flex; gap: 14px; padding: 10px; border: 1px solid var(--faint); }
.cover { flex: none; width: 112px; height: 112px; object-fit: cover; background: var(--tile); }
.meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meta .title { font-size: 14px; overflow-wrap: anywhere; }
.meta .artist a:hover { text-decoration: underline; }
.meta .links { margin-top: 6px; }
.result .again { margin-top: 12px; }

/* status bar */
.statusbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 24px;
  padding: 0 8px;
  background: var(--bar);
  color: var(--bar-ink);
  white-space: nowrap;
}
.statusbar .r { margin-left: auto; display: flex; gap: 14px; color: var(--bar-dim); }

/* phone */
@media (max-width: 700px) {
  body { font-size: 13px; }
  .topbar { height: 40px; }
  .tab { height: 28px; line-height: 28px; padding: 0 8px; }
  .view { padding: 28px 14px 24px; }
  .intro { margin-left: 8px; }
  .listen, .drop, .level { width: 100%; max-width: 360px; }
  .listen { height: 72px; }
  .card { gap: 12px; }
  .cover { width: 88px; height: 88px; }
  .statusbar { height: calc(28px + env(safe-area-inset-bottom)); padding: 0 12px env(safe-area-inset-bottom); }
  .statusbar .keys { display: none; }
}
