*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: #0a0a0c;
  color: #e8e8ec;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: manipulation;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.site-header,
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  background-color: #5b8def;
  color: #0a0a0c;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-header {
  top: 0;
  padding: 0.5rem 1rem 0.5rem 2rem;
}

.site-footer {
  bottom: 0;
  padding: 0.5rem 1rem;
  text-align: left;
}

.site-footer__link,
.site-footer__link:visited,
.site-footer__link:hover,
.site-footer__link:active {
  color: #0a0a0c;
  text-decoration: none;
}

.audio-unlock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 0;
  padding: 1.5rem;
  border: none;
  background: rgba(10, 10, 12, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #5b8def;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.audio-unlock__title {
  font-size: clamp(2rem, 12vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.audio-unlock__hint {
  max-width: 360px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: center;
  color: #888;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Row 1 — frequency display */
.freq-display {
  width: 100%;
  text-align: center;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-size: clamp(5rem, 10vw, 3rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #5b8def;
  text-shadow: 0 0 24px rgba(91, 141, 239, 0.35);
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}

/* Row 2 & 3 — dials */
.dial-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.dial-row--split {
  gap: 1rem;
}

.dial {
  display: block;
  touch-action: none;
  cursor: pointer;
}

.dial--freq {
  width: 40vw;
  height: 40vw;
  max-width: 288px;
  max-height: 288px;
}

.dial-row--split .dial--bounded {
  width: 30vw;
  height: 30vw;
  max-width: 100px;
  max-height: 100px;
}

/* Row 4 — waveform buttons */
.waveform-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.waveform-btn {
  aspect-ratio: 3 / 2;
  min-height: 0;
  padding: 0.4rem;
  border: 2px solid #2a2a32;
  border-radius: 8px;
  background-color: #141418;
  color: #e8e8ec;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.waveform-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.waveform-btn:hover {
  border-color: #3a3a44;
}

.waveform-btn[data-waveform="sine"].waveform-btn--active {
  border-color: #22c55e;
  background-color: #0f1a12;
}

.waveform-btn[data-waveform="saw"].waveform-btn--active {
  border-color: #3b82f6;
  background-color: #0f1524;
}

.waveform-btn[data-waveform="square"].waveform-btn--active {
  border-color: #eab308;
  background-color: #1a1708;
}

.waveform-btn[data-waveform="whiteNoise"].waveform-btn--active {
  border-color: #f8fafc;
  background-color: #1a1a1c;
}

.waveform-btn[data-waveform="pinkNoise"].waveform-btn--active {
  border-color: #ec4899;
  background-color: #1a0f16;
}

.waveform-btn:focus-visible {
  outline: 2px solid #5b8def;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .waveform-btn {
    transition: none;
  }
}
