:root{
  --blue:#3D5CAD;
  --blue-dark:#1C2B5E;
  --blue-deep:#152040;
  --gold:#D4A433;
  --gold-dark:#B88A1A;
  --offwhite:#EDECEA;
  --cream:#F2EFE2;
  --black:#191912;
  --brown:#2B1D0E;
  --white:#FFFFFF;
  --font:"Segoe UI",system-ui,-apple-system,sans-serif;
  --gold-04:rgba(212,164,51,.04);
  --gold-08:rgba(212,164,51,.08);
  --gold-14:rgba(212,164,51,.14);
  --line:rgba(255,255,255,.09);
  --line-soft:rgba(255,255,255,.06);
  --muted:rgba(237,236,234,.6);
}

*{box-sizing:border-box;}
body{margin:0;}
.app{
  min-height:100vh;
  background:linear-gradient(180deg, var(--blue-deep) 0%, var(--black) 46%, var(--black) 100%) fixed;
  color:var(--offwhite);
  font-family:var(--font);
  display:flex;
  flex-direction:column;
}
a,button{font-family:inherit;color:inherit;}
a{text-decoration:none;}

/* ---------- header ---------- */
.topbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.5rem;
  border-bottom:1px solid var(--line);
  background:rgba(21,32,64,.55);
  backdrop-filter:blur(6px);
  position:sticky;
  top:0;
  z-index:5;
}
.brand{display:flex;align-items:center;gap:.85rem;}
.brand-mark{height:2.5rem;width:auto;flex-shrink:0;}
.brand-text .wordmark{
  margin:0;
  font-size:.98rem;
  font-weight:800;
  line-height:1.05;
  text-transform:uppercase;
  letter-spacing:.01em;
  color:var(--white);
}
.brand-text .tagline{
  margin:.3rem 0 0;
  font-size:.68rem;
  font-weight:600;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--gold);
}
.meta{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;}
.back-link{
  display:flex;
  align-items:center;
  gap:.4rem;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:6px;
  padding:.4rem .75rem;
  transition:color .15s ease, border-color .15s ease;
}
.back-link:hover{color:var(--gold);border-color:var(--gold-dark);}
.pill{
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.09em;
  text-transform:uppercase;
  padding:.32rem .65rem;
  border-radius:4px;
  border:1px solid var(--line);
  color:var(--muted);
}
.pill-gold{border-color:transparent;background:var(--gold);color:var(--black);}

/* ---------- shell / workspace ---------- */
.shell{
  flex:1;
  width:100%;
  max-width:60rem;
  margin:0 auto;
  padding:2.75rem 1.5rem 3.5rem;
}
.workspace{
  flex:1;
  width:100%;
  max-width:74rem;
  margin:0 auto;
  padding:2.25rem 1.5rem 3rem;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,360px);
  gap:2.5rem;
  align-items:start;
}
.eyebrow{
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
  margin:0 0 .6rem;
}

/* ---------- index / hero ---------- */
.hero h1{
  margin:0 0 .6rem;
  font-size:2.4rem;
  font-weight:800;
  letter-spacing:-.02em;
  text-wrap:balance;
  color:var(--white);
}
.hero p{
  margin:0 0 1.6rem;
  max-width:42rem;
  font-size:1rem;
  line-height:1.65;
  color:var(--muted);
}
.book-card{
  background:var(--gold-04);
  border:1px solid var(--line);
  border-radius:12px;
  padding:1.5rem 1.6rem 1.7rem;
  margin-bottom:2.25rem;
}
.book-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:.5rem;
  margin-bottom:.3rem;
}
.book-head h2{margin:0;font-size:1.3rem;font-weight:800;color:var(--white);}
.book-head .book-sub{font-size:.78rem;color:var(--muted);}
.progress-row{display:flex;align-items:center;gap:.75rem;margin:.9rem 0 1.3rem;}
.progress-track{flex:1;height:6px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;}
.progress-fill{height:100%;background:var(--gold);border-radius:99px;}
.progress-label{
  flex-shrink:0;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.03em;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.chapter-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(46px,1fr));gap:.5rem;}
