/* =====================================================================
   Inspiração e Fé por meio das Escrituras — sistema de design
   Movimento: Códice Iluminado Contemporâneo
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --ink-900: #05090f;
  --ink-850: #080d18;
  --ink-800: #0b1220;
  --ink-700: #111a2b;
  --ink-600: #182438;
  --ink-500: #223048;

  --vellum-100: #f7efe0;
  --vellum-200: #f4ead8;
  --vellum-300: #e9dcc4;
  --vellum-400: #d8c8ab;

  --gold-100: #f3e2b0;
  --gold-300: #e8ce7a;
  --gold-500: #c9a227;   /* Ouro Rubrica — cor-assinatura */
  --gold-700: #8a6e1e;
  --gold-900: #4a3a11;

  --rubric-500: #8c2f3b;
  --rubric-300: #c26b73;
  --verdigris-500: #2e5d57;
  --verdigris-300: #6fa8a0;
  --lapis-500: #2b4a7a;

  --t-on-dark: #e8dfcd;
  --t-on-dark-mute: #a4977f;
  --t-on-dark-faint: #6f6553;
  --t-on-light: #211b12;
  --t-on-light-mute: #6b5f4d;

  --f-display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --f-title: "Cormorant Garamond", "Spectral", Georgia, serif;
  --f-read: "Spectral", Georgia, "Times New Roman", serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --rail: 232px;
  --maxw: 1280px;
  --pad: clamp(18px, 4vw, 44px);
  --bar: 68px;
  --era-bar: 54px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-lift: 0 18px 50px -24px rgba(0, 0, 0, .75);
  --hair: linear-gradient(90deg, transparent, var(--gold-700) 12%, var(--gold-500) 50%, var(--gold-700) 88%, transparent);
}

/* Tema velino (claro) */
html[data-theme="vellum"] {
  --t-on-dark: #211b12;
  --t-on-dark-mute: #6b5f4d;
  --t-on-dark-faint: #9b8f7a;
}

* { box-sizing: border-box }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100% }
html[data-theme="night"] body { background: var(--ink-850); color: var(--t-on-dark) }
html[data-theme="vellum"] body { background: var(--vellum-200); color: var(--t-on-light) }

body {
  margin: 0;
  padding-top: calc(var(--bar) + var(--era-bar));   /* espaço do topo fixo */
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.62;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* fundo com véu de estrelas muito sutil */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(201, 162, 39, .07), transparent 60%),
    radial-gradient(900px 620px at -10% 30%, rgba(46, 93, 87, .09), transparent 62%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .014) 0 2px, transparent 2px 900px);
  pointer-events: none; z-index: 0;
}
html[data-theme="vellum"] body::before {
  background:
    radial-gradient(1100px 640px at 85% -12%, rgba(201, 162, 39, .13), transparent 62%),
    radial-gradient(900px 620px at -8% 34%, rgba(46, 93, 87, .1), transparent 60%);
}
main { position: relative; z-index: 1 }

html { overflow-x: clip }
img { max-width: 100%; display: block }
a { color: inherit }
button, input, select { font: inherit; color: inherit }

::selection { background: var(--gold-500); color: #14100a }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--gold-700) transparent }
*::-webkit-scrollbar { width: 9px; height: 9px }
*::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, .38); border-radius: 8px }
*::-webkit-scrollbar-track { background: transparent }

/* ---------- 2. Tipografia ---------- */
.h-display, h1, h2, h3 { font-weight: 600; margin: 0 }
h1, .h1 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  line-height: 1.06; letter-spacing: .015em; text-transform: uppercase;
}
h2, .h2 {
  font-family: var(--f-display);
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  line-height: 1.14; letter-spacing: .03em; text-transform: uppercase;
}
h3, .h3 { font-family: var(--f-title); font-size: clamp(1.22rem, 2vw, 1.6rem); line-height: 1.2 }
h4, .h4 { font-family: var(--f-ui); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700 }

