/* ═══════════════════════════════════════════════════════
   PROJETO BÍBLIA NTLH — Design System v3
   Atmosfera: Manuscrito iluminado sob luz de vela em catedral

   Tipografia: Cormorant Garamond (títulos), Crimson Pro (corpo), JetBrains Mono (UI)
   Paleta: mogno profundo, dourado luminoso, âmbar quente
   Signature: títulos com glow dourado + gradiente mesh atmosférico
   ═══════════════════════════════════════════════════════ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}

:root{
  --bg:#080604;
  --bg2:#0e0c08;
  --bg3:#16120c;
  --bg4:#1e1a12;
  --bg5:#28221a;

  --gold1:#f8edd6;
  --gold2:#e4c880;
  --gold3:#d4b06a;
  --gold4:#c09a50;
  --gold5:#a07e3a;
  --gold6:#6a5428;

  --txt:#ece4d4;
  --txt2:#c4b8a4;
  --txt3:#8a8070;
  --txtv:#e2d8c6;

  --extra:#e09050;
  --theo:#b8a0d0;

  --ease:cubic-bezier(.16,1,.3,1);
  --r:12px;
  --font-body:'Crimson Pro',Georgia,'Times New Roman',serif;
}

@media(prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
  /* Garante visibilidade quando animações estão desabilitadas.
     Sem isso, elementos com opacity:0 + animation:fadeIn ficam invisíveis. */
  .hero-label,.hero-title,.hero-sub,.hero-meta,.hero-btn,.hero-reset,
  .global-progress,.arc,.idx-hero .hero-label,.idx-hero .hero-title,
  .idx-hero .hero-sub,.idx-hero .hero-meta{opacity:1!important;transform:none!important}
}

html{
  scroll-behavior:smooth;
  scrollbar-width:thin;scrollbar-color:var(--gold6) var(--bg);
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  font-size:17px;
}
::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--gold6);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--gold5)}
::selection{background:var(--gold4);color:var(--bg)}

body{
  font-family:var(--font-body);
  background:var(--bg);color:var(--txt);
  font-size:1rem;line-height:1.7;
  min-height:100vh;
}

/* Fundo sólido var(--bg) #080604 — mogno profundo, limpo. */

/* ── Progress bar ── */
#progress{position:fixed;top:0;left:0;height:2px;
  background:linear-gradient(90deg,var(--gold5),var(--gold3),var(--gold2));
  z-index:900;transition:width .8s var(--ease);
  box-shadow:0 0 20px rgba(200,170,100,.35)}

/* ── Layout ── */
.container{position:relative;z-index:1;max-width:780px;margin:0 auto;padding:0 2.2rem}


/* ═══════════════════════════════════════
   HERO — Tela de entrada do capítulo
   ═══════════════════════════════════════ */

.hero{
  min-height:100vh;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;
  padding:3rem 2rem;position:relative;z-index:1;
}

.hero-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.8rem;letter-spacing:.25em;text-transform:uppercase;
  color:var(--gold4);margin-bottom:1.4rem;
  animation:fadeIn .8s var(--ease) .3s both;
}

.hero-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(2.8rem,7vw,5rem);font-weight:300;
  line-height:.95;letter-spacing:-.03em;color:var(--gold1);
  /* Glow dourado — como folha de ouro sob luz de vela */
  text-shadow:
    0 0 60px rgba(212,176,106,.2),
    0 0 120px rgba(212,176,106,.08),
    0 2px 4px rgba(0,0,0,.4);
  animation:titleReveal 1.2s var(--ease) .5s both;
}

.hero-sub{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.15rem;font-style:italic;color:var(--txt2);
  margin-top:1.2rem;font-weight:300;letter-spacing:.02em;
  animation:fadeIn .8s var(--ease) .9s both;
}

.hero-meta{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.78rem;color:var(--txt3);letter-spacing:.12em;margin-top:2rem;
  animation:fadeIn .8s var(--ease) 1.1s both;
}

.hero-resume{
  font-size:1.05rem;color:var(--gold3);margin-top:1.4rem;
  font-style:italic;display:none;
}

.hero-btn{
  margin-top:3rem;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.82rem;letter-spacing:.15em;text-transform:uppercase;
  color:var(--gold3);background:transparent;
  border:1px solid var(--gold5);padding:1.1rem 3rem;border-radius:50px;
  cursor:pointer;transition:all .4s var(--ease);
  position:relative;overflow:hidden;
  animation:fadeIn .8s var(--ease) 1.3s both;
}
.hero-btn::before{
  content:'';position:absolute;inset:0;
  background:linear-gradient(135deg,rgba(212,176,106,.1),transparent);
  opacity:0;transition:opacity .4s;
}
.hero-btn:hover{
  border-color:var(--gold3);transform:translateY(-2px);
  box-shadow:0 8px 40px rgba(212,176,106,.12);
}
.hero-btn:hover::before{opacity:1}

.hero-reset{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;color:var(--txt3);margin-top:1.4rem;cursor:pointer;
  text-decoration:underline;text-underline-offset:4px;
  display:none;background:none;border:none;transition:color .3s;
}
.hero-reset:hover{color:var(--txt2)}

@keyframes fadeIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes titleReveal{
  from{opacity:0;transform:translateY(20px) scale(.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}


/* ═══════════════════════════════════════
   MAP — Nós de navegação do capítulo
   ═══════════════════════════════════════ */

#mapWrap{display:none;padding:3.5rem 0 1.5rem}

.map-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.78rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--gold5);text-align:center;margin-bottom:2rem;
}

.map{display:flex;align-items:center;justify-content:center;gap:0;flex-wrap:wrap;padding:0 .5rem}

.map-node{
  display:flex;flex-direction:column;align-items:center;
  cursor:pointer;padding:.8rem .6rem;
  transition:all .35s var(--ease);position:relative;
}
.map-node:hover .node-circle{
  border-color:var(--gold3);
  box-shadow:0 0 28px rgba(212,176,106,.2);
}

.node-circle{
  width:54px;height:54px;border-radius:50%;
  border:1.5px solid var(--gold6);background:var(--bg3);
  display:flex;align-items:center;justify-content:center;
  transition:all .4s var(--ease);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.25rem;font-weight:500;color:var(--gold2);
}
.map-node.active .node-circle{
  border-color:var(--gold3);background:var(--bg4);
  box-shadow:0 0 28px rgba(212,176,106,.18),inset 0 0 14px rgba(212,176,106,.06);
}
.map-node.done .node-circle{
  border-color:var(--gold4);background:var(--gold6);color:var(--bg);
}
.map-node.done .node-circle::after{
  content:'✓';position:absolute;top:-5px;right:-5px;font-size:.6rem;
  width:18px;height:18px;border-radius:50%;background:var(--gold4);color:var(--bg);
  display:flex;align-items:center;justify-content:center;
}

.node-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.65rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--txt3);margin-top:.55rem;text-align:center;
  max-width:90px;transition:color .3s;
}
.map-node:hover .node-label,
.map-node.active .node-label{color:var(--gold3)}

.map-conn{width:36px;height:1.5px;background:var(--gold6);opacity:.3;flex-shrink:0}
.map-conn.lit{background:var(--gold4);opacity:.7;box-shadow:0 0 8px rgba(212,176,106,.15)}


/* ═══════════════════════════════════════
   STATS
   ═══════════════════════════════════════ */

.stats{
  display:flex;justify-content:center;gap:2.5rem;
  margin-top:1.5rem;padding-bottom:2rem;
  border-bottom:1px solid rgba(212,176,106,.08);
}
.stat{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--txt3);
}
.stat b{color:var(--gold3);font-weight:400}
.stat-label{color:var(--txt3)}


/* ═══════════════════════════════════════
   SECTION CONTENT
   ═══════════════════════════════════════ */

#sectionPanel{display:none;padding-top:3rem;padding-bottom:4rem;animation:fadeUp .5s var(--ease)}
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}

.sec-head{
  text-align:center;padding-bottom:2.5rem;margin-bottom:2.5rem;
  border-bottom:1px solid rgba(212,176,106,.08);position:relative;
}
.sec-head::after{
  content:'';position:absolute;bottom:-1px;left:50%;transform:translateX(-50%);
  width:60px;height:2px;
  background:linear-gradient(90deg,transparent,var(--gold4),transparent);
}
.sec-num{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.78rem;letter-spacing:.25em;text-transform:uppercase;color:var(--gold4);
}
.sec-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.8rem,4vw,2.5rem);font-weight:300;
  color:var(--gold1);margin-top:.7rem;letter-spacing:-.01em;
  text-shadow:0 0 40px rgba(212,176,106,.1);
}
.sec-desc{
  font-size:.95rem;font-style:italic;color:var(--txt2);margin-top:.6rem;font-weight:300;
}


/* ── Flowchart ── */
.flow{display:flex;flex-direction:column;align-items:center;gap:0;margin:2.5rem 0}

.flow-step{
  background:var(--bg3);border:1px solid rgba(212,176,106,.1);border-radius:var(--r);
  padding:.9rem 1.5rem;text-align:center;max-width:380px;width:100%;
  transition:all .3s var(--ease);
}
.flow-step:hover{border-color:rgba(212,176,106,.25);background:var(--bg4)}
.flow-step b{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1rem;font-weight:500;color:var(--gold2);display:block;
}
.flow-step span{font-size:.9rem;color:var(--txt3)}

.flow-arrow{width:1.5px;height:24px;background:linear-gradient(var(--gold6),var(--gold5));position:relative}
.flow-arrow::after{
  content:'';position:absolute;bottom:-4px;left:-3.5px;
  border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid var(--gold5);
}


/* ── Verses — o coração do design ── */
.verse{
  display:flex;gap:1.1rem;align-items:flex-start;
  padding:1.1rem 0;position:relative;
  border-bottom:1px solid rgba(212,176,106,.04);
  transition:background .3s;
}
.verse:hover{background:rgba(212,176,106,.015);border-radius:var(--r)}
.verse:last-child{border-bottom:none}
.verse.verse-target{
  background:rgba(212,176,106,.06);
  border-radius:var(--r);
  box-shadow:0 0 0 1px rgba(212,176,106,.14);
}

.v-num{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.75rem;color:var(--gold5);min-width:26px;
  text-align:right;padding-top:.4rem;flex-shrink:0;
}
.v-body{flex:1}
.v-text{
  font-size:1.05rem;line-height:1.75;color:var(--txtv);font-weight:300;
}
.v-text .speech{color:var(--gold1);font-style:italic;font-weight:400}

.v-note-btn{
  position:absolute;right:0;top:1rem;opacity:0;font-size:.9rem;
  background:none;border:none;cursor:pointer;
  color:var(--gold5);transition:opacity .2s;padding:6px;
}
.verse:hover .v-note-btn{opacity:.5}
.v-note-btn:hover{opacity:1!important}
.v-has-note::after{
  content:'';position:absolute;right:0;top:50%;transform:translateY(-50%);
  width:6px;height:6px;border-radius:50%;background:var(--gold4);
  box-shadow:0 0 10px rgba(192,154,80,.35);
}


/* ── Insight box (conteúdo extra-bíblico) ── */
.insight{
  margin:2.5rem 0;padding:1.5rem 1.8rem;background:var(--bg3);
  border-left:3px solid var(--extra);border-radius:0 var(--r) var(--r) 0;
  transition:border-color .3s;
}
.insight:hover{border-color:var(--gold3)}
.insight-tag{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;letter-spacing:.15em;text-transform:uppercase;
  color:var(--extra);margin-bottom:.7rem;
  display:flex;align-items:center;gap:.5rem;
}
.insight-tag::before{content:'⚠'}
.insight h4{
  margin:0 0 .8rem;
  font-size:1rem;
  color:var(--txt);
}
.insight p{font-size:.92rem;line-height:1.7;color:var(--txt2);font-weight:300}
.insight .src{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;color:var(--txt3);margin-top:.8rem;
  font-style:italic;letter-spacing:.04em;
}


/* ── Section navigation ── */
.sec-nav{
  display:flex;justify-content:space-between;align-items:center;
  padding:2.5rem 0 1rem;margin-top:2.5rem;
  border-top:1px solid rgba(212,176,106,.06);
}
.nav-btn{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.75rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--gold4);background:transparent;border:1px solid var(--gold6);
  padding:.75rem 1.5rem;border-radius:50px;cursor:pointer;
  transition:all .3s var(--ease);text-decoration:none;
}
.nav-btn:hover{
  background:rgba(212,176,106,.06);border-color:var(--gold4);
  transform:translateY(-1px);
}
.nav-btn:disabled{opacity:.2;cursor:default;pointer-events:none}
.nav-counter{font-family:'JetBrains Mono',Consolas,monospace;font-size:.72rem;color:var(--txt3)}

/* ── Chapter navigation (entre capítulos) ── */
.ch-nav{
  display:flex;justify-content:space-between;align-items:center;
  padding:2rem 0;margin-top:1rem;border-top:1px solid rgba(212,176,106,.06);
}
.ch-nav .nav-btn{font-size:.78rem;padding:.85rem 1.8rem}


/* ═══════════════════════════════════════
   FABs — Floating Action Buttons
   ═══════════════════════════════════════ */

.fab-group{
  position:fixed;bottom:2rem;right:2rem;z-index:800;
  display:flex;flex-direction:column;gap:.8rem;
}
.fab{
  width:50px;height:50px;border-radius:50%;
  border:1px solid var(--gold6);
  background:rgba(14,12,8,.95);backdrop-filter:blur(12px);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:1.15rem;color:var(--gold3);
  transition:all .3s var(--ease);
  box-shadow:0 4px 24px rgba(0,0,0,.5);
}
.fab:hover{
  border-color:var(--gold3);background:var(--bg4);
  transform:translateY(-2px);
  box-shadow:0 8px 36px rgba(0,0,0,.5),0 0 20px rgba(212,176,106,.1);
}
.fab.active{border-color:var(--gold3);box-shadow:0 0 24px rgba(212,176,106,.2)}

body.q-mode{cursor:help}
body.q-mode .lookup{
  text-decoration-line:underline;text-decoration-style:dotted;
  text-decoration-color:var(--gold5);text-underline-offset:4px;
  cursor:help;transition:color .2s;
}
body.q-mode .lookup:hover{color:var(--gold2)}
body.doubt-unavailable #menuStudyModeBtn,
body.doubt-unavailable #fabQ{display:none}


/* ═══════════════════════════════════════
   MODALS
   ═══════════════════════════════════════ */

.modal-bg{
  position:fixed;inset:0;background:rgba(0,0,0,.7);backdrop-filter:blur(8px);
  z-index:1000;display:none;align-items:center;justify-content:center;padding:1.5rem;
}
.modal-bg.open{display:flex}

.modal{
  background:var(--bg2);border:1px solid rgba(212,176,106,.12);
  border-radius:var(--r);width:100%;max-width:560px;max-height:85vh;
  overflow-y:auto;padding:2.5rem;
  box-shadow:0 24px 80px rgba(0,0,0,.6),0 0 60px rgba(212,176,106,.04);
}
.modal h3{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.5rem;font-weight:400;color:var(--gold1);margin-bottom:.5rem;
}
.modal .modal-verse{
  font-size:1rem;color:var(--txt2);font-style:italic;
  margin-bottom:1.5rem;line-height:1.65;font-weight:300;
}
.modal textarea{
  width:100%;min-height:140px;background:var(--bg3);
  border:1px solid rgba(212,176,106,.12);border-radius:var(--r);
  color:var(--txt);font-family:var(--font-body);
  font-size:1.1rem;padding:1rem;resize:vertical;line-height:1.7;
}
.modal textarea:focus{
  outline:none;border-color:var(--gold5);
  box-shadow:0 0 16px rgba(212,176,106,.08);
}
.modal-actions{display:flex;gap:.8rem;margin-top:1.3rem;justify-content:flex-end}
.modal-btn{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;
  padding:.65rem 1.3rem;border-radius:var(--r);cursor:pointer;
  transition:all .25s;border:1px solid var(--gold6);
  background:transparent;color:var(--gold3);
}
.modal-btn:hover{background:rgba(212,176,106,.08)}
.modal-btn.primary{background:var(--gold5);color:var(--bg);border-color:var(--gold5)}
.modal-btn.primary:hover{background:var(--gold4)}
.modal-btn.danger{border-color:#7a4040;color:#e08060}
.modal-btn.danger:hover{background:rgba(122,64,64,.15)}


/* ── Verbete (knowledge base) ── */
.verbete-section{margin-bottom:1.4rem;padding:1.1rem 1.3rem;border-radius:var(--r);background:var(--bg3)}
.verbete-section.biblical{border-left:3px solid var(--gold3)}
.verbete-section.extra{border-left:3px solid var(--extra)}
.verbete-section.theo{border-left:3px solid var(--theo)}
.verbete-type{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;letter-spacing:.15em;text-transform:uppercase;margin-bottom:.5rem;
}
.verbete-section.biblical .verbete-type{color:var(--gold3)}
.verbete-section.extra .verbete-type{color:var(--extra)}
.verbete-section.theo .verbete-type{color:var(--theo)}
.verbete-body{font-size:.92rem;line-height:1.7;color:var(--txt2);font-weight:300}
.verbete-src{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;color:var(--txt3);margin-top:.5rem;font-style:italic;
}


/* ── Notes panel ── */
.notes-panel{
  position:fixed;top:0;right:-400px;width:390px;max-width:92vw;height:100vh;
  background:var(--bg2);border-left:1px solid rgba(212,176,106,.1);
  z-index:950;transition:right .4s var(--ease);overflow-y:auto;padding:2.5rem 2rem;
  box-shadow:-10px 0 50px rgba(0,0,0,.4);
}
.notes-panel.open{right:0}
.notes-panel h3{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.4rem;font-weight:400;color:var(--gold1);margin-bottom:2rem;
}
.np-close{
  position:absolute;top:1.3rem;right:1.3rem;background:none;border:none;
  color:var(--txt3);cursor:pointer;font-size:1.3rem;transition:color .2s;
}
.np-close:hover{color:var(--txt)}
.np-item{padding:1rem 0;border-bottom:1px solid rgba(212,176,106,.05)}
.np-item-v{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;color:var(--gold4);letter-spacing:.08em;text-transform:uppercase;
}
.np-item-t{font-size:1rem;color:var(--txt2);line-height:1.65;margin-top:.3rem;font-weight:300}
.np-empty{
  min-height:14rem;
  display:grid;
  place-items:center;
  align-content:center;
  gap:.85rem;
  padding:2.8rem 1rem;
  text-align:center;
  font-style:normal;
  color:var(--txt3);
}
.np-empty-title{
  display:block;
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.35rem,2vw,1.65rem);
  line-height:1.12;
  color:var(--txt2);
  font-style:italic;
  opacity:.82;
}
.np-empty-hint{
  display:block;
  max-width:18rem;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.09em;
  line-height:1.75;
  text-transform:uppercase;
  color:var(--txt3);
  opacity:.74;
}


/* ── Footer ── */
.footer{text-align:center;padding:4rem 2rem 4rem;border-top:1px solid rgba(212,176,106,.05);position:relative;z-index:1}
.footer p{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;color:var(--txt3);letter-spacing:.08em;line-height:2.2;
}
.footer .footer-label{
  color:var(--gold4);
  text-transform:uppercase;
}
.footer[data-shared-footer="bibliography"]:empty::before,
.footer[data-shared-footer="bibliography"]:empty::after{
  display:block;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  line-height:2.2;
}
.footer[data-shared-footer="bibliography"]:empty::before{
  content:'Bibliografia:';
  color:var(--gold4);
  text-transform:uppercase;
}
.footer[data-shared-footer="bibliography"]:empty::after{
  content:'NTLH — Nova Tradução na Linguagem de Hoje\a\a Sociedade Bíblica do Brasil';
  color:var(--txt3);
  white-space:pre-line;
}
.footer a{color:var(--gold5);text-decoration:none;transition:color .2s}
.footer a:hover{color:var(--gold3)}