.chapter-tile{
  aspect-ratio:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  font-weight:700;
  font-size:.92rem;
  font-variant-numeric:tabular-nums;
}
.chapter-tile.live{background:var(--gold);color:var(--black);cursor:pointer;transition:background-color .15s ease;}
.chapter-tile.live:hover{background:var(--gold-dark);}
.chapter-tile.live:focus-visible{outline:2px solid var(--white);outline-offset:2px;}
.chapter-tile.soon{background:transparent;border:1px dashed var(--line);color:var(--muted);cursor:default;}
.chapter-legend{display:flex;gap:1.4rem;margin-top:1.1rem;font-size:.72rem;color:var(--muted);}
.chapter-legend span{display:inline-flex;align-items:center;gap:.4rem;}
.legend-swatch{width:.65rem;height:.65rem;border-radius:3px;display:inline-block;}
.legend-swatch.live{background:var(--gold);}
.legend-swatch.soon{border:1px dashed var(--line);}
.more-books h3{margin:0 0 .3rem;font-size:.95rem;font-weight:800;color:var(--white);}
.more-books p{margin:0 0 1rem;font-size:.82rem;color:var(--muted);}
.book-chips{display:flex;flex-wrap:wrap;gap:.6rem;}
.book-chip{
  display:flex;
  align-items:center;
  gap:.5rem;
  border:1px dashed var(--line);
  border-radius:99px;
  padding:.45rem .9rem .45rem 1rem;
  font-size:.85rem;
  color:var(--muted);
}
.book-chip .soon-tag{
  font-size:.6rem;
  font-weight:700;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--gold-dark);
  border:1px solid var(--gold-dark);
  border-radius:4px;
  padding:.12rem .4rem;
}

/* ---------- reader ---------- */
.reading-pane{min-width:0;}
.passage-title{
  margin:0 0 1.6rem;
  font-size:2rem;
  font-weight:800;
  letter-spacing:-.02em;
  text-wrap:balance;
  display:flex;
  align-items:baseline;
  gap:.65rem;
  color:var(--white);
}
.passage-title .version{
  font-size:.65rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:4px;
  padding:.2rem .45rem;
}
.verses{
  display:flex;
  flex-direction:column;
  background:var(--gold-04);
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}
.verse{
  display:flex;
  gap:.9rem;
  align-items:flex-start;
  text-align:left;
  width:100%;
  background:none;
  border:none;
  border-bottom:1px solid var(--line-soft);
  padding:1rem 1.2rem;
  cursor:pointer;
  font-size:1.03rem;
  line-height:1.75;
  color:var(--offwhite);
  transition:background-color .15s ease;
}
.verse:last-child{border-bottom:none;}
.verse:hover{background:var(--gold-08);}
.verse:focus-visible{outline:2px solid var(--gold);outline-offset:-2px;}
.verse .vnum{
  flex-shrink:0;
  width:1.7rem;
  text-align:right;
  font-size:.78rem;
  font-weight:700;
  color:var(--muted);
  padding-top:.25rem;
  font-variant-numeric:tabular-nums;
}
.verse.active{background:var(--gold-14);box-shadow:inset 3px 0 0 var(--gold);}
.verse.active .vnum{color:var(--gold);}
.notes-pane{position:sticky;top:6.4rem;min-width:0;}
.notes-empty,.notes-card{
  background:var(--gold-04);
  border-radius:12px;
  padding:1.3rem 1.4rem;
  min-height:11rem;
}
.notes-empty{border:1px dashed var(--line);}
.notes-empty p{margin:0;font-size:.85rem;color:var(--muted);line-height:1.7;}
.notes-empty.is-hidden{display:none;}
.notes-card{border:1px solid var(--line);display:none;}
.notes-card.open{display:block;}
.mobile-hint{display:none;}
.sheet-backdrop{display:none;}
.sheet-handle{display:none;}
.notes-close{display:none;}
.notes-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.9rem;}
.notes-ref{
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.06em;
  color:var(--black);
  background:var(--gold);
  border-radius:4px;
  padding:.28rem .55rem;
}
.notes-label{font-size:.65rem;font-weight:700;letter-spacing:.09em;color:var(--muted);text-transform:uppercase;}
.notes-quote{
  margin:0 0 1rem;
  padding-left:.85rem;
  border-left:2px solid var(--gold-dark);
  font-style:italic;
  color:var(--muted);
  font-size:.92rem;
  line-height:1.65;
}
.notes-body{margin:0;font-size:.94rem;line-height:1.72;color:var(--offwhite);}

