/* ─── Design tokens ──────────────────────────────── */
:root {
    --ink:        #0d2b33;
    --paper:      #f4f8f8;
    --rule:       #ccdfe3;
    --accent:     #f3932d;
    --accent-alt: #164450;
    --muted:      #4a7080;
    --surface:    #ffffff;
    --shadow:     0 2px 12px rgba(26,26,46,.08);
    --radius:     6px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Source Sans 3', 'Segoe UI', sans-serif;
}

/* ─── Reset & base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background-color: var(--paper);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 12px 48px;
    min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────── */
.site-header {
    text-align: center;
    max-width: 680px;
    margin-bottom: 28px;
    padding: 0 8px;
}

.site-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
    line-height: 1.15;
}

.site-header h1 span { color: var(--accent); }

.site-header h2 {
    font-family: var(--font-body);
    font-size: clamp(.85rem, 2.5vw, 1rem);
    font-weight: 400;
    color: var(--muted);
    margin-top: 6px;
    letter-spacing: .01em;
}

/* Thin decorative rule below the title */
.site-header::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background: var(--accent);
    margin: 16px auto 0;
}

/* ─── Control panels ─────────────────────────────── */
.controls-wrapper {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 20px;
}

/* ─── Labels & inputs ────────────────────────────── */
.field {
    display: flex;
    align-items: center;
    gap: 8px;
}

label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

select,
input[type="number"] {
    font-family: var(--font-body);
    font-size: .9rem;
    padding: 7px 10px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    outline: none;
    transition: border-color .15s;
}
select:focus,
input[type="number"]:focus { border-color: var(--accent-alt); }
input[type="number"] { width: 64px; text-align: center; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, transform .08s;
}
.btn:active { transform: scale(.97); }

.btn-generate {
    background: var(--accent-alt);
    color: #fff;
}
.btn-generate:hover { background: #1e4a72; }

.btn-metro {
    background: #2e7d52;
    color: #fff;
    min-width: 110px;
}
.btn-metro:hover { background: #235e3d; }
.btn-metro.is-playing { background: var(--accent); }
.btn-metro.is-playing:hover { background: #a93226; }

/* ─── BPM slider ─────────────────────────────────── */
input[type="range"] {
    width: 110px;
    accent-color: var(--accent-alt);
    cursor: pointer;
}

/* ─── Sheet music container ──────────────────────── */
#score-output {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 8px;
    width: 100%;
    max-width: 860px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    margin-bottom: 32px;
}

/* ─── Footer SEO block ───────────────────────────── */
.seo-footer {
    max-width: 680px;
    padding: 24px 16px 0;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.7;
    text-align: center;
}
.seo-footer h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 8px;
}
.seo-footer a { color: var(--accent-alt); text-decoration: none; }
.seo-footer a:hover { text-decoration: underline; }

/* ─── Language switcher ──────────────────────────── */
#lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--rule);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    outline: none;
}
#lang-switcher:focus { border-color: var(--accent-alt); }

/* ─── Mobile tweaks ──────────────────────────────── */
@media (max-width: 480px) {
    .btn { width: 100%; }
}
