/* ═══════════════════════════════════════════════════════
   ReadVault — Design System
   Dark parchment · Rich gold · Playfair + Inter
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --dark:       #120e08;
  --dark-2:     #1c1610;
  --dark-3:     #251d13;
  --dark-card:  #1a1309;
  --gold:       #c9a048;
  --gold-light: #e8c570;
  --gold-dim:   #8a6c2e;
  --amber:      #5a3c1e;
  --parchment:  #f5eedc;
  --parchment-2:#d4c9a8;
  --text-muted: #9a8a6a;
  --border:     rgba(201,160,72,0.18);
  --border-hover: rgba(201,160,72,0.45);
  --glow:       rgba(201,160,72,0.12);

  --radius:     14px;
  --radius-lg:  22px;
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
  --shadow:     0 4px 32px rgba(0,0,0,0.55);
  --shadow-gold:0 0 40px rgba(201,160,72,0.14);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--dark);
  color: var(--parchment);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

p { color: var(--parchment-2); }

a { text-decoration: none; color: var(--gold); transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ── Layout helpers ────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 96px 0; }
.section-sm { padding: 64px 0; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  box-shadow: 0 4px 24px rgba(201,160,72,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(201,160,72,0.5);
  color: var(--dark);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--border-hover);
}
.btn-outline:hover {
  background: var(--glow);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.btn-amazon {
  background: linear-gradient(135deg, #ff9900, #ffb74d);
  color: #111;
  font-weight: 700;
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  border-radius: var(--radius);
}
.btn-amazon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,153,0,0.4);
  color: #111;
}

/* ── Nav ───────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(18,14,8,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--parchment);
}
.nav-logo span { color: var(--gold); }
.nav-logo svg { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  color: var(--parchment-2);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }

.nav-cta { margin-left: 12px; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--parchment);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 68px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 60% 40%, rgba(201,160,72,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 70%, rgba(90,60,30,0.15) 0%, transparent 60%),
    var(--dark);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,160,72,0.1);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero-badge::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero h1 { margin-bottom: 24px; }
.hero h1 em { color: var(--gold); font-style: italic; }

.hero p {
  font-size: 1.15rem;
  max-width: 540px;
  margin-bottom: 40px;
  color: var(--parchment-2);
}

.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Floating book decoration */
.hero-deco {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  opacity: 0.07;
  pointer-events: none;
  font-size: 320px;
  line-height: 1;
  user-select: none;
}

/* ── Section headers ───────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.section-header h2 { margin-bottom: 16px; }
.section-header p { max-width: 520px; margin: 0 auto; font-size: 1.05rem; }

/* ── Book Cards ────────────────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.book-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.book-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-gold), var(--shadow);
}

.book-card-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--dark-3);
  position: relative;
}
.book-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.book-card:hover .book-card-img img { transform: scale(1.06); }
.book-card-img .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--gold-dim);
}

.book-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 50px;
}

.book-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-category {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--parchment);
  line-height: 1.35;
  flex: 1;
}

.book-author { font-size: 0.85rem; color: var(--text-muted); }

.book-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.stars { color: var(--gold); letter-spacing: 1px; }
.rating-count { color: var(--text-muted); }

.book-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}
.book-price .was {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
  font-family: 'Inter', sans-serif;
}

/* ── Category Filter Pills ─────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.filter-tab {
  padding: 8px 22px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.filter-tab:hover { border-color: var(--gold-dim); color: var(--parchment); }
.filter-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-color: transparent;
  color: var(--dark);
  font-weight: 600;
}

/* ── Feature / Value Props ─────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.feature-card {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--dark-3);
  transform: translateY(-4px);
}
.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 20px;
  display: block;
}
.feature-card h3 { margin-bottom: 10px; font-size: 1.15rem; }
.feature-card p { font-size: 0.92rem; }

/* ── Audible Banner ────────────────────────────────────── */
.audible-banner {
  background: linear-gradient(135deg, #1a1009 0%, #2a1a06 50%, #1a1009 100%);
  border: 1px solid rgba(255,153,0,0.25);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.audible-banner::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,153,0,0.12), transparent 70%);
  border-radius: 50%;
}
.audible-banner-text h2 { font-size: 2rem; margin-bottom: 12px; }
.audible-banner-text p { max-width: 420px; }
.audible-tag {
  display: inline-block;
  background: #ff9900;
  color: #111;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 4px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.btn-audible {
  background: linear-gradient(135deg, #ff9900, #ffb74d);
  color: #111;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}
.btn-audible:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255,153,0,0.4);
  color: #111;
}

/* ── Newsletter / CTA banner ───────────────────────────── */
.cta-banner {
  text-align: center;
  padding: 80px 24px;
}
.cta-banner h2 { margin-bottom: 16px; }
.cta-banner p { margin-bottom: 36px; font-size: 1.05rem; }

/* ── Footer ────────────────────────────────────────────── */
footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-brand p { font-size: 0.9rem; margin-top: 16px; max-width: 280px; line-height: 1.8; }
.footer-col h4 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--parchment);
  margin-bottom: 20px;
  font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.88rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--gold); }

.social-links { display: flex; gap: 12px; margin-top: 24px; }
.social-link {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.social-link:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--glow);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); font-size: 0.82rem; }
.footer-bottom a:hover { color: var(--gold); }
.affiliate-disclosure {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* ── About page ────────────────────────────────────────── */
.about-hero { padding: 140px 0 80px; text-align: center; }
.about-hero h1 em { color: var(--gold); font-style: italic; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.about-visual {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  font-size: 8rem;
  line-height: 1;
}

/* ── Page header (books.html) ──────────────────────────── */
.page-hero {
  padding: 140px 0 64px;
  text-align: center;
}
.page-hero .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ── Scroll reveal ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: rgba(18,14,8,0.97);
    backdrop-filter: blur(20px);
    padding: 32px 24px 48px;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }

  .hero-deco { display: none; }
  .hero-stats { gap: 28px; flex-wrap: wrap; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { display: none; }

  .audible-banner { flex-direction: column; text-align: center; padding: 40px 24px; }
}

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .hero { min-height: auto; padding: 120px 0 80px; }
  .hero-stats { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}

/* -- Dynamic grid divider ---------------------------------------- */
.grid-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 4px;
  color: var(--text-muted, #a8956e);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.grid-divider::before,
.grid-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201,160,72,0.2);
}

/* -- Skeleton loader card ---------------------------------------- */
.skeleton-card { pointer-events: none; }
.skeleton-img  { background: rgba(255,255,255,0.06); border-radius: 12px 12px 0 0; height: 220px; }
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  margin: 10px 0;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}

/* -- YouTube video badge on book card --------------------------- */
.video-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,0,0,0.85);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
  z-index: 2;
}
.video-badge:hover { background: #cc0000; }
