:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #141416;
  --surface-2: #1e1b1b;
  --surface-3: #252016;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f7f1e8;
  --muted: #b8ada1;
  --quiet: #8f867b;
  --red: #db1f2b;
  --red-soft: #8e1720;
  --amber: #d9a441;
  --teal: #2aa79b;
  --green: #5f9d68;
  --focus: #f4cc76;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --reader-size: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding-bottom: 230px;
  background:
    linear-gradient(180deg, rgba(9, 9, 11, 0.12), #09090b 52rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

/* Hide hosting badges that may be injected by the deployment provider. */
#netlify-badge,
.netlify-badge,
[data-netlify-badge],
a[aria-label*="netlify" i],
a[title*="netlify" i],
a[href*="netlify.com"],
a[href*="netlify.app"] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 380px);
  gap: 20px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(6, 6, 8, 0.94), rgba(6, 6, 8, 0.66));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--red);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(219, 31, 43, 0.28);
}

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

.nav-button,
.ghost-action,
.mini-button,
.tab-button,
.dock-tab {
  min-height: 38px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 14px;
  border: 1px solid transparent;
}

.nav-button:hover,
.ghost-action:hover,
.mini-button:hover,
.tab-button:hover,
.dock-tab:hover {
  background: rgba(255, 255, 255, 0.14);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.searchbar span {
  color: var(--quiet);
  font-size: 1.25rem;
  line-height: 1;
}

.searchbar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.searchbar input::placeholder {
  color: #8e877f;
}

.search-submit {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}

.search-submit:hover {
  background: rgba(255, 255, 255, 0.18);
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: min(86vh, 780px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(24px, 4vw, 52px);
  align-items: end;
  padding: 118px clamp(16px, 4vw, 54px) 184px;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(90deg, #09090b 0%, rgba(9, 9, 11, 0.86) 30%, rgba(9, 9, 11, 0.28) 68%, #09090b 100%),
    linear-gradient(0deg, #09090b 0%, rgba(9, 9, 11, 0.42) 48%, rgba(9, 9, 11, 0.7) 100%),
    url("assets/hero-bible.png");
  background-position: center;
  background-size: cover;
}

.hero__content {
  max-width: 760px;
  padding-bottom: 24px;
}

.kicker,
.panel-label {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.chapter-lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: #e1d7cc;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-action {
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--red);
  padding: 0 22px;
  font-weight: 800;
  color: white;
}

.primary-action:hover {
  background: #ee3340;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.ghost-action {
  min-height: 44px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.13);
}

.now-panel {
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(16, 16, 18, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 20px;
}

.now-panel h2,
.reader-toolbar h2,
.section-heading h2,
.dock-header h2,
.drawer__header h2 {
  margin: 0;
  letter-spacing: 0;
}

.now-panel p:not(.panel-label) {
  color: var(--muted);
  line-height: 1.45;
}

.progress-shell {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--teal));
  transition: width 260ms ease;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(210px, 300px) minmax(0, 1fr);
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 54px) 30px;
}

.chapter-rail,
.scripture-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 20, 22, 0.88);
}

.chapter-rail {
  position: sticky;
  top: 82px;
  align-self: start;
  padding: 16px;
}

.rail-heading,
.reader-toolbar,
.section-heading,
.dock-header,
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.rail-heading {
  margin-bottom: 12px;
  font-weight: 800;
}

.chapter-buttons,
.drawer-chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
}

.chapter-button {
  min-height: 38px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chapter-button.active {
  background: var(--red);
  border-color: rgba(255, 255, 255, 0.24);
  font-weight: 800;
}

.topic-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.chip-list,
.theme-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.small-chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #efe8dd;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.chip.active {
  border-color: rgba(217, 164, 65, 0.72);
  background: rgba(217, 164, 65, 0.18);
  color: #ffe4a7;
}

.small-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
}

.scripture-surface {
  min-height: 620px;
  padding: clamp(16px, 3vw, 28px);
}

.reader-toolbar {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.mini-button {
  min-width: 38px;
  padding: 0 12px;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
}

.verses {
  display: grid;
  gap: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size);
  line-height: 1.72;
}

