:root {
  --bg: #FAF8F5;
  --bg-warm: #F5F0EA;
  --bg-warm2: #EDE8E0;
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A5A;
  --text-muted: #8A8A9A;
  --accent: #2C3E6B;
  --accent-light: #4A6FA5;
  --gold: #C8A96E;
  --gold-soft: #D4BC8A;
  --night-deep: #0B0E1A;
  --night-mid: #141830;
  --night-blue: #1A2144;
  --star: #F0E6C8;
  --border: #E0DCD5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(224, 220, 213, 0.5);
  transition: all 0.4s ease;
}

nav.scrolled {
  padding: 0.8rem 3rem;
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
}

.nav-logo-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1;
}

.nav-logo-sub {
  font-family: 'Lora', serif;
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
  cursor: pointer;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.mobile-menu-btn span {
  width: 22px; height: 1px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ===== PAGE TRANSITIONS ===== */
.page {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.page.active {
  display: block;
  opacity: 1;
}

.page.fade-out {
  opacity: 0;
}

/* ============================================
   HOME PAGE
   ============================================ */

/* --- HERO / MANIFESTO --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(44, 62, 107, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(200, 169, 110, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-ornament {
  width: 1px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  margin-bottom: 2.5rem;
  animation: fadeDown 1.5s ease forwards;
  opacity: 0;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
  animation: fadeIn 1.5s ease 0.3s forwards;
  opacity: 0;
}

.hero-manifesto {
  max-width: 650px;
  animation: fadeIn 1.5s ease 0.6s forwards;
  opacity: 0;
}

.hero-manifesto h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.hero-manifesto h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-manifesto-text {
  font-family: 'Lora', serif;
  font-size: 1rem;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-manifesto-text .highlight {
  color: var(--text-primary);
  font-weight: 500;
}

.hero-signature {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gold);
  margin-top: 2rem;
  animation: fadeIn 1.5s ease 1.2s forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 1.5s ease 1.8s forwards;
  opacity: 0;
  cursor: pointer;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* --- TRANSITION STRIP --- */
.transition-strip {
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
}

.transition-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--border));
}

.transition-label {
  font-family: 'Lora', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 2rem;
}

/* --- BOOKSHELF --- */
.bookshelf {
  padding: 2rem 2rem 8rem;
  background: var(--bg);
  position: relative;
}

.bookshelf-header {
  text-align: center;
  margin-bottom: 4rem;
}

.bookshelf-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.bookshelf-subtitle {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Book grid */
.books-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 3rem;
  justify-items: center;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.4s ease;
}

.book-card:hover {
  transform: translateY(-8px);
}

.book-card-cover {
  width: 180px;
  height: 260px;
  border-radius: 3px 10px 10px 3px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
  perspective: 600px;
}

.book-card:hover .book-card-cover {
  box-shadow: 0 15px 40px rgba(0,0,0,0.2), 0 0 60px rgba(74, 111, 165, 0.1);
}

.book-card-cover-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

/* Book 1 - A Estrela */
.book-estrela .book-card-cover-inner {
  background: linear-gradient(135deg, #1a2144 0%, #0d1229 40%, #1a2144 100%);
  box-shadow: -5px 5px 25px rgba(0,0,0,0.35);
}

.book-estrela .book-card-cover-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, rgba(200,169,110,0.3), rgba(200,169,110,0.1), rgba(200,169,110,0.3));
}

.book-estrela .book-card-cover-inner::after {
  content: '';
  position: absolute;
  top: 15%; right: 15%;
  width: 2.5px; height: 2.5px;
  background: var(--star);
  border-radius: 50%;
  box-shadow:
    -25px -15px 0 1px rgba(240,230,200,0.5),
    15px -30px 0 0.5px rgba(240,230,200,0.3),
    -40px 8px 0 0.5px rgba(240,230,200,0.25),
    30px 15px 0 1px rgba(240,230,200,0.4);
}

.book-card-cover-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #E8E0D0;
  line-height: 1.4;
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}

.book-card-cover-author {
  font-family: 'Lora', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  opacity: 0.6;
  position: relative; z-index: 1;
}

/* Coming soon books */
.book-coming .book-card-cover-inner {
  background: linear-gradient(135deg, #d5cfc5 0%, #c8c0b4 50%, #d5cfc5 100%);
  box-shadow: -5px 5px 20px rgba(0,0,0,0.15);
}

.book-coming .book-card-cover-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, rgba(180,170,155,0.5), rgba(180,170,155,0.2), rgba(180,170,155,0.5));
}

.book-coming .book-card-cover-title {
  color: #8A8275;
  font-size: 1rem;
}

.book-coming .book-card-cover-author {
  color: #A09A8E;
}

.book-card-info {
  text-align: center;
}

.book-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.book-card-status {
  font-family: 'Lora', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-available {
  color: var(--gold);
}

.status-soon {
  color: var(--text-muted);
}

/* Shelf decoration */
.shelf-line {
  max-width: 1000px;
  margin: 0 auto;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border), var(--bg-warm2), var(--border), transparent);
  margin-top: -0.5rem;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ============================================
   BOOK PAGE
   ============================================ */

