/* 4Cheedar — estilo "códex medieval". Variáveis + componentes reutilizados nas 4 páginas. */

:root {
  --ink: #17121c;
  --bone: #ede6d8;
  --verdigris: #3e8c7a;
  --verdigris-light: #6fbfa8;
  --brass: #a88a4e;
  --line: #2c2434;
  --line-soft: #3a3145;
  --border-outline: #4a4058;
  --blob-purple: #4a2f52;
  --text-secondary: #b3a7bc;
  --text-muted: #9a8ea6;
  --text-soft: #ded4e0;
  --panel: #1d1725;
  --btn-ink: #12211d;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-mono: "Space Mono", monospace;
  --font-body: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
}

a { color: var(--verdigris-light); text-decoration: none; }
a:hover { color: var(--bone); }

::selection { background: var(--verdigris); color: var(--ink); }

img { max-width: 100%; }

/* ---------- fundo (ruído + vinheta + barra de progresso) ---------- */

.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .14; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='3'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.bg-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  box-shadow: inset 0 0 260px rgba(0,0,0,.6), inset 0 0 90px rgba(0,0,0,.35);
}

.scroll-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40;
  background: linear-gradient(90deg, #275a4e, var(--verdigris) 55%, var(--brass));
  transform-origin: 0 50%;
  animation: widen linear both;
  animation-timeline: scroll(root);
}

.page { position: relative; overflow-x: hidden; background: var(--ink); }

/* ---------- header / nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(23,18,28,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: baseline; gap: 12px; color: var(--bone);
}
.brand-mark { font-family: var(--font-serif); font-size: 30px; line-height: .9; }
.brand-mark em { font-style: normal; color: var(--verdigris); }
.brand-name { font-family: var(--font-mono); font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--text-muted); }

.site-nav {
  display: flex; align-items: center; gap: clamp(10px, 1.8vw, 22px);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-secondary);
}
.nav-link { display: flex; align-items: baseline; gap: 7px; color: inherit; }
.nav-link:hover { color: var(--verdigris-light); }
.nav-link.is-current { color: var(--verdigris-light); }
.nav-link .num { color: var(--verdigris); }
.nav-sep { width: 1px; height: 16px; background: var(--line-soft); }

.lang-btn {
  background: none; border: 1px solid var(--line-soft); border-radius: 1px;
  color: var(--text-secondary); font: inherit; font-size: 10px; letter-spacing: .18em;
  padding: 5px 9px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--verdigris); color: var(--verdigris-light); }

.nav-cta {
  border: 1px solid var(--verdigris); color: var(--verdigris-light);
  padding: 6px 14px; border-radius: 1px; letter-spacing: .16em;
}
.nav-cta:hover { background: var(--verdigris); color: var(--ink); }

/* ---------- kicker / fleuron / rule ---------- */

.kicker {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .36em; text-transform: uppercase;
  color: var(--text-muted);
}
.kicker .rule { width: 34px; height: 1px; background: var(--line-soft); }
.kicker .num { color: var(--verdigris); }

.fleuron {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 30px 0 26px;
}
.fleuron i { width: 6px; height: 6px; background: var(--brass); transform: rotate(45deg); display: block; }
.fleuron .rule {
  width: min(46vw, 280px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-soft), transparent);
  transform-origin: 50% 50%;
  animation: ruleDraw 1.3s .4s ease-out both;
}

/* ---------- glow blob (fundo decorativo) ---------- */

.glow {
  position: absolute; top: -24%; left: 50%; transform: translateX(-50%);
  width: min(96vw, 980px); height: min(96vw, 980px); border-radius: 50%;
  background: radial-gradient(circle, var(--verdigris) 0%, transparent 62%);
  filter: blur(72px);
  animation: glow 15s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- hero centralizado (carta/abertura/pórtico) ---------- */

.hero-letter {
  position: relative; z-index: 2; padding: clamp(56px,10vh,120px) clamp(18px,4vw,56px) clamp(40px,7vh,80px);
  overflow: hidden; text-align: center;
}
.hero-letter .hero-in { position: relative; max-width: 820px; margin: 0 auto; }
.hero-letter h1 {
  font-family: var(--font-serif); font-weight: 400; line-height: .96; letter-spacing: -.025em;
  margin: 26px 0 0; color: var(--bone);
}
.hero-letter .lede {
  font-family: var(--font-serif); line-height: 1.6; color: var(--text-soft);
  margin: 0 auto 34px; text-wrap: pretty;
}
.hero-letter .cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- seções / grid de marginália ---------- */

.section { position: relative; z-index: 2; padding: clamp(56px, 9vh, 120px) clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); }
.section-tinted { background: linear-gradient(180deg, rgba(62,140,122,.06), transparent 50%); }