.verse {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: 100%;
  min-height: 46px;
  padding: 9px 10px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  color: #f3eadf;
}

.verse:hover,
.verse.selected {
  background: rgba(255, 255, 255, 0.08);
}

.verse.topic-hit {
  background: rgba(42, 167, 155, 0.13);
}

.verse.selected {
  box-shadow: inset 3px 0 0 var(--red);
}

.verse sup {
  color: var(--amber);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 2;
}

.verse span {
  min-width: 0;
}

.shelf-section {
  padding: 28px clamp(16px, 4vw, 54px);
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.92rem;
}

.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 310px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.book-card,
.theme-card,
.connection-card,
.continue-card {
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--card-tone, #1f1b18);
  color: var(--text);
  padding: 16px;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.book-card:hover,
.theme-card:hover,
.connection-card:hover,
.continue-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
}

.book-card h3,
.theme-card h3,
.continue-card h3,
.connection-card h3 {
  margin: 0 0 9px;
  font-size: 1.2rem;
  line-height: 1.18;
}

.book-card p,
.theme-card p,
.continue-card p,
.connection-card p {
  margin: 0;
  color: #d2c7bb;
  line-height: 1.42;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: #f0c470;
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-row {
  grid-auto-columns: minmax(260px, 340px);
}

.theme-card {
  min-height: 180px;
}

.theme-card__chips {
  margin-top: 14px;
}

.catalog-section {
  padding-bottom: 70px;
}

.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button.active,
.dock-tab.active {
  background: rgba(219, 31, 43, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.book-grid .book-card {
  min-height: 166px;
}

.study-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 24;
  padding: 0 clamp(10px, 3vw, 32px) 12px;
  pointer-events: none;
}

.dock-shell {
  max-width: 1320px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 15, 17, 0.94);
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(22px);
  pointer-events: auto;
}

.dock-header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.dock-header h2 {
  font-size: 1.05rem;
}

.dock-header .panel-label {
  margin-bottom: 4px;
}

.dock-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.dock-tab {
  min-height: 32px;
  padding: 0 12px;
}

.dock-toggle {
  display: inline-grid;
  width: 36px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.25rem;
}

.dock-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 12px;
  max-height: 118px;
  overflow: auto;
  padding: 10px 14px 12px;
}

.study-dock.collapsed .dock-content,
.study-dock.collapsed .dock-tabs .dock-tab {
  display: none;
}

.study-dock.collapsed .dock-header {
  border-bottom: 0;
}

.dock-text {
  color: #e9ded1;
  font-size: 0.94rem;
  line-height: 1.55;
}

.dock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

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

.connection-card {
  min-height: 118px;
  padding: 13px;
}

.connection-card h3 {
  font-size: 1rem;
}

.map-card {
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.map-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--red));
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(560px, 100vw);
  padding: 20px;
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: #111113;
  box-shadow: var(--shadow);
}

.drawer-summary {
  color: var(--muted);
  line-height: 1.5;
}

.drawer-chapters {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  margin-top: 18px;
}

.empty-state {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  body {
    padding-bottom: 260px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .topnav {
    order: 3;
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .searchbar {
    min-width: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 150px;
  }

  .now-panel {
    align-self: stretch;
  }

  .reader-layout {
    grid-template-columns: 1fr;
  }

  .chapter-rail {
    position: static;
  }

  .dock-content {
    grid-template-columns: 1fr;
    max-height: 210px;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 24px;
  }

  .study-dock {
    position: static;
    padding: 24px 12px 0;
  }

  .dock-shell {
    box-shadow: none;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand {
    font-size: 1.28rem;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .searchbar {
    grid-column: 1 / -1;
    order: 2;
  }

  .topnav {
    order: 3;
  }

  .hero {
    padding: 178px 14px 42px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.5rem);
  }

  .reader-layout,
  .shelf-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .reader-toolbar,
  .section-heading,
  .dock-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dock-tabs {
    justify-content: start;
  }

  .verse {
    grid-template-columns: 38px minmax(0, 1fr);
    padding-left: 6px;
    padding-right: 6px;
  }

  .shelf-row {
    grid-auto-columns: minmax(210px, 82vw);
  }

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