/* ═══════════════════════════════════════
   INDEX PAGE
   ═══════════════════════════════════════ */

.idx-hero{
  min-height:55vh;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  text-align:center;padding:5rem 2rem 2.5rem;position:relative;z-index:1;
}
.idx-hero::before{
  content:'';position:absolute;top:18%;left:50%;transform:translateX(-50%);
  width:1px;height:38px;background:linear-gradient(180deg,transparent,var(--gold5));
  animation:fadeIn 1.4s var(--ease) .1s both;
}
.idx-hero .hero-label{
  font-size:.62rem;letter-spacing:.4em;color:var(--gold5);
  margin-top:1.4rem;
}
.idx-hero .hero-title{
  font-size:clamp(3rem,8vw,5.5rem);
  font-weight:300;line-height:.95;
  margin:1.4rem 0 .8rem;
}
.idx-hero .hero-title em{
  font-style:italic;color:var(--gold3);font-weight:400;
  display:block;font-size:.55em;letter-spacing:.05em;
  margin-top:.3rem;
  text-shadow:0 0 30px rgba(212,176,106,.15);
}
.idx-hero .hero-sub{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.15rem;font-style:italic;color:var(--txt2);
  font-weight:300;letter-spacing:.01em;
}
.idx-hero .hero-meta{
  font-family:'JetBrains Mono',Consolas,monospace;
  margin-top:1.5rem;font-size:.66rem;
  letter-spacing:.22em;text-transform:uppercase;
  color:var(--txt3);
}
.idx-hero .hero-label,.idx-hero .hero-title,.idx-hero .hero-sub,.idx-hero .hero-meta{
  animation:fadeIn .8s var(--ease) both;
}
.idx-hero .hero-label{animation-delay:.2s}
.idx-hero .hero-title{animation-delay:.4s;animation-name:titleReveal;animation-duration:1.2s}
.idx-hero .hero-sub{animation-delay:.7s}
.idx-hero .hero-meta{animation-delay:.9s}

.global-progress{
  margin:1.8rem auto 2rem;max-width:440px;text-align:center;
  animation:fadeIn .8s var(--ease) 1.2s both;
}
.gp-bar{width:100%;height:3px;background:var(--bg4);border-radius:2px;overflow:hidden;margin:.8rem 0}
.gp-bar-fill{
  height:100%;background:linear-gradient(90deg,var(--gold5),var(--gold3));
  transition:width 1s var(--ease);box-shadow:0 0 10px rgba(212,176,106,.25);
}
.gp-label{font-family:'JetBrains Mono',Consolas,monospace;font-size:.72rem;color:var(--txt3);letter-spacing:.08em}

/* Arcos narrativos */
.arc{margin-bottom:3.5rem;animation:fadeIn .6s var(--ease) both}
.arc:nth-child(1){animation-delay:.3s}
.arc:nth-child(2){animation-delay:.4s}
.arc:nth-child(3){animation-delay:.5s}
.arc:nth-child(4){animation-delay:.55s}
.arc:nth-child(5){animation-delay:.6s}
.arc:nth-child(6){animation-delay:.65s}
.arc:nth-child(7){animation-delay:.7s}

/* ── Arc head: numeral romano + título editorial + range ── */
.arc{
  margin-bottom:2.8rem;
  animation:fadeIn .6s var(--ease) both;
}
.arc-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:baseline;gap:1.2rem;
  margin-bottom:.4rem;
  padding-bottom:.7rem;
  border-bottom:1px dotted rgba(212,176,106,.12);
}
.arc-num{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-style:italic;
  font-size:1.1rem;color:var(--gold5);
  letter-spacing:.05em;
  font-feature-settings:'smcp';
}
.arc-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.18rem;font-weight:400;color:var(--gold1);
  letter-spacing:.005em;
}
.arc-range{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;color:var(--txt3);
  letter-spacing:.18em;text-transform:uppercase;
}

.arc-theme{
  font-family:var(--font-body);
  font-size:.86rem;font-style:italic;color:var(--txt3);
  margin:.2rem 0 1.2rem;font-weight:300;
  padding-left:.1rem;
}
.arc-progress{
  width:100%;height:1.5px;
  background:rgba(20,16,10,.8);border-radius:1px;
  margin-bottom:1.1rem;overflow:hidden;
  box-shadow:inset 0 0 3px rgba(0,0,0,.4);
}
.arc-progress-fill{
  height:100%;
  background:linear-gradient(90deg,var(--gold6),var(--gold4));
  transition:width 1s var(--ease);
  box-shadow:0 0 6px rgba(212,176,106,.2);
}

/* ── Chapter grid: células manuscritas ── */
.ch-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(48px,1fr));
  gap:.4rem;
  padding:.2rem 0;
}

.ch-cell{
  display:flex;align-items:center;justify-content:center;
  height:42px;
  border:1px solid rgba(212,176,106,.12);
  background:linear-gradient(180deg,rgba(20,16,10,.6),rgba(8,6,4,.4));
  border-radius:3px;
  cursor:pointer;text-decoration:none;
  position:relative;
  transition:transform .3s var(--ease),
             border-color .25s var(--ease),
             background .25s var(--ease),
             box-shadow .35s var(--ease);
}

/* Estado disponível: célula clicável */
.ch-cell.available{
  border-color:rgba(212,176,106,.22);
  background:linear-gradient(180deg,rgba(28,22,14,.85),rgba(14,10,6,.6));
  box-shadow:inset 0 1px 0 rgba(212,176,106,.06),
             0 1px 2px rgba(0,0,0,.3);
}
.ch-cell.available:hover{
  transform:translateY(-2px);
  border-color:var(--gold3);
  background:linear-gradient(180deg,rgba(38,30,18,.95),rgba(20,16,10,.8));
  box-shadow:inset 0 1px 0 rgba(212,176,106,.15),
             0 6px 16px rgba(0,0,0,.4),
             0 0 20px rgba(212,176,106,.18);
}
.ch-cell.available:hover,
.ch-cell.available:focus-visible{
  z-index:3;
}
.ch-cell.available:focus-visible{
  outline:1px solid rgba(228,200,128,.72);
  outline-offset:3px;
}

.chapter-tooltip{
  position:fixed;
  z-index:2000;
  top:0;left:0;
  padding:.68rem .82rem;
  border:1px solid rgba(212,176,106,.28);
  border-radius:4px;
  background:linear-gradient(180deg,rgba(24,19,12,.96),rgba(10,8,5,.95));
  color:rgba(246,238,220,.94);
  box-shadow:0 18px 34px rgba(0,0,0,.38),
             inset 0 1px 0 rgba(212,176,106,.1);
  font-family:'Crimson Pro',Georgia,serif;
  font-size:.96rem;
  font-weight:400;
  line-height:1.22;
  letter-spacing:0;
  text-align:center;
  white-space:normal;
  overflow-wrap:break-word;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transform:translateY(.25rem);
  transition:opacity .18s var(--ease),
             transform .18s var(--ease),
             visibility 0s linear .18s;
}
.chapter-tooltip.visible{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  transition-delay:0s;
}

/* Estado completo: brilho dourado interno */
.ch-cell.done{
  border-color:var(--gold4);
  background:linear-gradient(180deg,rgba(120,90,40,.25),rgba(60,46,20,.18));
  box-shadow:inset 0 0 14px rgba(212,176,106,.18),
             inset 0 1px 0 rgba(212,176,106,.25);
}
.ch-cell.done::after{
  content:'';
  position:absolute;top:3px;right:3px;
  width:5px;height:5px;border-radius:50%;
  background:var(--gold2);
  box-shadow:0 0 6px rgba(228,200,128,.8);
}

.ch-cell-n{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.05rem;
  font-weight:400;
  color:var(--gold3);
  font-feature-settings:'lnum','tnum';
  transition:color .25s,text-shadow .25s;
}
.ch-cell:hover .ch-cell-n{
  color:var(--gold1);
  text-shadow:0 0 8px rgba(228,200,128,.4);
}
.ch-cell.done .ch-cell-n{color:var(--gold1)}

.ch-cell:not(.available):not(.done){
  opacity:.18;cursor:default;pointer-events:none;
}


/* ═══════════════════════════════════════
   FABs — Home & Settings (SVG icons)
   ═══════════════════════════════════════ */

.fab.fab-home,.fab.fab-settings{
  display:inline-flex;align-items:center;justify-content:center;
  text-decoration:none;
}
.fab.fab-home svg,.fab.fab-settings svg{
  width:20px;height:20px;color:var(--gold3);
  transition:transform .35s var(--ease),color .25s;
}
.fab.fab-home:hover svg{
  color:var(--gold1);transform:translateY(-1px);
}
.fab.fab-settings:hover svg{
  color:var(--gold1);transform:rotate(45deg);
}
.fab.fab-settings.active{
  border-color:var(--gold3);background:var(--bg4);
  box-shadow:0 0 24px rgba(212,176,106,.2);
}
.fab.fab-settings.active svg{transform:rotate(90deg);color:var(--gold1)}


/* ═══════════════════════════════════════
   SETTINGS PANEL — Font size & family
   ═══════════════════════════════════════ */

.settings-panel{
  position:fixed;top:0;right:0;width:340px;max-width:92vw;height:100vh;
  background:var(--bg2);border-left:1px solid rgba(212,176,106,.1);
  z-index:950;transition:transform .4s var(--ease);overflow-y:auto;padding:2.5rem 2rem;
  transform:translateX(100%);
  box-shadow:-10px 0 50px rgba(0,0,0,.4);
}
.settings-panel.open{transform:translateX(0)}

.settings-panel h3{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.4rem;font-weight:400;color:var(--gold1);margin-bottom:2rem;
}
.settings-panel .sp-close{
  position:absolute;top:1.3rem;right:1.3rem;background:none;border:none;
  color:var(--txt3);cursor:pointer;font-size:1.3rem;transition:color .2s;
}
.settings-panel .sp-close:hover{color:var(--txt)}

.settings-panel .sp-section{margin-bottom:2rem}
.settings-panel .sp-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;letter-spacing:.15em;text-transform:uppercase;
  color:var(--gold5);margin-bottom:.8rem;
}

/* Font size button group */
.font-size-group{
  display:flex;gap:.5rem;
}
.font-size-btn{
  flex:1;padding:.6rem .4rem;text-align:center;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;letter-spacing:.06em;
  color:var(--txt3);background:var(--bg3);
  border:1px solid rgba(212,176,106,.08);border-radius:var(--r);
  cursor:pointer;transition:all .25s var(--ease);
}
.font-size-btn:hover{
  color:var(--gold3);border-color:rgba(212,176,106,.2);background:var(--bg4);
}
.font-size-btn.active{
  color:var(--bg);background:var(--gold4);border-color:var(--gold4);
  box-shadow:0 0 14px rgba(212,176,106,.2);
}

/* Font family button group */
.font-family-group{
  display:flex;flex-direction:column;gap:.5rem;
}
.font-family-btn{
  padding:.7rem 1rem;text-align:left;
  font-size:.92rem;color:var(--txt3);background:var(--bg3);
  border:1px solid rgba(212,176,106,.08);border-radius:var(--r);
  cursor:pointer;transition:all .25s var(--ease);
}
.font-family-btn:hover{
  color:var(--gold3);border-color:rgba(212,176,106,.2);background:var(--bg4);
}
.font-family-btn.active{
  color:var(--gold2);border-color:var(--gold5);background:var(--bg4);
  box-shadow:inset 0 0 14px rgba(212,176,106,.04);
}
.font-family-btn .ffb-name{display:block;margin-bottom:.15rem}
.font-family-btn .ffb-preview{
  font-size:.78rem;color:var(--txt3);font-weight:300;
}
.font-family-btn.active .ffb-preview{color:var(--gold5)}

/* Font family preview typefaces */
.font-family-btn[data-ff="crimson-pro"]{font-family:var(--font-body)}
.font-family-btn[data-ff="georgia"]{font-family:Georgia,'Times New Roman',serif}
.font-family-btn[data-ff="system"]{font-family:system-ui,-apple-system,serif}

.settings-panel .sp-saved{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;color:var(--gold5);letter-spacing:.1em;
  text-transform:uppercase;opacity:0;transition:opacity .3s;
  margin-top:1rem;
}
.settings-panel .sp-saved.visible{opacity:1}


/* ═══════════════════════════════════════
   TEXT SELECTION TOOLBAR
   ═══════════════════════════════════════ */

.sel-toolbar{
  position:absolute;z-index:850;
  display:flex;align-items:center;gap:3px;
  background:rgba(13,12,9,.86);border:1px solid rgba(212,176,106,.22);
  border-radius:12px;padding:5px;
  backdrop-filter:blur(16px);
  box-shadow:0 14px 42px rgba(0,0,0,.48),0 0 0 1px rgba(255,255,255,.025) inset;
  opacity:0;transform:translateY(6px);
  transition:opacity .2s var(--ease),transform .2s var(--ease);
  pointer-events:none;
}
.sel-toolbar.visible{
  opacity:1;transform:translateY(0);pointer-events:auto;
}
.sel-toolbar::after{
  content:'';position:absolute;bottom:-7px;left:50%;transform:translateX(-50%);
  border-left:7px solid transparent;border-right:7px solid transparent;
  border-top:7px solid rgba(13,12,9,.86);
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.3));
}

.sel-btn{
  width:36px;height:36px;border-radius:9px;
  background:transparent;border:none;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:rgba(232,220,198,.82);
  transition:background .2s var(--ease),color .2s var(--ease),transform .2s var(--ease);
}
.sel-btn:hover{
  background:rgba(212,176,106,.11);color:var(--gold2);
}
.sel-btn:active{transform:scale(.92)}
.sel-btn[hidden]{display:none}

.sel-btn-remove{
  color:rgba(232,188,168,.78);
}

.sel-btn-remove:hover{
  background:rgba(180,95,72,.13);
  color:#e8c1ad;
}

.sel-btn .sel-icon{
  width:18px;height:18px;pointer-events:none;
  stroke-width:1.75;
}

/* ═══════════════════════════════════════
   HIGHLIGHT COLORS
   ═══════════════════════════════════════ */

/* Highlight marks in text */
mark.hl{
  display:inline;padding:2px 0;border-radius:2px;
  background:transparent;color:inherit;
}
mark.hl-gold{background:rgba(212,176,106,.25)}
mark.hl-rose{background:rgba(200,120,120,.22)}
mark.hl-sage{background:rgba(120,160,200,.22)}
mark.hl-moss{background:rgba(130,180,130,.22)}


/* ═══════════════════════════════════════
   AI INSIGHTS PANEL
   ═══════════════════════════════════════ */

.info-panel-scrim{
  position:fixed;
  inset:0;
  background:rgba(8,6,4,.56);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .24s var(--ease);
  z-index:1000;
}

.info-panel-scrim.visible{
  opacity:1;
  pointer-events:auto;
}

.insight-panel{
  position:fixed;
  top:50%;
  left:50%;
  width:min(760px,calc(100vw - 2rem));
  max-height:min(82vh,900px);
  background:var(--bg2);
  border:1px solid rgba(212,176,106,.14);
  border-radius:24px;
  z-index:1010;
  transform:translate(-50%,-46%) scale(.96);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:transform .28s var(--ease),opacity .24s var(--ease),visibility 0s linear .28s;
  overflow:hidden;
  box-shadow:0 28px 80px rgba(0,0,0,.55);
  display:flex;
  flex-direction:column;
}
.insight-panel.open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translate(-50%,-50%) scale(1);
  transition:transform .28s var(--ease),opacity .24s var(--ease);
}

.insight-panel .ip-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:1.8rem 2rem 1.4rem;
  border-bottom:1px solid rgba(212,176,106,.08);
  flex-shrink:0;
}
.insight-panel .ip-header h3{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.35rem;font-weight:400;color:var(--gold1);
  margin:0;
}
.insight-panel .ip-close{
  background:none;border:none;color:var(--txt3);
  cursor:pointer;font-size:.76rem;transition:color .2s;
  padding:4px;
  font-family:'JetBrains Mono',Consolas,monospace;
  letter-spacing:.08em;text-transform:uppercase;
}
.insight-panel .ip-close:hover{color:var(--txt)}

.insight-panel .ip-verse{
  font-family:var(--font-body);
  font-size:1rem;font-style:italic;color:var(--txt2);
  line-height:1.65;font-weight:300;
  padding:1.4rem 2rem;
  border-bottom:1px solid rgba(212,176,106,.06);
  background:rgba(212,176,106,.015);
  flex-shrink:0;
}
.insight-panel .ip-verse .ip-verse-ref{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--gold4);display:block;margin-bottom:.4rem;
  font-style:normal;
}

.insight-panel .ip-loading{
  padding:3rem 2rem;text-align:center;color:var(--txt3);
  font-style:italic;font-size:.95rem;
}
.insight-panel .ip-loading::after{
  content:'';display:block;width:28px;height:28px;margin:1.2rem auto 0;
  border:2px solid var(--bg4);border-top-color:var(--gold4);border-radius:50%;
  animation:ipSpin .8s linear infinite;
}
@keyframes ipSpin{to{transform:rotate(360deg)}}

.insight-panel .ip-content{
  flex:1;padding:1.8rem 2rem;overflow-y:auto;
  font-family:var(--font-body);
  font-size:1rem;line-height:1.8;color:var(--txt);font-weight:300;
}
.insight-panel .ip-content h4{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.15rem;font-weight:500;color:var(--gold2);
  margin:1.6rem 0 .6rem;
}
.insight-panel .ip-content h4:first-child{margin-top:0}
.insight-panel .ip-content p{margin-bottom:1rem}
.insight-panel .ip-content ul,.insight-panel .ip-content ol{
  margin-bottom:1rem;padding-left:1.3rem;
}
.insight-panel .ip-content li{margin-bottom:.4rem}
.insight-panel .ip-content blockquote{
  border-left:2px solid var(--gold5);padding:.5rem 0 .5rem 1rem;
  color:var(--txt2);font-style:italic;margin:1rem 0;
}
.tp-list{display:grid;gap:1rem}
.tp-card{
  padding:1rem 1.1rem;border-radius:var(--r);
  background:var(--bg3);border:1px solid rgba(212,176,106,.08);
}
.tp-card-head{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;margin-bottom:.45rem}
.tp-card-head h4{margin:0}
.tp-badge{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--gold3);border:1px solid rgba(212,176,106,.18);
  border-radius:999px;padding:.18rem .5rem;
}
.tp-meta,.tp-related{
  color:var(--txt3);font-size:.82rem;line-height:1.6;
}
.tp-note,.tp-refs{
  color:var(--txt2);font-size:.92rem;line-height:1.7;
}

.insight-panel .ip-prompt{
  padding:1rem 2rem;background:var(--bg3);
  border-top:1px solid rgba(212,176,106,.06);
  flex-shrink:0;
}
.insight-panel .ip-prompt-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--txt3);margin-bottom:.4rem;
}
.insight-panel .ip-prompt-text{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;line-height:1.6;color:var(--txt2);
  word-break:break-word;
}

