:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101012;
  color: #f4f0e8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #19191d 0, #101012 52%);
}

button,
input {
  font: inherit;
}

.metronome {
  width: min(92vw, 24rem);
  display: grid;
  justify-items: center;
  gap: 2rem;
  padding: 2rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aaa39a;
}

.bpm-control {
  display: grid;
  justify-items: center;
}

.bpm-input {
  width: 7ch;
  border: 0;
  border-bottom: 1px solid #4d4944;
  border-radius: 0;
  padding: 0.2rem 0;
  appearance: textfield;
  background: transparent;
  color: #f4f0e8;
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 700;
  line-height: 0.95;
  text-align: center;
  outline: none;
}

.bpm-input:focus-visible {
  border-color: #d8c7a4;
}

.bpm-input::-webkit-outer-spin-button,
.bpm-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.bpm-step-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: -1.4rem;
}

.bpm-step,
.tap-tempo {
  height: 2.4rem;
  border: 1px solid #3a3733;
  border-radius: 999px;
  background: transparent;
  color: #aaa39a;
  cursor: pointer;
}

.bpm-step {
  width: 2.4rem;
}

.tap-tempo {
  min-width: 4.2rem;
  padding: 0 0.9rem;
}

.bpm-step:focus-visible,
.bpm-step:hover,
.tap-tempo:focus-visible,
.tap-tempo:hover {
  border-color: #d8c7a4;
  color: #f4f0e8;
}

.subdivision-row {
  display: flex;
  gap: 0.55rem;
  margin-top: -0.7rem;
}

.subdivision {
  min-width: 2.6rem;
  height: 2.2rem;
  border: 1px solid #302e2b;
  border-radius: 999px;
  background: transparent;
  color: #8d867d;
  cursor: pointer;
  font-size: 1.05rem;
}

.subdivision:focus-visible,
.subdivision:hover {
  border-color: #d8c7a4;
  color: #f4f0e8;
}

.subdivision-active {
  border-color: #d8c7a4;
  color: #101012;
  background: #d8c7a4;
}

.beat-row {
  display: grid;
  grid-template-columns: repeat(4, 2.4rem);
  gap: 0.6rem;
  justify-content: center;
}

.beat {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid #3a3733;
  border-radius: 999px;
  color: #77716a;
  font-size: 1rem;
  transition: border-color 80ms linear, color 80ms linear, background 80ms linear;
}

.beat-active {
  border-color: #d8c7a4;
  background: #d8c7a4;
  color: #101012;
}

.primary-action {
  min-width: 8rem;
  border: 1px solid #d8c7a4;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #f4f0e8;
  cursor: pointer;
}

.primary-action:focus-visible,
.primary-action:hover {
  background: #d8c7a4;
  color: #101012;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