.section-grid {
  display: grid;
  grid-template-columns: clamp(72px, 13vw, 190px) minmax(280px, 760px);
  justify-content: center;
  gap: clamp(16px, 3vw, 48px);
}

.margin-col {
  text-align: right;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-muted);
}
.margin-col .no { font-family: var(--font-serif); font-size: 40px; letter-spacing: 0; color: var(--verdigris); line-height: 1; }
.margin-col .no-roman { font-family: var(--font-serif); font-size: 46px; letter-spacing: 0; color: var(--verdigris); line-height: 1; }
.margin-col .label { margin-top: 10px; }
.margin-col .sub-label { margin-top: 4px; font-size: 9px; letter-spacing: .18em; color: #6e6273; }
.margin-col hr { margin: 18px 0 0; height: 1px; border: 0; background: var(--line); }
.margin-col .meta { margin-top: 18px; line-height: 1.9; }

/* ---------- prancha (imagem com legenda) ---------- */

.plate { border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.plate img { display: block; width: 100%; height: auto; }
.plate-caption {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 14px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-muted);
}
.plate-caption .tag { color: var(--verdigris); }

.plate-placeholder {
  display: grid; place-items: center; aspect-ratio: 16/9;
  border: 1px dashed var(--line-soft); background: var(--panel);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); text-align: center; gap: 10px; padding: 16px;
}
.plate-placeholder .diamond { width: 14px; height: 14px; border: 1px solid var(--verdigris); transform: rotate(45deg); opacity: .7; }

/* ---------- botões ---------- */

.btn {
  display: inline-block; padding: 14px 30px; border-radius: 1px;
  font-weight: 600; font-size: 14px; text-align: center; white-space: nowrap;
}
.btn-solid { background: var(--verdigris); color: var(--btn-ink); }
.btn-solid:hover { background: var(--verdigris-light); color: var(--btn-ink); }
.btn-outline { border: 1px solid var(--border-outline); color: var(--bone); }
.btn-outline:hover { border-color: var(--bone); background: rgba(237,230,216,.06); color: var(--bone); }
.btn-text {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-secondary); text-align: center; padding: 6px;
}
.btn-text:hover { color: var(--verdigris-light); }

/* ---------- rodapé ---------- */

.site-footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 22px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-muted);
}
.site-footer .footer-brand { display: flex; align-items: center; gap: 12px; }
.site-footer .footer-mark { font-family: var(--font-serif); font-size: 20px; letter-spacing: 0; color: var(--bone); }
.site-footer .footer-mark em { font-style: normal; color: var(--verdigris); }
.site-footer .footer-right { display: flex; align-items: center; gap: 8px; }
.caret { width: 7px; height: 13px; background: var(--verdigris); animation: caret 1.4s steps(1) infinite; display: inline-block; }

/* ---------- animações (scroll-driven, sem JS) ---------- */

