/* ============================================================
   BPM Tap Tempo Detector — page-specific styles
   Dark theme, uses design tokens from /css/styles.css
   ============================================================ */

.bpm-page {
  --bg: #0C1A14;
  --bg-card: #12251B;
  --bg-card-border: #1F4B34;
  --text: #E8F5EE;
  --text-dim: #7CA88E;
  --accent: #10B981;
  --accent-hover: #059669;
  --pulse: rgba(16, 185, 129, 0.3);
}

/* ── Layout ── */
.bpm-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  background: var(--bg);
  min-height: 100vh;
}

body:has(.bpm-page) { background: #0C1A14; }
body:has(.bpm-page) .nav { background: rgba(12, 26, 20, 0.92); border-bottom-color: #1F4B34; }
body:has(.bpm-page) .nav__menu a { color: #7CA88E; }
body:has(.bpm-page) .nav__menu a:hover,
body:has(.bpm-page) .nav__menu a.active { color: #10B981; }
body:has(.bpm-page) .footer { background: #0A1610; color: #7CA88E; }
body:has(.bpm-page) .footer h4 { color: #E8F5EE; }
body:has(.bpm-page) .footer a { color: #7CA88E; }
body:has(.bpm-page) .footer a:hover { color: #10B981; }
body:has(.bpm-page) .footer__bottom { border-top-color: #1F4B34; color: #5A8A6E; }
body:has(.bpm-page) .footer__brand p,
body:has(.bpm-page) .footer .loc { color: #5A8A6E; }

.bpm-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.bpm-page .page-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 32px;
  text-align: center;
}
.bpm-page .page-subtitle strong { color: var(--text); font-weight: 500; }

/* ── Card ── */
.bpm-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}

/* ── BPM Display ── */
.bpm-display {
  margin-bottom: 32px;
}
.bpm-number {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}
.bpm-number.active { color: var(--accent); }
.bpm-unit {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.bpm-marking {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--accent);
  margin-top: 8px;
  font-style: italic;
}

/* ── Tap Button ── */
.bpm-tap {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.3);
  transition: transform 0.08s, box-shadow 0.08s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.bpm-tap:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 32px rgba(16, 185, 129, 0.4);
}
.bpm-tap:active {
  transform: scale(0.95);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.2);
}
.bpm-tap__text {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.bpm-tap__hint {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.6);
  pointer-events: none;
}

/* Pulse ring */
.bpm-tap__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
@keyframes bpm-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.bpm-tap__pulse.pulse {
  animation: bpm-pulse 0.5s ease-out;
}

/* ── Stats ── */
.bpm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.bpm-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.bpm-stat__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.bpm-stat__value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Actions ── */
.bpm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.bpm-btn--ghost {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.bpm-btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.bpm-btn--accent {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
}
.bpm-btn--accent:hover { background: var(--accent-hover); }

/* ── History ── */
.bpm-history-card { margin-top: 20px; text-align: left; }
.bpm-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.bpm-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bpm-history__item {
  padding: 4px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
}

/* ── Info Sections ── */
.bpm-info {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 20px;
  color: var(--text);
}
.bpm-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 16px;
  color: var(--text);
}
.bpm-info ol {
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.8;
}
.bpm-info ol strong { color: var(--text); font-weight: 500; }
.bpm-info p {
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 10px;
}
.bpm-info p:last-child { margin-bottom: 0; }
.bpm-info p strong { color: var(--text); font-weight: 500; }
.bpm-info--links p { font-size: 0.9375rem; }
.bpm-info a { color: var(--accent); text-decoration: none; }
.bpm-info a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .bpm-page { padding: 32px 16px 64px; }
  .bpm-card { padding: 24px 16px; }
  .bpm-tap { width: 150px; height: 150px; }
  .bpm-tap__text { font-size: 1.5rem; }
  .bpm-stats { grid-template-columns: repeat(2, 1fr); }
  .bpm-actions { flex-direction: column; }
  .bpm-btn--accent { text-align: center; }
}
