/* WavBeam Live's listen page: the app's colours and its one family, Archivo. One control, the button;
   its ring moves with the sound, so a listener can see the mix is coming through before they hear it. */

@font-face {
  font-family: "Archivo";
  src: url("/static/archivo.woff2") format("woff2-variations"), url("/static/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0e1114;
  --panel: #181d22;
  --text: #e8edf2;
  --muted: #9aa7b4;
  --line: #2a333c;
  --beam: #4fc3f7;
  --go: #69d58c;
  --warn: #ffc857;
  --level: 0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

main {
  flex: 1;
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: max(2.25rem, env(safe-area-inset-top)) 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: var(--muted);
  font-size: .9375rem;
  font-stretch: 112%;
  font-weight: 600;
}

h1 {
  margin: .5rem 0 2rem;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.15;
  font-stretch: 80%;
  font-weight: 750;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.lede { color: var(--muted); max-width: 24rem; }

#listen {
  position: relative;
  width: min(15rem, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 50% 38%, #1d252c, var(--panel) 70%);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  font-stretch: 90%;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#listen:disabled { cursor: default; color: var(--muted); }
#listen:focus-visible { outline: 3px solid var(--beam); outline-offset: 6px; }

#listen .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--line);
  transform: scale(calc(1 + var(--level) * .09));
  transition: border-color .3s ease, transform 60ms linear;
}
#listen:not(:disabled) .ring { border-color: var(--beam); }
body.playing #listen .ring { border-color: var(--go); box-shadow: 0 0 calc(8px + var(--level) * 40px) rgba(105, 213, 140, calc(.15 + var(--level) * .45)); }
body.trouble #listen .ring { border-color: var(--warn); }

#status {
  min-height: 3em;
  margin: 1.5rem 0 .5rem;
  color: var(--muted);
}
body.playing #status { color: var(--go); }
body.trouble #status { color: var(--warn); }

.meter {
  display: grid;
  gap: 5px;
  width: min(15rem, 62vw);
  margin-bottom: 1.5rem;
  opacity: .35;
  transition: opacity .3s ease;
}
body.playing .meter { opacity: 1; }
.meter .bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter .bar span { display: block; height: 100%; width: 100%; background: var(--go); transform-origin: left; transform: scaleX(0); }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100%;
  margin: 0 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.facts div { background: var(--panel); padding: .75rem .5rem; }
.facts dt { color: var(--muted); font-size: .8125rem; }
.facts dd { margin: .125rem 0 0; font-size: 1.125rem; font-weight: 650; font-variant-numeric: tabular-nums; }

.note { color: var(--muted); font-size: .875rem; max-width: 22rem; margin: auto 0 0; }

footer {
  padding: 1rem 1.5rem max(1rem, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: .8125rem;
}
footer a { color: var(--beam); }

@media (prefers-reduced-motion: reduce) {
  #listen .ring { transform: none; transition: border-color .3s ease; }
  body.playing #listen .ring { box-shadow: none; }
}