.book-page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s;
  padding: 7rem 3rem 0;
}

.book-page-back:hover {
  color: var(--gold);
}

.book-page-back svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Night hero for book */
.book-hero {
  background: linear-gradient(180deg, var(--night-deep) 0%, var(--night-mid) 50%, var(--night-blue) 100%);
  padding: 5rem 2rem 6rem;
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
}

.book-hero .stars {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.book-hero-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
  position: relative;
  z-index: 2;
}

.book-hero-cover {
  flex-shrink: 0;
  width: 240px; height: 340px;
  perspective: 800px;
}

.book-hero-cover-inner {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a2144 0%, #0d1229 40%, #1a2144 100%);
  border-radius: 4px 12px 12px 4px;
  box-shadow:
    -8px 8px 30px rgba(0,0,0,0.5),
    0 0 60px rgba(74,111,165,0.15),
    inset 0 0 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: rotateY(-5deg);
  transition: transform 0.5s ease;
}

.book-hero-cover-inner:hover {
  transform: rotateY(0deg) scale(1.02);
}

.book-hero-cover-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, rgba(200,169,110,0.3), rgba(200,169,110,0.1), rgba(200,169,110,0.3));
}

.book-hero-cover-inner::after {
  content: '';
  position: absolute;
  top: 10%; right: 10%;
  width: 3px; height: 3px;
  background: var(--star);
  border-radius: 50%;
  box-shadow:
    -30px -20px 0 1px rgba(240,230,200,0.6),
    20px -40px 0 0.5px rgba(240,230,200,0.4),
    -50px 10px 0 0.5px rgba(240,230,200,0.3),
    40px 20px 0 1px rgba(240,230,200,0.5);
}

.book-hero-cover-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: #E8E0D0;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}

.book-hero-cover-author {
  font-family: 'Lora', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  opacity: 0.7;
  position: relative; z-index: 1;
}

.book-hero-info {
  flex: 1;
}

.book-hero-label {
  font-family: 'Lora', serif;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.book-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  color: #E8E0D0;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.book-hero-author {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--gold-soft);
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.book-hero-desc {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  line-height: 1.9;
  color: rgba(232,224,208,0.6);
  margin-bottom: 2.5rem;
  max-width: 450px;
}

.book-cta {
  display: inline-block;
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding: 0.9rem 2.5rem;
  border: 1px solid rgba(200,169,110,0.4);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.book-cta::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: rgba(200,169,110,0.1);
  transition: left 0.4s ease;
}

.book-cta:hover::before { left: 0; }
.book-cta:hover {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(200,169,110,0.1);
}

/* Book excerpt / quote section */
.book-excerpt {
  padding: 6rem 2rem;
  background: var(--bg);
  text-align: center;
}

.book-excerpt-content {
  max-width: 550px;
  margin: 0 auto;
}

.book-excerpt-label {
  font-family: 'Lora', serif;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
}

.book-excerpt-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.book-excerpt-divider {
  width: 40px; height: 1px;
  background: var(--gold);
  margin: 0 auto 2rem;
}

.book-excerpt-context {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

/* Book details */
.book-details {
  padding: 4rem 2rem 6rem;
  background: var(--bg-warm);
}

.book-details-content {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.book-detail-item {
  text-align: center;
  padding: 1.5rem;
}

.book-detail-label {
  font-family: 'Lora', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.book-detail-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* ===== FOOTER ===== */
footer {
  background: var(--night-deep);
  padding: 4rem 2rem;
  text-align: center;
}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #E8E0D0;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer-sub {
  font-family: 'Lora', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(200,169,110,0.5);
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(232,224,208,0.4);
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
}

.footer-links a:hover { color: var(--gold-soft); }

.footer-divider {
  width: 40px; height: 1px;
  background: rgba(200,169,110,0.2);
  margin: 0 auto 2rem;
}

.footer-copy {
  font-family: 'Lora', serif;
  font-size: 0.7rem;
  color: rgba(232,224,208,0.25);
  letter-spacing: 0.05em;
}

/* ===== REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 7rem 1.5rem 4rem; }
  .bookshelf { padding: 2rem 1.5rem 5rem; }
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .book-card-cover { width: 150px; height: 216px; }
  .book-card-cover-title { font-size: 0.95rem; }
  .book-hero { padding: 3rem 1.5rem 4rem; margin-top: 1rem; }
  .book-hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }
  .book-hero-cover { width: 200px; height: 280px; }
  .book-hero-desc { max-width: 100%; }
  .book-page-back { padding: 6.5rem 1.5rem 0; }
  .book-excerpt { padding: 4rem 1.5rem; }
  .book-details { padding: 3rem 1.5rem 4rem; }
  .book-details-content { grid-template-columns: 1fr; }
  footer { padding: 3rem 1.5rem; }
}

/* Mobile menu overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250, 248, 245, 0.97);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.mobile-nav-overlay.open {
  display: flex;
}

.mobile-nav-overlay a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.1em;
}

.mobile-nav-close {
  position: absolute;
  top: 1.2rem; right: 1.5rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
}

/* Twinkle animation for stars */
@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.8; }
}
