/* ── Portal Cápsulas de Lucidez · identidade ritual escura ─────────────── */

:root {
  /* modo escuro (padrão): contraste reduzido para conforto de leitura */
  --vinho-fundo: #1C0D0F;      /* um degrau acima do tom da capa (#180808) */
  --vinho-profundo: #130709;
  --vinho-painel: #251114;
  --vinho-borda: #351B1E;
  --ouro: #C9A24B;
  --ouro-claro: #E3C685;
  --ouro-veu: rgba(201, 162, 75, 0.35);
  --creme: #CFC5B4;            /* corpo do texto */
  --titulo: #F5EFE4;           /* títulos mantêm mais brilho */
  --apaga-1: #A99F8E;
  --apaga-2: #837B6C;
  --apaga-3: #575145;
  --apaga-4: #332F27;
  --erro: #C97B6B;
  --serif: "Cormorant Garamond", Garamond, serif;
  --sans: "Montserrat", "Segoe UI", sans-serif;
}

/* modo claro sépia (alternável nas páginas de Cápsula) */
.modo-claro {
  --vinho-fundo: #F3EEE5;
  --vinho-profundo: #EAE3D6;
  --vinho-painel: #EDE7DA;
  --vinho-borda: #CFC7B8;
  --ouro: #96742C;
  --ouro-claro: #7A5D20;
  --ouro-veu: rgba(150, 116, 44, 0.4);
  --creme: #262219;
  --titulo: #1F1B13;
  --apaga-1: #4E4638;
  --apaga-2: #736B5A;
  --apaga-3: #A29A87;
  --apaga-4: #CBC3B1;
  --erro: #A2452F;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(64, 18, 20, 0.35) 0%, transparent 60%),
    var(--vinho-fundo);
  color: var(--creme);
  font-family: var(--serif);
  font-size: 1.25rem;      /* 20px — corpo de leitura */
  font-weight: 500;        /* evita serifas finas demais no fundo escuro */
  line-height: 1.9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.modo-claro body {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201, 162, 75, 0.08) 0%, transparent 60%),
    var(--vinho-fundo);
}

main { flex: 1; width: 100%; }

a { color: var(--ouro); text-decoration: none; }
a:hover { color: var(--ouro-claro); }

em { font-style: italic; }

/* ── rótulos sans ── */
.rotulo, .topo .marca span, .rodape-assinatura, .parte-rotulo, .cap-rotulo {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: var(--ouro);
}

/* ── topo ── */
.topo {
  display: flex;
  justify-content: center;
  padding: 2.2rem 1rem 1.6rem;
}
.marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.glifo { width: 17px; height: 28px; opacity: 0.9; }

/* ── rodapé ── */
.rodape {
  text-align: center;
  padding: 4.5rem 1rem 3rem;
}
.glifo-rodape { margin-bottom: 0.9rem; opacity: 0.6; }
.rodape-assinatura { margin-bottom: 0.4rem; }
.rodape-site a {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--apaga-2);
}
.rodape-site a:hover { color: var(--ouro); }

/* ── página do livro ── */
.hero {
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 0 1.4rem;
  text-align: center;
}
.hero .capa {
  width: min(310px, 72vw);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--vinho-borda);
  margin-bottom: 2.6rem;
}
.hero .colecao { margin-bottom: 1.6rem; }
.titulo-livro {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.12;
  color: var(--titulo);
}
.titulo-livro .quase { color: var(--ouro); }
.subtitulo {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--apaga-1);
  margin-top: 0.9rem;
}
.autora {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--apaga-1);
}

.epigrafe {
  max-width: 480px;
  margin: 4.5rem auto 0;
  padding: 0 1.4rem;
  text-align: center;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--apaga-1);
}
.epigrafe p + p { margin-top: 0.2rem; }

/* divisor com chama */
.divisor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin: 4.2rem auto;
  max-width: 420px;
  padding: 0 1.4rem;
}
.divisor::before, .divisor::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ouro-veu));
}
.divisor::after { background: linear-gradient(90deg, var(--ouro-veu), transparent); }
.divisor .glifo { opacity: 0.65; }