.lede {
  font-family: var(--f-title);
  font-size: clamp(1.14rem, 1.9vw, 1.5rem);
  line-height: 1.5; color: var(--t-on-dark);
  max-width: 62ch;
}
.prose { font-family: var(--f-read); font-size: 1.06rem; line-height: 1.78; max-width: 74ch }
.prose p { margin: 0 0 1.05em }
.prose p + p { text-indent: 0 }
.prose h3 { margin: 1.9em 0 .5em }
.small { font-size: .86rem }
.mute { color: var(--t-on-dark-mute) }
.faint { color: var(--t-on-dark-faint) }
.gold { color: var(--gold-500) }
.rubric { color: var(--rubric-500) }
strong { font-weight: 600; color: inherit }
.num { font-family: var(--f-ui); font-variant-numeric: tabular-nums; letter-spacing: .02em }

.kicker {
  font-family: var(--f-ui); font-size: .72rem; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold-500);
  display: flex; align-items: center; gap: 12px;
}
.kicker::after { content: ""; height: 1px; flex: 1; background: var(--hair); opacity: .5 }

/* capitular iluminada */
.dropcap::first-letter {
  font-family: var(--f-display);
  font-size: 3.5em; line-height: .78; float: left;
  padding: .06em .12em 0 0; margin-right: .06em;
  color: var(--gold-500);
  text-shadow: 0 0 26px rgba(201, 162, 39, .35);
}

/* filete com losango */
.rule { height: 1px; background: var(--hair); position: relative; margin: 0 }
.rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold-500); box-shadow: 0 0 12px rgba(201, 162, 39, .6);
}
.rule.thin { opacity: .45 }

/* ---------- 3. Estrutura ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) }
.wrap.narrow { max-width: 940px }
section.band { padding: clamp(52px, 8vw, 104px) 0; position: relative }
section.band + section.band { border-top: 1px solid rgba(201, 162, 39, .14) }
.stack > * + * { margin-top: var(--gap, 18px) }
.row { display: flex; flex-wrap: wrap; gap: var(--gap, 14px); align-items: center }
.grid { display: grid; gap: var(--gap, 20px); grid-template-columns: repeat(auto-fit, minmax(var(--min, 260px), 1fr)) }
.split { display: grid; gap: clamp(24px, 4vw, 54px); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start }
.split.wide-l { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) }
@media (max-width: 900px) { .split, .split.wide-l { grid-template-columns: 1fr } }

.two-col-text { columns: 2; column-gap: 34px; column-rule: 1px solid rgba(201, 162, 39, .16) }
@media (max-width: 760px) { .two-col-text { columns: 1 } }

/* ---------- 4. Topo: barra + trilho de eras — SEMPRE fixo no alto ---------- */
#chrome { position: fixed; top: 0; left: 0; right: 0; z-index: 70; }
html { scroll-padding-top: calc(var(--bar) + var(--era-bar) + 20px); }
.masthead {
  position: relative; z-index: 60;
  backdrop-filter: blur(16px) saturate(130%);
  background: color-mix(in oklab, var(--ink-850) 82%, transparent);
  border-bottom: 1px solid rgba(201, 162, 39, .22);
}
html[data-theme="vellum"] .masthead { background: color-mix(in oklab, var(--vellum-100) 88%, transparent) }
#chrome.scrolled .masthead { box-shadow: 0 14px 34px rgba(4, 7, 14, .38) }
#chrome.scrolled .era-rail { opacity: .96 }
.mast-in {
  height: var(--bar); display: flex; align-items: center; gap: clamp(10px, 3vw, 26px);
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); min-width: 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 0 auto }
.brand-mark { width: 34px; height: 34px; flex: none }
.brand-txt { display: flex; flex-direction: column; line-height: 1 }
.brand-txt b { font-family: var(--f-display); font-size: .96rem; letter-spacing: .16em; text-transform: uppercase }
.brand-txt span { font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-500); margin-top: 4px }

nav.sections {
  display: flex; gap: clamp(6px, 1.4vw, 20px); margin-left: auto; align-items: center;
  flex: 0 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent) }
nav.sections::-webkit-scrollbar { display: none }
nav.sections > a {
  flex: 0 0 auto; text-decoration: none; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; padding: 9px 4px; position: relative; white-space: nowrap; color: var(--t-on-dark-mute);
  transition: color .25s var(--ease);
}
nav.sections > a:hover, nav.sections > a[aria-current="page"] { color: var(--gold-300) }
nav.sections > a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px;
  background: var(--gold-500); transition: right .3s var(--ease);
}
nav.sections > a:hover::after, nav.sections > a[aria-current="page"]::after { right: 0 }