.discussion-widget{
  margin-top:1.1rem;
  padding-top:1.1rem;
  border-top:1px dashed var(--line);
}
.discussion-widget[hidden]{display:none;}
.discussion-heading{
  margin:0 0 .4rem;
  font-size:.62rem;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--gold);
}
.discussion-theme{margin:0 0 .35rem;font-size:.85rem;font-weight:700;color:var(--white);}
.discussion-question{margin:0;font-size:.92rem;line-height:1.65;color:var(--offwhite);}

@media (prefers-reduced-motion:no-preference){
  .notes-card{animation:rise .22s ease;}
  @keyframes rise{
    from{opacity:0;transform:translateY(6px);}
    to{opacity:1;transform:translateY(0);}
  }
}

/* ---------- footer ---------- */
.footer{border-top:1px solid var(--line);padding:1.1rem 1.5rem 1.5rem;}
.footer p{max-width:74rem;margin:0 auto;font-size:.72rem;color:var(--muted);letter-spacing:.01em;}

@media (max-width:860px){
  .workspace{grid-template-columns:1fr;gap:1.75rem;padding-top:1.5rem;}
  .notes-pane{position:static;top:auto;}
  .workspace{padding-left:1.1rem;padding-right:1.1rem;}

  /* slimmer sticky header - it's permanently on screen, don't let it eat the viewport */
  /* backdrop-filter on a sticky element, composited at the same time as the
     fixed bottom sheet's transform transition below, is a known freeze/jank
     trigger on mobile Safari - drop it on mobile, keep it on desktop */
  .topbar{padding:.6rem .9rem;gap:.5rem;backdrop-filter:none;background:rgba(21,32,64,.92);}
  .brand{gap:.6rem;}
  .brand-mark{height:2rem;}
  .brand-text .wordmark{font-size:.82rem;}
  .brand-text .tagline{font-size:.6rem;margin-top:.15rem;}
  .meta{gap:.5rem;}
  .back-link{padding:.32rem .55rem;font-size:.7rem;}
  .pill{padding:.28rem .5rem;font-size:.62rem;}

  /* inline hint replaces the sidebar empty-state, which would otherwise sit
     off-screen below 50+ verses with no way to see it without scrolling */
  .mobile-hint{
    display:flex;
    align-items:center;
    gap:.4rem;
    margin:0 0 1rem;
    font-size:.78rem;
    font-weight:600;
    color:var(--gold);
  }
  .notes-empty{display:none;}

  /* notes become a bottom sheet: tapping a verse shouldn't require scrolling
     away from the verse list to read its note, or scrolling back to tap the next one */
  .sheet-backdrop{
    display:block;
    position:fixed;
    top:0;
    right:0;
    bottom:0;
    left:0;
    background:rgba(0,0,0,0);
    pointer-events:none;
    transition:background-color .25s ease;
    z-index:25;
  }
  .sheet-backdrop.open{background:rgba(0,0,0,.5);pointer-events:auto;}
  .notes-card{
    display:block;
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    max-height:72vh;
    overflow-y:auto;
    z-index:30;
    background:rgba(10,8,4,.92);
    border-radius:16px 16px 0 0;
    border-bottom:none;
    box-shadow:0 -12px 32px rgba(0,0,0,.45);
    transform:translateY(100%);
    transition:transform .28s ease;
    animation:none;
    padding-bottom:calc(1.4rem + env(safe-area-inset-bottom));
  }
  .notes-card.open{transform:translateY(0);}
  .sheet-handle{
    display:block;
    width:2.5rem;
    height:.25rem;
    border-radius:99px;
    background:var(--line);
    margin:0 auto .9rem;
  }
  .notes-close{
    display:flex;
    align-items:center;
    justify-content:center;
    width:1.8rem;
    height:1.8rem;
    flex-shrink:0;
    border-radius:50%;
    border:1px solid var(--line);
    background:transparent;
    color:var(--muted);
    font-size:1.1rem;
    line-height:1;
    cursor:pointer;
  }
}
@media (max-width:860px) and (prefers-reduced-motion:reduce){
  .notes-card,.sheet-backdrop{transition:none;}
}
@media (max-width:600px){
  .hero h1{font-size:1.9rem;}
  .book-card{padding:1.2rem 1.2rem 1.4rem;}
}
