/* ========================================
   VIRTUOSOS METRONOME
======================================== */


/* ========================================
   GLOBAL
======================================== */

* {
  box-sizing: border-box;
}

:root {
  --vw-bg: #1e3a3a;
  --vw-text: #F0ECE7;
  --vw-gold: #CCBB9A;
  --vw-accent: #cfd152;
  --vw-accent-text: #471915;
  --vw-muted: #81866e;
  --vw-border: rgba(255, 255, 255, 0.10);

  --vw-earth: #d5c1a2;
  --vw-earth-hover: #dfceb4;
  --vw-earth-text: #3d3328;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background-color: var(--vw-bg);
  color: var(--vw-text);
}


/* ========================================
   MAIN CONTAINER
======================================== */

.metronome {
  width: min(92vw, 760px);

  margin: 0 auto;

  padding: 24px 28px 55px;

  text-align: center;
}


/* ========================================
   TOP BRANDING
======================================== */

.metronome-header {
  margin-bottom: 90px;
  opacity: 0.9;
}

.academy-name {
  display: inline-block;

  margin-bottom: 8px;

  color: var(--vw-gold);
  text-decoration: none;

  font-size: 18px;
  font-weight: 700;

  letter-spacing: 1.4px;

  opacity: 0.95;

  transition:
    color 0.15s ease,
    opacity 0.15s ease;
}

.academy-name:hover {
  color: var(--vw-text);
  opacity: 1;
}

.metronome-title {
  margin: 0;

  color: var(--vw-text);

  font-size: 14px;
  font-weight: 500;

  letter-spacing: 0.5px;

  opacity: 0.68;
}

.metronome-subtitle {
  display: none;
}


/* ========================================
   VISUAL BEATS
======================================== */

.beats {
  display: flex;

  justify-content: center;
  align-items: flex-start;

  flex-wrap: nowrap;

  gap: clamp(14px, 4vw, 34px);

  margin-top: 0;
  margin-bottom: 55px;
}

.beat {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 10px;

  opacity: 0.32;

  transition:
    opacity 0.08s linear,
    transform 0.08s linear;
}

.beat-dot {
  width: clamp(42px, 7vw, 62px);
  height: clamp(42px, 7vw, 62px);

  border-radius: 50%;

  background: rgba(240, 236, 231, 0.20);

  border: 2px solid var(--vw-border);

  transition:
    background 0.08s linear,
    transform 0.08s linear,
    box-shadow 0.08s linear;
}

.beat span {
  color: var(--vw-gold);

  font-size: 18px;
  font-weight: 600;
}


/* ========================================
   ACTIVE BEAT
======================================== */

.beat.active {
  opacity: 1;
  transform: scale(1.08);
}

.beat.active .beat-dot {
  background: var(--vw-text);

  transform: scale(1.08);

  box-shadow:
    0 0 0 7px rgba(240, 236, 231, 0.08),
    0 0 24px rgba(240, 236, 231, 0.20);
}

.beat.active span {
  color: var(--vw-text);
}


/* ========================================
   BEAT 1
======================================== */

.beat[data-beat="1"].active .beat-dot {
  background: var(--vw-accent);

  box-shadow:
    0 0 0 7px rgba(207, 209, 82, 0.10),
    0 0 28px rgba(207, 209, 82, 0.30);
}

.beat[data-beat="1"].active span {
  color: var(--vw-accent);
}


/* ========================================
   HIDDEN BEATS
======================================== */

.beat.hidden {
  display: none;
}


/* ========================================
   BPM DISPLAY
======================================== */

.tempo-display {
  margin-bottom: 42px;
}

.tempo-number-row {
  display: flex;

  justify-content: center;
  align-items: flex-end;

  gap: 12px;
}

.bpm-value {
  color: var(--vw-text);

  font-size: clamp(80px, 14vw, 125px);

  line-height: 0.85;

  font-weight: 700;

  letter-spacing: -4px;
}

.bpm-label {
  margin-bottom: 8px;

  color: var(--vw-gold);

  font-size: 16px;
  font-weight: 600;

  letter-spacing: 4px;
}


/* ========================================
   CONTROLS AREA
======================================== */

.controls-area {
  margin-bottom: 0;
}


/* ========================================
   MAIN CONTROL ROW
======================================== */

.controls {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-wrap: nowrap;

  gap: 11px;

  margin-bottom: 34px;
}

button {
  font-family: inherit;

  border: 1px solid var(--vw-border);

  cursor: pointer;

  color: var(--vw-text);

  background: rgba(255, 255, 255, 0.06);

  transition:
    transform 0.08s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

button:hover {
  border-color: var(--vw-gold);
}

button:active {
  transform: scale(0.95);
}


/* ========================================
   PREVENT DOUBLE-TAP ZOOM ON CONTROLS
======================================== */

.small-btn,
.jump-btn,
.play-btn,
.tap-btn,
.meter-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}


/* ========================================
   +/- 1 BPM
======================================== */

.small-btn {
  width: 72px;
  height: 72px;

  border-radius: 50%;

  font-size: 38px;
  font-weight: 300;
}