/* ── sumário ── */
.sumario {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 1.4rem;
}
.sumario-titulo {
  text-align: center;
  margin-bottom: 3rem;
}
.parte { margin-bottom: 3rem; }
.parte-rotulo {
  display: block;
  text-align: center;
  margin-bottom: 0.4rem;
  color: var(--apaga-2);
}
.parte-nome {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--ouro);
  margin-bottom: 1.6rem;
}
.lista-capsulas { list-style: none; }
.lista-capsulas li + li { margin-top: 0.25rem; }
.lista-capsulas a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 3px;
  color: var(--creme);
  transition: background 0.25s ease, color 0.25s ease;
}
.lista-capsulas a:hover { background: rgba(201, 162, 75, 0.07); color: var(--ouro-claro); }
.lista-capsulas .num {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--ouro);
  white-space: nowrap;
}
.lista-capsulas .nome { font-size: 1.22rem; line-height: 1.4; }

.leitura-aberta {
  list-style: none;
  max-width: 620px;
  margin: 0 auto 0;
  padding: 0 1.4rem;
  text-align: center;
}
.leitura-aberta a {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--apaga-1);
}
.leitura-aberta a:hover { color: var(--ouro-claro); }
.leitura-aberta .aberta {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--apaga-2);
  margin-left: 0.7rem;
  text-transform: lowercase;
}

/* ── seções de texto corrido (prólogo, prefácio, leitura) ── */
.secao-texto {
  max-width: 34em;   /* ~65 caracteres por linha */
  margin: 0 auto;
  padding: 0 1.4rem;
}
.secao-texto h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 2rem;
  color: var(--ouro);
  text-align: center;
  margin-bottom: 2.2rem;
}
.secao-texto p + p { margin-top: 1.15rem; }

/* ── página da cápsula ── */
.cap-cabeca {
  max-width: 620px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.4rem;
  text-align: center;
}
.cap-parte { color: var(--apaga-2); display: block; margin-bottom: 1.6rem; }
.cap-rotulo { display: block; margin-bottom: 0.7rem; }
.cap-titulo {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  line-height: 1.25;
  color: var(--titulo);
}

.antes-de-ler {
  max-width: 34em;
  margin: 0 auto 3.2rem;
  padding: 1.8rem 1.9rem;
  font-style: italic;
  font-size: 1.28rem;
  color: var(--apaga-1);
  border-top: 1px solid var(--ouro-veu);
  border-bottom: 1px solid var(--ouro-veu);
}
.antes-de-ler .rotulo { display: block; margin-bottom: 0.9rem; font-style: normal; }

.preview {
  max-width: 34em;
  margin: 0 auto;
  padding: 0 1.4rem;
}
.preview p + p { margin-top: 1.15rem; }
.preview p:nth-last-child(3) { color: var(--apaga-1); }
.preview p:nth-last-child(2) { color: var(--apaga-2); }
.preview p:nth-last-child(1) { color: var(--apaga-3); }
.preview .apaga { color: var(--apaga-4); }
.preview p:nth-last-child(1) {
  -webkit-mask-image: linear-gradient(180deg, #000 30%, rgba(0,0,0,0.25) 92%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 30%, rgba(0,0,0,0.25) 92%, transparent 100%);
}

/* ── cartão de desbloqueio ── */
.desbloqueio {
  max-width: 540px;
  margin: 0.6rem auto 0;
  padding: 3rem 2rem 2.8rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 12, 14, 0.0) 0%, var(--vinho-painel) 26%);
  border: 1px solid var(--vinho-borda);
  border-radius: 6px;
  position: relative;
}
.desbloqueio .glifo { width: 22px; height: 36px; margin-bottom: 1.2rem; }
.desbloqueio h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.9rem;
  color: var(--titulo);
  margin-bottom: 0.8rem;
}
.desbloqueio .frase {
  font-style: italic;
  font-size: 1.18rem;
  color: var(--apaga-1);
  max-width: 360px;
  margin: 0 auto 2rem;
}
.botao-ouro {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--vinho-profundo);
  background: linear-gradient(180deg, var(--ouro-claro), var(--ouro));
  padding: 1.05rem 2.4rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: filter 0.25s ease, transform 0.25s ease;
}
.botao-ouro:hover { filter: brightness(1.12); color: var(--vinho-profundo); }
.desbloqueio .preco {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--apaga-2);
}
.desbloqueio .livro-completo {
  margin-top: 2.1rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--vinho-borda);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--apaga-2);
}
.desbloqueio .livro-completo a {
  color: var(--ouro);
  border-bottom: 1px solid var(--ouro-veu);
  padding-bottom: 1px;
}
.desbloqueio .ja-tem {
  margin-top: 1.4rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--apaga-3);
}
.desbloqueio .ja-tem a { color: var(--apaga-2); }
.desbloqueio .ja-tem a:hover { color: var(--ouro); }