.ip-copy-btn{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--gold5);background:none;border:1px solid var(--gold6);
  border-radius:6px;padding:.35rem .7rem;cursor:pointer;
  transition:all .2s var(--ease);margin-left:.5rem;
}
.ip-copy-btn:hover{color:var(--gold3);border-color:var(--gold4);background:rgba(212,176,106,.06)}
.ip-copy-btn.copied{color:var(--gold2);border-color:var(--gold3)}
.ip-copy-btn.copy-error{color:#d7b49b;border-color:rgba(215,180,155,.55)}
.ip-copy-btn:disabled{opacity:.7;cursor:wait}
.ip-copy-status{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.04em;
  color:var(--txt3);
}

.ip-actions{
  display:flex;align-items:center;gap:.6rem;
  padding:1.2rem 2rem;border-top:1px solid rgba(212,176,106,.06);
  flex-shrink:0;
}
.ip-actions .ip-action-btn{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--gold4);background:transparent;
  border:1px solid var(--gold6);border-radius:var(--r);
  padding:.55rem 1.1rem;cursor:pointer;
  transition:all .25s var(--ease);
}
.ip-actions .ip-action-btn:hover{
  background:rgba(212,176,106,.06);border-color:var(--gold4);
  transform:translateY(-1px);
}
.ip-actions .ip-action-btn.primary{
  background:var(--gold5);color:var(--bg);border-color:var(--gold5);
}
.ip-actions .ip-action-btn.primary:hover{background:var(--gold4)}

.lookup-popover{
  position:fixed;
  z-index:1020;
  width:min(340px,calc(100vw - 1.5rem));
  padding:1rem 1.05rem;
  border-radius:18px;
  border:1px solid rgba(212,176,106,.16);
  background:var(--panel-strong);
  box-shadow:0 20px 48px rgba(0,0,0,.34);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(6px);
  transition:opacity .18s var(--ease),transform .18s var(--ease),visibility 0s linear .18s;
}

.lookup-popover.open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0);
  transition:opacity .18s var(--ease),transform .18s var(--ease);
}

.lookup-popover-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.8rem;
}

.lookup-popover-title{
  flex:1;
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.15rem;
  line-height:1.05;
  color:var(--gold1);
}

.lookup-popover-close{
  display:grid;
  place-items:center;
  flex:0 0 auto;
  width:38px;
  height:38px;
  min-width:38px;
  padding:0;
  border:1px solid rgba(212,176,106,.16);
  border-radius:999px;
  background:rgba(212,176,106,.05);
  color:var(--txt2);
  cursor:pointer;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:1.35rem;
  line-height:1;
  transition:color .18s var(--ease),border-color .18s var(--ease),background .18s var(--ease),transform .18s var(--ease);
}

.lookup-popover-close:hover{
  color:var(--txt);
  border-color:rgba(212,176,106,.34);
  background:rgba(212,176,106,.09);
  transform:translateY(-1px);
}

.lookup-popover-close:focus-visible{
  outline:2px solid rgba(212,176,106,.35);
  outline-offset:3px;
  color:var(--txt);
  border-color:rgba(212,176,106,.42);
}

.lookup-popover-copy,
.lookup-popover-refs{
  margin-top:.65rem;
  color:var(--txt2);
  line-height:1.65;
  font-size:.92rem;
}

.lookup-popover-refs{
  color:var(--gold3);
  font-size:.8rem;
}

@media(max-width:640px){
  .lookup-popover-close{
    width:44px;
    height:44px;
    min-width:44px;
  }
}


/* ═══════════════════════════════════════
   FONT SIZE CLASSES (html)
   ═══════════════════════════════════════ */

html.fs-small{font-size:16px}
html.fs-medium{font-size:20px}
html.fs-large{font-size:24px}
html.fs-xlarge{font-size:28px}


/* ═══════════════════════════════════════
   FONT FAMILY CLASSES (body)
   ═══════════════════════════════════════ */

body.ff-crimson-pro{--font-body:'Crimson Pro',Georgia,serif}
body.ff-georgia{--font-body:Georgia,'Times New Roman',serif}
body.ff-system{--font-body:system-ui,-apple-system,serif}


/* ═══════════════════════════════════════
   MULTI-BOOK INDEX
   ═══════════════════════════════════════ */

/* ── Book navigation: ribbon de tabs com scroll horizontal ── */
.book-nav{
  display:flex;gap:.45rem;padding:.4rem .9rem;
  margin:0 auto 3rem;max-width:880px;
  background:linear-gradient(180deg,rgba(20,16,10,.4),rgba(8,6,4,.6));
  border:1px solid rgba(212,176,106,.08);
  border-radius:6px;
  overflow-x:auto;scroll-behavior:smooth;
  box-shadow:0 2px 30px rgba(0,0,0,.3),inset 0 1px 0 rgba(212,176,106,.06);
  scrollbar-width:thin;scrollbar-color:var(--gold6) transparent;
}
.book-nav::-webkit-scrollbar{height:4px}
.book-nav::-webkit-scrollbar-thumb{background:var(--gold6);border-radius:2px}

.book-tab{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;letter-spacing:.18em;text-transform:uppercase;
  color:var(--txt3);text-decoration:none;
  padding:.5rem .85rem;border-radius:3px;
  white-space:nowrap;flex-shrink:0;
  border:1px solid transparent;
  transition:color .3s var(--ease),border-color .3s var(--ease),background .3s var(--ease);
}
.book-tab:hover{
  color:var(--gold2);
  border-color:rgba(212,176,106,.15);
  background:rgba(212,176,106,.04);
}

/* ── Section divisors entre testaments/blocos ── */
.bible-divisor{
  display:flex;align-items:center;gap:1.5rem;
  margin:5rem 0 3.5rem;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;letter-spacing:.4em;text-transform:uppercase;
  color:var(--gold5);
}
.bible-divisor::before,.bible-divisor::after{
  content:'';flex:1;height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,176,106,.25),transparent);
}
.bible-divisor span{display:flex;align-items:center;gap:.7rem}
.bible-divisor span::before,.bible-divisor span::after{
  content:'◆';color:var(--gold6);font-size:.5rem;
}

/* ── Book section: cada livro como bloco editorial ── */
.book-section{
  margin-bottom:4.5rem;
  position:relative;
  scroll-margin-top:2rem;
}

/* ── Book header: layout horizontal com drop cap ornamental ── */
.book-header{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;gap:1.5rem;
  padding:1.4rem 0 2rem;
  margin-bottom:2.5rem;
  border-bottom:1px solid rgba(212,176,106,.08);
  position:relative;
}
.book-header::after{
  content:'';position:absolute;bottom:-1px;left:0;right:0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,176,106,.4) 20%,rgba(212,176,106,.4) 80%,transparent);
}

/* Drop cap iluminado: primeira letra do livro como manuscrito */
.book-dropcap{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-style:italic;
  font-size:clamp(3.5rem,7vw,4.8rem);
  font-weight:500;
  color:var(--gold2);
  line-height:.85;
  padding:.1rem .5rem 0 0;
  text-shadow:0 0 30px rgba(212,176,106,.18),0 2px 4px rgba(0,0,0,.4);
  border-right:1px solid rgba(212,176,106,.15);
  margin-right:.4rem;
  flex-shrink:0;
}

.book-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.6rem,3.5vw,2.4rem);
  font-weight:300;color:var(--gold1);
  letter-spacing:-.005em;
  line-height:1.05;
  text-shadow:0 0 30px rgba(212,176,106,.08);
  margin:0;
}

.book-meta{
  display:flex;flex-direction:column;align-items:flex-end;gap:.5rem;
  flex-shrink:0;
}
.book-stats{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;color:var(--txt3);letter-spacing:.18em;
  text-transform:uppercase;
  display:block;margin:0;
  text-align:right;
}
.book-bar{
  width:120px;height:1.5px;background:rgba(20,16,10,.8);
  border-radius:1px;overflow:hidden;
  box-shadow:inset 0 0 4px rgba(0,0,0,.4);
}
.book-bar-fill{
  height:100%;
  background:linear-gradient(90deg,var(--gold6),var(--gold4),var(--gold3));
  transition:width 1.2s var(--ease);
  box-shadow:0 0 8px rgba(212,176,106,.25);
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media(max-width:600px){
  html{font-size:15px}
  .container{padding:0 1.4rem}
  .map{gap:0}
  .map-conn{width:20px}
  .node-circle{width:46px;height:46px;font-size:1.1rem}
  .stats{gap:1.2rem;flex-wrap:wrap}
  .fab-group{bottom:1.2rem;right:1.2rem}
  .fab{width:46px;height:46px;font-size:1.05rem}
  .ch-grid{grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:.5rem}
  .ch-cell{min-height:54px;padding:.7rem .3rem}
  .arc-head{flex-wrap:wrap;gap:.5rem}
  .arc-range{margin-left:0}
  .sec-nav{flex-wrap:wrap;gap:.8rem;justify-content:center}
  .v-text{font-size:1rem}
  .settings-panel{width:100%;max-width:100%;transform:translateX(100%)}
  .settings-panel.open{transform:translateX(0)}
  .insight-panel{width:calc(100vw - 1rem);max-height:86vh;border-radius:20px}
  .insight-panel .ip-header{padding:1.4rem 1.4rem 1rem}
  .insight-panel .ip-verse{padding:1rem 1.4rem}
  .insight-panel .ip-content{padding:1.2rem 1.4rem}
  .insight-panel .ip-prompt{padding:.8rem 1.4rem}
  .insight-panel .ip-actions{padding:1rem 1.4rem}
  .sel-toolbar{border-radius:8px}
}

@media(min-width:1200px){
  .container{max-width:780px}
  .v-text{font-size:1.08rem;line-height:1.75}
}


/* ═══════════════════════════════════════
   V4 SURFACES — Home, Livro, Menu, Mapa
   ═══════════════════════════════════════ */

:root{
  --panel:rgba(14,12,8,.82);
  --panel-strong:rgba(16,12,8,.97);
  --panel-border:rgba(212,176,106,.14);
  --shadow-soft:0 28px 80px rgba(0,0,0,.38);
  --page-parallax:0px;
}

html[data-theme='light']{
  --bg:#efe5d4;
  --bg2:#f4ecdf;
  --bg3:#e8dcc6;
  --bg4:#daccb2;
  --bg5:#c3b291;
  --gold1:#4e3823;
  --gold2:#785731;
  --gold3:#9b7040;
  --gold4:#b7864e;
  --gold5:#926533;
  --gold6:#6b4e2b;
  --txt:#3a2a1d;
  --txt2:#5d4733;
  --txt3:#826a52;
  --txtv:#433022;
  --panel:rgba(244,236,223,.86);
  --panel-strong:rgba(247,240,230,.98);
  --panel-border:rgba(126,91,44,.16);
  --shadow-soft:0 22px 56px rgba(76,57,27,.12);
}

body{
  position:relative;
  isolation:isolate;
  background:var(--bg);
}

body.auth-open,
body.menu-open,
body.map-open,
body.notes-open,
body.journey-open{overflow:hidden}

body::before{
  content:'';
  position:fixed;
  inset:-6%;
  background-image:
    linear-gradient(180deg,rgba(8,6,4,.7),rgba(8,6,4,.28) 34%,rgba(8,6,4,.56)),
    radial-gradient(circle at 50% 24%,rgba(212,176,106,.08),transparent 42%),
    url('assets/canaan-map-bg.png');
  background-size:cover;
  background-position:center 18%;
  background-blend-mode:multiply,screen,normal;
  opacity:.16;
  filter:saturate(.76) contrast(.98) brightness(.8) blur(.4px);
  -webkit-mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.92) 0, rgba(0,0,0,.66) 18%, rgba(0,0,0,.34) 30%, rgba(0,0,0,.12) 42%, transparent 62%);
  mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.92) 0, rgba(0,0,0,.66) 18%, rgba(0,0,0,.34) 30%, rgba(0,0,0,.12) 42%, transparent 62%);
  transform:translate3d(0,var(--page-parallax),0) scale(1.08);
  transform-origin:center top;
  z-index:-2;
  pointer-events:none;
}

html[data-theme='light'] body::before{
  background-image:
    linear-gradient(180deg,rgba(239,229,212,.6),rgba(239,229,212,.18) 36%,rgba(239,229,212,.54)),
    radial-gradient(circle at 50% 24%,rgba(183,134,78,.08),transparent 40%),
    url('assets/canaan-map-bg.png');
  background-blend-mode:multiply,multiply,normal;
  opacity:.13;
  filter:sepia(.16) saturate(.8) contrast(.98) brightness(1.01) blur(.4px);
  -webkit-mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.88) 0, rgba(0,0,0,.58) 18%, rgba(0,0,0,.28) 32%, rgba(0,0,0,.1) 44%, transparent 64%);
  mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.88) 0, rgba(0,0,0,.58) 18%, rgba(0,0,0,.28) 32%, rgba(0,0,0,.1) 44%, transparent 64%);
}

body::after{
  content:'';
  position:fixed;
  inset:0;
  background:
    radial-gradient(circle at 50% 22%,rgba(212,176,106,.07),transparent 34%),
    linear-gradient(180deg,rgba(8,6,4,.2),rgba(8,6,4,.06) 24%,rgba(8,6,4,.34));
  z-index:-1;
  pointer-events:none;
}

html[data-theme='light'] body::after{
  background:
    radial-gradient(circle at 50% 22%,rgba(183,134,78,.06),transparent 32%),
    linear-gradient(180deg,rgba(244,236,223,.06),rgba(244,236,223,.22));
}

.atmosphere-canvas{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:-1;
  pointer-events:none;
  opacity:.85;
  mix-blend-mode:screen;
}

html[data-theme='light'] .atmosphere-canvas{
  opacity:.4;
  mix-blend-mode:multiply;
}

.app-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.app-topbar{
  position:fixed;
  top:calc(30px + env(safe-area-inset-top));
  left:calc(30px + env(safe-area-inset-left));
  right:calc(30px + env(safe-area-inset-right));
  width:auto;
  min-height:52px;
  z-index:982;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  backdrop-filter:none;
  box-shadow:none;
  pointer-events:none;
}

.app-topbar-left,
.app-topbar-actions{
  display:flex;
  align-items:center;
  gap:.75rem;
  min-width:0;
  pointer-events:auto;
}

.app-topbar-actions{
  justify-content:flex-end;
}

.app-brand{
  color:var(--gold2);
  text-decoration:none;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hamburger-shell{
  position:relative;
  width:52px;
  height:52px;
  border-radius:50%;
  border:1px solid var(--panel-border);
  background:var(--panel);
  backdrop-filter:blur(18px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  cursor:pointer;
  z-index:980;
  box-shadow:var(--shadow-soft);
  transition:opacity .24s var(--ease),transform .24s var(--ease),background .24s var(--ease),border-color .24s var(--ease);
  flex:0 0 auto;
}

.hamburger-shell span{
  width:18px;
  height:1.5px;
  border-radius:999px;
  background:var(--gold2);
  pointer-events:none;
  transition:transform .3s var(--ease),opacity .3s var(--ease);
}

.app-auth-control{
  min-height:44px;
  max-width:min(34vw,230px);
  padding:.68rem .9rem;
  border-radius:999px;
  border:1px solid var(--panel-border);
  background:rgba(212,176,106,.07);
  color:var(--gold1);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.app-auth-user{
  text-transform:none;
  letter-spacing:0;
  color:var(--txt);
}

.primary-nav{
  position:fixed;
  top:calc(6.35rem + env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  width:max-content;
  max-width:calc(100vw - 10rem);
  z-index:970;
  display:flex;
  align-items:center;
  gap:.45rem;
  padding:.46rem .7rem;
  border:1px solid rgba(212,176,106,.12);
  border-radius:999px;
  background:rgba(8,6,4,.54);
  backdrop-filter:blur(16px);
  overflow-x:auto;
  scrollbar-width:none;
}

.primary-nav::-webkit-scrollbar{display:none}

.primary-nav-item,
.mobile-nav-item{
  min-height:42px;
  border:1px solid transparent;
  background:transparent;
  color:var(--txt2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  white-space:nowrap;
}

.primary-nav-item{
  border-radius:999px;
  padding:0 .9rem;
}

.primary-nav-item:hover,
.primary-nav-item.active,
.mobile-nav-item:hover,
.mobile-nav-item.active{
  border-color:rgba(212,176,106,.24);
  background:rgba(212,176,106,.08);
  color:var(--gold1);
}

.mobile-bottom-nav{
  display:none;
}

body.page-home .home-main{
  padding-top:5.75rem;
}

body:not(.page-home):not(.page-book) .chapter-hero{
  padding-top:8.75rem;
}

.home-menu-panel{
  position:fixed;
  top:0;
  left:0;
  width:min(92vw,390px);
  height:100vh;
  padding:2rem 2rem 1rem;
  background:var(--panel-strong);
  border-right:1px solid var(--panel-border);
  backdrop-filter:blur(12px);
  z-index:996;
  transform:translateX(-100%);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:transform .36s var(--ease),opacity .24s var(--ease),visibility 0s linear .36s;
  overflow-y:auto;
  box-shadow:24px 0 60px rgba(0,0,0,.28);
}

.home-menu-panel.open{
  transform:translateX(0);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:transform .36s var(--ease),opacity .24s var(--ease);
}

.menu-scrim{
  position:fixed;
  inset:0;
  background:rgba(8,6,4,.45);
  backdrop-filter:blur(4px);
  z-index:985;
  opacity:0;
  pointer-events:none;
  transition:opacity .24s ease;
}

.menu-scrim.visible{
  opacity:1;
  pointer-events:auto;
}

.menu-kicker,
.stage-kicker,
.book-kicker{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--gold4);
}

.menu-title,
.stage-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.9rem,3vw,2.6rem);
  font-weight:400;
  color:var(--gold1);
  line-height:1;
  margin-top:.35rem;
}

.menu-copy{
  font-size:.95rem;
  color:var(--txt2);
  margin-top:.9rem;
  line-height:1.7;
}

.home-menu-search{
  position:relative;
  display:grid;
  gap:.76rem;
  margin:1.25rem 0 1.28rem;
  padding:1rem;
  border:1px solid rgba(212,176,106,.16);
  border-radius:16px;
  background:
    linear-gradient(145deg,rgba(212,176,106,.085),rgba(212,176,106,.022) 54%,rgba(0,0,0,.08)),
    rgba(12,10,7,.24);
  box-shadow:inset 0 1px 0 rgba(248,237,214,.035);
}

.home-menu-search-head{
  display:grid;
  gap:.18rem;
}

.home-menu-search-kicker{
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:0;
  text-transform:uppercase;
}

.home-menu-search-head label{
  color:var(--gold1);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.46rem;
  font-weight:500;
  line-height:1.05;
}

.home-menu-search-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  align-items:center;
  min-height:54px;
  border:1px solid rgba(212,176,106,.2);
  border-radius:14px;
  background:rgba(7,6,4,.34);
  overflow:hidden;
  transition:border-color .22s var(--ease),box-shadow .22s var(--ease),background .22s var(--ease);
}

.home-menu-search-icon{
  display:none;
}

.home-menu-search-box input{
  min-width:0;
  width:100%;
  min-height:54px;
  padding:0 .86rem;
  border:0;
  background:transparent;
  color:var(--txt);
  font:400 .95rem/1.2 'Crimson Pro',Georgia,serif;
  outline:none;
}

.home-menu-search-box input::placeholder{
  color:rgba(196,184,164,.5);
}

.home-menu-search-box input::-webkit-search-cancel-button,
.home-menu-search-box input::-webkit-search-decoration{
  -webkit-appearance:none;
  appearance:none;
  display:none;
}

.home-menu-search-box:focus-within{
  border-color:rgba(212,176,106,.46);
  background:rgba(10,8,5,.42);
  box-shadow:0 0 0 3px rgba(212,176,106,.095),0 16px 34px rgba(0,0,0,.14);
}

.home-menu-search-box button{
  position:relative;
  align-self:stretch;
  min-width:48px;
  padding:0;
  border:0;
  border-left:1px solid rgba(212,176,106,.18);
  background:linear-gradient(180deg,rgba(212,176,106,.16),rgba(212,176,106,.07));
  color:var(--gold1);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:0;
  letter-spacing:0;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .2s var(--ease),color .2s var(--ease);
}

.home-menu-search-box button::before,
.home-menu-search-box button::after{
  content:'';
  position:absolute;
  display:block;
  color:currentColor;
}

.home-menu-search-box button::before{
  width:.72rem;
  height:.72rem;
  left:50%;
  top:50%;
  border:1px solid currentColor;
  border-radius:999px;
  transform:translate(-58%,-58%);
}

.home-menu-search-box button::after{
  width:.45rem;
  height:1px;
  left:50%;
  top:50%;
  background:currentColor;
  transform:translate(.08rem,.22rem) rotate(45deg);
  transform-origin:left center;
}

.home-menu-search-box button:hover,
.home-menu-search-box button:focus-visible{
  background:linear-gradient(180deg,rgba(212,176,106,.24),rgba(212,176,106,.1));
  color:var(--gold2);
  outline:none;
}

.home-menu-search-status{
  min-height:1.05rem;
  margin:0;
  color:var(--txt3);
  font-size:.76rem;
  line-height:1.35;
}

.home-menu-search-results{
  display:grid;
  gap:.58rem;
  max-height:250px;
  overflow-y:auto;
  padding-right:.2rem;
  scrollbar-width:thin;
}

.home-menu-search-result{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.35rem .65rem;
  padding:.74rem .78rem .78rem;
  border:1px solid rgba(212,176,106,.12);
  border-left-color:rgba(212,176,106,.32);
  border-radius:12px;
  background:linear-gradient(90deg,rgba(212,176,106,.075),rgba(212,176,106,.018) 72%);
}

.home-menu-search-result-link{
  color:var(--gold1);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.64rem;
  letter-spacing:0;
  text-transform:uppercase;
  text-decoration:none;
}

.home-menu-search-result-link:hover,
.home-menu-search-result-link:focus-visible{
  color:var(--gold2);
  outline:none;
}

.home-menu-search-badge{
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.56rem;
  letter-spacing:0;
  text-transform:uppercase;
}

.home-menu-search-excerpt,
.home-menu-search-empty{
  grid-column:1/-1;
  margin:0;
  color:var(--txt2);
  font-size:.9rem;
  line-height:1.42;
}

.settings-root-shell[hidden]{
  display:none!important;
}

.settings-menu-root{
  display:grid;
  gap:.72rem;
  margin:1.45rem 0 0;
}

.settings-menu-root[hidden]{
  display:none!important;
}

.settings-menu-item{
  position:relative;
  box-sizing:border-box;
  min-height:78px;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:.42rem .9rem;
  width:100%;
  padding:.78rem 1rem;
  border:1px solid rgba(212,176,106,.14);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(212,176,106,.06),rgba(212,176,106,.024));
  color:var(--txt);
  text-align:left;
  cursor:pointer;
  transition:border-color .22s var(--ease),background .22s var(--ease),color .22s var(--ease);
}

