/* Biblioteca — estante de livros */

:root {
  --bg-deep: #06080d;
  --bg-panel: #0c1018;
  --bg-elevated: #121822;
  --text-primary: #e8ecf4;
  --text-secondary: #8b95a8;
  --text-muted: #5c6578;
  --accent: #5eead4;
  --accent-dim: #2dd4bf66;
  --accent-glow: #5eead422;
  --border: #1e2836;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-read: "Literata", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, #6366f111, transparent);
  pointer-events: none;
  z-index: 0;
}

.library {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.library-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.library-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

.library-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-read);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
}

.library-subtitle {
  margin: 0 auto;
  max-width: 32rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 2.5rem 2rem;
}

.shelf-list > li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Livro 3D */
.book {
  position: relative;
  display: block;
  width: 9.5rem;
  height: 13.5rem;
  text-decoration: none;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateY(-18deg);
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(12px 16px 24px #00000088);
}

.book:hover {
  transform: perspective(900px) rotateY(-8deg) translateY(-6px);
  filter: drop-shadow(16px 22px 32px #000000aa);
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.1rem;
  height: 100%;
  background: linear-gradient(180deg, #0a3d38 0%, #062824 100%);
  border-radius: 3px 0 0 3px;
  box-shadow: inset -2px 0 6px #00000066;
}

.book-pages {
  position: absolute;
  right: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 0.55rem;
  background: repeating-linear-gradient(
    180deg,
    #d8dce6 0,
    #d8dce6 2px,
    #b8beca 2px,
    #b8beca 3px
  );
  border-radius: 0 2px 2px 0;
}

.book-cover {
  position: absolute;
  inset: 0 0.55rem 0 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.85rem;
  background:
    linear-gradient(145deg, #134e4a 0%, #0f766e 35%, #115e59 100%);
  border: 1px solid #2dd4bf33;
  border-radius: 0 4px 4px 0;
  box-shadow: inset 0 1px 0 #ffffff18;
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffffff12 0%, transparent 45%);
  pointer-events: none;
}

.book-year {
  position: relative;
  align-self: flex-end;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #99f6e4cc;
  padding: 0.2rem 0.45rem;
  border: 1px solid #5eead444;
  border-radius: 999px;
}

.book-title {
  position: relative;
  font-family: var(--font-read);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  text-shadow: 0 2px 12px #00000066;
}

.book-genre {
  position: relative;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #99f6e4aa;
}

.book-info {
  text-align: center;
  max-width: 14rem;
}

.book-info-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.book-info-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.book-info-title a:hover {
  color: var(--accent);
}

.book-info-tagline {
  margin: 0 0 0.5rem;
  font-family: var(--font-read);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.45;
}

.book-info-meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.library-footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .library {
    padding-top: 2rem;
  }

  .shelf-list {
    grid-template-columns: 1fr;
  }
}
