@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

: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;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 2rem;
  padding: 2rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  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,
.beat-count-step {
  height: 2.4rem;
  border: 1px solid #3a3733;
  border-radius: 999px;
  background: transparent;
  color: #aaa39a;
  cursor: pointer;
}

.bpm-step,
.beat-count-step {
  width: 2.4rem;
}

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

.beat-count-value {
  min-width: 2.4rem;
  color: #f4f0e8;
  font-size: 1.05rem;
}

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

.subdivision-row,
.beat-count-row,
.beat-pattern-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: 0.55rem;
  margin-top: -0.7rem;
}

.beat-count-row {
  align-items: center;
  gap: 0.75rem;
}

.subdivision,
.beat-state-toggle {
  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,
.beat-state-toggle:focus-visible,
.beat-state-toggle:hover {
  border-color: #d8c7a4;
  color: #f4f0e8;
}

.subdivision-active,
.beat-state-accent {
  border-color: #d8c7a4;
  color: #101012;
  background: #d8c7a4;
}

.beat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  max-width: 100%;
}

.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,
.reset-settings {
  border: 1px solid #d8c7a4;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.primary-action {
  min-width: 8rem;
  padding: 0.75rem 1.5rem;
  color: #f4f0e8;
}

.reset-settings {
  margin-top: -1rem;
  border-color: #302e2b;
  padding: 0.4rem 0.85rem;
  color: #8d867d;
  font-size: 0.9rem;
}

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

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

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