.settings-menu-item::after{
  content:'';
  width:.5rem;
  height:.5rem;
  border-top:1px solid currentColor;
  border-right:1px solid currentColor;
  opacity:.45;
  transform:rotate(45deg);
  transition:opacity .22s var(--ease),transform .22s var(--ease);
}

.settings-menu-item span{
  min-width:0;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.7rem;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.settings-menu-item small{
  grid-column:1;
  color:var(--txt3);
  font-size:.84rem;
  line-height:1.25;
}

.settings-menu-item:hover,
.settings-menu-item:focus-visible{
  border-color:rgba(212,176,106,.32);
  background:linear-gradient(180deg,rgba(212,176,106,.09),rgba(212,176,106,.04));
  color:var(--gold1);
  outline:none;
}

.settings-menu-item:hover::after,
.settings-menu-item:focus-visible::after{
  opacity:.8;
  transform:translateX(.12rem) rotate(45deg);
}

.settings-submenu-panel{
  display:grid;
  gap:.68rem;
  margin-top:1.05rem;
}

.settings-submenu-panel[hidden]{
  display:none!important;
}

.settings-submenu-panel[data-settings-panel="about"]{
  gap:0;
  padding-top:.25rem;
}

.settings-back{
  width:max-content;
  min-height:36px;
  padding:.3rem 0;
  border:0;
  background:transparent;
  color:var(--gold3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  cursor:pointer;
}

.settings-back:hover,
.settings-back:focus-visible{
  color:var(--gold1);
  outline:none;
}

.settings-submenu-title{
  margin:.2rem 0 .45rem;
  color:var(--gold1);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.45rem,2.3vw,1.95rem);
  font-weight:400;
  line-height:1;
}

.settings-submenu-panel[data-settings-panel="about"] .settings-back{
  margin-bottom:1.45rem;
}

.settings-submenu-panel[data-settings-panel="about"] .settings-submenu-title{
  margin:0 0 2.2rem;
}

.menu-section{margin-top:1.4rem}

.reader-auth{
  display:grid;
  gap:.55rem;
  margin:0 0 1rem;
}

.reader-auth-status{
  min-height:34px;
  padding:.55rem .75rem;
  border-radius:8px;
  border:1px solid rgba(212,176,106,.12);
  color:var(--txt2);
  font-size:.78rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.account-session-shell{
  position:relative;
  display:grid;
  gap:.32rem;
  margin:.82rem 0 .95rem;
  padding:.15rem 0 .2rem .72rem;
  border-left:1px solid rgba(212,176,106,.22);
  background:transparent;
}

.account-session-shell::before{
  content:'';
  position:absolute;
  left:-3px;
  top:.35rem;
  width:5px;
  height:5px;
  border-radius:999px;
  background:var(--gold2);
  opacity:.78;
  box-shadow:0 0 12px rgba(212,176,106,.38);
}

.account-session-shell.is-authenticated{
  border-left-color:rgba(167,204,168,.42);
  background:transparent;
}

.account-session-shell.is-authenticated::before{
  background:#a7cca8;
  box-shadow:0 0 18px rgba(167,204,168,.45);
}

.account-session-header{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:.45rem;
  min-width:0;
}

.account-status-pill{
  min-width:0;
  max-width:100%;
  display:inline-flex;
  align-items:center;
  min-height:auto;
  padding:0;
  border:0;
  border-radius:0;
  color:var(--gold3);
  background:transparent;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.56rem;
  line-height:1.2;
  letter-spacing:.15em;
  text-transform:uppercase;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.account-status-pill.is-authenticated{
  border-color:transparent;
  background:transparent;
  color:#d9f0d8;
}

.account-session-meta{
  flex:0 0 auto;
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  line-height:1.2;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.account-anonymous-notice{
  margin:0;
  max-width:24rem;
  color:var(--txt3);
  font-size:.74rem;
  line-height:1.34;
}

.account-storage-ledger{
  display:grid;
  border-top:1px solid rgba(212,176,106,.13);
  border-bottom:1px solid rgba(212,176,106,.13);
}

.account-storage-row{
  display:grid;
  gap:.22rem;
  padding:.5rem 0;
  border-top:1px solid rgba(212,176,106,.1);
}

.account-storage-row:first-child{
  border-top:0;
}

.account-storage-row span{
  color:var(--gold3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  line-height:1.25;
  letter-spacing:.13em;
  text-transform:uppercase;
}

.account-storage-row strong{
  color:var(--txt3);
  font-family:'Crimson Pro',Georgia,serif;
  font-size:.84rem;
  font-weight:400;
  line-height:1.28;
}

.account-action-stack{
  display:grid;
  gap:.5rem;
  margin:.1rem 0 0;
}

.account-auth-actions{
  margin-top:.25rem;
  margin-bottom:.15rem;
}

.account-action-stack .menu-link{
  border-radius:12px;
  justify-content:center;
  text-align:center;
  letter-spacing:.06em;
  min-height:52px;
}

.account-primary-action{
  border-color:rgba(212,176,106,.34);
  background:
    linear-gradient(180deg,rgba(212,176,106,.15),rgba(212,176,106,.055));
  color:var(--gold1);
}

.account-primary-action:hover,
.account-primary-action:focus-visible{
  border-color:rgba(228,200,128,.48);
  background:linear-gradient(180deg,rgba(212,176,106,.2),rgba(212,176,106,.08));
}

.account-local-actions{
  display:grid;
  gap:.55rem;
  margin-top:1rem;
  padding-top:.95rem;
  border-top:1px solid rgba(212,176,106,.14);
}

.account-clear-action{
  min-height:56px;
  border-color:rgba(230,160,160,.34);
  background:
    linear-gradient(180deg,rgba(230,160,160,.13),rgba(230,160,160,.045));
  color:#f0b2b2;
}

.account-clear-action:hover,
.account-clear-action:focus-visible{
  border-color:rgba(255,190,190,.5);
  background:
    linear-gradient(180deg,rgba(230,160,160,.18),rgba(230,160,160,.07));
  color:#ffd4d4;
}

.account-data-note{
  margin:0;
  color:var(--txt3);
  font-size:.74rem;
  line-height:1.34;
}

.home-menu-links,
.reader-menu-links,
.book-menu-links{
  display:grid;
  gap:.6rem;
  margin-top:1.5rem;
}

.menu-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  min-height:46px;
  padding:.85rem 1rem;
  border-radius:16px;
  border:1px solid var(--panel-border);
  background:rgba(212,176,106,.04);
  color:var(--txt);
  text-decoration:none;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}

.menu-link:hover,
.menu-link.active{
  border-color:rgba(212,176,106,.3);
  background:rgba(212,176,106,.08);
  color:var(--gold2);
}

.menu-link-danger{
  color:var(--destructive,#e6a0a0);
}

.menu-link-danger:hover,
.menu-link-danger:focus-visible{
  border-color:rgba(230,160,160,.34);
  background:rgba(230,160,160,.08);
  color:#ffd4d4;
  outline:none;
}

.account-local-actions .menu-link.account-clear-action{
  min-height:56px;
  border-color:rgba(230,160,160,.36);
  background:
    linear-gradient(180deg,rgba(230,160,160,.14),rgba(230,160,160,.055));
  color:#f2b4b4;
  box-shadow:0 12px 32px rgba(80,28,28,.12);
}

.account-local-actions .menu-link.account-clear-action:hover,
.account-local-actions .menu-link.account-clear-action:focus-visible{
  border-color:rgba(255,190,190,.54);
  background:
    linear-gradient(180deg,rgba(230,160,160,.19),rgba(230,160,160,.075));
  color:#ffd6d6;
  box-shadow:0 14px 34px rgba(100,32,32,.18);
}

.about-project{
  display:grid;
  gap:0;
  max-width:18.8rem;
}

.about-project::before{
  content:'';
  width:3rem;
  height:1px;
  margin-bottom:1.45rem;
  background:rgba(212,176,106,.34);
}

.about-project-kicker{
  margin:0 0 .85rem;
  color:var(--gold4);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.18em;
  text-transform:uppercase;
}

.about-project-title{
  margin:0 0 .95rem;
  color:var(--gold1);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.78rem,2.6vw,2.2rem);
  font-weight:400;
  line-height:1.04;
}

.about-project-copy{
  margin:0;
  max-width:17rem;
  color:var(--txt2);
  font-size:.98rem;
  line-height:1.68;
}

.about-contact{
  justify-content:flex-start;
  width:max-content;
  max-width:100%;
  gap:1rem;
  min-height:0;
  margin-top:2.2rem;
  padding:0 0 .45rem;
  border:0;
  border-bottom:1px solid rgba(212,176,106,.28);
  border-radius:0;
  background:transparent;
  color:var(--txt3);
}

.about-contact span{
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.56rem;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.about-contact strong{
  color:var(--gold3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.6rem;
  font-weight:400;
  letter-spacing:.14em;
  text-transform:uppercase;
  overflow-wrap:anywhere;
}

.about-contact::after{
  content:'';
  flex:0 0 auto;
  width:.42rem;
  height:.42rem;
  border-top:1px solid currentColor;
  border-right:1px solid currentColor;
  opacity:.5;
  transform:rotate(45deg);
}

.about-contact:hover,
.about-contact:focus-visible{
  border-color:rgba(212,176,106,.48);
  background:transparent;
  color:var(--gold2);
  outline:none;
}

.menu-link.is-disabled,
.menu-link:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.auth-popover-scrim{
  position:fixed;
  inset:0;
  z-index:984;
  background:rgba(8,6,4,.24);
  opacity:0;
  pointer-events:none;
  transition:opacity .24s var(--ease);
}

.auth-popover-scrim.visible{
  opacity:1;
  pointer-events:auto;
}

.auth-popover{
  position:fixed;
  top:calc(92px + env(safe-area-inset-top));
  right:calc(30px + env(safe-area-inset-right));
  z-index:997;
  width:min(430px,calc(100vw - 60px));
  max-height:calc(100svh - 6rem);
  overflow-y:auto;
  padding:1rem;
  border:1px solid rgba(212,176,106,.22);
  border-radius:20px;
  background:
    linear-gradient(145deg,var(--panel-strong),var(--bg2)),
    radial-gradient(circle at 85% 0%,rgba(212,176,106,.12),transparent 45%);
  color:var(--txt);
  box-shadow:0 26px 80px rgba(0,0,0,.54),inset 0 1px 0 rgba(248,237,214,.06);
  backdrop-filter:blur(22px);
  opacity:0;
  transform:translateY(-10px) scale(.98);
  pointer-events:none;
  visibility:hidden;
  transition:opacity .24s var(--ease),transform .24s var(--ease),visibility 0s linear .24s;
}

.auth-popover.open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
  visibility:visible;
  transition:opacity .24s var(--ease),transform .24s var(--ease);
}

.auth-popover-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:.25rem .25rem .8rem;
}

.auth-kicker{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--gold4);
}

.auth-popover h2{
  margin-top:.25rem;
  color:var(--gold1);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.75rem;
  font-weight:400;
  line-height:1;
}

.auth-close{
  width:38px;
  height:38px;
  border:1px solid rgba(212,176,106,.16);
  border-radius:999px;
  background:rgba(212,176,106,.05);
  color:var(--txt2);
  cursor:pointer;
  font-size:1.35rem;
  line-height:1;
}

.auth-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.35rem;
  padding:.28rem;
  border:1px solid rgba(212,176,106,.12);
  border-radius:999px;
  background:rgba(8,6,4,.45);
}

.auth-tab{
  min-height:38px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}

.auth-tab.active{
  background:rgba(212,176,106,.12);
  color:var(--gold1);
}

.auth-form{
  display:none;
  gap:.75rem;
  margin-top:1rem;
}

.auth-form.active{
  display:grid;
}

.auth-form label{
  display:grid;
  gap:.35rem;
  color:var(--txt2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.auth-form input{
  min-height:46px;
  width:100%;
  border:1px solid rgba(212,176,106,.18);
  border-radius:12px;
  background:rgba(8,6,4,.18);
  color:var(--gold1);
  padding:0 .85rem;
  font:400 .95rem/1.2 var(--font-body);
  letter-spacing:0;
  outline:none;
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease),background .2s var(--ease);
}

.auth-form input:focus{
  border-color:rgba(228,200,128,.58);
  background:rgba(8,6,4,.24);
  box-shadow:0 0 0 3px rgba(212,176,106,.1);
}

.auth-helper{
  margin:0;
  color:var(--txt2);
  font-size:.9rem;
  line-height:1.45;
}

.auth-password-criteria{
  display:grid;
  gap:.35rem;
  margin:-.15rem 0 .15rem;
  padding:0;
  list-style:none;
}

.auth-password-rule{
  display:flex;
  align-items:center;
  gap:.45rem;
  color:var(--destructive,#b85b5b);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  transition:color .18s var(--ease);
}

.auth-password-rule.is-met{
  color:#4f8f45;
}

.auth-rule-check{
  display:inline-grid;
  place-items:center;
  width:1.05rem;
  height:1.05rem;
  border:1px solid currentColor;
  border-radius:999px;
  font-size:.72rem;
  line-height:1;
}

.auth-password-rule.is-met .auth-rule-check{
  background:rgba(79,143,69,.14);
}

.auth-code-timer{
  margin:0;
  color:#5f9349;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.62rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.auth-code-timer.is-expired{
  color:var(--destructive,#b85b5b);
}

.auth-submit,
.auth-google,
.auth-secondary,
.auth-link-button{
  min-height:48px;
  border-radius:999px;
  cursor:pointer;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.auth-submit{
  margin-top:.1rem;
  border:1px solid rgba(212,176,106,.34);
  background:rgba(212,176,106,.15);
  color:var(--gold1);
}

.auth-submit:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.auth-secondary{
  border:1px solid rgba(212,176,106,.22);
  background:rgba(8,6,4,.18);
  color:var(--txt2);
}

.auth-link-button{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  justify-self:center;
  width:max-content;
  max-width:100%;
  min-height:34px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--gold3);
  padding:.35rem .75rem;
  text-decoration:none;
}

.auth-link-button:hover,
.auth-link-button:focus-visible{
  background:rgba(212,176,106,.07)!important;
  border-color:rgba(212,176,106,.18);
  color:var(--gold1);
  outline:none;
}

.auth-google{
  width:100%;
  border:1px solid rgba(248,237,214,.18);
  background:rgba(248,237,214,.92);
  color:#3a2a16;
}

.auth-divider{
  display:flex;
  align-items:center;
  gap:.75rem;
  margin:1rem 0;
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.auth-divider::before,
.auth-divider::after{
  content:'';
  height:1px;
  flex:1;
  background:rgba(212,176,106,.12);
}

.auth-feedback{
  min-height:1.4rem;
  margin-top:.8rem;
  color:var(--txt3);
  font-size:.9rem;
  line-height:1.4;
}

.auth-feedback[data-tone='success']{color:#5f9349}
.auth-feedback[data-tone='error']{color:var(--destructive,#b85b5b)}

html[data-theme='dark'] .auth-popover-scrim{
  background:rgba(5,4,3,.36);
}

html[data-theme='dark'] .auth-popover{
  border-color:rgba(214,181,108,.18);
  background:
    radial-gradient(circle at 88% -8%,rgba(212,176,106,.13),transparent 16rem),
    linear-gradient(165deg,rgba(18,14,10,.96),rgba(8,7,5,.94) 58%,rgba(5,4,3,.97));
  color:#efe8dc;
  box-shadow:
    0 28px 70px rgba(0,0,0,.58),
    inset 0 1px 0 rgba(248,237,214,.075);
  scrollbar-width:none;
  overscroll-behavior:contain;
}

html[data-theme='dark'] .auth-popover::-webkit-scrollbar{width:0;height:0}
html[data-theme='dark'] .auth-popover::-webkit-scrollbar-track{background:transparent}
html[data-theme='dark'] .auth-popover::-webkit-scrollbar-thumb{
  background:rgba(212,176,106,.32);
  border-radius:999px;
}

html[data-theme='dark'] .auth-popover-head{
  padding:.2rem .2rem .7rem;
}

html[data-theme='dark'] .auth-kicker{
  color:rgba(212,176,106,.9);
}

html[data-theme='dark'] .auth-popover h2{
  color:#f4ead8;
}

html[data-theme='dark'] .auth-close{
  border-color:rgba(248,237,214,.11);
  background:rgba(248,237,214,.045);
  color:rgba(248,237,214,.74);
}

html[data-theme='dark'] .auth-tabs{
  border-color:rgba(212,176,106,.16);
  background:rgba(5,4,3,.44);
  box-shadow:inset 0 1px 0 rgba(248,237,214,.04);
}

html[data-theme='dark'] .auth-tab{
  color:rgba(196,184,164,.72);
}

html[data-theme='dark'] .auth-tab.active{
  background:rgba(212,176,106,.14);
  color:#f8edd6;
  box-shadow:inset 0 1px 0 rgba(248,237,214,.08);
}

html[data-theme='dark'] .auth-form{
  gap:.68rem;
  margin-top:.9rem;
}

html[data-theme='dark'] .auth-form label{
  color:rgba(196,184,164,.9);
}

html[data-theme='dark'] .auth-form input{
  min-height:44px;
  border-color:rgba(212,176,106,.18);
  background:rgba(248,237,214,.035);
  color:#f8edd6;
  box-shadow:inset 0 1px 0 rgba(248,237,214,.025);
}

html[data-theme='dark'] .auth-form input:focus{
  border-color:rgba(228,200,128,.52);
  background:rgba(248,237,214,.055);
  box-shadow:0 0 0 2px rgba(212,176,106,.1),inset 0 1px 0 rgba(248,237,214,.04);
}

html[data-theme='dark'] .auth-helper,
html[data-theme='dark'] .auth-feedback{
  color:rgba(196,184,164,.82);
}

html[data-theme='dark'] .auth-submit,
html[data-theme='dark'] .auth-google,
html[data-theme='dark'] .auth-secondary,
html[data-theme='dark'] .auth-link-button{
  appearance:none;
  -webkit-appearance:none;
  transition:background .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease),box-shadow .2s var(--ease);
}

html[data-theme='dark'] .auth-submit{
  min-height:46px;
  border-color:rgba(212,176,106,.28);
  background:rgba(212,176,106,.13);
  color:#f8edd6;
}

html[data-theme='dark'] .auth-submit:hover{
  border-color:rgba(228,200,128,.44);
  background:rgba(212,176,106,.18);
}

html[data-theme='dark'] .auth-link-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  justify-self:center;
  width:max-content;
  max-width:100%;
  min-height:34px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent!important;
  box-shadow:none!important;
  color:rgba(228,200,128,.86);
  padding:.35rem .75rem;
  text-decoration:none;
}

html[data-theme='dark'] .auth-link-button:hover,
html[data-theme='dark'] .auth-link-button:focus-visible{
  border-color:rgba(212,176,106,.18);
  background:rgba(212,176,106,.07)!important;
  color:#f8edd6;
  outline:none;
}

html[data-theme='dark'] .auth-divider{
  margin:.75rem 0 .8rem;
  color:rgba(196,184,164,.62);
}

html[data-theme='dark'] .auth-divider::before,
html[data-theme='dark'] .auth-divider::after{
  background:rgba(212,176,106,.11);
}

html[data-theme='dark'] .auth-google{
  min-height:46px;
  border-color:rgba(248,237,214,.78);
  background:#eee2ca;
  color:#2f241a;
  box-shadow:0 10px 28px rgba(0,0,0,.16);
}

html[data-theme='dark'] .auth-google:hover{
  background:#f8edd6;
  border-color:#f8edd6;
}

body.auth-open .mobile-bottom-nav{
  display:none;
  opacity:0;
  pointer-events:none;
  transform:translateY(10px);
}

body.menu-open .mobile-bottom-nav,
body.map-open .mobile-bottom-nav,
body.notes-open .mobile-bottom-nav,
body.study-open .mobile-bottom-nav{
  display:none;
  opacity:0;
  pointer-events:none;
  transform:translateY(10px);
}

.theme-toggle{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.55rem;
}

.theme-pill{
  min-height:42px;
  border-radius:14px;
  border:1px solid var(--panel-border);
  background:rgba(212,176,106,.04);
  color:var(--txt2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}

.theme-pill.active{
  background:var(--gold4);
  border-color:var(--gold4);
  color:var(--bg);
}

.home-main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:3.5rem 1.5rem 2rem;
}

.home-stage{
  display:none;
  width:min(1120px,100%);
  margin:0 auto;
}

.home-stage.is-active{display:block}
.home-stage-hero.is-active{display:grid}

.home-stage-hero{
  min-height:calc(100vh - 7rem);
  place-items:center;
  align-content:center;
  gap:clamp(1.4rem,3.4vh,2.45rem);
  text-align:center;
  padding-block:clamp(.8rem,2.2vh,1.6rem) clamp(5rem,12vh,7.25rem);
}

.home-title-stack{
  display:grid;
  gap:.35rem;
  justify-items:center;
}

.home-title-line{
  font-family:'Cormorant Garamond',Georgia,serif;
  line-height:.88;
  letter-spacing:.05em;
  color:var(--gold1);
  text-transform:uppercase;
  animation:heroCascade .9s var(--ease) both;
}

.home-title-line-sm{font-size:clamp(2rem,5vw,3.5rem);animation-delay:.08s}
.home-title-line-xl{font-size:clamp(4.4rem,12vw,8rem);letter-spacing:.02em;animation-delay:.2s}
.home-title-line-md{font-size:clamp(2.4rem,6vw,4.2rem);animation-delay:.34s}

.home-subtitle{
  font-size:clamp(1rem,2vw,1.2rem);
  color:var(--txt2);
  letter-spacing:.05em;
  animation:fadeIn .8s var(--ease) .48s both;
}

.home-legend{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.76rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--txt3);
  animation:fadeIn .8s var(--ease) .62s both;
  max-width:44rem;
  margin:0 auto;
  line-height:1.9;
}

.hero-actions{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:1rem;
  position:relative;
  z-index:2;
}

.hero-cta{
  width:min(100%,22rem);
  min-height:52px;
  padding:0 1.6rem;
  border-radius:999px;
  border:1px solid rgba(212,176,106,.24);
  background:rgba(212,176,106,.08);
  color:var(--gold2);
  text-decoration:none;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  touch-action:manipulation;
  position:relative;
  z-index:2;
  transition:border-color .28s var(--ease),background .28s var(--ease),box-shadow .28s var(--ease),color .28s var(--ease);
}

.hero-cta[hidden]{display:none}

.hero-cta:hover{
  border-color:var(--gold3);
  background:rgba(212,176,106,.14);
  color:var(--gold1);
  box-shadow:0 0 0 1px rgba(212,176,106,.12),0 0 24px rgba(212,176,106,.18);
}

.hero-cta-secondary{
  background:rgba(248,237,214,.92);
  color:var(--gold6);
  border-color:rgba(212,176,106,.3);
}

.journey-trigger{
  border:none;
  background:none;
  color:var(--txt2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  cursor:pointer;
  padding:.3rem 0;
  position:relative;
  z-index:2;
  transition:color .24s var(--ease),opacity .24s var(--ease);
}

.journey-trigger:hover{
  color:var(--gold3);
}

.journey-modal-scrim{
  position:fixed;
  inset:0;
  background:rgba(8,6,4,.48);
  backdrop-filter:blur(5px);
  z-index:998;
  opacity:0;
  pointer-events:none;
  transition:opacity .24s ease;
}

.journey-modal-scrim.visible{
  opacity:1;
  pointer-events:auto;
}

.journey-modal,
.book-journey-panel{
  width:min(920px,100%);
  padding:1.35rem;
  border-radius:28px;
  border:1px solid var(--panel-border);
  background:var(--panel-strong);
  box-shadow:var(--shadow-soft);
}

.journey-modal{
  position:fixed;
  top:50%;
  left:50%;
  width:min(760px,calc(100vw - 2rem));
  max-height:min(86vh,860px);
  padding:1.45rem;
  transform:translate(-50%,-46%) scale(.96);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  overflow:auto;
  z-index:999;
  transition:transform .28s var(--ease),opacity .24s var(--ease),visibility 0s linear .28s;
}

.journey-modal.open{
  transform:translate(-50%,-50%) scale(1);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:transform .28s var(--ease),opacity .24s var(--ease);
}

.journey-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1.1rem;
}

.journey-modal-copy{
  display:grid;
  gap:.45rem;
}

.journey-overview{
  display:grid;
  gap:.55rem;
  padding:1rem 1.05rem;
  margin-bottom:1rem;
  border-radius:22px;
  border:1px solid rgba(212,176,106,.14);
  background:rgba(212,176,106,.08);
}

.journey-modal-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:.75rem;
}

.modal-close{
  width:42px;
  height:42px;
  border:none;
  border-radius:999px;
  background:rgba(212,176,106,.08);
  color:var(--gold2);
  font-size:1.55rem;
  line-height:1;
  cursor:pointer;
  flex-shrink:0;
  transition:background .24s var(--ease),transform .24s var(--ease),color .24s var(--ease);
}

.modal-close:hover{
  background:rgba(212,176,106,.16);
  color:var(--gold1);
  transform:translateY(-1px);
}

.journey-kicker{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--gold4);
}

.journey-headline{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.8rem,4vw,2.7rem);
  font-weight:400;
  color:var(--gold1);
  line-height:1;
}

.journey-copy{
  color:var(--txt2);
  line-height:1.7;
}

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

.journey-card,
.chapter-complete-card{
  padding:1rem 1.05rem;
  border-radius:20px;
  border:1px solid rgba(212,176,106,.14);
  background:rgba(212,176,106,.08);
  display:grid;
  gap:.35rem;
}

.journey-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.64rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--gold4);
}

.journey-value{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.35rem,3vw,2rem);
  font-weight:500;
  line-height:1;
  color:var(--gold1);
}

