@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

:root {
  --ink: #102033;
  --ink-soft: #486074;
  --night: #0b1b2a;
  --paper: #f8f5ed;
  --paper-deep: #eee9dc;
  --gold: #d9b35a;
  --gold-soft: #f0dfae;
  --line: rgba(16, 32, 51, .12);
  --white: #fffdf8;
  --radius-lg: 28px;
  --radius-md: 17px;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; background: var(--paper); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; max-width: 1240px; margin: auto; }
.brand { display: block; width: 166px; }
.brand img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.icon-button { border: 1px solid var(--line); background: transparent; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); font-size: 20px; }

.main-content { max-width: 1240px; margin: auto; padding: 0 20px 100px; }
.hero { overflow: hidden; min-height: 310px; border-radius: var(--radius-lg); background: var(--night); color: var(--white); position: relative; display: grid; place-items: center; padding: 44px 8%; }
.hero::after { content: ''; position: absolute; inset: 18px; border: 1px solid rgba(240, 223, 174, .22); border-radius: 20px; pointer-events: none; }
.hero-lockup { position: relative; z-index: 1; width: min(100%, 500px); text-align: center; }
.hero-label { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .24em; margin: 0 0 19px; }
.hero-logo-panel { background: var(--white); border-radius: 18px; padding: 16px 20px; margin: auto; width: min(100%, 420px); }
.hero-logo-panel img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.hero-name { color: #c7d0d5; font-size: 12px; letter-spacing: .18em; margin: 18px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .17em; font-size: 11px; font-weight: 700; margin: 0 0 15px; color: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { font: 500 clamp(42px, 6vw, 78px)/.95 'Fraunces', Georgia, serif; letter-spacing: -.04em; margin-bottom: 24px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero-text { color: #c7d0d5; line-height: 1.7; max-width: 460px; font-size: 15px; margin-bottom: 25px; }
.hero-meta { display: flex; align-items: center; gap: 11px; font-size: 12px; color: #a8b7c1; text-transform: uppercase; letter-spacing: .11em; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.library-section { padding: 82px 2px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-heading h2 { font: 500 clamp(32px, 5vw, 52px)/1 'Fraunces', Georgia, serif; letter-spacing: -.04em; margin: 0; }
.count-pill { width: 40px; height: 40px; display: grid; place-items: center; background: var(--gold-soft); border-radius: 50%; font-size: 13px; font-weight: 700; }
.search-box { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: rgba(255,253,248,.62); padding: 0 15px; height: 55px; border-radius: 14px; max-width: 670px; }
.search-box > span { color: var(--ink-soft); font-size: 28px; line-height: 0; transform: rotate(-15deg); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-box kbd { border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; color: var(--ink-soft); font-size: 12px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 26px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 99px; padding: 9px 15px; font-size: 12px; }
.filter-chip.is-active, .filter-chip:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.song-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.song-card { min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-md); padding: 21px; color: var(--ink); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.song-card:hover, .song-card:focus-visible { transform: translateY(-4px); border-color: rgba(16, 32, 51, .3); box-shadow: 0 12px 24px rgba(16,32,51,.08); outline: none; }
.song-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.song-number { color: var(--ink-soft); font-size: 12px; letter-spacing: .1em; }
.song-badge { color: #856c2e; background: #fbf3d9; border-radius: 99px; padding: 5px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.song-card h3 { font: 500 26px/1.05 'Fraunces', Georgia, serif; letter-spacing: -.025em; margin: 24px 0 12px; }
.song-card-footer { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.arrow { color: var(--ink); font-size: 20px; }
.card-youtube { display: inline-flex; align-items: center; gap: 5px; color: #d92d20; text-decoration: none; font-weight: 700; }
.card-youtube:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius-md); }
.empty-icon { font-size: 38px; color: var(--gold); }
.empty-state h3 { font: 500 27px 'Fraunces', Georgia, serif; margin: 12px 0 7px; }
.empty-state p { color: var(--ink-soft); margin: 0; }

.reader { min-height: 100vh; background: var(--paper); padding-bottom: 100px; }
.reader-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; max-width: 900px; margin: auto; }
.back-button { border: 0; background: transparent; color: var(--ink); padding: 10px 0; font-size: 13px; }
.back-button span { color: var(--gold); font-size: 20px; margin-right: 5px; }
.reader-number { color: var(--ink-soft); text-transform: uppercase; font-size: 11px; letter-spacing: .14em; }
.song-sheet { max-width: 900px; margin: 0 auto; padding: 50px clamp(20px, 6vw, 75px) 80px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); min-height: 80vh; position: relative; }
.song-heading { padding-right: 140px; border-bottom: 1px solid var(--line); padding-bottom: 27px; }
.song-heading h1 { font: 500 clamp(40px, 8vw, 72px)/.96 'Fraunces', Georgia, serif; letter-spacing: -.045em; margin: 0; }
.song-note { color: var(--ink-soft); font-size: 13px; margin: 15px 0 0; line-height: 1.6; }
.youtube-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; padding: 8px 12px; border-radius: 99px; background: #ffebe8; color: #d92d20; font-size: 12px; font-weight: 700; text-decoration: none; }
.youtube-link:hover { background: #ffd8d3; }
.song-actions { position: absolute; top: 48px; right: clamp(20px, 6vw, 75px); display: flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.song-actions button { border: 0; border-right: 1px solid var(--line); background: var(--paper); color: var(--ink); width: 38px; height: 34px; font-size: 13px; }
.song-actions button:last-child { border-right: 0; }
.song-body { padding-top: 32px; max-width: 720px; font-size: 18px; line-height: 1.8; }
.song-body .song-section { margin-bottom: 32px; }
.song-body h3 { color: #9b7a25; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; margin-bottom: 12px; }
.song-body p { margin-bottom: 15px; white-space: pre-line; }
.song-body .chords { color: #9b7a25; font: 700 13px/1.4 'DM Sans', sans-serif; letter-spacing: .06em; margin: 0 0 3px; }
.song-body .repeat { color: var(--ink-soft); font-style: italic; font-size: .88em; }

.bottom-nav { position: fixed; z-index: 20; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; padding: 6px; background: rgba(11,27,42,.94); border-radius: 99px; box-shadow: 0 10px 30px rgba(11,27,42,.25); }
.bottom-link { display: flex; align-items: center; gap: 7px; color: #aebbc4; padding: 8px 14px; border-radius: 99px; text-decoration: none; font-size: 15px; }
.bottom-link small { font-size: 11px; }
.bottom-link.is-active { background: var(--gold); color: var(--night); }

body.night-mode { --paper: #101c26; --paper-deep: #1a2a36; --white: #162733; --ink: #f8f5ed; --ink-soft: #acbbc3; --line: rgba(248,245,237,.14); }
body.night-mode .brand img { filter: invert(1); mix-blend-mode: screen; }
body.night-mode .search-box { background: #162733; }
body.night-mode .song-card { background: #162733; }
body.night-mode .song-sheet { background: #162733; }
body.night-mode .hero { background: #07121c; }

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 10px 16px; }
  .brand { width: 142px; }
  .main-content { padding: 0 14px 98px; }
  .hero { min-height: 255px; padding: 28px 20px; }
  .hero::after { inset: 12px; }
  .hero-logo-panel { padding: 12px 14px; }
  .hero-name { font-size: 9px; letter-spacing: .13em; }
  .library-section { padding-top: 55px; }
  .song-grid { grid-template-columns: 1fr; gap: 10px; }
  .song-card { min-height: 142px; padding: 17px; }
  .song-card h3 { font-size: 24px; margin: 19px 0 9px; }
  .song-sheet { border-radius: 0; border-left: 0; border-right: 0; padding: 34px 20px 70px; }
  .reader-topbar { padding: 0 16px; }
  .song-heading { padding-right: 0; padding-bottom: 70px; }
  .song-actions { top: 127px; left: 20px; right: auto; }
  .song-body { font-size: 17px; line-height: 1.72; }
  .bottom-link { padding: 8px 12px; }
}

@media print {
  .topbar, .bottom-nav, .reader-topbar, .song-actions { display: none !important; }
  .reader { display: block !important; padding: 0; }
  .song-sheet { border: 0; max-width: none; }
}
