/* ============================================================
   A DOR É A CHAVE — Verdade Banida
   Tokens
   ============================================================ */
:root {
  --preto: #080706;
  --carvao: #120e0a;
  --sepia: #241a10;
  --bronze: #8a6a3c;
  --dourado: #b8945a;
  --dourado-vela: #d8b878;
  --pergaminho: #e6d9bc;
  --branco-quente: #f4ecd8;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", -apple-system, sans-serif;
  --caps: "Cinzel", var(--serif);

  --easing: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-slow: 1.4s;
  --dur-med: 0.8s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--preto);
  color: var(--pergaminho);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--bronze); color: var(--preto); }

:focus-visible {
  outline: 1px solid var(--dourado-vela);
  outline-offset: 4px;
}

/* ---------- grain + cursor ---------- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor {
  position: fixed; top: 0; left: 0; width: 22px; height: 22px;
  border: 1px solid var(--dourado-vela); border-radius: 50%;
  pointer-events: none; z-index: 999; opacity: 0.7;
  transform: translate(-50%, -50%);
  transition: width .3s var(--easing), height .3s var(--easing), opacity .3s ease, border-color .3s ease;
  will-change: transform;
}
.cursor.active {
  width: 46px; height: 46px; opacity: 1; border-color: var(--dourado);
  box-shadow: 0 0 18px rgba(184,148,90,.35);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- layout helpers ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
section { position: relative; padding: 8rem 0; }

.eyebrow {
  font-family: var(--caps); font-size: .68rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--bronze); text-align: center;
  display: block; margin-bottom: 1.6rem;
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--easing), transform 1s var(--easing); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-slow { transition-duration: 1.6s; }

/* ---------- header / brand mark ---------- */
.brandbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center; padding: 1.4rem 0;
  font-family: var(--caps); font-size: .62rem; letter-spacing: .38em;
  text-transform: uppercase; color: var(--pergaminho); opacity: .75;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  position: relative; text-align: center; padding: 7rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% 30%, rgba(138,106,60,.10), transparent 60%),
    linear-gradient(180deg, var(--preto) 0%, var(--carvao) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(184,148,90,.02) 0 1px, transparent 1px 3px);
}
.hero-scene {
  position: relative; width: 210px; height: 210px; margin: 0 auto 2.6rem;
  opacity: 0; animation: sceneIn 2s var(--easing) .3s forwards;
}
@keyframes sceneIn { to { opacity: 1; } }
.hero-scene svg { width: 100%; height: 100%; filter: drop-shadow(0 0 30px rgba(184,148,90,.18)); }
.hero-scene .key-glow { animation: keyGlow 5s ease-in-out infinite; transform-origin: center; }
@keyframes keyGlow {
  0%, 100% { opacity: .85; }
  50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(216,184,120,.5)); }
}

h1.title {
  font-family: var(--serif); font-optical-sizing: auto;
  font-weight: 600; font-size: clamp(2.6rem, 8vw, 4.6rem);
  letter-spacing: .01em; line-height: 1.05; color: var(--branco-quente);
  text-shadow: 0 0 40px rgba(216,184,120,.12);
  opacity: 0; animation: riseIn 1.3s var(--easing) 1s forwards;
}
.impact-line {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.1rem, 2.7vw, 1.4rem); color: var(--dourado-vela);
  max-width: 540px; margin: 1.6rem auto 0; line-height: 1.55;
  opacity: 0; animation: riseIn 1.3s var(--easing) 1.4s forwards;
}
.hero-desc {
  font-family: var(--sans); font-weight: 300; font-size: 1rem;
  color: var(--pergaminho); opacity: 0; max-width: 460px; margin: 1.8rem auto 0;
  line-height: 1.8; animation: riseIn 1.3s var(--easing) 1.7s forwards;
  opacity: 0;
}
@keyframes riseIn { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: translateY(0); } }

.cta {
  display: inline-block; font-family: var(--caps); font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--branco-quente);
  border: 1px solid var(--bronze); padding: 1.05rem 2.4rem; margin-top: 2.6rem;
  position: relative; overflow: hidden; background: transparent;
  transition: border-color .5s ease, color .5s ease;
  opacity: 0; animation: riseIn 1.3s var(--easing) 2s forwards;
}
.cta::before {
  content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(216,184,120,.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--easing);
}
.cta:hover { border-color: var(--dourado-vela); color: var(--dourado-vela); }
.cta:hover::before { transform: translateX(120%); }

.scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  font-family: var(--caps); font-size: .58rem; letter-spacing: .3em; color: var(--bronze);
  opacity: 0; animation: riseIn 1s ease 2.6s forwards, drift 3s ease-in-out 3.2s infinite;
}
@keyframes drift { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

/* ---------- transição / whisper sections ---------- */
.whisper {
  min-height: 65vh; display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.whisper p {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(1.5rem, 4.4vw, 2.3rem); line-height: 1.5; color: var(--pergaminho);
  max-width: 640px;
}
.whisper p + p { margin-top: 1.4rem; color: var(--dourado-vela); }

/* ---------- pergunta ---------- */
.section-title {
  font-family: var(--serif); font-weight: 600; text-align: center;
  font-size: clamp(1.7rem, 5vw, 2.5rem); color: var(--branco-quente);
  line-height: 1.25; margin-bottom: 2.4rem;
}
.body-text {
  font-family: var(--serif); font-weight: 400; font-size: 1.15rem;
  line-height: 2; color: var(--pergaminho); text-align: center;
}
.body-text em { color: var(--dourado-vela); font-style: italic; }

/* ---------- chave / parallax ---------- */
.key-section { text-align: center; overflow: hidden; }
.key-stage {
  position: relative; width: 100%; max-width: 420px; margin: 3rem auto 0; aspect-ratio: 1;
}
.key-stage svg { width: 100%; height: 100%; }
.key-layer-back { position: absolute; inset: 0; opacity: .35; will-change: transform; }
.key-layer-front { position: absolute; inset: 0; will-change: transform; }
.key-particles { position: absolute; inset: -20%; pointer-events: none; }
.key-particles span {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--dourado-vela); opacity: 0;
}

/* ---------- manuscrito / capítulos ---------- */
.manuscript-grid { display: flex; flex-direction: column; gap: 3.2rem; margin-top: 3rem; }
.frag {
  position: relative; padding: 2.2rem 2rem; text-align: center;
  border-top: 1px solid rgba(138,106,60,.35); border-bottom: 1px solid rgba(138,106,60,.35);
  background: linear-gradient(180deg, rgba(184,148,90,.035), transparent 60%);
}
.frag .num {
  font-family: var(--caps); font-size: .72rem; letter-spacing: .3em; color: var(--bronze);
  display: block; margin-bottom: .9rem;
}
.frag h3 {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; color: var(--branco-quente);
  margin-bottom: .7rem;
}
.frag p { font-family: var(--serif); font-style: italic; color: var(--pergaminho); font-size: 1.02rem; }

/* ---------- trecho da obra ---------- */
.excerpt {
  text-align: center; padding: 3.2rem 2rem; position: relative;
  border: 1px solid rgba(138,106,60,.3);
}
.excerpt::before, .excerpt::after {
  content: ""; position: absolute; width: 26px; height: 1px; background: var(--bronze);
  left: 50%; transform: translateX(-50%);
}
.excerpt::before { top: 1.6rem; }
.excerpt::after { bottom: 1.6rem; }
.excerpt-placeholder {
  font-family: var(--sans); font-size: .85rem; letter-spacing: .02em; color: var(--bronze);
  line-height: 1.9; font-style: normal;
}
.excerpt-placeholder code {
  display: block; margin-top: 1rem; font-family: monospace; font-size: .78rem;
  color: var(--dourado-vela); background: rgba(0,0,0,.35); padding: .7rem 1rem;
}
.excerpt cite {
  display: block; margin-top: 1.6rem; font-style: normal; font-family: var(--caps);
  font-size: .64rem; letter-spacing: .25em; color: var(--dourado); text-transform: uppercase;
}

/* ---------- índice ---------- */
.index-list { margin-top: 2.4rem; }
.index-item {
  display: flex; align-items: baseline; gap: 1.2rem; padding: 1rem 0;
  border-bottom: 1px solid rgba(138,106,60,.22);
  font-family: var(--serif); font-size: 1.05rem; color: var(--pergaminho);
}
.index-item .n { font-family: var(--caps); font-size: .72rem; color: var(--bronze); letter-spacing: .1em; min-width: 2.4rem; }
.index-note {
  margin-top: 1.6rem; text-align: center; font-family: var(--sans); font-size: .78rem;
  color: var(--bronze); letter-spacing: .02em; font-style: italic;
}

/* ---------- para quem / não é sobre fugir ---------- */
.dark-flat { background: var(--preto); }
.identify p { font-family: var(--serif); font-size: 1.15rem; line-height: 2.1; color: var(--pergaminho); text-align: center; }

.blackout { min-height: 70vh; display: flex; align-items: center; justify-content: center; background: #050403; }
.blackout-inner { text-align: center; max-width: 620px; padding: 0 1.5rem; }
.blackout h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 5.5vw, 2.8rem);
  line-height: 1.35; color: var(--branco-quente);
}
.blackout p.small {
  margin-top: 1.6rem; font-family: var(--sans); font-weight: 300; font-size: .95rem;
  line-height: 1.9; color: var(--bronze);
}