.journey-meta{
  color:var(--txt2);
  line-height:1.65;
}

.book-explorer-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
  margin:0 0 1rem;
}

.toolbar-pill{
  min-height:42px;
  padding:0 1rem;
  border-radius:999px;
  border:1px solid var(--panel-border);
  background:rgba(212,176,106,.04);
  color:var(--txt2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}

.toolbar-pill.active{
  background:var(--gold4);
  border-color:var(--gold4);
  color:var(--bg);
}

.stage-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1.5rem;
}

.stage-back{
  border:none;
  background:none;
  color:var(--gold3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}

.testament-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}

.testament-portal{
  min-height:320px;
  padding:2rem;
  border-radius:28px;
  border:1px solid var(--panel-border);
  background:
    linear-gradient(180deg,rgba(212,176,106,.07),rgba(212,176,106,.02)),
    rgba(10,8,6,.36);
  color:var(--txt);
  text-align:left;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:.7rem;
  cursor:pointer;
  box-shadow:var(--shadow-soft);
  transition:transform .28s var(--ease),border-color .28s var(--ease);
}

.testament-portal:hover{
  transform:translateY(-4px);
  border-color:rgba(212,176,106,.26);
}

.portal-kicker{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.64rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--gold4);
}

.testament-portal strong{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(2rem,4vw,3rem);
  font-weight:400;
  color:var(--gold1);
}

.testament-portal span:last-child{
  max-width:22ch;
  color:var(--txt2);
}

.book-explorer{
  display:grid;
  gap:1.6rem;
}

.book-group{
  padding:1.35rem;
  border-radius:24px;
  border:1px solid var(--panel-border);
  background:rgba(10,8,6,.28);
  box-shadow:var(--shadow-soft);
}

.book-group-toggle{
  width:100%;
  margin-bottom:1rem;
  padding:0;
  border:none;
  background:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  color:inherit;
  cursor:pointer;
  text-align:left;
}

.book-group-toggle span,
.book-group-toggle strong{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--gold4);
}

.book-group.is-collapsed .book-lines{
  display:none;
}

.book-lines{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:.75rem;
}

.book-line{
  min-height:86px;
  padding:1rem 1.1rem;
  border-radius:18px;
  border:1px solid rgba(212,176,106,.12);
  background:rgba(212,176,106,.04);
  text-decoration:none;
  color:var(--txt);
  display:grid;
  gap:.35rem;
  transition:transform .24s var(--ease),border-color .24s var(--ease),background .24s var(--ease);
}

.book-line:hover{
  transform:translateY(-2px);
  border-color:rgba(212,176,106,.26);
  background:rgba(212,176,106,.08);
}

.book-line.is-disabled{
  opacity:.45;
  pointer-events:none;
}

.book-line-count,
.book-line-meta{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.64rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--txt3);
}

.book-line-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:1.45rem;
  font-weight:500;
  color:var(--gold1);
}

.book-line-status{
  justify-self:start;
  padding:.2rem .55rem;
  border-radius:999px;
  border:1px solid rgba(212,176,106,.18);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.book-line-status-started{
  color:var(--gold2);
  background:rgba(212,176,106,.08);
}

.book-line-status-completed{
  color:#7fc69a;
  background:rgba(127,198,154,.1);
  border-color:rgba(127,198,154,.24);
}

.book-line-status-fresh{
  color:var(--txt3);
  background:rgba(255,255,255,.03);
}

.book-empty{
  padding:1rem 0;
  color:var(--txt2);
}

.book-shell{
  width:min(1120px,calc(100% - 3rem));
  margin:5.5rem auto 0;
  display:grid;
  gap:1.4rem;
}

.book-hero,
.book-search,
.book-arcs{
  scroll-margin-top:8.75rem;
}

.book-hero{
  padding:2.2rem;
  border-radius:30px;
  border:1px solid var(--panel-border);
  background:rgba(10,8,6,.34);
  box-shadow:var(--shadow-soft);
}

.book-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(3rem,7vw,5rem);
  font-weight:400;
  line-height:.92;
  color:var(--gold1);
  margin-top:.45rem;
}

.book-copy{
  max-width:44rem;
  margin-top:1rem;
  font-size:1.02rem;
  color:var(--txt2);
}

.book-actions{
  margin-top:1.6rem;
  justify-content:flex-start;
}

.book-progress-strip{
  padding:1.25rem 1.4rem;
  border-radius:24px;
  border:1px solid var(--panel-border);
  background:rgba(10,8,6,.28);
  box-shadow:var(--shadow-soft);
}

.book-progress-meta{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--txt3);
}

.book-search{
  padding:1.45rem;
  border:1px solid rgba(212,176,106,.16);
  border-radius:24px;
  background:linear-gradient(135deg,rgba(10,8,6,.38),rgba(212,176,106,.045));
  box-shadow:var(--shadow-soft);
}

.book-search-head{
  display:grid;
  gap:.45rem;
}

.book-search-title{
  margin:0;
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(2rem,4.8vw,3.2rem);
  font-weight:400;
  line-height:1;
  color:var(--gold1);
}

.book-search-copy{
  max-width:44rem;
  margin:0;
  color:var(--txt2);
  line-height:1.55;
}

.book-search-form{
  display:grid;
  gap:.85rem;
  margin-top:1.15rem;
}

.book-search-label{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--gold3);
}

.book-search-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.65rem;
  align-items:center;
}

.book-search-box input{
  min-width:0;
  min-height:54px;
  border:1px solid rgba(212,176,106,.18);
  border-radius:18px;
  padding:.85rem 1rem;
  background:rgba(6,5,4,.45);
  color:var(--gold1);
  font:inherit;
  outline:none;
  box-shadow:inset 0 1px 0 rgba(248,237,214,.04);
}

.book-search-box input::placeholder{
  color:var(--txt3);
}

.book-search-box input:focus-visible{
  border-color:rgba(212,176,106,.58);
  box-shadow:0 0 0 3px rgba(212,176,106,.12),inset 0 1px 0 rgba(248,237,214,.05);
}

.book-search-submit,
.book-search-mode{
  min-height:54px;
  border:1px solid rgba(212,176,106,.22);
  border-radius:18px;
  padding:.78rem 1.05rem;
  background:rgba(212,176,106,.08);
  color:var(--gold1);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .22s var(--ease),border-color .22s var(--ease),box-shadow .22s var(--ease),color .22s var(--ease);
}

.book-search-submit:hover,
.book-search-submit:focus-visible,
.book-search-mode:hover,
.book-search-mode:focus-visible,
.book-search-mode.active{
  background:rgba(212,176,106,.18);
  border-color:rgba(212,176,106,.42);
  box-shadow:0 0 28px rgba(212,176,106,.12);
}

.book-search-modes{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

.book-search-mode{
  min-height:44px;
  color:var(--txt2);
}

.book-search-mode.active{
  color:var(--gold1);
}

.book-search-status{
  min-height:1.5rem;
  margin:.95rem 0 0;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--txt3);
}

.book-search-results{
  display:grid;
  gap:.7rem;
  margin-top:.9rem;
}

.book-search-result{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:.35rem .75rem;
  padding:1rem;
  border:1px solid rgba(212,176,106,.14);
  border-radius:18px;
  background:rgba(6,5,4,.32);
}

.book-search-result-link{
  color:var(--gold2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.7rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  text-decoration:none;
}

.book-search-result-link:hover,
.book-search-result-link:focus-visible{
  color:var(--gold1);
  text-decoration:underline;
  text-underline-offset:.25rem;
}

.book-search-badge{
  justify-self:end;
  color:var(--txt3);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.book-search-excerpt{
  grid-column:1/-1;
  margin:.2rem 0 0;
  color:var(--gold1);
  font-size:1.08rem;
  line-height:1.55;
}

.book-search-context,
.book-search-empty{
  grid-column:1/-1;
  margin:0;
  color:var(--txt3);
  line-height:1.45;
}

.book-arcs{
  display:grid;
  gap:1.2rem;
}

.book-journey-panel{
  max-width:760px;
  margin:0 auto;
}

.book-focus-panel{
  padding:1.2rem 1.3rem;
  border-radius:24px;
  border:1px solid rgba(212,176,106,.14);
  background:rgba(212,176,106,.08);
  display:grid;
  gap:.45rem;
  text-align:left;
}

.book-focus-panel .journey-value{
  line-height:1.08;
}

.book-focus-trail{
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.66rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--txt3);
}

.ch-cell.current{
  border-color:var(--gold3);
  box-shadow:0 0 0 1px rgba(212,176,106,.25) inset;
}

.chapter-entry-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:.75rem;
  margin-top:1.6rem;
}

.entry-action,
.entry-action-link{
  min-height:46px;
  padding:0 1.05rem;
  border-radius:999px;
  border:1px solid rgba(212,176,106,.18);
  background:rgba(212,176,106,.06);
  color:var(--gold2);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
  transition:transform .24s var(--ease),border-color .24s var(--ease),background .24s var(--ease),opacity .24s var(--ease);
}

.entry-action:hover,
.entry-action-link:hover{
  transform:translateY(-2px);
  border-color:var(--gold3);
  background:rgba(212,176,106,.1);
}

.entry-action.is-disabled,
.entry-action:disabled{
  opacity:.48;
  cursor:not-allowed;
  pointer-events:none;
}

.chapter-hamburger{z-index:995}
body.menu-open .chapter-hamburger,
body.map-open .chapter-hamburger{
  opacity:0;
  pointer-events:none;
}

.chapter-hero{
  min-height:100vh;
  padding:6rem 2rem 4rem;
}

.section-actions{
  justify-content:flex-start;
  margin:0 0 1rem;
}

.chapter-complete-card{
  margin:1rem 0 1.5rem;
}

.reader-sheet,
.map-panel{
  position:fixed;
  top:0;
  right:0;
  width:min(94vw,420px);
  height:100vh;
  padding:4.2rem 1.4rem 1.8rem;
  background:var(--panel-strong);
  border-left:1px solid var(--panel-border);
  backdrop-filter:blur(12px);
  z-index:997;
  transform:translateX(100%);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:transform .36s var(--ease),opacity .24s var(--ease),visibility 0s linear .36s;
  overflow-y:auto;
  box-shadow:-24px 0 60px rgba(0,0,0,.28);
}