.tools { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; margin-left: clamp(8px, 1.4vw, 18px) }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid rgba(201, 162, 39, .34); border-radius: 2px;
  transition: .25s var(--ease); font-size: .8rem;
}
.icon-btn:hover { border-color: var(--gold-500); background: rgba(201, 162, 39, .12); color: var(--gold-300) }

/* trilho de eras — a divisão PRIMÁRIA */
.era-rail { border-bottom: 1px solid rgba(201, 162, 39, .14); background: color-mix(in oklab, var(--ink-900) 60%, transparent) }
html[data-theme="vellum"] .era-rail { background: color-mix(in oklab, var(--vellum-300) 55%, transparent) }
.era-rail-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.era-rail-in::-webkit-scrollbar { display: none }
.era-rail a {
  flex: 0 0 auto; text-decoration: none; display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--t-on-dark-mute); border-bottom: 2px solid transparent; white-space: nowrap;
  transition: .28s var(--ease);
}
.era-rail a i { font-style: normal; font-family: var(--f-display); color: var(--gold-700); font-size: .78rem }
.era-rail a:hover { color: var(--gold-300); border-bottom-color: rgba(201, 162, 39, .5) }
.era-rail a.on { color: var(--gold-300); border-bottom-color: var(--gold-500); background: rgba(201, 162, 39, .07) }
.era-rail a.on i { color: var(--gold-500) }
@media (max-width: 760px) { nav.sections { display: none } .menu-open-btn { display: grid } }

/* menu mobile */
.sheet {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: color-mix(in oklab, var(--ink-900) 94%, transparent);
  backdrop-filter: blur(8px); overflow-y: auto; padding: 22px var(--pad) 60px;
}
.sheet.on { display: block }
.sheet h4 { color: var(--gold-500); margin: 26px 0 10px }
.sheet a { display: block; text-decoration: none; padding: 9px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); font-family: var(--f-title); font-size: 1.1rem }
.sheet .close { position: absolute; top: 16px; right: var(--pad) }

/* ---------- 5. Herói ---------- */
.hero { position: relative; min-height: clamp(560px, 82vh, 860px); display: grid; align-items: end; overflow: hidden }
.hero-art { position: absolute; inset: 0 }
.hero-art img, .hero-art .ph { width: 100%; height: 100%; object-fit: cover }
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 9, 15, .28) 0%, rgba(5, 9, 15, .58) 46%, var(--ink-850) 96%),
              radial-gradient(70% 60% at 20% 90%, rgba(5, 9, 15, .8), transparent);
}
html[data-theme="vellum"] .hero-art::after { background: linear-gradient(180deg, rgba(21, 16, 9, .3), rgba(244, 234, 216, .95) 92%) }
.hero-in { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(44px, 7vw, 86px); width: 100% }
.hero h1 { max-width: 17ch }
.hero .lede { margin: 20px 0 26px; max-width: 54ch; color: color-mix(in oklab, var(--t-on-dark) 92%, transparent) }
.hero-flicker { position: absolute; inset: auto auto 12% 8%; width: 340px; height: 340px; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, rgba(232, 206, 122, .5), transparent 62%); filter: blur(22px);
  animation: candle 5.2s infinite var(--ease) }
@keyframes candle {
  0%, 100% { opacity: .42; transform: scale(1) translate(0, 0) }
  28% { opacity: .62; transform: scale(1.06) translate(6px, -8px) }
  54% { opacity: .38; transform: scale(.97) translate(-6px, 4px) }
  76% { opacity: .58; transform: scale(1.03) translate(3px, 6px) }
}

/* ---------- 6. Cartões e componentes ---------- */
.card {
  position: relative; padding: 22px; border: 1px solid rgba(201, 162, 39, .2);
  background: color-mix(in oklab, var(--ink-800) 72%, transparent);
  transition: .34s var(--ease); overflow: hidden;
}
html[data-theme="vellum"] .card { background: rgba(255, 253, 248, .66); border-color: rgba(201, 162, 39, .38) }
.card:hover { border-color: rgba(201, 162, 39, .55); transform: translateY(-3px); box-shadow: var(--shadow-lift) }
.card::after {
  content: ""; position: absolute; left: 14px; top: 14px; width: 10px; height: 10px;
  border-left: 1px solid var(--gold-500); border-top: 1px solid var(--gold-500); opacity: .55;
}
.card.pad-lg { padding: clamp(22px, 3vw, 34px) }
.card-flat { border: 1px solid rgba(201, 162, 39, .18); background: transparent }

