:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f4efe7;
  --text: #2a1f17;
  --muted: #7a6b5d;
  --line: #e8dfd3;
  --accent: #d9661e;          /* 우쿨렐레 우드 오렌지 */
  --accent-ink: #ffffff;
  --accent-soft: #fdeee2;
  --teal: #0b8f7a;            /* 파비콘 틸 (링크/포인트) */
  --teal-soft: #e2f5f1;
  --dg-line: #3b2c21;
  --dg-fret: #b9aa99;
  --radius: 14px;
  --header-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110e; --surface: #1f1914; --surface-2: #2a221b; --text: #f3ebe1; --muted: #a8998a;
    --line: #3a3027; --accent: #f08a3c; --accent-ink: #1a120c; --accent-soft: #3a2616;
    --teal: #3fd1b5; --teal-soft: #173a33; --dg-line: #efe5d8; --dg-fret: #6c5d4f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15110e; --surface: #1f1914; --surface-2: #2a221b; --text: #f3ebe1; --muted: #a8998a;
  --line: #3a3027; --accent: #f08a3c; --accent-ink: #1a120c; --accent-soft: #3a2616;
  --teal: #3fd1b5; --teal-soft: #173a33; --dg-line: #efe5d8; --dg-fret: #6c5d4f; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h2 a { color: inherit; }