/* ========================================
   +/- 5 BPM
======================================== */

.jump-btn {
  width: 58px;
  height: 58px;

  border-radius: 50%;

  font-size: 16px;
  font-weight: 700;

  color: var(--vw-gold);

  border: 1px solid rgba(204, 187, 154, 0.35);

  background: rgba(255, 255, 255, 0.04);
}

.jump-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}


/* ========================================
   PLAY / STOP BUTTON
======================================== */

.play-btn {
  width: 120px;
  height: 120px;

  padding: 0;

  border: none;
  border-radius: 50%;

  display: flex;

  justify-content: center;
  align-items: center;

  background: var(--vw-accent);

  color: var(--vw-accent-text);

  flex-shrink: 0;
}

.play-btn:hover {
  background: #dadd67;
}


/* ========================================
   PLAY TRIANGLE
======================================== */

.play-icon {
  width: 0;
  height: 0;

  border-top: 19px solid transparent;
  border-bottom: 19px solid transparent;

  border-left: 31px solid var(--vw-accent-text);

  margin-left: 8px;

  transition: all 0.12s ease;
}


/* ========================================
   STOP STATE
======================================== */

.play-btn.running {
  background: #8f4941;
}

.play-btn.running:hover {
  background: #9b5148;
}

.play-btn.running .play-icon {
  width: 30px;
  height: 30px;

  margin-left: 0;

  border: none;

  background: var(--vw-text);

  border-radius: 3px;
}


/* ========================================
   TAP TEMPO
======================================== */

.tap-row {
  display: flex;

  justify-content: center;
  align-items: center;

  width: 100%;

  margin-bottom: 44px;
}

.tap-btn {
  min-width: 92px;
  height: 50px;

  padding: 0 22px;

  border-radius: 999px;

  border: 1px solid rgba(204, 187, 154, 0.45);

  background: rgba(204, 187, 154, 0.10);

  color: var(--vw-gold);

  font-size: 15px;
  font-weight: 700;

  letter-spacing: 1.5px;
}

.tap-btn:hover {
  background: var(--vw-gold);

  color: var(--vw-accent-text);
}

.tap-btn.tap-active {
  transform: scale(0.94);

  background: var(--vw-accent);

  color: var(--vw-accent-text);

  border-color: var(--vw-accent);
}


/* ========================================
   TIME SIGNATURE
======================================== */

.meter-selector {
  display: flex;

  justify-content: center;

  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 0;
}

.meter-btn {
  min-width: 62px;

  padding: 10px 16px;

  border: 1px solid rgba(204, 187, 154, 0.35);

  border-radius: 999px;

  background: transparent;

  color: var(--vw-gold);

  font-size: 15px;
  font-weight: 600;
}

.meter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.meter-btn.active {
  background: var(--vw-accent);

  color: var(--vw-accent-text);

  border-color: var(--vw-accent);
}


/* ========================================
   SECONDARY NAVIGATION
======================================== */

.metronome-navigation {
  display: flex;

  flex-direction: column;

  justify-content: center;
  align-items: center;

  gap: 12px;

  margin-top: 100px;

  margin-bottom: 45px;
}


/* ========================================
   STUDENT LOGIN / BOOK A TRIAL
======================================== */

.metronome-link {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 9px;

  min-width: 210px;

  padding: 13px 22px;

  border-radius: 12px;

  background: var(--vw-earth);

  color: var(--vw-earth-text);

  text-decoration: none;

  font-size: 14px;
  font-weight: 700;

  border: 1px solid rgba(204, 187, 154, 0.80);

  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.12);

  opacity: 1;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.metronome-link:hover {
  background: var(--vw-earth-hover);

  color: var(--vw-earth-text);

  transform: translateY(-1px);

  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.16);
}

.student-login-link,
.trial-link {
  color: var(--vw-earth-text);

  background: var(--vw-earth);

  border-color: rgba(204, 187, 154, 0.80);
}

.student-login-link:hover,
.trial-link:hover {
  color: var(--vw-earth-text);

  background: var(--vw-earth-hover);
}


/* ========================================
   NAV ICON
======================================== */

.nav-icon {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  color: var(--vw-earth-text);
}


/* ========================================
   INFORMATION / SEO CONTENT
======================================== */

.metronome-info {
  max-width: 620px;

  margin: 0 auto;

  padding-top: 30px;

  border-top: 1px solid rgba(255, 255, 255, 0.07);

  text-align: center;
}

.metronome-info h2 {
  margin: 0 0 12px;

  color: var(--vw-gold);

  font-size: 17px;
  font-weight: 500;

  opacity: 0.75;
}

.metronome-info p {
  margin: 0 auto;

  color: var(--vw-text);

  font-size: 13px;

  line-height: 1.7;

  opacity: 0.58;
}

.metronome-credit {
  margin-top: 14px !important;

  color: var(--vw-gold) !important;

  font-size: 11px !important;

  opacity: 0.55 !important;
}