@keyframes inkIn { from { opacity: 0; filter: blur(7px); transform: translateY(18px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ruleDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes widen { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes marginIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes plateReveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes glow { 0%, 100% { opacity: .30; transform: scale(1); } 50% { opacity: .62; transform: scale(1.1); } }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes hint { 0%, 100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(8px); opacity: .8; } }
@keyframes drift { from { transform: translateY(-40px); } to { transform: translateY(40px); } }

.anim-ink { animation: inkIn 1s ease-out both; }
.anim-rule { animation: ruleDraw 1.3s .4s ease-out both; }
.anim-plate { animation: plateReveal linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
.anim-margin { animation: marginIn linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }

.reveal { animation: fadeUp linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
.reveal-55 { animation-range: entry 0% entry 55%; }
.reveal-65 { animation-range: entry 0% entry 65%; }
.reveal-70 { animation-range: entry 0% entry 70%; }
.reveal-75 { animation-range: entry 0% entry 75%; }
.reveal-80 { animation-range: entry 0% entry 80%; }
.reveal-90 { animation-range: entry 0% entry 90%; }

/* ---------- lista numerada de itens (relíquias / passos / cláusulas) ---------- */

.item-list { border-top: 1px solid var(--line); }
.item-row {
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  padding: 15px 4px; border-bottom: 1px solid var(--line); align-items: baseline;
}
.item-row .item-no { font-family: var(--font-mono); font-size: 10px; color: var(--brass); }
.item-row .item-text { font-size: 15px; line-height: 1.7; color: var(--text-soft); }

/* ---------- cartão de destaque com CTAs (licença / download) ---------- */

.info-card {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(20px,4vw,48px); align-items: center;
  border: 1px solid var(--verdigris);
  background: linear-gradient(135deg, rgba(62,140,122,.16), rgba(23,18,28,.2));
  padding: clamp(22px,3vw,36px);
}
.info-card .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--verdigris-light); margin-bottom: 12px; }
.info-card .headline { font-family: var(--font-serif); font-size: clamp(26px,3vw,34px); line-height: 1.3; color: var(--bone); max-width: 34ch; }
.info-card .tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-secondary); }
.info-card .tags .dot { color: var(--verdigris); }
.info-card .cta-col { display: grid; gap: 9px; min-width: 0; justify-self: end; }

.foot-row {
  margin-top: 44px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted);
}

/* ---------- catálogo (lista clicável) ---------- */

.catalog-list { border-top: 1px solid var(--line); }
.catalog-row {
  display: grid; grid-template-columns: 34px 46px 1fr auto 18px; align-items: center; gap: 16px;
  width: 100%; box-sizing: border-box; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 16px 10px; color: var(--bone); font: inherit; cursor: pointer;
}
.catalog-row:hover { background: rgba(62,140,122,.09); color: var(--verdigris-light); }
.catalog-row .row-no { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.catalog-row .row-thumb { display: block; width: 46px; height: 46px; border: 1px solid var(--line); object-fit: cover; }
.catalog-row .row-blank { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); }
.catalog-row .row-blank .diamond { width: 12px; height: 12px; border: 1px solid var(--verdigris); transform: rotate(45deg); opacity: .7; }
.catalog-row .row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.catalog-row .row-title { font-family: var(--font-serif); font-size: 22px; line-height: 1.15; }
.catalog-row .row-type { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.catalog-row .row-dist { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); text-align: right; min-width: 66px; }
.catalog-row .row-arrow { font-family: var(--font-mono); color: var(--verdigris); font-size: 13px; }
.catalog-row.is-more { color: var(--text-secondary); }
.catalog-row.is-more .row-blank { border: 1px dashed var(--line-soft); font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); }

/* ---------- modal de detalhe ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: clamp(16px,4vw,44px); background: rgba(10,7,13,.78); backdrop-filter: blur(4px);
  animation: fadein .2s ease-out both;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  max-width: 840px; width: 100%; max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-soft); padding: clamp(22px,3vw,36px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: popIn .26s cubic-bezier(.2,.7,.3,1) both;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.modal-head .head-info { display: flex; align-items: center; gap: 16px; }
.modal-head .head-thumb { width: 64px; height: 64px; flex: none; border: 1px solid var(--line-soft); object-fit: cover; }
.modal-head .head-title { font-family: var(--font-serif); font-size: 32px; line-height: 1.1; color: var(--bone); }
.modal-head .head-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
.modal-close {
  flex: none; border: 1px solid var(--line-soft); background: none; color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 12px; padding: 8px 12px; cursor: pointer;
}
.modal-close:hover { border-color: var(--verdigris); color: var(--verdigris-light); }
.modal-rule { height: 1px; background: var(--line); margin: 24px 0; }
.modal-desc { font-family: var(--font-serif); font-size: 20px; line-height: 1.68; color: var(--text-soft); margin: 0 0 26px; max-width: 62ch; }
.modal-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 10px; }
.modal-shots .plate-placeholder { border: 1px solid var(--line); }
.modal-foot {
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.7; color: var(--text-secondary);
}
.modal-foot .license-link { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- grid de tenets (TotalAdventure) ---------- */