.reader-sheet.open,
.map-panel.open{
  transform:translateX(0);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:transform .36s var(--ease),opacity .24s var(--ease);
}

.map-panel{
  width:min(94vw,520px);
}

.map-panel .container{
  max-width:none;
  padding:0;
}

.map-panel .map-label{
  text-align:left;
  margin-bottom:1.2rem;
}

.map-panel .map{
  justify-content:flex-start;
  padding:0;
}

.map-panel .stats{
  justify-content:flex-start;
  gap:1rem;
  flex-wrap:wrap;
}

.map-panel-close{
  top:1.1rem;
  right:1.1rem;
}

.home-footer{
  padding-top:1rem;
}

html[data-theme='light'] .testament-portal,
html[data-theme='light'] .book-group,
html[data-theme='light'] .book-hero,
html[data-theme='light'] .book-search,
html[data-theme='light'] .book-search-result,
html[data-theme='light'] .book-progress-strip{
  background:rgba(247,240,230,.72);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .book-search-box input{
  background:rgba(255,251,244,.86);
  border-color:rgba(126,91,44,.2);
  color:#3d2818;
}

html[data-theme='light'] .book-search-submit,
html[data-theme='light'] .book-search-mode{
  background:rgba(116,82,42,.08);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .journey-modal,
html[data-theme='light'] .book-journey-panel{
  background:var(--panel-strong);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .book-line,
html[data-theme='light'] .entry-action,
html[data-theme='light'] .entry-action-link,
html[data-theme='light'] .hero-cta,
html[data-theme='light'] .menu-link,
html[data-theme='light'] .theme-pill,
html[data-theme='light'] .font-size-btn,
html[data-theme='light'] .font-family-btn{
  background:rgba(250,244,235,.88);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .book-line:hover,
html[data-theme='light'] .entry-action:hover,
html[data-theme='light'] .entry-action-link:hover,
html[data-theme='light'] .hero-cta:hover,
html[data-theme='light'] .menu-link:hover{
  background:rgba(244,235,219,.96);
  border-color:rgba(126,91,44,.28);
}

html[data-theme='light'] .account-session-shell{
  border-left-color:rgba(126,91,44,.22);
  background:transparent;
}

html[data-theme='light'] .account-session-shell::before{
  background:#8a5d28;
  box-shadow:0 0 16px rgba(138,93,40,.22);
}

html[data-theme='light'] .account-status-pill{
  border-color:transparent;
  background:transparent;
  color:rgba(98,66,32,.82);
}

html[data-theme='light'] .account-session-meta,
html[data-theme='light'] .account-storage-row strong,
html[data-theme='light'] .account-data-note{
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .account-anonymous-notice{
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .account-storage-ledger,
html[data-theme='light'] .account-storage-row{
  border-color:rgba(126,91,44,.13);
}

html[data-theme='light'] .account-storage-row span{
  color:rgba(98,66,32,.82);
}

html[data-theme='light'] .book-line-meta,
html[data-theme='light'] .book-line-count,
html[data-theme='light'] .book-progress-meta{
  color:#73563a;
}

html[data-theme='light'] .journey-card,
html[data-theme='light'] .book-focus-panel,
html[data-theme='light'] .chapter-complete-card{
  background:rgba(250,244,235,.88);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .journey-overview,
html[data-theme='light'] .modal-close{
  background:rgba(250,244,235,.88);
  border-color:rgba(126,91,44,.18);
}

html[data-theme='light'] .journey-trigger{
  color:#73563a;
}

@keyframes heroCascade{
  from{opacity:0;transform:translateY(18px);letter-spacing:.22em}
  to{opacity:1;transform:translateY(0);letter-spacing:inherit}
}

@media(max-width:900px){
  .testament-grid{grid-template-columns:1fr}
  .book-lines{grid-template-columns:1fr}
  .book-progress-meta{flex-direction:column;align-items:flex-start}
}

@media(max-height:760px){
  .home-main{padding-top:2.2rem}
  .home-stage-hero{gap:1.15rem;padding-block:.35rem clamp(3.8rem,9vh,5.2rem)}
  .home-title-stack{gap:.18rem}
}

@media(max-width:640px){
  .home-main{padding:1.25rem 1rem 1rem}
  .home-stage-hero{min-height:calc(100vh - 5rem)}
  .book-shell{width:calc(100% - 1.6rem);margin-top:4.8rem}
  .book-hero,
  .book-search,
  .book-progress-strip,
  .book-group,
  .journey-modal,
  .book-journey-panel{padding:1.2rem}
  .hero-actions{width:100%}
  .chapter-entry-actions{justify-content:flex-start}
  .entry-action,
  .entry-action-link{width:100%}
  .reader-sheet,
  .map-panel,
  .home-menu-panel{width:100%;max-width:100vw}
  .journey-grid,
  .book-journey-panel{grid-template-columns:1fr}
  .journey-modal{
    width:calc(100vw - 1rem);
    max-height:88vh;
  }
  .journey-modal-head{align-items:center}
  .menu-title,
  .stage-title{font-size:2rem}
}

/* V5 front-end polish: stronger ink, safer mobile composition. */
html[data-theme='light']{
  --bg:#e8ddca;
  --bg2:#f0e6d8;
  --bg3:#dfd0b8;
  --bg4:#cdb99b;
  --bg5:#aa8f68;
  --gold1:#2f241a;
  --gold2:#503a24;
  --gold3:#74532f;
  --gold4:#946b3c;
  --gold5:#79552c;
  --gold6:#4d3822;
  --txt:#312318;
  --txt2:#563f2c;
  --txt3:#735941;
  --txtv:#2b1f16;
  --panel:rgba(245,238,226,.9);
  --panel-strong:rgba(249,243,233,.98);
  --panel-border:rgba(87,62,34,.2);
  --shadow-soft:0 24px 60px rgba(70,49,24,.15);
}

html[data-theme='light'] body{
  background:
    linear-gradient(180deg,rgba(232,221,202,.96),rgba(221,207,184,.96)),
    var(--bg);
}

html[data-theme='light'] body::before{
  opacity:.18;
  filter:sepia(.12) saturate(.74) contrast(1.06) brightness(.96) blur(.35px);
}

html[data-theme='light'] body::after{
  background:
    radial-gradient(circle at 50% 20%,rgba(255,255,255,.34),transparent 24rem),
    linear-gradient(180deg,rgba(232,221,202,.1),rgba(190,170,136,.18));
}

.home-stage,
.home-title-stack,
.book-shell,
.book-hero,
.book-search,
.book-journey-panel,
.book-progress-strip,
.book-group,
.chapter-hero{
  max-width:100%;
}

.home-title-stack,
.home-title-line,
.hero-title,
.book-title,
.book-copy,
.journey-headline,
.journey-meta,
.book-focus-trail,
.book-progress-meta,
.footer{
  overflow-wrap:anywhere;
}

.home-title-line,
.hero-title,
.book-title{
  letter-spacing:0;
}

.home-stage-hero{
  overflow:hidden;
}

.home-title-line-xl,
.home-title-line-md{
  max-width:100%;
}

.home-subtitle,
.home-legend{
  max-width:min(100%,44rem);
}

.hero-cta,
.entry-action,
.entry-action-link,
.toolbar-pill,
.theme-pill,
.font-size-btn,
.font-family-btn,
.menu-link{
  min-width:0;
}

.entry-action,
.entry-action-link,
.hero-cta{
  text-align:center;
}

html[data-theme='light'] .book-hero,
html[data-theme='light'] .book-search,
html[data-theme='light'] .book-search-result,
html[data-theme='light'] .book-progress-strip,
html[data-theme='light'] .book-group,
html[data-theme='light'] .journey-modal,
html[data-theme='light'] .book-journey-panel,
html[data-theme='light'] .testament-portal{
  background:
    linear-gradient(180deg,rgba(255,251,244,.74),rgba(241,231,216,.86)),
    rgba(249,243,233,.9);
}

html[data-theme='light'] .book-line,
html[data-theme='light'] .entry-action,
html[data-theme='light'] .entry-action-link,
html[data-theme='light'] .hero-cta,
html[data-theme='light'] .menu-link,
html[data-theme='light'] .theme-pill,
html[data-theme='light'] .font-size-btn,
html[data-theme='light'] .font-family-btn,
html[data-theme='light'] .journey-card,
html[data-theme='light'] .book-focus-panel,
html[data-theme='light'] .chapter-complete-card,
html[data-theme='light'] .journey-overview{
  background:rgba(255,249,239,.82);
}

@media(max-width:640px){
  html{font-size:16px}

  body{
    width:100%;
  }

  body::before{
    inset:-3%;
    background-position:center top;
    transform:translate3d(0,var(--page-parallax),0) scale(1.02);
    -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,.82),rgba(0,0,0,.44) 46%,rgba(0,0,0,.16) 72%,transparent 100%);
    mask-image:linear-gradient(180deg,rgba(0,0,0,.82),rgba(0,0,0,.44) 46%,rgba(0,0,0,.16) 72%,transparent 100%);
  }

  .home-main{
    width:min(100%,100vw);
    min-height:calc(100svh - 6.5rem);
    padding:4.4rem 1rem 1.2rem;
    align-items:center;
  }

  .home-stage-hero{
    min-height:auto;
    width:100%;
    gap:1.05rem;
    align-content:center;
    padding:0;
  }

  .home-title-stack{
    width:100%;
    gap:.12rem;
    overflow:hidden;
  }

  .home-title-line{
    width:100%;
    line-height:.96;
    white-space:normal;
  }

  .home-title-line-sm{font-size:1.75rem}
  .home-title-line-xl{font-size:3.75rem}
  .home-title-line-md{font-size:1.9rem}

  .home-subtitle{
    width:100%;
    padding:0 .4rem;
    font-size:.95rem;
    line-height:1.35;
  }

  .home-legend{
    font-size:.72rem;
    line-height:1.55;
    padding:0 .35rem;
  }

  .hero-actions{
    width:100%;
    max-width:22rem;
    margin:0 auto;
    gap:.85rem;
  }

  .hero-cta{
    width:100%;
    min-height:50px;
    padding:0 1.1rem;
  }

  .home-footer.footer{
    width:100%;
    padding:1rem 1.2rem 1.4rem;
    font-size:.8rem;
    line-height:1.55;
  }

  .home-footer.footer p{
    max-width:100%;
  }

  .home-footer.footer a{
    overflow-wrap:anywhere;
  }

  .stage-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .testament-portal{
    min-height:240px;
    padding:1.35rem;
    border-radius:22px;
  }

  .book-shell{
    width:calc(100vw - 2rem);
    margin-top:5rem;
    padding:0;
    gap:1rem;
    margin-left:auto;
    margin-right:auto;
  }

  .book-hero,
  .book-search,
  .book-progress-strip,
  .book-group,
  .book-journey-panel{
    width:100%;
    border-radius:20px;
    overflow:hidden;
  }

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

  .book-search-submit{
    width:100%;
  }

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

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

  .book-search-badge{
    justify-self:start;
  }

  .book-hero,
  .book-search,
  .book-arcs{
    scroll-margin-top:5.8rem;
  }

  .book-title{
    font-size:3.2rem;
    line-height:.98;
  }

  .book-copy{
    font-size:1rem;
    line-height:1.65;
  }

  .book-actions,
  .chapter-entry-actions{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
    max-width:22rem;
    margin-left:auto;
    margin-right:auto;
  }

  .book-progress-meta{
    gap:.35rem;
    line-height:1.45;
  }

  .book-focus-panel{
    border-radius:18px;
  }

  .chapter-hero{
    min-height:100svh;
    padding:5.25rem 1.25rem 2rem;
    justify-content:center;
    overflow:hidden;
  }

  .chapter-hero .hero-label,
  .chapter-hero .hero-meta{
    max-width:100%;
    line-height:1.45;
    white-space:normal;
  }

  .chapter-hero .hero-title{
    display:block;
    width:100%;
    max-width:21rem;
    margin-left:auto;
    margin-right:auto;
    font-size:3rem;
    line-height:1;
  }

  .chapter-hero .hero-sub{
    max-width:21rem;
    margin-left:auto;
    margin-right:auto;
    line-height:1.45;
  }

  .chapter-hero .hero-btn{
    width:100%;
    max-width:22rem;
    padding-inline:1rem;
  }

  .home-menu-panel{
    padding:5rem 1.2rem 1.5rem;
  }

  .journey-modal{
    border-radius:20px;
  }

  .home-title-line,
  .home-subtitle,
  .home-legend,
  .hero-label,
  .hero-meta,
  .book-kicker,
  .menu-kicker,
  .stage-kicker,
  .journey-label,
  .book-line-count,
  .book-line-meta,
  .book-progress-meta,
  .book-focus-trail,
  .entry-action,
  .entry-action-link,
  .hero-btn,
  .hero-cta,
  .toolbar-pill,
  .theme-pill,
  .font-size-btn,
  .font-family-btn,
  .menu-link,
  .footer{
    letter-spacing:0;
  }
}

/* V6 review pass: remove excess copy, compact navigation, clarify active states. */
html[data-theme-choice='system'] .theme-pill[data-theme='system'],
html[data-theme-choice='dark'] .theme-pill[data-theme='dark'],
html[data-theme-choice='light'] .theme-pill[data-theme='light'],
.theme-pill[aria-pressed='true']{
  background:var(--gold4);
  border-color:var(--gold4);
  color:var(--bg);
}

.journey-trigger[hidden],
.home-legend{
  display:none;
}

.home-title-stack{
  gap:.62rem;
}

.home-title-line{
  line-height:.98;
}

.home-subtitle{
  margin-top:.18rem;
}

.testament-portal{
  min-height:220px;
  padding:1.55rem 1.75rem;
  border-radius:22px;
}

.book-lines{
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
}

.book-line{
  min-height:74px;
  padding:1rem 1.15rem;
  align-content:center;
}

.book-line-title{
  font-size:1.55rem;
}

.book-line-meta{
  color:var(--txt2);
  font-size:.86rem;
  letter-spacing:0;
  text-transform:none;
}

.book-line-status,
.book-line-count{
  display:none;
}

.book-hero{
  text-align:center;
  display:grid;
  justify-items:center;
}

.book-copy{
  margin-left:auto;
  margin-right:auto;
}

.book-actions{
  justify-content:center;
}

.book-actions .entry-action.is-disabled{
  display:none;
}

.insight-panel .ip-close{
  width:44px;
  height:44px;
  padding:0;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(212,176,106,.08);
  color:var(--gold2);
  font-size:1.7rem;
  line-height:1;
}

.insight-panel .ip-close:hover{
  background:rgba(212,176,106,.16);
  color:var(--gold1);
}

@media(max-width:640px){
  .home-title-stack{
    gap:.34rem;
  }

  .home-title-line{
    line-height:1;
  }

  .testament-portal{
    min-height:190px;
  }

  .book-line{
    min-height:68px;
  }
}

/* V7 review pass: subtler home hierarchy and cleaner book surfaces. */
body.page-home::before{
  opacity:.3;
  filter:saturate(.88) contrast(1.12) brightness(.74) blur(.2px);
  -webkit-mask-image:radial-gradient(circle at 50% 26%, rgba(0,0,0,.98) 0, rgba(0,0,0,.86) 20%, rgba(0,0,0,.6) 42%, rgba(0,0,0,.3) 62%, transparent 82%);
  mask-image:radial-gradient(circle at 50% 26%, rgba(0,0,0,.98) 0, rgba(0,0,0,.86) 20%, rgba(0,0,0,.6) 42%, rgba(0,0,0,.3) 62%, transparent 82%);
}

body.page-home::after{
  background:
    radial-gradient(circle at 50% 40%, rgba(0,0,0,.18), rgba(0,0,0,.48) 33rem),
    linear-gradient(180deg, rgba(8,6,4,.06), rgba(8,6,4,.18) 30%, rgba(8,6,4,.48));
}

.home-subtitle{
  font-size:1rem;
  opacity:.9;
  color:rgba(236,228,212,.9);
}

body.page-book .book-hero{
  padding:clamp(3rem,7vh,5rem) clamp(2rem,5vw,4.8rem);
  row-gap:clamp(1.35rem,3.4vh,2.6rem);
  border:0;
  background:linear-gradient(180deg, rgba(10,8,6,.28), rgba(10,8,6,.12));
  box-shadow:0 22px 70px rgba(0,0,0,.16);
}

body.page-book .book-title,
body.page-book .book-copy,
body.page-book .book-actions,
body.page-book .book-progress-strip{
  margin:0;
}

body.page-book .book-journey-panel,
body.page-book .book-progress-strip{
  border:0;
  background:transparent;
  box-shadow:none;
}

body.page-book .book-focus-panel{
  border:0;
  background:rgba(212,176,106,.06);
  border-radius:18px;
}

body.page-book .arc{
  padding:1.25rem 0 1.45rem;
  margin-bottom:1.25rem;
  border-top:1px solid rgba(212,176,106,.1);
}

body.page-book .arc-head{
  border-bottom:0;
  padding-bottom:.25rem;
}

body.page-book .arc-progress{
  background:rgba(212,176,106,.08);
  box-shadow:none;
}

body.page-book .ch-cell{
  border-color:rgba(212,176,106,.1);
  background:rgba(212,176,106,.035);
}

.chapter-entry-actions .entry-action.is-disabled{
  cursor:not-allowed;
  opacity:.42;
}

html[data-theme='light'] body.page-home::before{
  opacity:.22;
  filter:saturate(.9) contrast(1.04) brightness(1);
}

html[data-theme='light'] body.page-home::after{
  background:
    radial-gradient(circle at 50% 40%, rgba(255,249,239,.14), rgba(255,249,239,.52) 34rem),
    linear-gradient(180deg, rgba(255,249,239,.18), rgba(255,249,239,.46));
}

html[data-theme='light'] .home-subtitle{
  color:rgba(86,63,44,.9);
}

html[data-theme='light'] body.page-book .book-hero{
  background:rgba(255,249,239,.48);
  box-shadow:0 18px 50px rgba(70,49,24,.08);
}

html[data-theme='light'] body.page-book .book-focus-panel{
  background:rgba(173,127,52,.07);
}

@media(max-width:640px){
  .home-subtitle{
    font-size:.88rem;
  }

  body.page-book .arc{
    padding:1rem 0 1.2rem;
  }
}

/* V9 review pass: remove ornamental dividers, calm card motion, unify book backdrop. */
.footer{
  border-top:0;
}

.testament-portal{
  transition:border-color .28s var(--ease),box-shadow .28s var(--ease),background .28s var(--ease);
}

.testament-portal:hover{
  transform:none;
  border-color:rgba(212,176,106,.52);
  background:
    linear-gradient(180deg,rgba(212,176,106,.09),rgba(212,176,106,.025)),
    rgba(10,8,6,.36);
  box-shadow:
    var(--shadow-soft),
    inset 0 0 0 1px rgba(212,176,106,.14),
    0 0 32px rgba(212,176,106,.055);
}

.testament-portal:focus-visible{
  outline:none;
  border-color:rgba(212,176,106,.58);
  box-shadow:
    var(--shadow-soft),
    0 0 0 2px rgba(212,176,106,.16);
}

.testament-portal span:last-child{
  max-width:24ch;
  font-family:'Crimson Pro',Georgia,serif;
  font-size:1.08rem;
  font-weight:400;
  font-style:normal;
  line-height:1.24;
  color:rgba(236,228,212,.78);
}

body.page-book::before{
  opacity:.24;
  filter:saturate(.82) contrast(1.04) brightness(.78) blur(.25px);
  background-position:center top;
  -webkit-mask-image:none;
  mask-image:none;
}

body.page-book::after{
  background:
    linear-gradient(180deg,rgba(8,6,4,.22),rgba(8,6,4,.24) 34%,rgba(8,6,4,.38));
}

html[data-theme='light'] .testament-portal span:last-child{
  color:rgba(86,63,44,.82);
}

html[data-theme='light'] .testament-portal:hover{
  border-color:rgba(148,107,60,.48);
  box-shadow:
    var(--shadow-soft),
    inset 0 0 0 1px rgba(148,107,60,.12),
    0 0 30px rgba(148,107,60,.055);
}

html[data-theme='light'] body.page-book::before{
  opacity:.2;
  filter:sepia(.12) saturate(.78) contrast(1.02) brightness(.98) blur(.25px);
  -webkit-mask-image:none;
  mask-image:none;
}

html[data-theme='light'] body.page-book::after{
  background:linear-gradient(180deg,rgba(232,221,202,.2),rgba(232,221,202,.28) 35%,rgba(190,170,136,.2));
}

/* V10 review pass: quieter labels, stronger chapter actions. */
.home-subtitle{
  font-size:clamp(.82rem,1.2vw,.95rem);
  color:rgba(232,224,208,.62);
  opacity:.72;
  letter-spacing:.03em;
}

html[data-theme='light'] .home-subtitle{
  color:rgba(86,63,44,.62);
}

#entryActions{
  display:grid;
  grid-template-columns:1fr;
  width:min(100%,34rem);
  padding:clamp(1.1rem,3.2vh,2.2rem) 0;
  gap:clamp(1.05rem,2.8vh,1.9rem);
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

#entryActions .entry-action,
#entryActions .entry-action-link{
  position:relative;
  width:100%;
  min-height:48px;
  padding:.36rem .25rem .55rem;
  border:0;
  border-radius:0;
  background:transparent;
  color:rgba(245,230,200,.72);
  letter-spacing:.16em;
  line-height:1.28;
}

#entryActions .entry-action::after,
#entryActions .entry-action-link::after{
  content:'';
  position:absolute;
  left:50%;
  bottom:.1rem;
  width:min(12rem,46%);
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,176,106,.32),transparent);
  transform:translateX(-50%);
  transition:width .24s var(--ease),background .24s var(--ease),opacity .24s var(--ease);
}

#entryActions .entry-action:hover,
#entryActions .entry-action-link:hover{
  transform:none;
  color:var(--gold1);
  background:transparent;
}