/* ---------- leitor digital ---------- */
.reader-panel {
  margin-top: 3rem; border: 1px solid rgba(138,106,60,.35); background: var(--carvao);
}
.reader-toolbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid rgba(138,106,60,.25);
  font-family: var(--caps); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
}
.reader-toolbar .group { display: flex; gap: .5rem; align-items: center; }
.reader-btn {
  background: transparent; border: 1px solid var(--bronze); color: var(--pergaminho);
  font-family: var(--caps); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .55rem .9rem; cursor: pointer; transition: border-color .3s ease, color .3s ease;
}
.reader-btn:hover, .reader-btn.on { border-color: var(--dourado-vela); color: var(--dourado-vela); }
.reader-stage {
  min-height: 420px; padding: 3rem 2.4rem; display: flex; flex-direction: column; justify-content: center;
  transition: background .5s ease;
}
.reader-stage.focus-mode { background: #030201; padding: 4rem 2.4rem; }
.reader-page-label {
  text-align: center; font-family: var(--caps); font-size: .6rem; letter-spacing: .3em; color: var(--bronze);
  margin-bottom: 1.6rem;
}
.reader-text {
  font-family: var(--serif); color: var(--pergaminho); line-height: 2; text-align: left;
  transition: font-size .3s ease;
}
.reader-nav { display: flex; justify-content: space-between; padding: 1rem 1.4rem; border-top: 1px solid rgba(138,106,60,.25); }
.reader-progress { flex: 1; height: 1px; background: rgba(138,106,60,.25); margin: 0 1.2rem; position: relative; align-self: center; }
.reader-progress i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--dourado-vela); width: 12%; transition: width .4s ease; }

/* ---------- CTA final ---------- */
.finale {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(ellipse 70% 50% at 50% 60%, rgba(184,148,90,.10), var(--preto) 70%);
}
.door-scene { width: 180px; height: 240px; margin: 0 auto 2.4rem; opacity: .9; }
.finale h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 6vw, 3.2rem); color: var(--branco-quente);
  letter-spacing: .02em;
}
.finale .sub {
  font-family: var(--serif); font-style: italic; color: var(--dourado-vela); max-width: 480px;
  margin: 1.4rem auto 0; font-size: 1.05rem; line-height: 1.7;
}

/* ---------- footer ---------- */
footer {
  padding: 4rem 1.5rem 3rem; text-align: center; border-top: 1px solid rgba(138,106,60,.25);
}
footer .mark { font-family: var(--caps); font-size: .8rem; letter-spacing: .3em; color: var(--pergaminho); }
footer .booktitle { font-family: var(--serif); font-style: italic; color: var(--bronze); margin-top: .4rem; }
footer nav { display: flex; gap: 1.6rem; justify-content: center; margin: 1.8rem 0; flex-wrap: wrap; }
footer nav a { font-family: var(--sans); font-size: .82rem; color: var(--pergaminho); opacity: .75; transition: opacity .3s ease; }
footer nav a:hover { opacity: 1; }
footer .quote {
  font-family: var(--serif); font-style: italic; font-size: .85rem; color: var(--bronze); max-width: 420px;
  margin: 1.6rem auto 0; line-height: 1.7;
}
footer .insta { margin-top: 1.6rem; font-family: var(--caps); font-size: .62rem; letter-spacing: .2em; color: var(--dourado); }

@media (max-width: 640px) {
  section { padding: 5.5rem 0; }
  .frag { padding: 1.8rem 1.4rem; }
}
