:root {
  --navy: #001542;
  --navy-2: #06245f;
  --teal: #086465;
  --teal-dark: #054b4d;
  --gold: #ffb30d;
  --cream: #fff9ec;
  --paper: #fffefa;
  --ink: #14213d;
  --muted: #647086;
  --line: #dfe5ed;
  --shadow: 0 20px 50px rgba(0, 21, 66, .1);
  --radius: 22px;
  --lyrics-size: 1.14rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f4f7fa; color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; padding: .75rem 1rem; background: var(--gold); color: var(--navy); border-radius: 0 0 8px 8px; font-weight: 700; }
.skip-link:focus { top: 0; }

.site-header { background: var(--navy); color: white; border-bottom: 1px solid rgba(255,255,255,.12); }
.header-inner { width: min(1180px, calc(100% - 32px)); min-height: 82px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { color: #c6d2ea; letter-spacing: .08em; }
.brand strong { font-family: Lora, Georgia, serif; font-size: 1.04rem; letter-spacing: .04em; }
.header-actions { display: flex; align-items: center; }

.section-nav { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid #e1e7ef; background: rgba(255,255,255,.97); box-shadow: 0 8px 24px rgba(0,21,66,.08); backdrop-filter: blur(12px); }
.section-nav-inner { width: min(1180px, calc(100% - 32px)); min-height: 54px; margin: auto; display: flex; align-items: center; }
.desktop-menu { width: 100%; display: flex; align-items: center; gap: 5px; }
.desktop-menu a, .mobile-menu-links a { border-radius: 9px; color: #344159; font-size: .88rem; font-weight: 700; text-decoration: none; }
.desktop-menu a { padding: 10px 12px; }
.desktop-menu a:hover, .mobile-menu-links a:hover { background: #e8f4f2; color: var(--teal-dark); }
.desktop-menu a[aria-current="page"], .mobile-menu-links a[aria-current="page"] { background: var(--navy); color: white; }
.mobile-menu { display: none; width: 100%; }
.mobile-menu summary { min-height: 50px; padding: 0 4px; display: flex; align-items: center; gap: 9px; color: #596579; font-weight: 800; cursor: pointer; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary span { font-size: 1.25rem; }
.mobile-menu-links { position: absolute; inset: 100% 0 auto; padding: 8px 12px 13px; display: grid; gap: 4px; border-top: 1px solid #e5eaf1; border-radius: 0 0 16px 16px; background: white; box-shadow: 0 18px 34px rgba(0,21,66,.15); }
.mobile-menu-links a { padding: 12px 14px; }

.button { min-height: 44px; border: 0; border-radius: 12px; padding: .7rem 1rem; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, .song-list button:focus-visible, .player-skip:focus-visible, .play-button:focus-visible, .font-controls button:focus-visible, .song-navigation button:focus-visible { outline: 3px solid rgba(255,179,13,.65); outline-offset: 3px; }
.button-header { min-height: 40px; background: rgba(255,255,255,.1); color: white; border: 1px solid rgba(255,255,255,.24); }
.button-primary { background: var(--teal); color: white; box-shadow: 0 8px 18px rgba(8,100,101,.2); }
.button-primary:hover { background: var(--teal-dark); }
.button-soft { background: #eef3f7; color: var(--navy); }
.button-gold { background: var(--gold); color: var(--navy); box-shadow: 0 10px 25px rgba(255,179,13,.24); }

.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--navy), #08265f 58%, var(--teal-dark)); color: white; }
.hero::after { content: "♫"; position: absolute; right: max(5vw, 20px); bottom: -62px; font-family: Lora, serif; font-size: 15rem; color: rgba(255,255,255,.045); transform: rotate(-8deg); }
.hero-glow { position: absolute; width: 440px; height: 440px; left: 7%; top: -300px; background: var(--gold); opacity: .15; filter: blur(45px); border-radius: 50%; }
.hero-inner { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: auto; padding: 64px 0 72px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero .eyebrow { color: #ffd46f; }
.hero h1 { max-width: 820px; margin: 0; font-family: Lora, Georgia, serif; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 1.04; }
.hero-inner > p:not(.eyebrow) { max-width: 650px; margin: 18px 0 0; color: #dce5f7; font-size: 1.08rem; line-height: 1.65; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; color: #b9c8e4; font-size: .92rem; }

.app-shell { position: relative; z-index: 2; width: min(1180px, calc(100% - 32px)); margin: -28px auto 64px; display: grid; grid-template-columns: 350px minmax(0, 1fr); align-items: start; gap: 24px; }
.catalogue, .song-view { background: var(--paper); border: 1px solid rgba(0,21,66,.07); border-radius: var(--radius); box-shadow: var(--shadow); }
.catalogue { position: sticky; top: 16px; max-height: calc(100vh - 32px); padding: 22px 12px 16px; display: flex; flex-direction: column; }
.catalogue-heading { padding: 0 10px; display: flex; align-items: start; justify-content: space-between; }
.catalogue h2 { margin: 0; font-family: Lora, Georgia, serif; font-size: 1.45rem; }
.search-field { margin: 20px 8px 8px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; background: white; }
.search-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,100,101,.11); }
.search-field svg { width: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-field input { min-width: 0; width: 100%; height: 46px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-summary { min-height: 18px; margin: 2px 12px 7px; color: var(--muted); font-size: .78rem; }
.song-list { min-height: 0; list-style: none; padding: 0 4px; margin: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b9c5d4 transparent; }
.song-list li { margin: 3px 0; }
.song-list button { width: 100%; border: 0; border-radius: 12px; background: transparent; padding: 11px 12px; display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 8px; color: var(--ink); text-align: left; }
.song-list button:hover { background: #f0f5f7; }
.song-list button[aria-current="true"] { background: #e8f4f2; color: #034c4d; }
.song-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #eef1f6; color: var(--muted); font-size: .76rem; font-weight: 800; }
.song-list button[aria-current="true"] .song-number { background: var(--teal); color: white; }
.song-name { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-arrow { color: #9ba7b7; font-size: 1.25rem; }
.empty-state { padding: 24px 16px; color: var(--muted); text-align: center; }

.song-view { min-height: 620px; padding: clamp(22px, 4vw, 44px); }
.loading-state { min-height: 480px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.loading-state span { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--teal); animation: pulse 1.1s infinite ease-in-out; }
.loading-state span:nth-child(2) { animation-delay: .15s; }.loading-state span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%,100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.error-state { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; }
.error-state strong { font-family: Lora, Georgia, serif; font-size: 1.4rem; }
.error-state p { color: var(--muted); }
.song-topbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.song-position { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 700; }
.song-actions { display: flex; gap: 8px; }
.song-header { margin: 42px 0 25px; }
.song-header h2 { margin: 0; font-family: Lora, Georgia, serif; color: var(--navy); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.12; }
.song-credit { margin: 12px 0 0; color: var(--muted); }
.song-credit:empty { display: none; }

.player-card { display: grid; grid-template-columns: 42px 58px minmax(0, 1fr) 42px; align-items: center; gap: 12px; padding: 15px; border-radius: 18px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: white; box-shadow: 0 16px 32px rgba(0,21,66,.18); }
.player-skip, .play-button { display: grid; place-items: center; border: 0; border-radius: 50%; color: white; }
.player-skip { width: 40px; height: 40px; background: rgba(255,255,255,.08); font-size: 1.8rem; }
.player-skip:hover { background: rgba(255,255,255,.17); }
.play-button { width: 56px; height: 56px; background: var(--gold); color: var(--navy); font-size: 1.12rem; box-shadow: 0 8px 20px rgba(255,179,13,.26); }
.player-labels { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .82rem; }
.player-labels strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-labels span { flex: none; color: #c4d0e6; font-variant-numeric: tabular-nums; }
.player-progress { width: 100%; height: 5px; accent-color: var(--gold); cursor: pointer; }

.youtube-card { width: 100%; max-width: 720px; min-width: 0; margin-inline: auto; padding: 12px; border-radius: 18px; background: var(--navy); color: white; box-shadow: 0 16px 32px rgba(0,21,66,.18); }
.youtube-frame { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; overflow: hidden; border-radius: 10px; background: #000; }
.youtube-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.youtube-card p { margin: 12px 4px 3px; font-size: .8rem; line-height: 1.5; color: #dce5f7; }
.youtube-card a { color: #ffd46f; }
.media-switch { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto 16px; }
.media-switch button { flex: 1 1 130px; max-width: 240px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #eef3f7; color: var(--navy); font-weight: 700; }
.media-switch button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: white; }
.media-switch button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.song-view, #song-content { min-width: 0; }

.lyrics-card { margin-top: 26px; padding: clamp(22px, 5vw, 42px); border: 1px solid #dfc995; border-radius: 18px; background: #f5e6c6; }
.lyrics-heading { padding-bottom: 18px; border-bottom: 1px solid #dfc995; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lyrics-heading h3 { margin: 0; font-family: Lora, Georgia, serif; font-size: 1.25rem; }
.lyrics-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.chords-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 1px solid #b9a16d; border-radius: 10px; background: #fff9ec; color: var(--navy); font-size: .8rem; font-weight: 700; }
.switch-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: #768194; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; }
.chords-toggle[aria-checked="true"] .switch-track { background: var(--teal); }
.chords-toggle[aria-checked="true"] .switch-track::after { transform: translateX(14px); }
.chords-toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
@media (max-width: 560px) { .lyrics-heading { flex-wrap: wrap; } .lyrics-controls { justify-content: flex-start; } }
.font-controls { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.font-controls button { width: 42px; height: 38px; border: 0; background: white; color: var(--navy); font-weight: 800; }
.font-controls button + button { border-left: 1px solid var(--line); }
.song-lyrics { padding-top: 28px; font-family: Lora, Georgia, serif; font-size: var(--lyrics-size); line-height: 1.85; color: #23304a; }
.lyrics-instruction { margin: 14px 0 0; color: #536078; font-size: .83rem; line-height: 1.5; }
.song-lyrics .lyric-stanza { display: block; width: 100%; margin: 0 0 1.2em; padding: 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; transition: background .15s ease, color .15s ease; }
.song-lyrics .lyric-stanza:last-child { margin-bottom: 0; }
.song-lyrics .lyric-stanza[aria-pressed="true"] { background: #001e60; border-color: #001e60; color: #fff9ec; }
.song-lyrics .lyric-stanza:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
@media (hover: hover) { .song-lyrics .lyric-stanza:not([aria-pressed="true"]):hover { background: #f5ce7a; } }
.song-navigation { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.song-navigation button { min-height: 76px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--navy); text-align: left; }
.song-navigation button:last-child { text-align: right; }
.song-navigation span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .78rem; }
.song-navigation strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contribute { width: min(1180px, calc(100% - 32px)); margin: 0 auto 64px; padding: clamp(28px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 32px; border-radius: var(--radius); background: linear-gradient(120deg, #e5f3ef, #f8f1db); }
.contribute h2 { max-width: 660px; margin: 0; font-family: Lora, Georgia, serif; color: var(--navy); font-size: clamp(1.65rem, 4vw, 2.3rem); }
.contribute p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: #536078; line-height: 1.65; }
footer { min-height: 130px; padding: 34px 16px; display: grid; place-content: center; gap: 5px; background: var(--navy); color: #dbe5f8; text-align: center; }
footer p { margin: 0; } footer p:first-child { font-family: Lora, Georgia, serif; color: white; font-weight: 700; }

.mobile-only { display: none; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf1f5; color: var(--navy); font-size: 1.5rem; }
.suggestion-dialog { width: min(740px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 25px 80px rgba(0,21,66,.28); }
.suggestion-dialog::backdrop { background: rgba(0,15,43,.62); backdrop-filter: blur(4px); }
.suggestion-dialog form { padding: clamp(22px, 5vw, 38px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-family: Lora, Georgia, serif; color: var(--navy); }
.dialog-intro { color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 22px; }
.form-grid label { color: #344159; font-size: .86rem; font-weight: 700; }
.form-grid input, .form-grid textarea { width: 100%; margin-top: 6px; border: 1px solid #cfd7e2; border-radius: 10px; padding: 11px 12px; background: white; color: var(--ink); outline: 0; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,100,101,.1); }
.form-grid textarea { resize: vertical; line-height: 1.5; }
.form-grid small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.full-field { grid-column: 1 / -1; }
.media-choice { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.media-choice legend { padding-inline: 5px; color: var(--navy); font-size: .86rem; font-weight: 700; }
.form-grid .media-choice label { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.form-grid .media-choice input { width: auto; flex: none; margin: 0; accent-color: var(--teal); }
.consent { display: flex; align-items: start; gap: 9px; margin: 18px 0; color: #4d5a70; font-size: .84rem; line-height: 1.45; }
.consent input { margin-top: 3px; accent-color: var(--teal); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.suggestion-status { min-height: 20px; margin: 10px 0 0; color: var(--teal); font-size: .86rem; text-align: right; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 24px; padding: 12px 18px; border-radius: 12px; background: var(--navy); color: white; box-shadow: var(--shadow); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) {
  .header-inner { min-height: 72px; }
  .brand img { width: 44px; height: 44px; }
  .section-nav-inner { width: min(100% - 22px, 1180px); min-height: 50px; }
  .desktop-menu { display: none; }
  .mobile-menu { display: block; }
  .hero-inner { padding: 48px 0 58px; }
  .app-shell { display: block; margin-top: -20px; }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .catalogue { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(380px, 92vw); height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; padding-bottom: max(16px, env(safe-area-inset-bottom)); overflow: hidden; border-radius: 0 20px 20px 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 15px 0 50px rgba(0,21,66,.24); }
  .catalogue.is-open { transform: translateX(0); }
  body.list-open { overflow: hidden; }
  .catalogue .song-list { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .song-view { min-height: 560px; }
  .song-topbar { align-items: start; }
  .song-position { display: none; }
  .song-header { margin-top: 30px; }
}

@media (max-width: 560px) {
  .header-inner { width: min(100% - 22px, 1180px); }
  .brand strong { font-size: .87rem; }
  .brand small { font-size: .72rem; }
  .button-header { padding: .6rem .72rem; font-size: .8rem; }
  .hero-inner, .app-shell, .contribute { width: min(100% - 20px, 1180px); }
  .song-view { padding: 18px 14px; border-radius: 18px; }
  .song-topbar { flex-direction: column; }
  .song-actions { width: 100%; }
  .song-actions .button { flex: 1; padding-inline: .7rem; font-size: .82rem; }
  .player-card { grid-template-columns: 48px minmax(0, 1fr); }
  .player-skip { display: none; }
  .play-button { width: 48px; height: 48px; }
  .lyrics-card { padding: 24px 19px; }
  .song-navigation { grid-template-columns: 1fr; }
  .song-navigation button:last-child { text-align: left; }
  .contribute { flex-direction: column; align-items: start; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hero, .catalogue, .song-topbar, .player-card, .youtube-card, .media-switch, .font-controls, .song-navigation, .contribute, footer { display: none !important; }
  body, .app-shell, .song-view, .lyrics-card { background: white; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .app-shell { width: 100%; display: block; }
  .song-header { margin: 0 0 24px; }
  .lyrics-card { margin: 0; }
  .lyrics-instruction { display: none; }
  .chords-toggle { display: none; }
  .song-lyrics .lyric-stanza, .song-lyrics .lyric-stanza[aria-pressed="true"] { margin: 0 0 1.65em; padding: 0; background: transparent; color: black; border: 0; outline: none; }
}