.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 600; padding: 4px 9px; border: 1px solid rgba(201, 162, 39, .35);
  color: var(--gold-300); background: rgba(201, 162, 39, .07); white-space: nowrap;
}
.tag.rub { color: var(--rubric-300); border-color: rgba(140, 47, 59, .5); background: rgba(140, 47, 59, .1) }
.tag.vrd { color: var(--verdigris-300); border-color: rgba(111, 168, 160, .45); background: rgba(46, 93, 87, .14) }
.tag.plain { border-color: rgba(255, 255, 255, .14); color: var(--t-on-dark-mute); background: transparent }

.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  padding: 13px 22px; border: 1px solid var(--gold-500); color: var(--gold-300);
  background: transparent; position: relative; overflow: hidden; transition: .32s var(--ease);
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--gold-500); transform: translateY(101%); transition: .32s var(--ease) }
.btn:hover { color: #14100a }
.btn:hover::before { transform: translateY(0) }
.btn > * { position: relative; z-index: 1 }
.btn.solid { background: var(--gold-500); color: #14100a }
.btn.solid::before { background: var(--gold-300) }
.btn.sm { padding: 8px 14px; font-size: .7rem }

/* cartela de versículo */
.cartela {
  position: relative; padding: 22px 26px 22px 34px;
  border-left: 2px solid var(--gold-500);
  background:
    linear-gradient(90deg, rgba(201, 162, 39, .09), rgba(201, 162, 39, .01)),
    color-mix(in oklab, var(--ink-800) 66%, transparent);
  font-family: var(--f-title); font-size: 1.22rem; line-height: 1.55;
}
html[data-theme="vellum"] .cartela { background: linear-gradient(90deg, rgba(201, 162, 39, .13), rgba(255, 255, 255, .4)) }
.cartela::before {
  content: "❝"; position: absolute; left: 8px; top: 8px; font-size: 1.1rem; color: var(--gold-500); opacity: .8
}
.cartela cite { display: block; margin-top: 10px; font-family: var(--f-ui); font-style: normal; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-500) }

/* margem anotada */
.margin-note { font-size: .74rem; letter-spacing: .08em; color: var(--t-on-dark-faint); text-transform: uppercase }
.folio { font-family: var(--f-display); color: var(--gold-500); font-size: .95rem; letter-spacing: .1em }

/* imagem com crédito */
figure.art { margin: 0; position: relative }
figure.art .frame { position: relative; overflow: hidden; border: 1px solid rgba(201, 162, 39, .3); background: var(--ink-900) }
figure.art .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter .6s }
figure.art:hover .frame img { transform: scale(1.045) }
figure.art figcaption { font-size: .74rem; color: var(--t-on-dark-mute); padding-top: 9px; line-height: 1.5; display: flex; gap: 8px; justify-content: space-between }
figure.art figcaption b { font-family: var(--f-title); font-weight: 600; font-size: .96rem; color: var(--t-on-dark) }
.ratio-43 { aspect-ratio: 4 / 3; } .ratio-169 { aspect-ratio: 16 / 9 }
.ratio-11 { aspect-ratio: 1 / 1 } .ratio-32 { aspect-ratio: 3 / 2 } .ratio-219 { aspect-ratio: 21 / 9 }

/* emblema gerado */
.emblem { display: block }
.emblem svg { display: block; width: 100%; height: auto }

/* contador */
.stat { display: flex; flex-direction: column; gap: 4px }
.stat b { font-family: var(--f-display); font-size: clamp(1.6rem, 3.6vw, 2.5rem); color: var(--gold-300); line-height: 1; font-variant-numeric: tabular-nums }
.stat span { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--t-on-dark-mute) }
.stat-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); text-align: center }