#entryActions .entry-action:hover::after,
#entryActions .entry-action-link:hover::after{
  width:min(16rem,58%);
  background:linear-gradient(90deg,transparent,rgba(212,176,106,.58),transparent);
}

#entryActions .entry-action + .entry-action::before,
#entryActions .entry-action-link + .entry-action-link::before{
  display:none;
}

html[data-theme='light'] #entryActions{
  background:transparent;
  box-shadow:none;
}

html[data-theme='light'] #entryActions{
  border-top-color:rgba(116,82,42,.22);
  border-bottom-color:rgba(116,82,42,.12);
}

html[data-theme='light'] #entryActions .entry-action,
html[data-theme='light'] #entryActions .entry-action-link{
  color:rgba(72,50,30,.78);
}

html[data-theme='light'] #entryActions .entry-action:hover,
html[data-theme='light'] #entryActions .entry-action-link:hover{
  color:#3d2818;
  background:transparent;
}

html[data-theme='light'] #entryActions .entry-action::after,
html[data-theme='light'] #entryActions .entry-action-link::after{
  background:linear-gradient(90deg,transparent,rgba(116,82,42,.26),transparent);
}

html[data-theme='light'] #entryActions .entry-action:hover::after,
html[data-theme='light'] #entryActions .entry-action-link:hover::after{
  background:linear-gradient(90deg,transparent,rgba(116,82,42,.48),transparent);
}

@media(max-width:640px){
  .home-subtitle{
    font-size:.78rem;
  }

  #entryActions{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
    max-width:28rem;
    padding:.7rem 0;
    gap:.7rem;
  }

  #entryActions .entry-action,
  #entryActions .entry-action-link{
    min-height:40px;
    padding:.22rem .2rem .4rem;
    letter-spacing:0;
  }

  #entryActions .entry-action::after,
  #entryActions .entry-action-link::after{
    width:min(8.5rem,44%);
  }

  #entryActions .entry-action + .entry-action::before,
  #entryActions .entry-action-link + .entry-action-link::before{
    top:0;
    left:12%;
    width:76%;
    height:1px;
    transform:none;
  }
}

/* V11 review pass: compact reader navigation menu. */
.chapter-menu-panel{
  padding:2.35rem 1.9rem 1.7rem;
}

.chapter-menu-panel .menu-title{
  margin:0 3rem 1.25rem 0;
  font-size:clamp(2.05rem,3vw,2.45rem);
}

.reader-menu-root{
  display:grid;
  gap:1.05rem;
}

.reader-menu-root[hidden]{
  display:none!important;
}

.reader-primary-nav{
  padding:1rem;
  border:1px solid rgba(212,176,106,.16);
  border-radius:18px;
  background:
    linear-gradient(145deg,rgba(212,176,106,.09),rgba(212,176,106,.026) 58%,rgba(0,0,0,.08)),
    rgba(9,7,5,.22);
  box-shadow:inset 0 1px 0 rgba(248,237,214,.04);
}

.reader-primary-head{
  display:grid;
  gap:.22rem;
}

.reader-primary-head h3{
  margin:0;
  color:var(--gold1);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.35rem,2vw,1.66rem);
  font-weight:500;
  line-height:1.05;
}

.chapter-menu-panel .reader-menu-links{
  gap:.48rem;
  margin-top:.86rem;
}

.reader-primary-nav .reader-menu-links{
  margin-top:.86rem;
}

.reader-study-tools{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.48rem;
  margin-top:.56rem;
  padding-top:.72rem;
  border-top:1px solid rgba(212,176,106,.1);
}

.reader-study-kicker{
  margin:0 0 .08rem;
  color:rgba(212,176,106,.66);
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.58rem;
  letter-spacing:.18em;
  text-transform:uppercase;
}

.reader-study-tools .menu-link{
  justify-content:center;
  text-align:center;
}

.reader-secondary-root{
  margin:.95rem 0 0;
  padding-top:.96rem;
  border-top:1px solid rgba(212,176,106,.12);
}

.reader-config-root{
  margin-top:.2rem;
}

.reader-about-launcher{
  margin-top:.72rem;
  border-color:rgba(212,176,106,.2);
  background:linear-gradient(180deg,rgba(212,176,106,.035),rgba(212,176,106,.012));
}

.menu-nav-item{
  position:relative;
  display:block;
}

.chapter-menu-panel .menu-link{
  min-height:42px;
  padding:.75rem .9rem;
  border-radius:10px;
  background:transparent;
  border-color:rgba(212,176,106,.12);
  transition:border-color .22s var(--ease),background .22s var(--ease),color .22s var(--ease);
}

.chapter-menu-panel .menu-link:hover,
.chapter-menu-panel .menu-link:focus-visible{
  transform:none;
  border-color:rgba(212,176,106,.34);
  background:rgba(212,176,106,.055);
  color:var(--gold1);
  outline:none;
}

.menu-help-bubble{
  position:absolute;
  right:calc(100% + .78rem);
  left:auto;
  top:50%;
  z-index:1003;
  width:min(17rem,calc(100vw - 4rem));
  padding:.72rem .84rem .78rem;
  border-radius:8px;
  border:1px solid rgba(226,174,82,.34);
  background:linear-gradient(180deg,rgba(58,40,20,.98),rgba(25,16,9,.98));
  color:rgba(255,241,214,.9);
  backdrop-filter:blur(12px);
  font-size:.84rem;
  line-height:1.42;
  box-shadow:0 16px 38px rgba(0,0,0,.32),
             0 0 0 1px rgba(255,255,255,.04) inset,
             0 0 28px rgba(212,148,54,.08);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate(.45rem,-50%);
  transition:opacity .18s var(--ease),transform .18s var(--ease),visibility 0s linear .18s;
}

.menu-help-bubble::before{
  content:'';
  position:absolute;
  top:50%;
  right:-5px;
  width:.55rem;
  height:.55rem;
  border-top:1px solid rgba(226,174,82,.34);
  border-right:1px solid rgba(226,174,82,.34);
  background:rgba(25,16,9,.98);
  transform:translateY(-50%) rotate(45deg);
}

.menu-nav-item:hover .menu-help-bubble,
.menu-nav-item:focus-within .menu-help-bubble{
  opacity:1;
  visibility:visible;
  transform:translate(0,-50%);
  transition:opacity .18s var(--ease),transform .18s var(--ease);
}

.home-menu-links .menu-help-bubble,
.book-menu-links .menu-help-bubble,
.chapter-menu-panel .menu-help-bubble{
  display:none;
}

.book-menu-links .menu-help-bubble{display:none}

.menu-floating-tip{
  position:fixed;
  z-index:1004;
  top:0;left:0;
  width:max-content;
  padding:.72rem .84rem .78rem;
  border-radius:8px;
  border:1px solid rgba(226,174,82,.34);
  background:linear-gradient(180deg,rgba(58,40,20,.98),rgba(25,16,9,.98));
  color:rgba(255,241,214,.9);
  backdrop-filter:blur(12px);
  font-size:.84rem;
  line-height:1.42;
  box-shadow:0 16px 38px rgba(0,0,0,.32),
             0 0 0 1px rgba(255,255,255,.04) inset,
             0 0 28px rgba(212,148,54,.08);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate(.45rem,-50%);
  transition:opacity .18s var(--ease),transform .18s var(--ease),visibility 0s linear .18s;
}

.menu-floating-tip.visible{
  opacity:1;
  visibility:visible;
  transform:translate(0,-50%);
  transition:opacity .18s var(--ease),transform .18s var(--ease);
}

.menu-floating-tip.is-right{
  transform:translate(-.45rem,-50%);
}

.menu-floating-tip.is-right.visible{
  transform:translate(0,-50%);
}

.menu-floating-tip::before{
  content:'';
  position:absolute;
  top:50%;
  right:-5px;
  width:.55rem;
  height:.55rem;
  border-top:1px solid rgba(226,174,82,.34);
  border-right:1px solid rgba(226,174,82,.34);
  background:rgba(25,16,9,.98);
  transform:translateY(-50%) rotate(45deg);
}

.menu-floating-tip.is-right::before{
  right:auto;
  left:-5px;
  border-top:none;
  border-right:none;
  border-bottom:1px solid rgba(226,174,82,.34);
  border-left:1px solid rgba(226,174,82,.34);
}

.menu-flyout[hidden]{
  display:none !important;
}

.home-menu-panel .compact-menu-section,
.chapter-menu-panel .compact-menu-section{
  position:relative;
  margin-top:.62rem;
}

.book-menu-links + .compact-menu-section,
.chapter-menu-panel .reader-menu-links + .compact-menu-section{
  margin-top:1.05rem;
}

.menu-select-trigger{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.85rem;
  padding:.72rem .9rem;
  border-radius:10px;
  border:1px solid rgba(212,176,106,.12);
  background:rgba(212,176,106,.035);
  color:var(--txt);
  text-align:left;
  cursor:pointer;
  transition:border-color .22s var(--ease),background .22s var(--ease),color .22s var(--ease);
}

.menu-select-trigger span{
  min-width:0;
  font-family:'JetBrains Mono',Consolas,monospace;
  font-size:.64rem;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:rgba(232,224,208,.62);
}

.menu-select-trigger strong{
  margin-left:auto;
  color:var(--gold2);
  font-family:'Crimson Pro',Georgia,serif;
  font-size:1rem;
  font-weight:500;
  white-space:nowrap;
}

.menu-select-trigger::after{
  content:'';
  width:.42rem;
  height:.42rem;
  border-right:1px solid currentColor;
  border-bottom:1px solid currentColor;
  opacity:.48;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .22s var(--ease),opacity .22s var(--ease);
}

.menu-select-trigger:hover,
.menu-select-trigger:focus-visible,
.menu-select-trigger[aria-expanded='true']{
  border-color:rgba(212,176,106,.34);
  background:rgba(212,176,106,.065);
  outline:none;
}

.menu-select-trigger[aria-expanded='true']::after{
  opacity:.72;
  transform:rotate(225deg) translateY(-1px);
}

.menu-flyout{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + .38rem);
  z-index:1002;
  padding:.34rem;
  border-radius:10px;
  border:1px solid rgba(212,176,106,.18);
  background:rgba(16,12,8,.98);
  backdrop-filter:blur(10px);
  box-shadow:0 18px 42px rgba(0,0,0,.28),0 0 0 1px rgba(255,255,255,.025) inset;
}

.menu-flyout.font-size-group{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.34rem;
}

.menu-flyout.font-family-group{
  display:grid;
  gap:.34rem;
}

.menu-flyout.theme-toggle{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.34rem;
}

.home-menu-panel .compact-menu-section:has(.font-size-group:not([hidden])),
.home-menu-panel .compact-menu-section:has(.theme-toggle:not([hidden])),
.chapter-menu-panel .compact-menu-section:has(.font-size-group:not([hidden])),
.chapter-menu-panel .compact-menu-section:has(.theme-toggle:not([hidden])){
  margin-bottom:3.45rem;
}

.home-menu-panel .compact-menu-section:has(.font-family-group:not([hidden])),
.chapter-menu-panel .compact-menu-section:has(.font-family-group:not([hidden])){
  margin-bottom:8.8rem;
}

.home-menu-panel .menu-flyout .font-size-btn,
.home-menu-panel .menu-flyout .font-family-btn,
.home-menu-panel .menu-flyout .theme-pill,
.chapter-menu-panel .menu-flyout .font-size-btn,
.chapter-menu-panel .menu-flyout .font-family-btn,
.chapter-menu-panel .menu-flyout .theme-pill{
  min-height:38px;
  padding:.55rem .65rem;
  border-radius:8px;
  border-color:transparent;
  background:transparent;
  box-shadow:none;
}

.home-menu-panel .menu-flyout .font-family-btn,
.chapter-menu-panel .menu-flyout .font-family-btn{
  text-align:left;
}

.home-menu-panel .menu-flyout .font-size-btn:hover,
.home-menu-panel .menu-flyout .font-family-btn:hover,
.home-menu-panel .menu-flyout .theme-pill:hover,
.chapter-menu-panel .menu-flyout .font-size-btn:hover,
.chapter-menu-panel .menu-flyout .font-family-btn:hover,
.chapter-menu-panel .menu-flyout .theme-pill:hover{
  color:var(--gold1);
  border-color:rgba(212,176,106,.18);
  background:rgba(212,176,106,.055);
}

.home-menu-panel .menu-flyout .font-size-btn.active,
.home-menu-panel .menu-flyout .font-family-btn.active,
.home-menu-panel .menu-flyout .theme-pill.active,
.chapter-menu-panel .menu-flyout .font-size-btn.active,
.chapter-menu-panel .menu-flyout .font-family-btn.active,
.chapter-menu-panel .menu-flyout .theme-pill.active{
  color:var(--gold1);
  border-color:rgba(212,176,106,.34);
  background:rgba(212,176,106,.12);
  box-shadow:none;
}

html[data-theme='light'] .chapter-menu-panel .menu-link,
html[data-theme='light'] .menu-select-trigger{
  border-color:rgba(116,82,42,.14);
}

html[data-theme='light'] .settings-menu-item{
  border-color:rgba(116,82,42,.14);
  background:linear-gradient(180deg,rgba(148,107,60,.055),rgba(148,107,60,.025));
  color:#4f321d;
}

html[data-theme='light'] .settings-menu-item small{
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .settings-menu-item:hover,
html[data-theme='light'] .settings-menu-item:focus-visible{
  border-color:rgba(116,82,42,.26);
  background:linear-gradient(180deg,rgba(148,107,60,.11),rgba(148,107,60,.045));
}

html[data-theme='light'] .reader-primary-nav{
  border-color:rgba(116,82,42,.14);
  background:
    linear-gradient(145deg,rgba(148,107,60,.075),rgba(255,250,242,.72) 58%,rgba(148,107,60,.03)),
    rgba(255,250,242,.58);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.44);
}

html[data-theme='light'] .reader-primary-head h3{
  color:#4f321d;
}

html[data-theme='light'] .reader-secondary-root{
  border-top-color:rgba(116,82,42,.12);
}

html[data-theme='light'] .reader-about-launcher{
  border-color:rgba(116,82,42,.16);
  background:linear-gradient(180deg,rgba(148,107,60,.035),rgba(148,107,60,.012));
}

html[data-theme='light'] .home-menu-search{
  border-color:rgba(116,82,42,.13);
  background:
    linear-gradient(145deg,rgba(148,107,60,.08),rgba(255,250,242,.7) 56%,rgba(148,107,60,.035)),
    rgba(255,250,242,.62);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.46);
}

html[data-theme='light'] .home-menu-search-head label{
  color:#4f321d;
}

