/* The static fingering-chart pages (written by tools/chartPages.mjs). The chart rules are the
   app's own (src/style.css, "Fingering chart page" and the woodwind/mallet pad), re-pointed at
   this page's few variables. Keep the two in step when the chart's look changes. */

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Bravura';
    font-display: block;
    src: url('/assets/fonts/bravura.woff2') format('woff2');
}

:root {
    --bg: #ffffff;
    --border: #e5e5ea;
    --text: #26302b;
    --text-secondary: #6b6f76;
    --accent: #f7c100;
    --accent-dark: #d99e00;
    --on-accent: color-mix(in oklch, #f7c100 32%, black);
}
html[data-theme="dark"] {
    --bg: #22262c;
    --border: #3a3e44;
    --text: #e4e6e8;
    --text-secondary: #8c8e91;
    --accent-dark: #caa015;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Nunito', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }
.top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--border);
}
.legal-logo { height: 30px; width: auto; aspect-ratio: 999.95 / 340.62; color: var(--accent); display: block; }
.back { font-weight: 700; text-decoration: none; color: var(--accent-dark); white-space: nowrap; }
.back:hover { text-decoration: underline; }
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 800; margin: 48px 0 4px; }
h3 { font-size: 0.95rem; font-weight: 800; margin: 18px 0 6px; color: var(--text-secondary); }
.lead { font-size: 1.05rem; margin: 0 0 4px; }
.note { color: var(--text-secondary); margin: 0 0 20px; }
.cta { margin: 0 0 28px; }
.btn {
    display: inline-block; padding: 10px 20px; border-radius: 8px;
    background: var(--accent); color: var(--on-accent);
    font-weight: 800; text-decoration: none;
}
.btn:hover { background: color-mix(in oklch, var(--accent) 85%, black); }
.others ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.others a { color: var(--text); font-weight: 700; text-decoration: none; }
.others a:hover { color: var(--accent-dark); text-decoration: underline; }
.others li:not(:has(a)) { color: var(--text-secondary); font-weight: 700; }
.others--hub ul { flex-direction: column; gap: 6px; }
.others--hub a { font-size: 1.1rem; }
.foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 0.9rem; }
.foot a { color: var(--text-secondary); }

/* ── The chart (from src/style.css) ── */
.chart {
    --color-text: var(--text);
    --color-bg: var(--bg);
    --color-border: var(--border);
}
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}
.chart-grid--ww { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.chart-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 30px 8px 14px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.chart-cell-name { position: absolute; top: 9px; left: 11px; font-size: 0.8rem; font-weight: 800; }
.chart-staff { display: flex; justify-content: center; }
.chart-staff svg text, .chart-staff svg tspan { font-family: 'Bravura', serif !important; fill: var(--color-text); }
.chart-staff svg { height: auto; max-width: 100%; display: block; overflow: visible; }
.chart-staff svg path, .chart-staff svg rect, .chart-staff svg line, .chart-staff svg use, .chart-staff svg polygon {
    fill: var(--color-text);
    stroke: var(--color-text);
}
.chart-cell-fingering { font-size: 1.35rem; font-weight: 800; line-height: 1; min-height: 1em; letter-spacing: 0.01em; }
.chart-cell-diagram { height: 260px; display: flex; justify-content: center; }

.ww-diagram { height: 100%; width: auto; aspect-ratio: 100 / 240; display: block; overflow: visible; }
.ww-shape { fill: var(--color-bg); stroke-linejoin: round; stroke: var(--color-text); stroke-width: 1.1; }
.ww-part { fill: var(--color-text); }
.ww-key.on .ww-shape { fill: var(--color-text); }

.chart-mallets { display: flex; flex-direction: column; gap: 22px; }
.mallet-kb {
    --wood: #c99a6b;
    --wood-edge: #8d6440;
    --wood-ink: #3a2312;
    position: relative;
    width: 100%;
    height: 200px;
    max-width: 820px;
}
html[data-theme="dark"] .mallet-kb { --wood: #a7784d; --wood-edge: #5d3f25; --wood-ink: #22140a; }
.mallet-bar {
    position: absolute;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mallet-bar--natural { top: 46%; height: 54%; }
.mallet-bar--sharp { top: 0; height: 42%; z-index: 1; }
.mallet-face {
    position: relative;
    width: 100%;
    height: calc(var(--len, 1) * 100%);
    border-radius: 3px;
    background: var(--wood);
    box-shadow: inset 0 0 0 1px var(--wood-edge), 0 2px 0 var(--wood-edge);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14%;
}
.mallet-bar--natural .mallet-face::before {
    content: '';
    position: absolute;
    top: 9%;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--wood-edge);
}
.mallet-bar--sharp .mallet-face { padding-bottom: 10%; }
.mallet-label {
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--wood-ink);
    text-align: center;
    white-space: pre-line;
}

@media (max-width: 560px) {
    .wrap { padding: 20px 14px 48px; }
    h1 { font-size: 1.6rem; }
    .chart-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .chart-cell-diagram { height: 220px; }
    .mallet-kb { height: 160px; }
    .mallet-label { font-size: 0.55rem; }
}
