/* ============================================================
   ADRIÁN MARÍA SOTO — SERIES DE NOVELAS
   Global Stylesheet
   Basado en hsinther.com — adaptado al brand español
   ============================================================ */

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Colors — warm Spanish palette based on retro-pulp logo */
  --bg-deep: #0f0a08;
  --bg-card: #1a1210;
  --bg-card-hover: #241a16;
  --bg-elevated: #1e1512;
  --text-primary: #ede6dc;
  --text-secondary: #9a8e82;
  --text-muted: #6a5e52;
  --accent: #8b2525;
  --accent-glow: #b83030;
  --accent-dark: #5c1a1a;
  --cream: #d4b896;
  --cream-glow: #e0c8a8;
  --cream-dark: #a08060;
  --border: #2a1e18;
  --border-light: #3a2e26;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--text-primary);
}

a {
  color: var(--cream);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--cream-glow); }

img { max-width: 100%; display: block; }

/* ==================== AMBIENT BACKGROUND ==================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.ambient-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(139, 37, 37, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(212, 184, 150, 0.03) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(139, 37, 37, 0.02) 0%, transparent 50%);
  animation: ambientDrift 30s ease-in-out infinite;
}

@keyframes ambientDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-2%, 1%) rotate(1deg); }
  66% { transform: translate(1%, -1%) rotate(-1deg); }
}

/* ==================== NAVIGATION ==================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(15, 10, 8, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 37, 37, 0.12);
  transition: all 0.4s var(--ease);
}

nav.scrolled {
  padding: 0.6rem 2rem;
  background: rgba(15, 10, 8, 0.95);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.nav-brand span {
  color: var(--cream);
  font-weight: 400;
  font-style: italic;
  font-size: 0.85em;
  margin-left: 0.5rem;
  opacity: 0.7;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--duration);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cream);
  transition: width var(--duration) var(--ease);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==================== LAYOUT HELPERS ==================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

section {
  padding: var(--space-2xl) 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==================== TYPOGRAPHY ==================== */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cream);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 650px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

/* ==================== HERO ==================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(139, 37, 37, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(212, 184, 150, 0.05) 0%, transparent 50%);
}

.hero-content {
  max-width: 800px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: 220px;
  height: auto;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 1s ease 0.2s forwards;
  filter: drop-shadow(0 4px 30px rgba(139, 37, 37, 0.3));
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cream);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 1s ease 0.3s forwards;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s ease 0.5s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-glow);
  font-weight: 600;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 1s ease 0.7s forwards;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  opacity: 0;
  animation: fadeUp 1s ease 0.9s forwards;
}

.hero-stat { text-align: center; }

.hero-stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeUp 1s ease 1.2s forwards;
}

.hero-scroll span {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--cream), transparent);
  margin: 0 auto;
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ==================== COVER GRID ==================== */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.2rem;
}

.cover-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s var(--ease);
  cursor: pointer;
  text-decoration: none;
  aspect-ratio: 6/9;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.cover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(139, 37, 37, 0.25);
  border-color: var(--accent);
}

.cover-card:hover img {
  transform: scale(1.03);
}

.cover-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.8rem 0.8rem;
  background: linear-gradient(to top, rgba(15, 10, 8, 0.95), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.cover-card:hover .cover-card-overlay {
  opacity: 1;
}

.cover-card-number {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--cream);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cover-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: 0.2rem;
}

/* Cover placeholder when no image */
.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.cover-placeholder-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cream);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.cover-placeholder-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.cover-placeholder-region {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-3px);
}

.card:hover::before { opacity: 1; }

/* Series Cards */
.series-card-genre {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cream);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.series-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.series-card-subtitle {
  font-size: 0.9rem;
  color: var(--cream);
  font-style: italic;
  margin-bottom: 1rem;
}

.series-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

/* ==================== TAGS ==================== */
.tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  display: inline-block;
}

.tag.accent {
  border-color: var(--accent-dark);
  color: var(--accent-glow);
}

.tag.cream {
  border-color: var(--cream-dark);
  color: var(--cream);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 0.9rem 1.8rem;
  background: var(--accent);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--duration);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-glow);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 37, 37, 0.35);
}

.btn-outline {
  padding: 0.7rem 1.5rem;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-outline:hover {
  background: rgba(212, 184, 150, 0.08);
  border-color: var(--cream);
  color: var(--cream);
}

.btn-amazon {
  background: #ff9900;
  color: #111;
}

.btn-amazon:hover {
  background: #ffaa22;
  color: #111;
  box-shadow: 0 4px 20px rgba(255, 153, 0, 0.3);
}

/* ==================== GRIDS ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

/* ==================== QUOTE DIVIDER ==================== */
.quote-divider {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.quote-divider::before,
.quote-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dark), transparent);
}

.quote-divider::before { top: 0; }
.quote-divider::after { bottom: 0; }

.quote-divider blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
}

.quote-divider cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: normal;
  letter-spacing: 0.1em;
}

/* ==================== BAND LIST (serie detail) ==================== */
.band-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--duration);
}

.band-item:last-child { border-bottom: none; }
.band-item:hover { padding-left: 0.5rem; }

.band-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cream);
}

.band-info { min-width: 0; }

.band-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.band-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.band-region {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ==================== NEWSLETTER ==================== */
.newsletter-section {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 600px;
  margin: 3rem auto;
  position: relative;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 37, 37, 0.2), transparent, rgba(212, 184, 150, 0.1));
  z-index: -1;
}

.newsletter-inner {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 3rem;
}

/* ==================== SOBRE MÍ (author page) ==================== */
.autor-hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.autor-content {
  max-width: 700px;
}

.autor-content p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.autor-content p:first-of-type {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.autor-signature {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--cream);
  margin-top: 2rem;
}

/* ==================== SERIE DETAIL PAGE ==================== */
.serie-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.serie-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(139, 37, 37, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(212, 184, 150, 0.04) 0%, transparent 50%);
}

.serie-hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

.serie-meta-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cream);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.serie-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.serie-hero .subtitle {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.serie-hero .logline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.serie-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.quick-fact {
  display: flex;
  flex-direction: column;
}

.quick-fact-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-fact-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ==================== RAINBOW ACCENT ==================== */
.rainbow-bar {
  height: 3px;
  background: linear-gradient(90deg, #e40303, #ff8c00, #ffed00, #008026, #004dff, #750787);
  border-radius: 2px;
  margin: 2rem 0;
  opacity: 0.7;
}

/* ==================== FOOTER ==================== */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: var(--space-xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--cream); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ==================== FRAGMENTO ==================== */
.fragmento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.fragmento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.fragmento-band {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cream);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.fragmento-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.fragmento-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.9;
  font-style: italic;
}

.fragmento-text p {
  margin-bottom: 1rem;
}

.fragmento-text p:last-child {
  margin-bottom: 0;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 600px) {
  nav { padding: 0.8rem 1rem; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 10, 8, 0.98);
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .hero-logo { width: 160px; }
  section { padding: 4rem 1.2rem; }
  .grid-4 { grid-template-columns: 1fr; }
  .band-region { display: none; }
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.8rem; }
}