/* ========================================
   ACCESSIBILITY
======================================== */

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(207, 209, 82, 0.55);

  outline-offset: 3px;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 700px) {

  .metronome {
    padding: 24px 18px 45px;
  }

  .metronome-header {
    margin-bottom: 95px;
  }

  .academy-name {
    font-size: 17px;
  }

  .beats {
    margin-top: 0;
    margin-bottom: 58px;
  }

  .tempo-display {
    margin-bottom: 44px;
  }

  .controls {
    gap: 9px;
    margin-bottom: 36px;
  }

  .small-btn {
    width: 66px;
    height: 66px;
  }

  .jump-btn {
    width: 54px;
    height: 54px;
  }

  .play-btn {
    width: 108px;
    height: 108px;
  }

  .play-icon {
    border-top-width: 17px;
    border-bottom-width: 17px;
    border-left-width: 28px;
  }

  .play-btn.running .play-icon {
    width: 27px;
    height: 27px;
  }

  .tap-row {
    margin-bottom: 46px;
  }

  .metronome-navigation {
    margin-top: 95px;
  }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 500px) {

  .metronome {
    width: 100%;

    padding: 22px 12px 40px;
  }


  /* ====================================
     BRANDING

     Extra space after:
     Free Online Metronome
  ==================================== */

  .metronome-header {
    margin-bottom: 108px;
  }


  .academy-name {
    font-size: 16px;

    letter-spacing: 1.2px;
  }


  .metronome-title {
    font-size: 13px;
  }


  /* ====================================
     BEATS

     Extra space between
     1 2 3 4 and BPM
  ==================================== */

  .beats {
    gap: 11px;

    margin-top: 0;

    margin-bottom: 64px;
  }


  .beat {
    gap: 8px;
  }


  .beat span {
    font-size: 16px;
  }


  .beat-dot {
    width: clamp(40px, 12vw, 54px);

    height: clamp(40px, 12vw, 54px);
  }


  /* ====================================
     BPM

     Space between BPM and controls
  ==================================== */

  .tempo-display {
    margin-bottom: 48px;
  }


  .tempo-number-row {
    gap: 10px;
  }


  .bpm-value {
    font-size: clamp(78px, 25vw, 110px);
  }


  .bpm-label {
    margin-bottom: 7px;

    font-size: 14px;

    letter-spacing: 3px;
  }


  /* ====================================
     CONTROLS

     Space between controls and TAP
  ==================================== */

  .controls {
    gap: 6px;

    margin-bottom: 38px;
  }


  .small-btn {
    width: 56px;

    height: 56px;

    font-size: 31px;
  }


  .jump-btn {
    width: 46px;

    height: 46px;

    font-size: 13px;
  }


  /* ====================================
     PLAY
  ==================================== */

  .play-btn {
    width: 100px;

    height: 100px;
  }


  .play-icon {
    border-top-width: 16px;

    border-bottom-width: 16px;

    border-left-width: 26px;

    margin-left: 7px;
  }


  .play-btn.running .play-icon {
    width: 25px;

    height: 25px;
  }


  /* ====================================
     TAP

     Space between TAP and time signatures
  ==================================== */

  .tap-row {
    margin-bottom: 48px;
  }


  .tap-btn {
    min-width: 88px;

    height: 48px;

    font-size: 14px;
  }


  /* ====================================
     TIME SIGNATURE
  ==================================== */

  .meter-selector {
    gap: 8px;
  }


  .meter-btn {
    min-width: 56px;

    padding: 9px 13px;

    font-size: 14px;
  }


  /* ====================================
     NAVIGATION

     Since the metronome itself is now
     taller, we no longer need the huge
     artificial 190px gap.
  ==================================== */

  .metronome-navigation {
    margin-top: 90px;

    margin-bottom: 38px;

    gap: 11px;
  }


  .metronome-link {
    min-width: 220px;

    padding: 13px 20px;

    font-size: 14px;
  }

}


/* ========================================
   VERY SMALL SCREENS
======================================== */

@media (max-width: 380px) {

  .metronome {
    padding-left: 8px;
    padding-right: 8px;
  }


  .metronome-header {
    margin-bottom: 95px;
  }


  .academy-name {
    font-size: 15px;
  }


  .beats {
    gap: 8px;

    margin-top: 0;

    margin-bottom: 58px;
  }


  .tempo-display {
    margin-bottom: 42px;
  }


  .controls {
    gap: 5px;

    margin-bottom: 34px;
  }


  .small-btn {
    width: 50px;

    height: 50px;

    font-size: 28px;
  }


  .jump-btn {
    width: 42px;

    height: 42px;

    font-size: 12px;
  }


  .play-btn {
    width: 88px;

    height: 88px;
  }


  .play-icon {
    border-top-width: 14px;

    border-bottom-width: 14px;

    border-left-width: 23px;
  }


  .play-btn.running .play-icon {
    width: 22px;

    height: 22px;
  }


  .tap-row {
    margin-bottom: 42px;
  }


  .metronome-navigation {
    margin-top: 80px;
  }


  .metronome-link {
    min-width: 205px;
  }

}