/* Shared by the free web tools (metronome, tap tempo). Colours follow the
   Downbeat landing page: ember orange on a near-black background. */

:root {
    --bg: #0f0f1e;
    --bg-2: #121220;
    --card: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f4f4f5;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --ember: #ff7a29;
    --ember-hi: #ffa94d;
    --ember-lo: #e8501a;
}

body { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); color: var(--text); }

:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; }

.tool-page { max-width: 760px; margin: 0 auto; padding: 5rem 1rem 3rem; }

.back-link {
    position: absolute; top: 1.5rem; left: 1.5rem;
    color: var(--text-2); text-decoration: none; font-size: 0.9rem;
}
.back-link:hover { color: var(--ember); }

.tool-header { text-align: center; margin-bottom: 2rem; }
/* The site-wide header glow is cyan; Downbeat's is ember. */
.tool-header::before { background: radial-gradient(closest-side, rgba(255, 122, 41, 0.14), transparent 70%); }
.tool-header h1 {
    font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -0.02em; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--ember-hi) 0%, var(--ember) 40%, var(--ember-lo) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tool-header p { color: var(--text-2); font-size: 1.05rem; }

.panel {
    background: var(--card);
    border: 1px solid rgba(255, 122, 41, 0.15);
    border-radius: 24px;
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* Buttons */
.btn {
    font: inherit; font-weight: 600; color: var(--text);
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
    border-radius: 14px; padding: 0.7rem 1.1rem; cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.96); }
.btn.primary {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--ember) 0%, var(--ember-lo) 100%);
    box-shadow: 0 10px 30px rgba(255, 122, 41, 0.35);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.round { width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; }

/* Segmented choices (time signature, subdivision, sound) */
.field { margin-top: 1.5rem; }
.field-label {
    display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text-2); margin-bottom: 0.6rem;
}
.segments { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.segments button {
    font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text-2);
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.45rem 0.95rem; cursor: pointer;
    touch-action: manipulation;
}
.segments button:hover { color: var(--text); }
.segments button[aria-pressed="true"] { color: #fff; background: var(--ember); border-color: var(--ember); }

input[type="range"] { width: 100%; accent-color: var(--ember); }

.kbd-hint { margin-top: 1.25rem; text-align: center; color: var(--text-3); font-size: 0.85rem; }
kbd {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8em; color: var(--text-2);
    border: 1px solid var(--border); border-radius: 5px; padding: 0.05rem 0.35rem;
}

/* The app promo under each tool */
.app-card {
    display: flex; gap: 1.25rem; align-items: center; margin-top: 2.5rem;
    background: linear-gradient(160deg, rgba(255, 122, 41, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 122, 41, 0.3); border-radius: 20px; padding: 1.5rem;
}
.app-card img { width: 72px; height: 72px; border-radius: 17px; flex-shrink: 0; }
.app-card h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.app-card p { color: var(--text-2); font-size: 0.95rem; margin-bottom: 0.75rem; }
.app-card a { color: var(--ember-hi); font-weight: 600; text-decoration: none; }
.app-card a:hover { text-decoration: underline; }

/* Explainer text under the tool, for people and search engines */
.guide { margin-top: 3rem; color: var(--text-2); line-height: 1.75; }
.guide h2 { color: var(--text); font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.guide h3 { color: var(--text); font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.guide p, .guide ul { margin-bottom: 0.9rem; }
.guide ul { padding-left: 1.25rem; }
.guide a { color: var(--ember-hi); }
.guide table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; font-size: 0.95rem; }
.guide th, .guide td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.guide th { color: var(--text); font-weight: 600; }

.site-footer { margin-top: 3rem; text-align: center; color: var(--text-3); font-size: 0.85rem; }
.site-footer a { color: var(--text-2); text-decoration: none; margin: 0 0.6rem; }
.site-footer a:hover { color: var(--ember); }

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

/* Keyboard shortcuts mean nothing on a phone. */
@media (hover: none) {
    .kbd-hint { display: none; }
}

@media (max-width: 520px) {
    .app-card { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
