:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-soft: #f4efe4;
  --ink: #112842;
  --muted: #68727f;
  --gold: #c99a2e;
  --gold-soft: #f3e4b7;
  --blue: #12304a;
  --teal: #1d6b73;
  --rose: #8f4a53;
  --line: rgba(17, 40, 66, 0.13);
  --shadow: 0 18px 50px rgba(18, 48, 74, 0.16);
  --reader-scale: 1;
}

:root[data-theme="dark"] {
  --bg: #111417;
  --surface: #191f24;
  --surface-soft: #202930;
  --ink: #f7f2e8;
  --muted: #c4c0b8;
  --gold: #e0b85a;
  --gold-soft: rgba(224, 184, 90, 0.2);
  --blue: #dceafa;
  --teal: #6bb9b5;
  --rose: #e0a0a6;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  color: #fffaf0;
  background: #12304a url("assets/hymns-book.jpg") center / cover no-repeat;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 24, 38, 0.9), rgba(10, 24, 38, 0.7) 52%, rgba(10, 24, 38, 0.24)),
    linear-gradient(0deg, rgba(10, 24, 38, 0.58), rgba(10, 24, 38, 0.08) 48%, rgba(10, 24, 38, 0.42));
}

.topbar,
.hero__content,
main {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand__mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: rgba(255, 250, 240, 0.78);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.topbar .icon-button {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.16);
  color: #fffaf0;
}

.hero__content {
  width: min(860px, calc(100% - 32px));
  margin: 44px auto 0;
  padding-bottom: 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #f5d587;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 8vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero__subtitle {
  max-width: 620px;
  margin: 18px 0 26px;
  color: rgba(255, 250, 240, 0.86);
  font-size: 1.12rem;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 760px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #12304a;
  box-shadow: var(--shadow);
}

.search-box span {
  color: var(--gold);
  font-size: 1.6rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #12304a;
  font-size: 1.08rem;
}

.search-panel__voice {
  width: 60px;
  height: 60px;
  background: #f7d77d;
  color: #14324c;
}

.search-results {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-top: 12px;
}

.result-button,
.hymn-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.search-results .result-button {
  background: rgba(255, 255, 255, 0.96);
  color: #12304a;
}

.number-pill {
  display: grid;
  min-width: 48px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold-soft);
  color: #74520e;
  font-weight: 800;
}

.result-button strong,
.hymn-row strong {
  display: block;
}

.result-button small,
.hymn-row small {
  color: var(--muted);
}

main {
  max-width: 1180px;
  margin: -36px auto 0;
  padding: 0 24px 72px;
}

.quick-nav,
.alphabet-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tab,
.letter-button,
.action-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}

.tab {
  padding: 0 15px;
}

.tab.is-active,
.letter-button.is-active,
.action-button.is-primary {
  border-color: rgba(201, 154, 46, 0.48);
  background: var(--gold);
  color: #1f2430;
}

.alphabet-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-top: 16px;
  box-shadow: 0 8px 28px rgba(18, 48, 74, 0.12);
}

.letter-button {
  width: 42px;
  padding: 0;
}

.view {
  margin-top: 26px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.section-title h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.panel,
.hymn-reader {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(18, 48, 74, 0.08);
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 0 0 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.alpha-group {
  scroll-margin-top: 92px;
  margin-bottom: 28px;
}

.alpha-group h3 {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 0 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fffaf0;
}

.hymn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 10px;
}

.hymn-reader {
  overflow: hidden;
}

.reader-head {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(115deg, var(--surface), var(--surface-soft));
}

.reader-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.reader-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-button {
  padding: 0 14px;
}

.reader-body {
  display: grid;
  gap: 18px;
  padding: 24px;
  font-size: calc(1.14rem * var(--reader-scale));
  line-height: 1.78;
}

.lyric-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lyric-section--chorus {
  border-color: rgba(201, 154, 46, 0.45);
  background: var(--gold-soft);
}

.lyric-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--blue);
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lyric-section--chorus .lyric-label {
  background: var(--gold);
  color: #1f2430;
}

.lyric-line {
  margin: 0 0 6px;
}

.scriptures {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.scripture-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scripture-links a {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.floating-search {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: none;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #1f2430;
  box-shadow: var(--shadow);
  font-size: 1.8rem;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

mark {
  border-radius: 4px;
  background: #ffe08a;
  color: #1d2430;
}

@media (max-width: 760px) {
  .hero {
    min-height: 610px;
  }

  .topbar {
    padding: 18px 16px;
  }

  .brand small {
    display: none;
  }

  .hero__content {
    margin-top: 34px;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .search-panel__voice {
    width: 100%;
  }

  main {
    padding: 0 12px 70px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: block;
  }

  .reader-head,
  .reader-body {
    padding: 18px;
  }

  .result-button,
  .hymn-row {
    grid-template-columns: auto 1fr;
  }

  .result-button .chevron,
  .hymn-row .chevron {
    display: none;
  }

  .floating-search {
    display: grid;
    place-items: center;
  }
}