.tenet-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,420px),1fr)); gap: 1px;
  background: var(--line);
}
.tenet-card { background: var(--ink); padding: 26px 22px; }
.tenet-card:hover { background: var(--panel); }
.tenet-card .tenet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.tenet-card .tenet-no { font-family: var(--font-mono); font-size: 10px; color: var(--brass); }
.tenet-card .tenet-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--verdigris-light); }
.tenet-card p { margin: 0; font-size: 15px; line-height: 1.72; color: var(--text-secondary); }

/* ---------- sumário (index.html) ---------- */

.volume-link {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(16px,3vw,30px);
  padding: 26px 8px; border-top: 1px solid var(--line); color: var(--bone);
}
.volume-link:hover { background: rgba(62,140,122,.09); color: var(--verdigris-light); }
.volume-link:last-child { border-bottom: 1px solid var(--line); }
.volume-link .vol-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--verdigris); }
.volume-link .vol-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.volume-link .vol-title { font-family: var(--font-serif); font-size: clamp(26px,3vw,36px); line-height: 1.05; }
.volume-link .vol-desc { font-size: 15px; line-height: 1.7; color: var(--text-secondary); }
.volume-link .vol-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); }
.volume-link .vol-arrow { font-family: var(--font-mono); color: var(--verdigris); font-size: 15px; }

/* ---------- colofão (contato) ---------- */

.contact-list { border-top: 1px solid var(--line); }
.contact-row {
  display: flex; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line);
  color: var(--bone);
}
.contact-row:hover { color: var(--verdigris-light); }
.contact-row .contact-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-muted); min-width: 78px;
}
.contact-row .contact-fill { flex: 1; border-bottom: 1px dotted var(--line-soft); }
.contact-row .contact-value { font-family: var(--font-serif); font-size: 22px; color: inherit; }
.motto {
  margin-top: 48px; text-align: center;
  display: inline-flex; align-items: center; gap: 12px; width: 100%; justify-content: center;
  font-family: var(--font-serif); font-style: italic; font-size: 24px; color: var(--verdigris-light);
}
.motto i { width: 5px; height: 5px; background: var(--brass); transform: rotate(45deg); display: block; }

/* ---------- vitrine de feature (prancha + descrição rica) ---------- */

.showcase-body { max-width: 62ch; }
.showcase-title { font-family: var(--font-serif); font-size: clamp(22px,2.6vw,28px); color: var(--bone); margin: 0 0 10px; }
.showcase-desc { font-size: 15px; line-height: 1.75; color: var(--text-secondary); margin: 0 0 14px; }
.showcase-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.showcase-tags .dot { color: var(--verdigris); }

/* ---------- tour interativo de features (abas trocam o painel, sem empilhar) ---------- */

.tour-nav {
  display: flex; flex-wrap: wrap; gap: 2px 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px,4vw,40px);
}
.tour-tab {
  background: none; border: 0; cursor: pointer;
  padding: 12px 16px 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: baseline; gap: 8px;
}
.tour-tab .num { color: var(--brass); font-family: var(--font-serif); font-size: 14px; letter-spacing: 0; }
.tour-tab:hover { color: var(--text-secondary); }
.tour-tab.is-active { color: var(--verdigris-light); border-bottom-color: var(--verdigris); }

.tour-panel { display: none; }
.tour-panel.is-active {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(22px,3vw,40px); align-items: start;
  animation: fadein .3s ease-out both;
}
.tour-panel .plate { margin: 0; }
.tour-panel .showcase-body { padding-top: 4px; }

@media (max-width: 780px) {
  .tour-panel.is-active { grid-template-columns: 1fr; }
}