h2 small { font-size: .8rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
h3 { font-size: 1rem; margin-top: 1.1em; }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .9rem; }
.lead { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--bg); } }
.header-bar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 32px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 1.05rem; letter-spacing: -.02em; }
.brand-text small { font-size: .72rem; color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.header-actions { display: flex; gap: 2px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--text); border-radius: 10px; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn[aria-expanded="true"] { background: var(--surface-2); }
.header-search { display: flex; gap: 8px; padding-bottom: 12px; }
.header-search[hidden], .header-menu[hidden] { display: none; }
.header-search input, .big-search input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.header-search input:focus, .big-search input:focus { border-color: var(--accent); }
.header-search button { height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; cursor: pointer; }
.header-menu { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 12px; }
.header-menu a { padding: 10px 12px; border-radius: 10px; color: var(--text); background: var(--surface-2); font-size: .95rem; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); padding: 10px 0 2px; }
.breadcrumb a { color: var(--muted); }
main.wrap { padding-top: 8px; padding-bottom: 32px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 12px 0; }
.card > :last-child { margin-bottom: 0; }
.card ul, .card ol { padding-left: 1.2em; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.row { margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 48px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 700; border: 1px solid var(--line);
}
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chip small { font-weight: 500; color: var(--muted); }
.chips.big .chip { min-width: 60px; font-size: 1.05rem; }

/* Home */
.hero { padding: 12px 0 4px; }
.hero h1 { font-size: 1.5rem; }
.big-search { display: flex; gap: 8px; margin: 10px 0 16px; }
.big-search input { height: 52px; font-size: 17px; }
.big-search button { width: 52px; height: 52px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.big-search button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.label { font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.more-link { text-align: center; margin: 14px 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cta { text-align: center; background: var(--teal-soft); border-color: transparent; }

/* Mini diagrams grid */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.mini-card { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mini-card:hover { text-decoration: none; border-color: var(--accent); }
.mini-name { font-weight: 800; font-size: 1.05rem; margin-top: 2px; }
.mini-meta { font-size: .75rem; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cat-grid a { display: flex; flex-direction: column; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); min-height: 44px; }
.cat-grid a:hover { text-decoration: none; outline: 1.5px solid var(--accent); }
.cat-grid small { color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; }

/* Diagram SVG */
.dg { display: block; overflow: visible; font-family: inherit; }
.dg-lg { width: min(230px, 62vw); margin: 0 auto 12px; }
.dg-sm { width: 100%; max-width: 110px; }
.dg-fret { stroke: var(--dg-fret); stroke-width: 2; }
.dg-string { stroke: var(--dg-line); stroke-width: 2; }
.dg-nut { fill: var(--dg-line); }
.dg-dot { fill: var(--accent); }
.dg-finger { fill: var(--accent-ink); font-size: 15px; font-weight: 800; }
.dg-open { fill: none; stroke: var(--dg-line); stroke-width: 2; }
.dg-mute { fill: var(--dg-line); font-size: 20px; font-weight: 700; }
.dg-base { fill: var(--muted); font-size: 13px; font-weight: 700; }
.dg-name { fill: var(--muted); font-size: 14px; font-weight: 700; }

/* Chord page */
.chord-head { text-align: center; padding-top: 4px; }
.chord-head h1 { font-size: 1.55rem; margin-bottom: 2px; }
.chord-sub { color: var(--muted); margin-bottom: 6px; }
.chord-sub .alt { color: var(--accent); font-weight: 700; margin-left: 4px; }
.diagram-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 16px 18px; text-align: center; }
.fingering-code { display: flex; justify-content: center; gap: 18px; margin: 8px 0 12px; font-size: 1.35rem; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; }
.fingering-code span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.fingering-code small { font-size: .7rem; color: var(--muted); font-family: inherit; }
.btn-play { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1rem; cursor: pointer; }
.btn-play svg { width: 18px; height: 18px; fill: currentColor; }
.btn-play.playing { filter: brightness(1.1); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-play.sm { min-height: 44px; padding: 0 14px; font-size: .85rem; }
.btn-play.sm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { width: 72px; flex: none; color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 600; }
.notes { display: flex; gap: 10px; flex-wrap: wrap; }
.notes span { display: inline-flex; align-items: baseline; gap: 3px; font-size: 1.1rem; font-weight: 800; }
.notes small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.stars { color: var(--accent); letter-spacing: 1px; }
.stars.sm { font-size: .75rem; }
.intro { margin-top: 12px; }
.string-list { list-style: none; padding: 0 !important; margin: 0; }
.string-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.string-list li:last-child { border-bottom: 0; }
.barre-note { color: var(--accent); font-weight: 600; }
.voicing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.voicing { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); }
.voicing figcaption { font-size: .85rem; text-align: center; }

.rank-list, .transition-list, .prog-list, .theory-list, .song-list { list-style: none; padding: 0 !important; margin: 0; }
.rank-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 4px 0; }
.rank-list .bar { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.rank-list .bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent); border-radius: 4px; opacity: .8; }
.num { color: var(--muted); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transition-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.transition-list .from { font-weight: 800; min-width: 40px; text-align: right; }
.transition-list .arrow { color: var(--muted); }
.transition-list .num { margin-left: auto; }
.prog-list li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.prog-list li:last-child a { border-bottom: 0; }
.prog-list .prog { font-weight: 800; letter-spacing: .01em; }
.theory-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.diatonic { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.diatonic a { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 800; font-size: .82rem; min-height: 44px; }
.diatonic a small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.diatonic a.on { background: var(--accent); color: var(--accent-ink); }
.diatonic a.on small { color: inherit; }
.keys-line { margin-top: 10px; }

.song-list li a { display: flex; flex-direction: column; gap: 4px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--text); }
.song-list li:last-child a { border-bottom: 0; }
.song-list li a:hover { text-decoration: none; }
.song-list li a:hover .song-title { color: var(--teal); }
.song-title { font-weight: 700; }
.song-artist { color: var(--muted); font-weight: 500; }
.song-chords { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .8rem; }
.song-level { color: var(--accent); font-size: .72rem; margin-right: 4px; }
.mini-chip { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); font-weight: 700; }
.mini-chip.on { background: var(--accent-soft); color: var(--accent); }
.more { color: var(--muted); }

.videos { display: grid; gap: 12px; }
.yt { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; text-align: left; aspect-ratio: 16 / 9; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.yt::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 12px; background: rgba(0,0,0,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 28px no-repeat; }
.yt-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px; color: #fff; font-weight: 700; font-size: .9rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.yt-title small { display: block; font-weight: 500; opacity: .8; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; min-height: 44px; list-style-position: outside; }
.faq details > p, .faq details > ul { color: var(--text); }

.prev-next { display: flex; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.prev-next a { flex: 1; text-align: center; padding: 12px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; min-height: 44px; }

.prog-diagrams { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.card:has(.prog-diagrams) { text-align: center; }
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.tabs a { padding: 10px 16px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a.on { background: var(--accent); color: var(--accent-ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 16px 0; }
.pager a { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }

/* Share */
.share-bar { display: flex; justify-content: center; gap: 8px; margin: 4px 0 12px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.share-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.share-btn.kakao { background: #fee500; border-color: #fee500; color: #191919; }
.share-btn.kakao svg { fill: #191919; stroke: none; }
.share-btn:active { transform: scale(.97); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 36px; color: var(--muted); font-size: .82rem; }
.footer-links { display: flex; gap: 16px; margin-bottom: 10px; }
.footer-links a { color: var(--text); font-weight: 600; }
.copy { margin-top: 8px; }

@media (min-width: 600px) {
  h1 { font-size: 1.9rem; }
  .chord-head h1 { font-size: 1.9rem; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 22px 22px; }
  .videos { grid-template-columns: 1fr 1fr; }
  .mini-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
