:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --primary: hsl(32.13 94.62% 43.73%);
  --primary-strong: hsl(26 90% 37%);
  --primary-ink: #ffffff;
  --primary-soft: hsl(48 100% 96.08%);
  --accent2: hsl(24.58 94.98% 53.14%);
  --gradient: linear-gradient(135deg, hsl(20.54 90.24% 48.24%), hsl(37.69 92.13% 50.2%));
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #1a1a1a;
    --text: #fafafa;
    --muted: #a3a3a3;
    --border: #262626;
    --primary: hsl(37.69 92.13% 50.2%);
    --primary-strong: hsl(43 96% 56%);
    --primary-ink: #0a0a0a;
    --primary-soft: hsl(26 60% 10%);
    --ok: #4ade80;
    --ok-bg: #0f2a1a;
    --err: #ff8a80;
    --err-bg: #331816;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.7 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-strong); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 800; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.2rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
:not(pre) > code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 1rem; border-radius: 10px; overflow-x: auto; line-height: 1.45; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.35em; background: var(--surface); }
.muted { color: var(--muted); }
.wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); opacity: 0.85; }
.wordmark { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Header */
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a { color: var(--text); text-decoration: none; padding: 0.45rem 0.85rem; border-radius: 8px; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current] { background: var(--primary-soft); color: var(--primary); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.5rem 1rem 1rem; }
  .site-nav.open { display: flex; }
}

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2.5rem; text-align: center; background: radial-gradient(ellipse at top, var(--primary-soft), transparent 70%); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 660px; margin: 0 auto 1.6rem; }
.hero h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); padding: 0.25rem 0.8rem; border-radius: 99px; margin-bottom: 1rem; }
.hero-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* Cards */
.section { padding: 1.5rem 0 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 0.25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 1rem; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
a.card:hover { border-color: var(--primary); transform: translateY(-2px); color: inherit; }
.card h3 { margin: 0.6rem 0 0.3rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.6; }
.card-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 1.25rem; }
.post-card .meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 0.1rem 0.5rem; border-radius: 99px; }
.path { counter-reset: step; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 1rem; }
.path a { counter-increment: step; }
.path a::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.features .card h3 { margin-top: 0; }

/* Page / article */
.page-head { padding: 2rem 0 0.5rem; }
.breadcrumb { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.75rem; }
.breadcrumb a { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.prose { font-size: 1.05rem; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.35rem 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose blockquote, .tip { margin: 1.2rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; }
.tip p { margin: 0; }
.post-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.5rem; }
.layout-2 { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; padding-bottom: 3rem; }
.sidebar { position: sticky; top: 80px; }
.sidebar .card { margin-bottom: 1rem; }
.sidebar h2 { font-size: 1rem; margin: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.sidebar li { margin: 0.4rem 0; line-height: 1.4; font-size: 0.95rem; }
@media (max-width: 920px) { .layout-2 { grid-template-columns: minmax(0, 1fr); } .sidebar { position: static; } }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1rem; margin: 0.6rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 0.6rem 0 0; }
.cta { background: var(--primary-soft); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 2rem 0; }
.cta p { margin: 0.25rem 0 0.75rem; }

/* Chord diagrams */
.chords { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin: 1rem 0 1.25rem; }
.chord { margin: 0; text-align: center; width: 112px; }
.chord svg { width: 112px; height: auto; display: block; color: var(--text); }
.chord figcaption { font-weight: 700; font-size: 0.95rem; }
.chord small { display: block; font-weight: 400; color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }

/* Tool UI */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.6rem); box-shadow: var(--shadow); margin: 1.25rem 0 2rem; }
.field { margin-bottom: 1rem; }
.field > label, .label-row label, .lbl { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cols-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }
textarea, input[type='text'], input[type='number'], select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 0.55rem 0.75rem;
}
textarea, input[type='text'] { width: 100%; }
textarea { resize: vertical; min-height: 120px; }
textarea.code { font-family: var(--mono); font-size: 0.92rem; line-height: 1.5; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
input[type='range'] { accent-color: var(--primary); width: 100%; }
input[type='checkbox'] { accent-color: var(--primary); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.inline { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.93rem; }
.btn { font: inherit; font-weight: 600; font-size: 0.93rem; border: 1px solid transparent; background: var(--primary); color: var(--primary-ink); padding: 0.5rem 1.05rem; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4; }
.btn:hover { filter: brightness(1.07); color: var(--primary-ink); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 0.2rem 0.6rem; font-size: 0.82rem; }
.btn.lg { padding: 0.75rem 1.4rem; font-size: 1.05rem; }
.btn[aria-pressed='true'] { background: var(--primary); color: var(--primary-ink); }
.status { min-height: 1.5em; margin: 0 0 1rem; font-size: 0.93rem; }
.status.ok, .status.err { padding: 0.5rem 0.8rem; border-radius: 8px; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.err { background: var(--err-bg); color: var(--err); }
.out-box { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 0.85rem; white-space: pre; overflow-x: auto; font-family: var(--mono); font-size: 0.92rem; min-height: 4rem; line-height: 1.5; }
.out-box b { color: var(--primary); }
table.kv { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.kv th, table.kv td { border-bottom: 1px solid var(--border); padding: 0.5rem 0.4rem; text-align: left; vertical-align: top; }
table.kv th { color: var(--muted); font-weight: 600; }
table.kv tr.best td { background: var(--primary-soft); }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill { display: inline-block; border: 1px solid var(--border); border-radius: 99px; padding: 0.2rem 0.75rem; font-weight: 600; font-size: 0.92rem; background: var(--surface); }
.pill.root { background: var(--gradient); color: #fff; border-color: transparent; }
.big { font-size: clamp(2.6rem, 9vw, 4.5rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.center { text-align: center; }
.fretboard { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 0.5rem; }
.fretboard svg { display: block; min-width: 720px; color: var(--text); }

/* Tuner */
.gauge { position: relative; height: 70px; margin: 1rem auto; max-width: 460px; }
.gauge .scale { position: absolute; inset: 30px 0 auto; height: 4px; background: linear-gradient(90deg, var(--err), var(--ok) 45%, var(--ok) 55%, var(--err)); border-radius: 4px; opacity: 0.55; }
.gauge .tick { position: absolute; top: 18px; width: 2px; height: 28px; background: var(--text); left: 50%; transform: translateX(-1px); }
.gauge .needle { position: absolute; top: 8px; width: 4px; height: 48px; border-radius: 4px; background: var(--primary); left: 50%; transform: translateX(-2px); transition: left 0.12s ease-out; }
.gauge .labels { position: absolute; top: 52px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }
.in-tune { color: var(--ok) !important; }

/* Metronome / tap */
.beats { display: flex; gap: 0.6rem; justify-content: center; margin: 1.2rem 0; flex-wrap: wrap; }
.beat { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface-2); transition: transform 0.05s; }
.beat.accent { border-color: var(--primary); }
.beat.on { background: var(--primary); transform: scale(1.15); }
.tap-pad { display: grid; place-items: center; width: min(260px, 80vw); aspect-ratio: 1; margin: 1rem auto; border-radius: 50%; border: 0; background: var(--gradient); color: #fff; font: 800 1.6rem var(--font); cursor: pointer; box-shadow: 0 10px 30px rgba(217, 119, 6, 0.25); user-select: none; -webkit-tap-highlight-color: transparent; }
.tap-pad:active { transform: scale(0.97); }

/* Footer */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 2.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.6fr 1fr 1fr 0.8fr; }
.site-footer h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.35rem 0; line-height: 1.4; }
.site-footer li a { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.site-footer li a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.2rem 0; font-size: 0.88rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }
