/* Catálogos J.E. Vargas — base pública (home, 404 e moldura do leitor) */
:root {
  --musgo: #12201a;
  --musgo-2: #1a2e25;
  --verde: #315A4A;
  --dourado: #CD9F57;
  --linho: #ECE6DA;
  --pedra: #93a39a;
  --linha: rgba(236, 230, 218, .12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--musgo);
  color: var(--linho);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--dourado); outline-offset: 3px; border-radius: 2px; }

/* ---------- topo ---------- */
.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
}
.topo__marca { display: block; width: 92px; }
.topo__marca svg, .topo__marca img { width: 100%; height: auto; display: block; }
.topo__rotulo {
  font-size: .68rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--pedra);
}

/* ---------- home ---------- */
.home {
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(49, 90, 74, .55) 0%, transparent 70%),
    var(--musgo);
}
.abertura {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) clamp(16px, 4vw, 48px) clamp(28px, 5vw, 56px);
}
.abertura h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: .95;
  letter-spacing: -.01em;
}
.abertura p {
  margin-top: 18px;
  max-width: 34ch;
  color: var(--pedra);
  font-size: 1rem;
}

.estante {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 56px);
}

/* Livro em 3D: a espessura do miolo vem do número de páginas */
.livro {
  display: block;
  text-decoration: none;
  perspective: 1600px;
}
.livro__obj {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-16deg) rotateX(3deg);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
  margin-right: var(--esp);
}
.livro__capa {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  border-radius: 2px 5px 5px 2px;
  transform: translateZ(calc(var(--esp) / 2));
  background: var(--musgo-2);
}
.livro__capa::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.livro__brilho {
  position: absolute;
  inset: 0;
  border-radius: 2px 5px 5px 2px;
  transform: translateZ(calc(var(--esp) / 2 + .5px));
  background: linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(255,255,255,.12) 1.2%, rgba(0,0,0,.08) 2.6%, transparent 6%),
              linear-gradient(115deg, rgba(255,255,255,.10), transparent 40%);
  pointer-events: none;
}
.livro__miolo {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 0;
  width: var(--esp);
  transform-origin: right center;
  transform: translateZ(calc(var(--esp) / 2)) rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f1ece1 0 1px, #cfc6b4 1px 2px);
}
.livro__verso {
  position: absolute;
  inset: 0;
  border-radius: 5px 2px 2px 5px;
  transform: translateZ(calc(var(--esp) / -2));
  background: #0c1612;
  box-shadow: 0 30px 50px -18px rgba(0, 0, 0, .8);
}
.livro__chao {
  display: block;
  height: 18px;
  margin: 6px 6% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .7s;
}
.livro:hover .livro__obj,
.livro:focus-visible .livro__obj { transform: rotateY(-30deg) rotateX(4deg) translateY(-8px); }
.livro:hover .livro__chao { transform: scaleX(.9); opacity: .7; }

.livro__legenda { margin-top: 18px; }
.livro__titulo {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.1;
}
.livro__info {
  margin-top: 6px;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--pedra);
}
.livro__info b { color: var(--dourado); font-weight: 500; white-space: nowrap; }

.vazio {
  grid-column: 1 / -1;
  padding: 64px 0;
  color: var(--pedra);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-style: italic;
}

/* ---------- rodapé ---------- */
.rodape {
  border-top: 1px solid var(--linha);
  padding: 28px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--pedra);
  text-align: center;
}
.rodape img { width: 84px; }
.rodape a { color: #fff; font-weight: 500; text-decoration: none; }
.rodape a:hover { color: var(--dourado); }

/* ---------- 404 ---------- */
.erro {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
}
.erro h1 { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(2.4rem, 7vw, 4rem); }
.erro p { margin-top: 12px; color: var(--pedra); }
.botao-linha {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 28px;
  border: 1px solid var(--dourado);
  border-radius: 999px;
  color: #fff;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.botao-linha:hover { background: var(--dourado); color: var(--musgo); }

@media (prefers-reduced-motion: reduce) {
  .livro__obj, .livro__chao { transition: none; }
}