/* ── página de leitura (porta com senha) ── */
.porta {
  max-width: 460px;
  margin: 3rem auto;
  padding: 0 1.4rem;
  text-align: center;
}
.porta .glifo { width: 24px; height: 40px; margin-bottom: 1.6rem; }
.porta h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.3;
  color: var(--titulo);
  margin-bottom: 0.7rem;
}
.porta .instrucao {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--apaga-1);
  margin-bottom: 2.2rem;
}
.porta form { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.porta input {
  width: 100%;
  max-width: 320px;
  background: var(--vinho-profundo);
  border: 1px solid var(--vinho-borda);
  border-radius: 2px;
  color: var(--creme);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 0.95rem 1rem;
  outline: none;
  transition: border-color 0.25s ease;
}
.porta input:focus { border-color: var(--ouro-veu); }
.porta .erro {
  font-style: italic;
  color: var(--erro);
  font-size: 1.05rem;
  min-height: 1.6em;
}
.porta .nota {
  margin-top: 2rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--apaga-3);
  line-height: 2;
}
.porta .nota a { color: var(--apaga-2); }

/* ── leitura aberta (conteúdo decifrado) ── */
.leitor { display: none; }
.leitor.aberto { display: block; }
.leitor .cap-cabeca { margin-top: 2.5rem; }

.frases-destaque {
  max-width: 34em;
  margin: 3.5rem auto;
  padding: 0 1.4rem;
}
.frases-destaque h2 {
  text-align: center;
  margin-bottom: 2.4rem;
}
.frases-destaque blockquote {
  font-style: italic;
  font-size: 1.3rem;
  color: var(--apaga-1);
  border-left: 1px solid var(--ouro);
  padding: 0.35rem 0 0.35rem 1.5rem;
  margin-bottom: 1.8rem;
}

.depois-de-ler {
  max-width: 34em;
  margin: 0 auto 2rem;
  padding: 1.8rem 1.9rem;
  border-top: 1px solid var(--ouro-veu);
  border-bottom: 1px solid var(--ouro-veu);
}
.depois-de-ler .rotulo { display: block; margin-bottom: 0.9rem; }
.depois-de-ler p { font-style: italic; font-size: 1.24rem; color: var(--apaga-1); }
.depois-de-ler p + p { margin-top: 1.1rem; }

.proxima {
  text-align: center;
  margin-top: 3.5rem;
  padding: 0 1.4rem;
}
.proxima a {
  font-style: italic;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--ouro-veu);
  padding-bottom: 2px;
}

/* ── CTA do livro na home ── */
.cta-livro {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 1.4rem;
  text-align: center;
}
.cta-livro p {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--apaga-1);
  margin-bottom: 1.8rem;
}

