/* web-metronome/web/style.css */
/* Design matches truemetronome.app */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #000000;
    --surface: #111111;
    --accent: #c9a962;
    --accent-glow: rgba(201, 169, 98, 0.4);
    --text: #f5f5f7;
    --text-muted: #86868b;
    --text-tertiary: #6e6e73;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation — matches truemetronome.app */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 2rem;
    height: 52px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-container {
    max-width: 1024px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo span {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.nav-active {
    color: var(--text);
}

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

.page-title {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.5px;
}

/* Metronome App */
.metronome-app {
    max-width: 420px;
    margin: 0 auto;
    padding: 76px 20px 32px; /* top padding accounts for fixed nav */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Pendulum */
.pendulum-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

#pendulum {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 3 / 4;
}

/* BPM Display */
.bpm-display {
    display: flex;
    align-items: center;
    gap: 28px;
}

.bpm-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#bpm-number {
    font-size: 64px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -1px;
    display: inline-block;
    min-width: 3ch; /* fits 3 digits (40–208), prevents layout shift */
    text-align: center;
}

.bpm-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 4px;
}

.bpm-btn {
    width: 44px;
    height: 44px;
    margin-bottom: 18px; /* offset down to align with number, not number+label */
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.bpm-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.bpm-btn:active {
    background: rgba(201, 169, 98, 0.15);
}

/* Slider */
.slider-container {
    width: 100%;
    padding: 0 8px;
}

#bpm-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

#bpm-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.control-btn {
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.15s,
                box-shadow 0.2s;
}

.control-btn:active {
    transform: scale(0.95);
}

.tap-btn {
    padding: 12px 28px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 24px;
}

.tap-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
}

.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}

.play-btn:hover {
    box-shadow: 0 0 30px var(--accent-glow);
}

.play-btn.playing {
    background: var(--text-muted);
    box-shadow: none;
}

/* Play/pause button icon color */
.play-btn svg {
    display: block;
}

.play-btn {
    color: #000;
}

.play-btn.playing {
    color: #000;
}

/* Unsupported */
.unsupported {
    text-align: center;
    padding: 24px;
    margin: 76px auto 0;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    line-height: 1.6;
    color: var(--text-muted);
}

.unsupported a {
    color: var(--accent);
    text-decoration: none;
}

/* CTA Banner */
.cta-banner {
    text-align: center;
    padding: 24px 16px;
    margin: 8px auto 0;
    max-width: 420px;
}

.cta-text {
    font-size: 15px;
    color: var(--text-muted);
}

.cta-link {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.cta-link:hover {
    opacity: 0.8;
}

/* SEO Content */
.seo-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px;
    line-height: 1.6;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 40px 0 12px;
    color: var(--text);
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text);
}

.seo-content p,
.seo-content li {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.seo-content ul {
    padding-left: 20px;
}

.seo-content li {
    margin-bottom: 8px;
}

/* Related Tempos (SEO subpages + hub) */
.related-tempos {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
}

.related-tempos h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.tempo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tempo-links a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.tempo-links a:hover {
    border-color: var(--accent);
    color: var(--text);
}

.back-link {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.back-link a {
    color: var(--accent);
    text-decoration: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    max-width: 640px;
    margin: 0 auto;
}

.footer a {
    color: var(--text-tertiary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 0 1rem;
        height: 48px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .logo span {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
    }

    .metronome-app {
        padding-top: 56px;
        gap: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    #pendulum {
        max-width: 200px;
    }

    #bpm-number {
        font-size: 48px;
    }

    .play-btn {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .tap-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}

@media (min-width: 769px) {
    #bpm-number {
        font-size: 80px;
    }
}
