/* =========================================
   EL ALMA DE MOIRA — Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lato:wght@300;400;700&display=swap');

/* ---- Variables ---- */
:root {
  --bg-deep: #08080e;
  --bg-mid: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --gold: #c9a96e;
  --gold-light: #e8c98a;
  --violet: #8b5cf6;
  --violet-dim: #4c2a8a;
  --cream: #e8e0d5;
  --cream-dim: #a09688;
  --border: rgba(201, 169, 110, 0.2);
  --glow-gold: 0 0 40px rgba(201, 169, 110, 0.25);
  --glow-violet: 0 0 40px rgba(139, 92, 246, 0.3);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Lato', sans-serif;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

/* =========================================
   NAV
   ========================================= */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 8, 14, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

nav.scrolled {
  background: rgba(8, 8, 14, 0.95);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--gold);
}

/* =========================================
   HERO
   ========================================= */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(139, 92, 246, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(201, 169, 110, 0.12) 0%, transparent 60%),
    var(--bg-deep);
}

#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}

.hero-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 80px rgba(201, 169, 110, 0.4);
  opacity: 0;
  animation: fadeUp 1s 0.6s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--gold);
}

.hero-divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem auto;
  opacity: 0;
  animation: fadeUp 1s 0.9s forwards;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--cream-dim);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 1s 1.1s forwards;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 1s 1.3s forwards;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #08080e;
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(201, 169, 110, 0.55);
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-3px);
}

/* =========================================
   SECTIONS – shared
   ========================================= */
section {
  padding: 7rem 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.section-title em {
  color: var(--gold);
  font-style: italic;
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   BOOK SECTION
   ========================================= */
#libro {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}

.libro-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 5rem;
  align-items: center;
}

.libro-cover-wrapper {
  position: relative;
}

.libro-cover-wrapper::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  border-radius: 4px;
}

.libro-cover {
  width: 100%;
  max-width: 320px;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), var(--glow-violet);
  animation: float 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.libro-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.libro-badge {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.libro-desc {
  font-size: 1.05rem;
  color: var(--cream-dim);
  line-height: 1.9;
  margin-bottom: 2rem;
}

.buy-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================================
   FRAGMENTOS
   ========================================= */
#fragmentos {
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

#fragmentos::before {
  content: '"';
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-size: 20rem;
  color: rgba(201, 169, 110, 0.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.fragmentos-header {
  text-align: center;
  margin-bottom: 4rem;
}

.tabs {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 0.8rem 2rem;
  background: none;
  border: none;
  color: var(--cream-dim);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active,
.tab-btn:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.fragmento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3rem;
  backdrop-filter: blur(8px);
  max-width: 820px;
  margin: 0 auto;
  position: relative;
}

.fragmento-card::before {
  content: attr(data-chapter);
  position: absolute;
  top: -0.75rem;
  left: 2rem;
  background: var(--gold);
  color: #08080e;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.2rem 0.8rem;
  border-radius: 2px;
}

.fragmento-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 2;
  color: var(--cream);
}

/* =========================================
   AUTORA
   ========================================= */
#autora {
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
}

.autora-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 5rem;
  align-items: center;
}

.autora-bio p {
  font-size: 1rem;
  color: var(--cream-dim);
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

.autora-facts {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 2rem 0;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--cream);
}

.fact-icon {
  width: 32px;
  height: 32px;
  background: rgba(20, 20, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.autora-photo-wrapper {
  position: relative;
}

.autora-photo-wrapper::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: -20px;
  bottom: -20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 0;
}

.autora-photo {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow-gold);
  position: relative;
  z-index: 1;
}

.dedicatoria-card {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.dedicatoria-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold);
}

.dedicatoria-content {
  max-width: 900px;
  margin: 0 auto;
}

.dedicatoria-p1 {
  font-family: var(--font-sans);
  color: var(--cream);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.dedicatoria-p2 {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--cream-dim);
  font-size: 1.25rem;
  line-height: 1.8;
  position: relative;
  padding-left: 2rem;
}

.dedicatoria-p2::before {
  content: '"';
  font-family: var(--font-serif);
  position: absolute;
  left: 0;
  top: -10px;
  font-size: 3rem;
  color: var(--gold);
  opacity: 0.4;
}

/* =========================================
   COMPRAR
   ========================================= */
#comprar {
  background: var(--bg-deep);
  text-align: center;
}

#comprar .section-title,
#comprar .section-label {
  text-align: center;
}

.comprar-subtitle {
  font-size: 1rem;
  color: var(--cream-dim);
  max-width: 500px;
  margin: 0 auto 4rem;
}

.comprar-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.comprar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.comprar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.05), transparent);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  /* Prevenir que bloquee clics */
  z-index: 0;
}

.comprar-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 169, 110, 0.5);
  box-shadow: var(--glow-gold);
}

.comprar-card:hover::before {
  opacity: 1;
}

.comprar-card.featured {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.08), rgba(139, 92, 246, 0.08));
}

.featured-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gold);
  color: #08080e;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 0 8px 0 8px;
}

.comprar-img-wrapper {
  width: 120px;
  height: 180px;
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
}

.comprar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(201, 169, 110, 0.2);
  transition: transform var(--transition);
}

.comprar-card:hover .comprar-img {
  transform: scale(1.05) translateY(-5px);
}

.comprar-format {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.comprar-desc {
  font-size: 0.85rem;
  color: var(--cream-dim);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--cream-dim);
  margin-bottom: 2.5rem;
}

.social-links {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  transition: all var(--transition);
}

.social-link:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-3px);
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 1.5rem;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--cream-dim);
  opacity: 0.6;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-18px);
  }
}

/* =========================================
   RESPONSIVE
   ========================================= */
.comprar-format,
.comprar-desc,
.btn-buy {
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {

  .libro-grid,
  .autora-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .libro-cover-wrapper {
    text-align: center;
  }

  .libro-cover {
    margin: 0 auto;
  }

  .autora-photo-wrapper {
    max-width: 340px;
    margin: 0 auto;
  }

  .autora-photo-wrapper::after {
    display: none;
  }

  .comprar-cards {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
}

@media (max-width: 600px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    display: none;
  }

  section {
    padding: 5rem 1.2rem;
  }

  .fragmento-card {
    padding: 2rem 1.2rem;
  }

  .tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}