/* no tema pergaminho o prólogo permanece noturno: véu e textos do herói */
html[data-theme="vellum"] .hero { --t-heading: #f2ecdc; --t-body: #e8dfcd; --t-mute: #bcb6a6;
  --t-on-dark-mute: #c9c2b2; color: #e8dfcd }
html[data-theme="vellum"] .hero-art::after {
  background: linear-gradient(180deg, rgba(5, 9, 15, .34) 0%, rgba(5, 9, 15, .62) 46%, #04070d 97%),
              radial-gradient(70% 60% at 20% 90%, rgba(5, 9, 15, .82), transparent) }
html[data-theme="vellum"] .hero .kicker { color: var(--gold-500) }
html[data-theme="vellum"] .hero .lede { color: #dcd5c6 }

/* listas iluminadas */
ul.rub-list { list-style: none; padding: 0; margin: 0 }
ul.rub-list li { padding: 10px 0 10px 24px; border-bottom: 1px solid rgba(201, 162, 39, .12); position: relative }
ul.rub-list li::before { content: "◆"; position: absolute; left: 0; top: 10px; font-size: .6rem; color: var(--gold-500) }

/* filtros */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.chip {
  cursor: pointer; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  padding: 8px 13px; border: 1px solid rgba(201, 162, 39, .26); background: transparent;
  color: var(--t-on-dark-mute); transition: .25s var(--ease); white-space: nowrap;
}
.chip:hover { color: var(--gold-300); border-color: var(--gold-500) }
.chip.on { background: var(--gold-500); border-color: var(--gold-500); color: #14100a }
.field {
  display: flex; align-items: center; gap: 8px; border: 1px solid rgba(201, 162, 39, .26); padding: 8px 12px; background: rgba(0, 0, 0, .18);
}
html[data-theme="vellum"] .field { background: rgba(255, 255, 255, .55) }
.field input, .field select { background: transparent; border: 0; outline: none; min-width: 130px; font-size: .9rem }
.field input::placeholder { color: var(--t-on-dark-faint) }

/* painel lateral / drawer */
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(560px, 92vw); z-index: 80;
  background: var(--ink-800); border-left: 1px solid rgba(201, 162, 39, .3);
  transform: translateX(101%); transition: transform .42s var(--ease); overflow-y: auto;
  padding: 26px var(--pad) 80px; box-shadow: -30px 0 70px -30px rgba(0, 0, 0, .8);
}
html[data-theme="vellum"] .drawer { background: var(--vellum-100) }
.drawer.on { transform: none }
.drawer .close { position: sticky; top: 0; float: right }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 70; opacity: 0; pointer-events: none; transition: .3s }
.scrim.on { opacity: 1; pointer-events: auto }

/* ---------- 7. Leitor ---------- */
.reader { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: start }
@media (max-width: 1040px) { .reader { grid-template-columns: 1fr } .reader-rail { position: static !important; max-height: none !important } }
.reader-rail {
  position: sticky; top: calc(var(--bar) + var(--era-bar) + 12px); max-height: calc(100dvh - var(--bar) - var(--era-bar) - 30px);
  overflow-y: auto; padding-right: 10px; border-right: 1px solid rgba(201, 162, 39, .16);
}
.rail-era { font-family: var(--f-ui); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-700); margin: 18px 0 6px }
.rail-book { display: flex; align-items: baseline; gap: 8px; text-decoration: none; padding: 5px 8px; font-family: var(--f-title); font-size: 1.02rem; border-left: 2px solid transparent; color: var(--t-on-dark-mute) }
.rail-book:hover { color: var(--gold-300); border-left-color: var(--gold-500); background: rgba(201, 162, 39, .06) }
.rail-book small { font-family: var(--f-ui); font-size: .62rem; color: var(--t-on-dark-faint) }
.rail-chaps { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 10px }
.rail-chaps a { text-decoration: none; font-size: .72rem; padding: 3px 7px; border: 1px solid rgba(201, 162, 39, .2); color: var(--t-on-dark-mute) }
.rail-chaps a:hover { border-color: var(--gold-500); color: var(--gold-300) }
.rail-chaps a.on { background: var(--gold-500); color: #14100a; border-color: var(--gold-500) }

/* índice em gaveta nos aparelhos estreitos */
.rail-open { display: none }
@media (max-width: 1040px) {
  .rail-open { display: inline-flex }
  .reader-rail {
    position: fixed !important; top: calc(var(--bar) + var(--era-bar)) !important; left: 0; bottom: 0;
    width: min(86vw, 330px); max-height: none !important; z-index: 45; padding: 14px 14px 60px;
    background: var(--ink-900); border-right: 1px solid rgba(201, 162, 39, .22);
    box-shadow: 0 0 60px rgba(0, 0, 0, .55); transform: translateX(-103%);
    transition: transform .34s cubic-bezier(.22, .78, .24, 1) }
  .reader-rail.open { transform: none }
  .rail-scrim { position: fixed; inset: 0; background: rgba(4, 8, 14, .62); z-index: 44; backdrop-filter: blur(2px) }
}
.text { font-family: var(--f-read); font-size: calc(1.08rem * var(--fs, 1)); line-height: 1.95; max-width: 68ch }
.text .v { cursor: pointer; transition: background .2s }
.text .vn {
  font-family: var(--f-ui); font-size: .62em; vertical-align: super; margin: 0 .18em 0 .04em;
  color: var(--gold-500); font-weight: 700; letter-spacing: 0;
}
.text .v:hover .vn { color: var(--gold-300) }
.text .v.mark { background: linear-gradient(transparent 62%, rgba(201, 162, 39, .34) 0) }
.text p + p { margin-top: .35em }
.chap-head { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 26px }
@media (max-width: 640px) { .chap-head { grid-template-columns: 60px 1fr; gap: 14px } }
.chap-head .roman { font-family: var(--f-display); font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--gold-500); line-height: .9 }
.chap-title { font-family: var(--f-title); font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.14 }
.chap-meta { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t-on-dark-mute); margin-top: 8px }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(201, 162, 39, .2) }