/* ── navegação: sidebar / gaveta ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  z-index: 40;
  background: var(--vinho-profundo);
  border-right: 1px solid var(--vinho-borda);
  padding: 2.4rem 1.7rem 3.5rem;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.35s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--vinho-borda) transparent;
}
.sidebar-cabeca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.sidebar-titulo {
  display: block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--ouro);
  line-height: 1.7;
}
.sidebar-titulo.ativa {
  border-left: 1px solid var(--ouro);
  padding-left: 0.55rem;
  color: var(--ouro-claro);
}
.sidebar ul { list-style: none; }
.sidebar-abertas { margin-bottom: 2.2rem; }
.sidebar-abertas a {
  display: block;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--apaga-1);
  padding: 0.3rem 0;
}
.sidebar-abertas a:hover { color: var(--ouro-claro); }
.sidebar-parte { margin-bottom: 2rem; }
.sidebar-parte-nome {
  display: block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  color: var(--apaga-2);
  margin-bottom: 0.7rem;
}
.sidebar-parte a {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.32rem 0.5rem 0.32rem 0.6rem;
  margin-left: -0.6rem;
  border-left: 1px solid transparent;
  border-radius: 0 2px 2px 0;
  color: var(--creme);
  font-size: 1.04rem;
  line-height: 1.35;
  transition: color 0.2s ease, background 0.2s ease;
}
.sidebar-parte a:hover { color: var(--ouro-claro); background: rgba(201, 162, 75, 0.06); }
.sidebar-parte a .n {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--apaga-2);
  min-width: 1.1rem;
  text-align: right;
}
.sidebar-parte a.ativa {
  color: var(--ouro);
  border-left-color: var(--ouro);
  background: rgba(201, 162, 75, 0.08);
}
.sidebar-parte a.ativa .n { color: var(--ouro); }

.veu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(8, 3, 4, 0.6);
}

.alterna {
  position: fixed;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--vinho-profundo);
  border: 1px solid var(--vinho-borda);
  border-radius: 3px;
  color: var(--ouro);
  cursor: pointer;
  transition: left 0.35s ease, transform 0.3s ease, opacity 0.3s ease;
}
.alterna:hover { color: var(--ouro-claro); border-color: var(--ouro-veu); }
.alterna .icone-seta { width: 15px; height: 15px; transition: transform 0.35s ease; }
.icone-hamb { display: none; flex-direction: column; gap: 5px; }
.icone-hamb i { display: block; width: 17px; height: 1px; background: currentColor; }

.pagina { transition: margin-left 0.35s ease; }

@media (min-width: 1100px) {
  .pagina { margin-left: 300px; }
  .menu-fechado .pagina { margin-left: 0; }
  .menu-fechado .sidebar { transform: translateX(-100%); }
  .alterna { top: 1.5rem; left: calc(300px + 1.2rem); }
  .menu-fechado .alterna { left: 1.2rem; }
  .menu-fechado .alterna .icone-seta { transform: rotate(180deg); }
}

@media (max-width: 1099.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5); }
  .gaveta-aberta .sidebar { transform: translateX(0); }
  .gaveta-aberta .veu { display: block; }
  .alterna { top: 1rem; left: 1rem; }
  .icone-hamb { display: flex; }
  .icone-seta { display: none; }
  .gaveta-aberta .icone-hamb { display: none; }
  .gaveta-aberta .icone-seta { display: block; }
  .menu-oculto .alterna { transform: translateY(-70px); opacity: 0; pointer-events: none; }
}

/* ── alternador de modo de leitura (global) ── */
.modo { display: flex; gap: 6px; }

/* desktop: no topo da sidebar */
.modo-sidebar .modo-botao { width: 30px; height: 30px; }
.modo-sidebar .modo-botao svg { width: 13px; height: 13px; }

/* mobile: na barra superior, ao lado do botão de menu */
.modo-topo {
  position: fixed;
  top: 1rem;
  left: calc(1rem + 42px + 8px);
  z-index: 45;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.modo-topo .modo-botao { width: 42px; height: 42px; }

@media (min-width: 1100px) {
  .modo-topo { display: none; }
}
@media (max-width: 1099.98px) {
  .modo-sidebar { display: none; }
  .menu-oculto .modo-topo { transform: translateY(-70px); opacity: 0; pointer-events: none; }
}
.modo-botao {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--vinho-profundo);
  border: 1px solid var(--vinho-borda);
  border-radius: 3px;
  color: var(--apaga-2);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.modo-botao svg { width: 15px; height: 15px; }
.modo-botao:hover { color: var(--ouro); }
.modo-botao.ativo { color: var(--ouro); border-color: var(--ouro-veu); }

/* modo sépia: botão de ação escuro, como a tipografia da capa sobre o creme */
.modo-claro .botao-ouro {
  background: #2A1512;
  color: #E3C685;
}
.modo-claro .botao-ouro:hover { filter: brightness(1.3); color: #E3C685; }
.modo-claro .hero .capa { box-shadow: 0 24px 60px rgba(42, 21, 18, 0.35), 0 0 0 1px var(--vinho-borda); }
.modo-claro .veu { background: rgba(38, 34, 25, 0.35); }

/* ── botão copiar link ── */
.copiar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding: 0.45rem 0.9rem;
  background: none;
  border: 1px solid var(--vinho-borda);
  border-radius: 2px;
  color: var(--apaga-2);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.copiar svg { width: 13px; height: 13px; }
.copiar:hover { color: var(--ouro); border-color: var(--ouro-veu); }
.copiar.copiado { color: var(--ouro); border-color: var(--ouro-veu); }

/* ── cápsula anterior / próxima ── */
.vizinhas {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 540px;
  margin: 2.6rem auto 0;
  padding: 0 1.4rem;
}
.vizinhas a {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--apaga-2);
  transition: color 0.2s ease;
}
.vizinhas a:hover { color: var(--ouro); }

@media (max-width: 520px) {
  body { font-size: 1.15rem; }
  .antes-de-ler, .depois-de-ler { padding: 1.5rem 1.3rem; }
  .desbloqueio { margin-left: 1rem; margin-right: 1rem; padding: 2.4rem 1.4rem 2.2rem; }
}
