:root {
  color-scheme: light;
  --ink: #261b1e;
  --muted: #75666a;
  --paper: #fffdf8;
  --surface: #f7f0e7;
  --surface-strong: #eadccc;
  --line: #d8c5b2;
  --brand: #5b2734;
  --brand-dark: #3d1822;
  --accent: #b78a46;
  --shadow: 0 18px 50px rgba(56, 31, 34, .12);
  --radius: 20px;
  --reader-size: 1.16rem;
}
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7eee7;
  --muted: #c9b8b3;
  --paper: #21191b;
  --surface: #2c2023;
  --surface-strong: #3a292d;
  --line: #584248;
  --brand: #d7a9b4;
  --brand-dark: #f0c9d2;
  --accent: #e0bc76;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.shell { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.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; left: 16px; top: 10px; z-index: 1000; padding: 10px 14px; border-radius: 10px; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 20%); background: color-mix(in srgb, var(--paper), transparent 5%); }
.topbar-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand img { flex: 0 0 auto; }
.brand-copy { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-note { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.header-link, .social-link, .footer-links a { color: var(--muted); text-decoration: none; }
.header-link:hover, .social-link:hover, .footer-links a:hover { color: var(--brand); }
.support-link, .primary-button, .donate-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 999px; padding: 10px 16px; color: #fff; background: var(--brand); text-decoration: none; font-weight: 750; box-shadow: 0 8px 24px rgba(91, 39, 52, .18); cursor: pointer; }
.support-link:hover, .primary-button:hover, .donate-button:hover { background: var(--brand-dark); }
.icon-button, .secondary-button, .action-button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; cursor: pointer; text-decoration: none; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; }
.secondary-button { padding: 10px 16px; font-weight: 700; }
.secondary-button.small { padding: 8px 13px; font-size: .92rem; }
.secondary-button:hover, .action-button:hover, .icon-button:hover { border-color: var(--accent); }
.hero { padding: clamp(68px, 10vw, 120px) 0 72px; text-align: center; }
.eyebrow, .hymn-kicker { margin: 0 0 10px; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero h1, .page-sheet h1, .hymn-heading h1, .directory h2 { font-family: Georgia, "Times New Roman", serif; color: var(--brand-dark); line-height: 1.08; }
.hero h1 { margin: 0; font-size: clamp(3.1rem, 9vw, 6.5rem); letter-spacing: -.045em; }
.hero-copy { max-width: 680px; margin: 22px auto 0; color: var(--muted); font-size: clamp(1.05rem, 2.5vw, 1.28rem); }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.resource-band { padding: 34px 0 42px; border-block: 1px solid var(--line); background: var(--paper); }
.resource-band h2 { margin: 0 0 18px; font-family: Georgia, "Times New Roman", serif; text-align: center; }
.resource-links { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.resource-card { position: relative; min-height: 122px; display: flex; flex-direction: column; gap: 7px; padding: 18px 42px 18px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; }
.resource-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.resource-card span { color: var(--muted); font-size: .9rem; }
.resource-arrow { position: absolute; right: 17px; top: 17px; color: var(--brand) !important; }
.resource-links.compact { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 760px; margin-inline: auto; }
.resource-card.compact-card { min-height: auto; padding-block: 12px; background: transparent; }
.directory { padding: 64px 0 90px; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.directory h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.1rem); }
.search-box { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.search-box:focus-within { outline: 3px solid color-mix(in srgb, var(--accent), transparent 65%); border-color: var(--accent); }
.search-box input { width: 100%; min-height: 58px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.results-note { margin: 16px 0 18px; color: var(--muted); text-align: center; font-size: .9rem; }
.hymn-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.hymn-card { content-visibility: auto; contain-intrinsic-size: 74px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; min-height: 72px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hymn-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 26px rgba(56,31,34,.08); }
.hymn-card[hidden] { display: none; }
.hymn-card-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--brand-dark); background: var(--surface-strong); font-weight: 800; }
.hymn-card-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.28; }
.hymn-card-arrow { color: var(--muted); }
.hymn-card.is-favourite .hymn-card-number::after { content: "★"; position: absolute; transform: translate(13px,-16px); color: var(--accent); font-size: .68rem; }
.empty-state { padding: 36px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.reader-wrap { width: min(890px, calc(100% - 28px)); margin: 28px auto 70px; }
.reader-tools { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.reader-tools-group, .share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 13px; }
.hymn-sheet, .page-sheet { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.hymn-sheet { padding: clamp(28px, 7vw, 64px); }
.hymn-heading { text-align: center; margin-bottom: 38px; }
.hymn-heading h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.8rem); }
.title-number { color: var(--accent); }
.ornament { margin-top: 18px; color: var(--accent); font-size: .72rem; }
.hymn-content { max-width: 680px; margin-inline: auto; font-family: Georgia, "Times New Roman", serif; font-size: var(--reader-size); line-height: 1.9; }
.hymn-content p { margin: 0 0 1.65em; }
.hymn-content .chorus { margin: 1.85em 0; padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--surface); }
.transcription-note { max-width: 680px; margin: 12px auto 30px; color: var(--muted); font-size: .86rem; }
.donation-cta { margin: 44px auto 24px; max-width: 680px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; }
.donation-cta h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.donation-cta p { color: var(--muted); }
.share-row { justify-content: center; margin-top: 22px; }
.reader-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 14px; }
.nav-button { min-height: 70px; display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); text-decoration: none; }
.nav-button.next { justify-content: flex-end; text-align: right; }
.nav-button.center { justify-content: center; min-height: auto; align-self: center; }
.nav-copy { display: grid; line-height: 1.25; }
.nav-copy small { color: var(--muted); }
.nav-button.disabled { opacity: .35; }
.page-wrap { padding: 48px 0 80px; }
.page-sheet { max-width: 850px; margin-inline: auto; padding: clamp(28px, 6vw, 58px); }
.page-sheet h1 { margin: 0 0 24px; font-size: clamp(2.2rem, 6vw, 4rem); }
.page-content { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.page-content p { margin: 0 0 1.35em; }
.page-resources { margin-top: 28px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.page-donate { text-align: center; margin-block: 30px !important; }
.page-social { display: flex; gap: 12px; flex-wrap: wrap; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { padding: 42px 0; text-align: center; }
.footer-links, .footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.footer-resources { margin: 28px 0; }
.footer-resources h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.footer-inner > p { margin: 22px 0 0; color: var(--muted); font-size: .88rem; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 140%); padding: 10px 16px; border-radius: 999px; color: #fff; background: #21191b; transition: transform .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); }
@media (max-width: 860px) {
  .resource-links, .hymn-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .header-link { display: none; }
}
@media (max-width: 600px) {
  .shell { width: min(100% - 22px, 1160px); }
  .topbar-inner { min-height: 66px; gap: 10px; }
  .brand-name { max-width: 190px; }
  .brand-note { display: none; }
  .support-link { padding: 8px 11px; }
  .resource-links, .resource-links.compact, .hymn-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 54px; }
  .directory-heading { align-items: flex-start; }
  .reader-tools { position: sticky; top: 72px; z-index: 20; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .button-label { display: none; }
  .hymn-sheet { padding: 28px 20px; }
  .reader-nav { grid-template-columns: 1fr 1fr; }
  .nav-button.center { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  .topbar, .reader-tools, .donation-cta, .share-row, .reader-nav, .site-footer, .toast, .transcription-note { display: none !important; }
  body { background: #fff; color: #000; }
  .hymn-sheet { border: 0; box-shadow: none; padding: 0; }
}
