:root {
  --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9; --text: #0f172a; --muted: #475569; --border: #e2e8f0;
  --accent: #2563eb; --good: #16a34a; --warn: #ea580c; --needle: #0f172a; --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1120; --surface: #111827; --surface-2: #1e293b; --text: #e2e8f0; --muted: #94a3b8; --border: #1f2a3c;
          --accent: #60a5fa; --good: #22c55e; --warn: #fb923c; --needle: #e2e8f0; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .9rem 16px; max-width: 980px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand-mark { color: var(--good); }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); text-decoration: underline; }
main { max-width: 980px; margin: 0 auto; padding: 0 16px 3rem; }
.hero { text-align: center; padding: 1rem 0 .5rem; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 .4rem; letter-spacing: -0.02em; }
.lead { color: var(--muted); max-width: 640px; margin: 0 auto; }

/* ---- tuner ---- */
.tuner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin: 1.25rem auto; max-width: 640px; box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35); }
.tuner-controls { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.tuner-field { display: flex; flex-direction: column; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; gap: .25rem; }
.tuner-field select { font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; min-width: 11rem; }
.tuner-display { display: grid; justify-items: center; margin-top: .5rem; }
.gauge { width: min(100%, 360px); }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge-arc { fill: none; stroke: var(--surface-2); stroke-width: 18; stroke-linecap: round; }
.gauge-zone { fill: none; stroke: var(--good); stroke-width: 18; opacity: .35; }
.tick { stroke: var(--muted); stroke-width: 2; opacity: .6; }
.tick-zero { stroke: var(--good); stroke-width: 3; opacity: 1; }
.gauge-label { fill: var(--muted); font-size: 20px; }
.needle { transform-origin: 150px 150px; transition: transform .12s ease-out; }
.needle line { stroke: var(--needle); stroke-width: 4; stroke-linecap: round; }
.needle circle { fill: var(--needle); }
.tuner:not(.has-pitch) .needle { opacity: .25; }
.tuner.in-tune .needle line, .tuner.in-tune .needle circle { stroke: var(--good); fill: var(--good); }
.readout { text-align: center; margin-top: -.6rem; min-height: 8.2rem; }
.note { font-size: 4.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.octave { font-size: 1.6rem; font-weight: 700; color: var(--muted); margin-left: .1rem; }
.tuner.in-tune .note { color: var(--good); }
.cents { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.hz { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.hint { font-weight: 600; color: var(--warn); min-height: 1.6em; }
.tuner.in-tune .hint { color: var(--good); }
.strings { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: .5rem 0 1rem; }
.string-btn { display: flex; flex-direction: column; align-items: center; min-width: 4.4rem; padding: .55rem .7rem; border-radius: 12px; border: 2px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.string-btn:hover { border-color: var(--accent); }
.string-note { font-size: 1.25rem; font-weight: 700; }
.string-note sub { font-size: .7em; color: var(--muted); }
.string-hz { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.string-btn.target { border-color: var(--warn); }
.string-btn.in-tune { border-color: var(--good); background: color-mix(in srgb, var(--good) 15%, var(--surface-2)); }
.string-btn.playing { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.start-btn { display: block; width: 100%; padding: .95rem 1rem; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.tuner.is-on .start-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.status { text-align: center; color: var(--muted); font-size: .88rem; margin: .6rem 0 0; }

/* ---- content ---- */
.content { max-width: 720px; margin: 2rem auto 0; }
.content h2 { margin-top: 2.2rem; font-size: 1.45rem; letter-spacing: -0.01em; }
.content h3 { font-size: 1.05rem; margin: 1.2rem 0 .3rem; }
.notes-table { border-collapse: collapse; width: 100%; margin: .75rem 0; background: var(--surface); border-radius: 12px; overflow: hidden; }
.notes-table caption { text-align: left; font-weight: 600; padding: .3rem 0; }
.notes-table th, .notes-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); text-align: left; font-variant-numeric: tabular-nums; }
.table-note { color: var(--muted); font-size: .88rem; }
.steps li { margin-bottom: .45rem; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.tip { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .2rem 1rem .6rem; }
.faq { border-top: 1px solid var(--border); }
.instrument-grid { max-width: 820px; margin: 2rem auto 0; }
.instrument-grid h2 { text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.card { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card span { color: var(--muted); font-size: .82rem; }
.other { columns: 2; }
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 16px; max-width: 980px; margin-left: auto; margin-right: auto; color: var(--muted); font-size: .9rem; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 2rem; }
.footer-cols h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .4rem; }
.footer-cols a { display: block; color: var(--muted); text-decoration: none; }
.footer-cols a:hover { color: var(--text); }
.fine { font-size: .8rem; }
@media (max-width: 480px) { .note { font-size: 3.4rem; } .string-btn { min-width: 3.9rem; padding: .5rem; } .other { columns: 1; } }