/* ---------- 8. Gráficos ---------- */
.chart { width: 100%; height: auto; overflow: visible }
.chart text { font-family: var(--f-ui); fill: var(--t-on-dark-mute) }
.chart .axis line, .chart .axis path { stroke: rgba(201, 162, 39, .26) }
.chart .gridline { stroke: rgba(201, 162, 39, .1); stroke-dasharray: 2 5 }
.bar { transition: .3s var(--ease) }
.bar:hover { filter: brightness(1.3) }
.dlabel { font-size: .68rem; letter-spacing: .06em }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .74rem; color: var(--t-on-dark-mute); margin-top: 12px }
.chart-legend i { width: 11px; height: 11px; display: inline-block; margin-right: 6px; vertical-align: -1px }

/* timeline */
.timeline { position: relative; padding-left: 30px }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px; background: var(--hair) }
.tl-item { position: relative; padding: 0 0 26px }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 7px; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold-500); box-shadow: 0 0 12px rgba(201, 162, 39, .7) }
.tl-item h4 { color: var(--gold-300); margin-bottom: 4px }
.tl-date { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--t-on-dark-faint) }

/* ---------- 9. Revelação ao scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease) }
.reveal.in { opacity: 1; transform: none }
.reveal[data-d="1"] { transition-delay: .08s } .reveal[data-d="2"] { transition-delay: .16s }
.reveal[data-d="3"] { transition-delay: .24s } .reveal[data-d="4"] { transition-delay: .32s }

/* skeleton */
.ph { position: relative; overflow: hidden; background: linear-gradient(100deg, var(--ink-700), var(--ink-600), var(--ink-700)); background-size: 200% 100%; animation: shimmer 2.2s infinite linear }
@keyframes shimmer { to { background-position: -200% 0 } }
.skel { height: 14px; border-radius: 2px; margin: 10px 0 }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 120;
  background: var(--gold-500); color: #14100a; padding: 11px 20px; font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; opacity: 0; transition: .32s var(--ease); pointer-events: none;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .7);
}
.toast.on { opacity: 1; transform: translate(-50%, 0) }

/* ---------- 10. Rodapé ---------- */
footer.foot { border-top: 1px solid rgba(201, 162, 39, .24); padding: 54px 0 40px; margin-top: 40px; font-size: .86rem }
.foot-cols { display: grid; gap: 30px; grid-template-columns: 1.35fr 1fr 1fr .9fr 1fr }
@media (max-width: 1040px) { .foot-cols { grid-template-columns: 1fr 1fr 1fr } }
@media (max-width: 820px) { .foot-cols { grid-template-columns: 1fr 1fr } }
@media (max-width: 520px) { .foot-cols { grid-template-columns: 1fr } }
.foot h4 { color: var(--gold-500); margin-bottom: 12px }
.foot a { text-decoration: none; color: var(--t-on-dark-mute); display: block; padding: 3px 0 }
.foot a:hover { color: var(--gold-300) }
.foot .credit { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(201, 162, 39, .14); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--t-on-dark-faint); font-size: .76rem }