html[data-theme='light'] .home-menu-search-kicker,
html[data-theme='light'] .home-menu-search-status,
html[data-theme='light'] .home-menu-search-badge{
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .home-menu-search-box{
  border-color:rgba(116,82,42,.18);
  background:rgba(255,249,239,.82);
}

html[data-theme='light'] .home-menu-search-box:focus-within{
  border-color:rgba(126,91,44,.34);
  background:rgba(255,251,244,.94);
  box-shadow:0 0 0 3px rgba(148,107,60,.08),0 14px 30px rgba(80,52,24,.08);
}

html[data-theme='light'] .home-menu-search-icon{
  color:rgba(116,82,42,.58);
}

html[data-theme='light'] .home-menu-search-box input{
  color:#3d2818;
}

html[data-theme='light'] .home-menu-search-box input::placeholder{
  color:rgba(72,50,30,.48);
}

html[data-theme='light'] .home-menu-search-box button{
  border-left-color:rgba(116,82,42,.14);
  background:rgba(148,107,60,.08);
  color:#5c3b1e;
}

html[data-theme='light'] .home-menu-search-result{
  border-left-color:rgba(116,82,42,.2);
  background:linear-gradient(90deg,rgba(148,107,60,.07),transparent 72%);
}

html[data-theme='light'] .home-menu-search-result-link{
  color:#5c3b1e;
}

html[data-theme='light'] .home-menu-search-excerpt,
html[data-theme='light'] .home-menu-search-empty{
  color:rgba(55,36,22,.78);
}

html[data-theme='light'] .about-project::before{
  background:rgba(116,82,42,.28);
}

html[data-theme='light'] .about-project-title{
  color:#4f321d;
}

html[data-theme='light'] .about-project-copy{
  color:rgba(55,36,22,.76);
}

html[data-theme='light'] .about-contact{
  border:0;
  border-bottom:1px solid rgba(116,82,42,.26);
  background:transparent;
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .about-contact strong{
  color:#6d451d;
}

html[data-theme='light'] .about-contact:hover,
html[data-theme='light'] .about-contact:focus-visible{
  border-color:rgba(116,82,42,.42);
  background:transparent;
}

html[data-theme='light'] .settings-back{
  color:rgba(98,66,32,.74);
}

html[data-theme='light'] .menu-select-trigger{
  background:rgba(148,107,60,.045);
}

html[data-theme='light'] .menu-select-trigger span,
html[data-theme='light'] .menu-help-bubble{
  color:rgba(72,50,30,.62);
}

html[data-theme='light'] .menu-help-bubble{
  border-color:rgba(148,94,35,.32);
  background:linear-gradient(180deg,rgba(255,244,222,.98),rgba(232,205,164,.98));
  color:rgba(63,38,18,.86);
  box-shadow:0 16px 38px rgba(92,74,36,.16),0 0 0 1px rgba(255,255,255,.58) inset;
}

html[data-theme='light'] .menu-help-bubble::before{
  border-top-color:rgba(148,94,35,.32);
  border-right-color:rgba(148,94,35,.32);
  background:rgba(232,205,164,.98);
}

html[data-theme='light'] .menu-floating-tip{
  border-color:rgba(148,94,35,.32);
  background:linear-gradient(180deg,rgba(255,244,222,.98),rgba(232,205,164,.98));
  color:rgba(63,38,18,.86);
  box-shadow:0 16px 38px rgba(92,74,36,.16),0 0 0 1px rgba(255,255,255,.58) inset;
}

html[data-theme='light'] .menu-floating-tip::before{
  border-top-color:rgba(148,94,35,.32);
  border-right-color:rgba(148,94,35,.32);
  background:rgba(232,205,164,.98);
}

html[data-theme='light'] .menu-floating-tip.is-right::before{
  border-top:none;
  border-right:none;
  border-bottom:1px solid rgba(148,94,35,.32);
  border-left:1px solid rgba(148,94,35,.32);
  background:rgba(232,205,164,.98);
}

html[data-theme='light'] .menu-flyout{
  border-color:rgba(116,82,42,.18);
  background:rgba(247,240,230,.98);
  box-shadow:0 18px 42px rgba(92,74,36,.14),0 0 0 1px rgba(255,255,255,.55) inset;
}

html[data-theme='light'] .home-menu-panel .menu-flyout .font-size-btn.active,
html[data-theme='light'] .home-menu-panel .menu-flyout .font-family-btn.active,
html[data-theme='light'] .home-menu-panel .menu-flyout .theme-pill.active,
html[data-theme='light'] .chapter-menu-panel .menu-flyout .font-size-btn.active,
html[data-theme='light'] .chapter-menu-panel .menu-flyout .font-family-btn.active,
html[data-theme='light'] .chapter-menu-panel .menu-flyout .theme-pill.active{
  color:#4f321d;
  border-color:rgba(116,82,42,.34);
  background:rgba(148,107,60,.12);
}

@media(max-width:640px){
  .chapter-menu-panel{
    padding:4.8rem 1.1rem 1.3rem;
  }

  .chapter-menu-panel .menu-title{
    margin-right:3.2rem;
    margin-bottom:1.05rem;
  }

  .chapter-menu-panel .menu-link,
  .menu-select-trigger{
    min-height:41px;
  }

  .menu-flyout{
    position:static;
    margin-top:.42rem;
  }

  .home-menu-panel .compact-menu-section:has(.font-size-group:not([hidden])),
  .home-menu-panel .compact-menu-section:has(.font-family-group:not([hidden])),
  .home-menu-panel .compact-menu-section:has(.theme-toggle:not([hidden])),
  .chapter-menu-panel .compact-menu-section:has(.font-size-group:not([hidden])),
  .chapter-menu-panel .compact-menu-section:has(.font-family-group:not([hidden])),
  .chapter-menu-panel .compact-menu-section:has(.theme-toggle:not([hidden])){
    margin-bottom:.62rem;
  }

  .menu-help-bubble{
    display:none;
  }

  .menu-floating-tip{
    display:none;
  }
}

/* V13 review pass: chapter CTA as a quiet typographic command, not a box. */
.chapter-hero .hero-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:0;
  min-height:44px;
  margin-top:clamp(2.6rem,6vh,4.1rem);
  padding:.18rem 1.35rem .54rem;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:var(--gold3);
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:clamp(1.25rem,2vw,1.48rem);
  font-style:italic;
  font-weight:600;
  letter-spacing:.018em;
  line-height:1.05;
  text-transform:none;
  overflow:visible;
  text-shadow:0 0 22px rgba(212,176,106,.08);
  transition:color .24s var(--ease),opacity .24s var(--ease),transform .24s var(--ease);
}

.chapter-hero .hero-btn::before{
  display:none;
}

.chapter-hero .hero-btn::after{
  content:'';
  position:absolute;
  left:50%;
  bottom:.12rem;
  width:calc(100% + 1.4rem);
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,176,106,.62),transparent);
  transform:translateX(-50%);
  transition:width .24s var(--ease),background .24s var(--ease),opacity .24s var(--ease);
}

.chapter-hero .hero-btn:hover,
.chapter-hero .hero-btn:focus-visible{
  transform:none;
  background:transparent;
  box-shadow:none;
  color:var(--gold1);
  outline:none;
}

.chapter-hero .hero-btn:hover::after,
.chapter-hero .hero-btn:focus-visible::after{
  width:calc(100% + 2.1rem);
  background:linear-gradient(90deg,transparent,rgba(245,216,145,.82),transparent);
}

.chapter-hero .hero-btn:focus-visible{
  outline:1px solid rgba(212,176,106,.28);
  outline-offset:.42rem;
}

html[data-theme='light'] .chapter-hero .hero-btn{
  background:transparent;
  color:#8a6427;
}

html[data-theme='light'] .chapter-hero .hero-btn::after{
  background:linear-gradient(90deg,transparent,rgba(138,100,39,.48),transparent);
}

html[data-theme='light'] .chapter-hero .hero-btn:hover,
html[data-theme='light'] .chapter-hero .hero-btn:focus-visible{
  background:transparent;
  color:#3d2818;
}

html[data-theme='light'] .chapter-hero .hero-btn:hover::after,
html[data-theme='light'] .chapter-hero .hero-btn:focus-visible::after{
  background:rgba(116,82,42,.5);
}

body.page-book .book-progress-strip{
  width:min(100%,28rem);
  margin:1.2rem auto 0;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}

body.page-book .book-progress-meta{
  flex-direction:row;
  align-items:center;
  justify-content:center;
  text-align:center;
}

body.page-book .book-progress-strip .gp-bar{
  margin:.65rem 0 0;
}

@media(max-width:640px){
  .chapter-hero .hero-btn{
    width:auto;
    max-width:100%;
    min-height:44px;
    margin-top:2.2rem;
  }
}

/* Adaptive auth navigation: platform-aligned app bar plus mobile bottom nav. */
body.page-home .home-main{
  padding-top:8.75rem;
}

body.page-book .book-shell{
  margin-top:8.75rem;
  padding-top:0;
}

body:not(.page-home):not(.page-book) .chapter-hero{
  padding-top:8.75rem;
}

html[data-theme='light'] .primary-nav,
html[data-theme='light'] .mobile-bottom-nav{
  background:rgba(249,243,233,.88);
  border-color:rgba(126,91,44,.16);
}

html[data-theme='light'] .app-auth-control,
html[data-theme='light'] .primary-nav-item:hover,
html[data-theme='light'] .primary-nav-item.active,
html[data-theme='light'] .mobile-nav-item:hover,
html[data-theme='light'] .mobile-nav-item.active{
  background:rgba(116,82,42,.08);
  border-color:rgba(116,82,42,.18);
}

@media(max-width:900px){
  .primary-nav{
    max-width:calc(100vw - 2rem);
  }
}

@media(max-width:640px){
  body{
    padding-bottom:calc(70px + env(safe-area-inset-bottom));
  }

  .app-topbar{
    top:calc(.75rem + env(safe-area-inset-top));
    left:calc(.75rem + env(safe-area-inset-left));
    right:calc(.75rem + env(safe-area-inset-right));
    width:auto;
    min-height:58px;
    padding:0;
  }

  .hamburger-shell{
    width:46px;
    height:46px;
  }

  .app-auth-control{
    max-width:30vw;
    min-height:42px;
    padding:.58rem .72rem;
    font-size:.6rem;
  }

  .auth-popover{
    top:calc(4.9rem + env(safe-area-inset-top));
    right:calc(.75rem + env(safe-area-inset-right));
    left:calc(.75rem + env(safe-area-inset-left));
    width:auto;
    max-height:calc(100svh - 7rem);
    overflow-y:auto;
    padding:.85rem;
    border-radius:18px;
  }

  .auth-popover h2{
    font-size:1.5rem;
  }

  .auth-tabs{
    border-radius:18px;
  }

  .auth-tab{
    font-size:.56rem;
    letter-spacing:.04em;
  }

  .primary-nav{
    display:none;
  }

  .mobile-bottom-nav{
    position:fixed;
    left:calc(.55rem + env(safe-area-inset-left));
    right:calc(.55rem + env(safe-area-inset-right));
    bottom:.55rem;
    z-index:982;
    height:58px;
    min-height:0;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:1fr;
    align-items:center;
    gap:.25rem;
    padding:6px 7px;
    box-sizing:border-box;
    overflow:hidden;
    border:1px solid rgba(212,176,106,.16);
    border-radius:20px;
    background:rgba(8,6,4,.96);
    backdrop-filter:blur(18px);
    box-shadow:0 12px 36px rgba(0,0,0,.26),inset 0 1px 0 rgba(248,237,214,.04);
  }

  .mobile-bottom-nav .mobile-nav-item{
    min-width:0;
    height:44px;
    min-height:44px;
    border-radius:15px;
    padding:0 .2rem;
    font-size:.58rem;
    line-height:1;
    letter-spacing:.04em;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  body.page-home .home-main{
    min-height:100svh;
    padding-top:5.6rem;
    padding-bottom:1rem;
  }

  body.page-home .home-stage-hero{
    min-height:calc(100svh - 10rem);
  }

  body.page-book .book-shell{
    margin-top:5.6rem;
    margin-bottom:1rem;
    padding-top:0;
  }

  body.page-book .book-hero{
    min-height:calc(100svh - 6rem);
    align-content:center;
    padding-bottom:7rem;
  }

  body:not(.page-home):not(.page-book) .chapter-hero{
    padding-top:5.8rem;
    padding-bottom:7.5rem;
  }

  .home-menu-panel{
    padding-top:calc(1.2rem + env(safe-area-inset-top));
  }

  .footer,
  .home-footer.footer{
    padding-bottom:calc(6.5rem + env(safe-area-inset-bottom));
  }

}

/* Mobile UX SPEC: capability-first refinements for small touch screens. */
@media(max-width:900px){
  html[data-input-mode='touch'] .primary-nav,
  html[data-input-mode='hybrid'] .primary-nav{
    max-width:calc(100% - 2rem);
  }

  html[data-input-mode='touch'] .app-menu-button,
  html[data-input-mode='touch'] .app-auth-control,
  html[data-input-mode='touch'] .mobile-nav-item,
  html[data-input-mode='hybrid'] .app-menu-button,
  html[data-input-mode='hybrid'] .app-auth-control,
  html[data-input-mode='hybrid'] .mobile-nav-item{
    min-height:44px;
  }
}

@media(max-width:640px){
  body{
    min-height:100dvh;
  }

  .app-shell,
  .book-shell,
  .home-main{
    min-height:100dvh;
  }

  .home-menu-panel{
    width:100%;
    max-width:100%;
    height:100dvh;
    min-height:100dvh;
    padding-bottom:calc(2rem + env(safe-area-inset-bottom));
  }

  .reader-sheet,
  .map-panel,
  .auth-popover{
    max-height:calc(100dvh - 1rem);
  }

  .reader-sheet,
  .map-panel{
    width:100%;
    max-width:100%;
    height:100dvh;
    padding-bottom:calc(2rem + env(safe-area-inset-bottom));
  }

  .auth-popover{
    bottom:auto;
  }

  .mobile-bottom-nav{
    padding-bottom:6px;
  }
}

@media(max-width:640px) and (max-height:700px){
  body.page-home .home-stage-hero{padding-bottom:5rem}
}

@media(max-width:640px) and (max-height:540px){
  body.page-home .home-title-line-sm{font-size:1.35rem}
  body.page-home .home-title-line-xl{font-size:2.8rem}
  body.page-home .home-title-line-md{font-size:1.45rem}
  body.page-home .home-subtitle{font-size:.84rem}
  body.page-home .home-stage-hero{gap:.55rem;padding-bottom:5rem}
  body.page-home .hero-actions{gap:.45rem}
  body.page-home .hero-cta{min-height:44px}
}

@media(max-width:430px){
  .app-topbar{
    left:calc(.65rem + env(safe-area-inset-left));
    right:calc(.65rem + env(safe-area-inset-right));
  }

  .app-auth-control{
    max-width:34vw;
  }

  .home-title-line{
    width:auto;
    max-width:100%;
    white-space:nowrap;
  }

  .home-title-line-sm{font-size:1.9rem}
  .home-title-line-xl{font-size:4.2rem}
  .home-title-line-md{font-size:2.45rem}

  .settings-menu-item,
  .menu-link,
  .menu-select-trigger{
    min-height:48px;
  }

  .auth-popover{
    top:calc(4.6rem + env(safe-area-inset-top));
  }
}

@media(max-width:359px){
  .app-topbar{
    left:calc(.5rem + env(safe-area-inset-left));
    right:calc(.5rem + env(safe-area-inset-right));
  }

  .hamburger-shell{
    width:44px;
    height:44px;
  }

  .app-auth-control{
    max-width:38vw;
    padding:.5rem .58rem;
    font-size:.54rem;
  }

  .home-title-line-sm{font-size:1.55rem}
  .home-title-line-xl{font-size:3.45rem}
  .home-title-line-md{font-size:2rem}

  .mobile-nav-item{
    font-size:.52rem;
  }
}

/* V11 cartography background pass: make the parallax map read as an etched layer. */
body::before{
  inset:-8%;
  background-image:
    radial-gradient(ellipse at 50% 20%,rgba(212,176,106,.18),transparent 31%),
    linear-gradient(90deg,rgba(2,2,1,.62),rgba(8,6,4,.12) 36%,rgba(4,3,2,.32) 68%,rgba(2,2,1,.7)),
    linear-gradient(180deg,rgba(7,5,3,.8),rgba(7,5,3,.2) 34%,rgba(7,5,3,.72)),
    url('assets/canaan-map-bg.png');
  background-size:cover;
  background-position:center 15%;
  background-blend-mode:screen,multiply,multiply,normal;
  opacity:.3;
  filter:sepia(.08) saturate(.92) contrast(1.18) brightness(.76) blur(.18px);
  -webkit-mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.98) 0, rgba(0,0,0,.78) 24%, rgba(0,0,0,.5) 43%, rgba(0,0,0,.18) 63%, transparent 82%);
  mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.98) 0, rgba(0,0,0,.78) 24%, rgba(0,0,0,.5) 43%, rgba(0,0,0,.18) 63%, transparent 82%);
  transform:translate3d(0,var(--page-parallax),0) scale(1.12);
}

body::after{
  background:
    radial-gradient(circle at 50% 40%,rgba(212,176,106,.105),transparent 30rem),
    radial-gradient(ellipse at 50% 50%,transparent 0,rgba(0,0,0,.18) 58%,rgba(0,0,0,.58) 100%),
    linear-gradient(180deg,rgba(8,6,4,.14),rgba(8,6,4,.05) 26%,rgba(8,6,4,.36));
}

.atmosphere-canvas{
  opacity:.72;
}

body.page-home::before{
  opacity:.36;
  background-position:center 12%;
  filter:sepia(.08) saturate(.92) contrast(1.18) brightness(.76) blur(.18px);
  -webkit-mask-image:radial-gradient(circle at 50% 26%, rgba(0,0,0,.98) 0, rgba(0,0,0,.8) 24%, rgba(0,0,0,.54) 45%, rgba(0,0,0,.22) 65%, transparent 84%);
  mask-image:radial-gradient(circle at 50% 26%, rgba(0,0,0,.98) 0, rgba(0,0,0,.8) 24%, rgba(0,0,0,.54) 45%, rgba(0,0,0,.22) 65%, transparent 84%);
}

body.page-home::after{
  background:
    radial-gradient(circle at 50% 40%,rgba(212,176,106,.12),transparent 29rem),
    radial-gradient(ellipse at 50% 52%,transparent 0,rgba(0,0,0,.18) 58%,rgba(0,0,0,.55) 100%),
    linear-gradient(180deg,rgba(8,6,4,.12),rgba(8,6,4,.08) 30%,rgba(8,6,4,.42));
}

body.page-book::before,
body:not(.page-home):not(.page-book)::before{
  opacity:.26;
  filter:sepia(.08) saturate(.92) contrast(1.18) brightness(.76) blur(.18px);
}

body.page-book::after{
  background:
    radial-gradient(circle at 50% 34%,rgba(212,176,106,.08),transparent 28rem),
    linear-gradient(180deg,rgba(8,6,4,.18),rgba(8,6,4,.16) 34%,rgba(8,6,4,.38));
}

html[data-theme='light'] body::before{
  background-image:
    radial-gradient(ellipse at 50% 18%,rgba(116,82,42,.22),transparent 30%),
    linear-gradient(90deg,rgba(255,251,244,.74),rgba(255,251,244,.18) 34%,rgba(222,199,160,.2) 70%,rgba(255,251,244,.72)),
    linear-gradient(180deg,rgba(255,251,244,.72),rgba(239,224,199,.1) 35%,rgba(202,181,146,.3)),
    url('assets/canaan-map-bg.png');
  background-blend-mode:multiply,soft-light,multiply,normal;
  opacity:.31;
  filter:sepia(.22) saturate(.92) contrast(1.18) brightness(1.01) blur(.16px);
  -webkit-mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.96) 0, rgba(0,0,0,.78) 24%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.2) 65%, transparent 84%);
  mask-image:radial-gradient(circle at 50% 24%, rgba(0,0,0,.96) 0, rgba(0,0,0,.78) 24%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.2) 65%, transparent 84%);
}

html[data-theme='light'] body::after{
  background:
    radial-gradient(circle at 50% 22%,rgba(255,251,244,.54),transparent 22rem),
    radial-gradient(ellipse at 50% 55%,transparent 0,rgba(126,91,44,.08) 68%,rgba(126,91,44,.16) 100%),
    linear-gradient(180deg,rgba(255,251,244,.2),rgba(232,219,196,.22) 42%,rgba(210,190,157,.2));
}

html[data-theme='light'] .atmosphere-canvas{
  opacity:.24;
  mix-blend-mode:multiply;
}

html[data-theme='light'] body.page-home::before{
  opacity:.38;
  filter:sepia(.22) saturate(.92) contrast(1.18) brightness(1.01) blur(.16px);
}

html[data-theme='light'] body.page-home::after{
  background:
    radial-gradient(circle at 50% 40%,rgba(255,249,239,.24),rgba(255,249,239,.46) 34rem),
    radial-gradient(ellipse at 50% 56%,transparent 0,rgba(126,91,44,.07) 70%,rgba(126,91,44,.14) 100%),
    linear-gradient(180deg,rgba(255,249,239,.18),rgba(232,219,196,.3));
}

html[data-theme='light'] body.page-book::before,
html[data-theme='light'] body:not(.page-home):not(.page-book)::before{
  opacity:.3;
  filter:sepia(.22) saturate(.92) contrast(1.18) brightness(1.01) blur(.16px);
}

html[data-theme='light'] body.page-book::after{
  background:
    radial-gradient(circle at 50% 28%,rgba(255,251,244,.42),transparent 24rem),
    linear-gradient(180deg,rgba(232,221,202,.18),rgba(232,221,202,.22) 35%,rgba(190,170,136,.18));
}

@media(max-width:640px){
  body::before{
    inset:-5%;
    background-position:center top;
    transform:translate3d(0,var(--page-parallax),0) scale(1.06);
    -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.6) 45%,rgba(0,0,0,.24) 75%,transparent 100%);
    mask-image:linear-gradient(180deg,rgba(0,0,0,.9),rgba(0,0,0,.6) 45%,rgba(0,0,0,.24) 75%,transparent 100%);
  }
}