/* ---------- contador de visitas (faixa de destaque) ---------- */
.visitas { margin-top: 30px; display: inline-flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 13px 20px 12px; border: 1px solid rgba(201, 162, 55, .46);
  font-family: var(--font-ui); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-200);
  background: linear-gradient(115deg, rgba(201, 162, 55, .23) 0%, rgba(201, 162, 55, .08) 46%, rgba(4, 7, 13, .58) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 160, .18), 0 10px 30px rgba(3, 6, 12, .5);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px) }
.visitas::before { content: "◈"; font-size: .95rem; color: var(--gold-500); margin-right: 3px }
.visitas .vis-num { font-family: var(--font-display); font-size: 2rem; line-height: 1; letter-spacing: .01em;
  text-transform: none; color: var(--gold-300); text-shadow: 0 0 22px rgba(201, 162, 55, .45) }
.visitas .vis-lab { color: var(--gold-200) }
.visitas .vis-sep { font-style: normal; color: rgba(201, 162, 55, .55); margin-left: 4px }
.visitas .vis-sub { text-transform: none; letter-spacing: .05em; color: rgba(232, 223, 205, .78) }
html[data-theme="vellum"] .visitas { color: #6b5312; border-color: rgba(150, 116, 20, .5);
  background: linear-gradient(115deg, rgba(201, 162, 55, .26) 0%, rgba(201, 162, 55, .12) 46%, rgba(240, 230, 205, .8) 100%) }
html[data-theme="vellum"] .visitas .vis-num { color: #7a5c12; text-shadow: none }
html[data-theme="vellum"] .visitas .vis-lab { color: #6b5312 }
html[data-theme="vellum"] .visitas .vis-sub { color: rgba(45, 35, 10, .74) }

/* ---------- fita de links do alto da home ---------- */
.link-rib { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px }
.link-chip { display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  padding: 10px 15px 10px 13px; border: 1px solid rgba(201, 162, 55, .44);
  background: linear-gradient(100deg, rgba(201, 162, 55, .17), rgba(4, 7, 13, .5));
  box-shadow: inset 0 1px 0 rgba(255, 232, 160, .14);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s, background .3s }
.link-chip:hover { transform: translateY(-3px); border-color: rgba(201, 162, 55, .78);
  background: linear-gradient(100deg, rgba(201, 162, 55, .3), rgba(4, 7, 13, .45));
  box-shadow: 0 12px 28px rgba(3, 6, 12, .5) }
.link-chip .lc-ico { font-style: normal; font-size: 1.05rem; line-height: 1; color: var(--gold-500) }
.link-chip .lc-txt { display: flex; flex-direction: column; line-height: 1.3 }
.link-chip .lc-txt b { font-family: var(--font-ui); font-weight: 600; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-200) }
.link-chip .lc-txt em { font-style: normal; font-size: .78rem; letter-spacing: .02em; color: rgba(232, 223, 205, .74) }
.link-chip .lc-go { font-size: .95rem; line-height: 1; color: var(--gold-500); transition: transform .3s var(--ease) }
.link-chip:hover .lc-go { transform: translate(3px, -3px) }
html[data-theme="vellum"] .link-chip { background: linear-gradient(100deg, rgba(201, 162, 55, .24), rgba(240, 230, 205, .74));
  border-color: rgba(150, 116, 20, .48) }
html[data-theme="vellum"] .link-chip .lc-txt b { color: #6b5312 }
html[data-theme="vellum"] .link-chip .lc-txt em { color: rgba(45, 35, 10, .74) }
@media (max-width: 620px) { .link-rib { flex-direction: column; align-items: stretch } }

/* ---------- convite: vídeos e materiais ---------- */
.invite-grid { display: grid; gap: clamp(18px, 2.4vw, 28px); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) }
.invite-card { position: relative; display: grid; gap: 12px; align-content: start; text-decoration: none;
  padding: clamp(24px, 3vw, 38px); border: 1px solid rgba(201, 162, 55, .26); background: var(--surface-1);
  align-content: space-between;
  overflow: hidden; transition: transform .34s var(--ease), border-color .34s, box-shadow .34s }
.invite-card::before { content: ""; position: absolute; inset: 0; opacity: .09; pointer-events: none;
  background: radial-gradient(120% 90% at 12% 0%, var(--gold-500), transparent 58%) }
.invite-card:hover { transform: translateY(-4px); border-color: rgba(201, 162, 55, .6); box-shadow: var(--shadow-lift) }
.invite-card .ic-ico { font-size: 1.5rem; color: var(--gold-500); line-height: 1 }
.invite-card .ic-kicker { margin: 0; font-family: var(--font-ui); font-size: .68rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold-500) }
.invite-card h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  color: var(--t-heading); letter-spacing: .01em }
.invite-card .ic-txt { margin: 0; color: var(--t-mute); line-height: 1.66; max-width: 44ch }
.invite-card .ic-go { margin-top: 12px; align-self: start; padding: 8px 14px;
  font-family: var(--font-ui); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-300);
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(201, 162, 55, .4);
  background: rgba(201, 162, 55, .1); transition: background .3s, border-color .3s, color .3s }
.invite-card:hover .ic-go { background: rgba(201, 162, 55, .2); border-color: rgba(201, 162, 55, .68); color: var(--gold-200) }
.invite-card .ic-go::after { content: "↗"; font-size: 1rem; transition: transform .3s var(--ease) }
.invite-card:hover .ic-go::after { transform: translate(3px, -3px) }
.invite-card.tiktok { border-color: rgba(201, 162, 55, .34) }

.foot a.ext::after { content: " ↗"; color: var(--gold-700) }

/* utilitários */
.hide { display: none !important }
.center { text-align: center }
.mt0 { margin-top: 0 } .mb0 { margin-bottom: 0 }
.only-mobile { display: none }
@media (max-width: 760px) { .only-mobile { display: initial } .no-mobile { display: none } }
.scroll-x { overflow-x: auto; scrollbar-width: thin }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem }
table.data th { text-align: left; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-500); padding: 10px 12px; border-bottom: 1px solid rgba(201, 162, 39, .3); white-space: nowrap }
table.data td { padding: 10px 12px; border-bottom: 1px solid rgba(201, 162, 39, .1); vertical-align: top }
table.data tr:hover td { background: rgba(201, 162, 39, .06) }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  html { scroll-behavior: auto }
  .reveal { opacity: 1; transform: none }
}

/* esqueleto dos cartões enquanto a ilustração entra */
.ph { position: relative; overflow: hidden; background:
   radial-gradient(120% 90% at 30% 10%, rgba(201,162,39,.12), transparent 60%), #0a1220;
  border: 1px solid rgba(201,162,39,.14) }
.ph::after { content: ""; position: absolute; inset: -40% -10%; background:
   linear-gradient(100deg, transparent 20%, rgba(232,206,122,.10) 45%, transparent 70%);
  transform: translateX(-60%); animation: ph-sweep 1.6s ease-in-out infinite }
.ph::before { content: "❖"; position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(201,162,39,.26); font-size: 1.6rem; letter-spacing: 0 }
@keyframes ph-sweep { to { transform: translateX(60%) } }
@media (prefers-reduced-motion: reduce) { .ph::after { animation: none } }

/* se a arte do herói falhar, o próprio abismo ilumina a página */
.hero.noart { background-image:
  radial-gradient(78% 62% at 74% 16%, rgba(232,206,122,.34), transparent 62%),
  radial-gradient(60% 50% at 20% 78%, rgba(111,168,160,.18), transparent 60%),
  linear-gradient(160deg, #0a1220 8%, #121b2c 55%, #070c16 96%) }

@media (max-width: 1180px) { .brand-txt span { display: none } }

nav.sections .short { display: none }
@media (max-width: 1400px) {
  nav.sections .long { display: none }
  nav.sections .short { display: inline }
  nav.sections > a.home { display: none }
  .mast-in { gap: 14px }
  nav.sections { gap: 10px; -webkit-mask-image: none }
  nav.sections > a { font-size: .7rem; letter-spacing: .04em; padding: 9px 0 }
  .brand-txt b { font-size: .82rem; letter-spacing: .1em }
  .brand-mark { width: 30px; height: 30px }
  .tools { gap: 5px; margin-left: 10px }
  .icon-btn { width: 34px; height: 34px; font-size: .9rem }
}
