/* ==========================================================================
   COLECCIÓN CORPORATIVA | BOOK COVER DESIGN SYSTEM
   Author: Andy Meza Rojas
   ========================================================================== */

/* --- CSS Variables & Theme Foundations --- */
:root {
  /* Common System Metrics */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --font-serif: 'Playfair Display', 'Cinzel', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Cinzel', 'Playfair Display', serif;
}

/* ==========================================================================
   THEMES (5 ALTERNATIVES)
   ========================================================================== */

/* 1. EDITORIAL OSCURO & ORO (Default) */
[data-theme="dark-editorial"] {
  --bg-page: #0b0d12;
  --bg-jacket: #131722;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #1c2333 0%, #111520 70%, #0a0d14 100%);
  --bg-sheet: #151a26;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  
  --border-cover: 1px solid rgba(212, 175, 55, 0.35);
  --border-inner: 1px solid rgba(212, 175, 55, 0.18);
  --border-sheet: 1px solid rgba(212, 175, 55, 0.25);
  --border-card: 1px solid rgba(255, 255, 255, 0.08);

  --text-title: #f8f6f0;
  --text-accent: #e5c158; /* Gold Foil */
  --text-body: #c0c6d4;
  --text-muted: #8892a6;

  --spine-color: linear-gradient(180deg, #d4af37 0%, #8a6d1c 50%, #4a3a0f 100%);
  --btn-bg: rgba(229, 193, 88, 0.08);
  --btn-border: 1px solid rgba(229, 193, 88, 0.3);
  --btn-text: #f5e4ab;
  --btn-hover-bg: rgba(229, 193, 88, 0.18);

  --shadow-cover: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.08);
}

/* 2. ENCUADERNACIÓN CLÁSICA (Crimson Leather & Gold) */
[data-theme="classic-leather"] {
  --bg-page: #12090b;
  --bg-jacket: #1f0d11;
  --bg-cover: radial-gradient(120% 100% at 50% 0%, #361117 0%, #200a0d 70%, #120507 100%);
  --bg-sheet: #260d12;
  --bg-card: rgba(255, 240, 220, 0.04);
  --bg-card-hover: rgba(255, 240, 220, 0.08);

  --border-cover: 2px solid rgba(235, 190, 105, 0.45);
  --border-inner: 1px solid rgba(235, 190, 105, 0.25);
  --border-sheet: 1px solid rgba(235, 190, 105, 0.3);
  --border-card: 1px solid rgba(235, 190, 105, 0.12);

  --text-title: #fff8eb;
  --text-accent: #f3cf7a; /* Warm Gold */
  --text-body: #e3d2c8;
  --text-muted: #a68b82;

  --spine-color: linear-gradient(180deg, #f3cf7a 0%, #99742d 50%, #4a340f 100%);
  --btn-bg: rgba(243, 207, 122, 0.1);
  --btn-border: 1px solid rgba(243, 207, 122, 0.4);
  --btn-text: #fdf1d6;
  --btn-hover-bg: rgba(243, 207, 122, 0.22);

  --shadow-cover: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(243, 207, 122, 0.12);
}

/* 3. MINIMALISTA MODERNO (Crisp Sapphire & Slate) */
[data-theme="modern-minimal"] {
  --bg-page: #0f172a;
  --bg-jacket: #1e293b;
  --bg-cover: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  --bg-sheet: #1e293b;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);

  --border-cover: 1px solid rgba(56, 189, 248, 0.4);
  --border-inner: 1px solid rgba(56, 189, 248, 0.2);
  --border-sheet: 1px solid rgba(56, 189, 248, 0.25);
  --border-card: 1px solid rgba(255, 255, 255, 0.08);

  --text-title: #f8fafc;
  --text-accent: #38bdf8; /* Sapphire Blue */
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;

  --spine-color: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
  --btn-bg: rgba(56, 189, 248, 0.08);
  --btn-border: 1px solid rgba(56, 189, 248, 0.3);
  --btn-text: #e0f2fe;
  --btn-hover-bg: rgba(56, 189, 248, 0.18);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.1);
}

/* 4. PLATA PLATINO (Silver Platinum & Obsidian Leather) */
[data-theme="silver-platinum"] {
  --bg-page: #0b0d11;
  --bg-jacket: #131720;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #1e2532 0%, #111622 70%, #090b10 100%);
  --bg-sheet: #151a26;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);

  --border-cover: 1px solid rgba(210, 220, 235, 0.4);
  --border-inner: 1px solid rgba(210, 220, 235, 0.22);
  --border-sheet: 1px solid rgba(210, 220, 235, 0.28);
  --border-card: 1px solid rgba(255, 255, 255, 0.08);

  --text-title: #f8fafc;
  --text-accent: #cbd5e1; /* Polished Sterling Silver */
  --text-body: #a0aec0;
  --text-muted: #64748b;

  --spine-color: linear-gradient(180deg, #f1f5f9 0%, #94a3b8 50%, #475569 100%);
  --btn-bg: rgba(203, 213, 225, 0.08);
  --btn-border: 1px solid rgba(203, 213, 225, 0.35);
  --btn-text: #f1f5f9;
  --btn-hover-bg: rgba(203, 213, 225, 0.18);

  --shadow-cover: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(203, 213, 225, 0.12);
}

/* 5. PLATA TITANIO (Frost Silver & Chrome Metallic) */
[data-theme="silver-frost"] {
  --bg-page: #0f141d;
  --bg-jacket: #182230;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #28364a 0%, #16202e 70%, #0d131c 100%);
  --bg-sheet: #192534;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);

  --border-cover: 1px solid rgba(241, 245, 249, 0.55);
  --border-inner: 1px solid rgba(241, 245, 249, 0.3);
  --border-sheet: 1px solid rgba(241, 245, 249, 0.35);
  --border-card: 1px solid rgba(255, 255, 255, 0.1);

  --text-title: #ffffff;
  --text-accent: #e2e8f0; /* Radiant Frost Silver */
  --text-body: #cbd5e1;
  --text-muted: #8495ab;

  --spine-color: linear-gradient(180deg, #ffffff 0%, #cbd5e1 45%, #64748b 100%);
  --btn-bg: rgba(241, 245, 249, 0.1);
  --btn-border: 1px solid rgba(241, 245, 249, 0.42);
  --btn-text: #ffffff;
  --btn-hover-bg: rgba(241, 245, 249, 0.22);

  --shadow-cover: 0 25px 60px -15px rgba(0, 0, 0, 0.88), 0 0 45px rgba(241, 245, 249, 0.18);
}

/* --- LIGHT THEMES (5 ALTERNATIVES) --- */

/* 6. EDITORIAL BLANCO & ORO (Light Gold Editorial) */
[data-theme="light-editorial"] {
  --bg-page: #f8fafc;
  --bg-jacket: #ffffff;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #ffffff 0%, #f1f5f9 70%, #e2e8f0 100%);
  --bg-sheet: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);

  --border-cover: 1px solid rgba(184, 134, 11, 0.4);
  --border-inner: 1px solid rgba(184, 134, 11, 0.2);
  --border-sheet: 1px solid rgba(184, 134, 11, 0.25);
  --border-card: 1px solid rgba(0, 0, 0, 0.08);

  --text-title: #0f172a;
  --text-accent: #b8860b; /* Rich Metallic Gold */
  --text-body: #334155;
  --text-muted: #64748b;

  --spine-color: linear-gradient(180deg, #d4af37 0%, #b8860b 50%, #8a6d1c 100%);
  --btn-bg: rgba(184, 134, 11, 0.06);
  --btn-border: 1px solid rgba(184, 134, 11, 0.3);
  --btn-text: #1e293b;
  --btn-hover-bg: rgba(184, 134, 11, 0.14);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.15), 0 0 30px rgba(184, 134, 11, 0.1);
}

/* 7. MARFIL & CARMESÍ (Light Ivory Leather & Crimson) */
[data-theme="light-crimson"] {
  --bg-page: #fdfbf7;
  --bg-jacket: #fcf8f2;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #fffdfa 0%, #f7f1e5 70%, #ede3d1 100%);
  --bg-sheet: #faf5eb;
  --bg-card: rgba(155, 28, 43, 0.04);
  --bg-card-hover: rgba(155, 28, 43, 0.08);

  --border-cover: 2px solid rgba(155, 28, 43, 0.45);
  --border-inner: 1px solid rgba(155, 28, 43, 0.2);
  --border-sheet: 1px solid rgba(155, 28, 43, 0.25);
  --border-card: 1px solid rgba(155, 28, 43, 0.12);

  --text-title: #2b0d12;
  --text-accent: #9b1c2b; /* Royal Crimson */
  --text-body: #4a2c31;
  --text-muted: #8a656c;

  --spine-color: linear-gradient(180deg, #c02638 0%, #9b1c2b 50%, #5c0f19 100%);
  --btn-bg: rgba(155, 28, 43, 0.06);
  --btn-border: 1px solid rgba(155, 28, 43, 0.3);
  --btn-text: #2b0d12;
  --btn-hover-bg: rgba(155, 28, 43, 0.14);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.15), 0 0 30px rgba(155, 28, 43, 0.1);
}

/* 8. ZAFIRO CLARO (Light Sapphire & Ice) */
[data-theme="light-sapphire"] {
  --bg-page: #f0f7ff;
  --bg-jacket: #ffffff;
  --bg-cover: linear-gradient(160deg, #ffffff 0%, #e6f0fa 100%);
  --bg-sheet: #ffffff;
  --bg-card: rgba(2, 132, 199, 0.04);
  --bg-card-hover: rgba(2, 132, 199, 0.08);

  --border-cover: 1px solid rgba(2, 132, 199, 0.4);
  --border-inner: 1px solid rgba(2, 132, 199, 0.2);
  --border-sheet: 1px solid rgba(2, 132, 199, 0.25);
  --border-card: 1px solid rgba(0, 0, 0, 0.08);

  --text-title: #0c4a6e;
  --text-accent: #0284c7; /* Vibrant Sapphire */
  --text-body: #334155;
  --text-muted: #64748b;

  --spine-color: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
  --btn-bg: rgba(2, 132, 199, 0.06);
  --btn-border: 1px solid rgba(2, 132, 199, 0.3);
  --btn-text: #0c4a6e;
  --btn-hover-bg: rgba(2, 132, 199, 0.14);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.12), 0 0 30px rgba(2, 132, 199, 0.1);
}

/* 9. PLATA PERLA (Light Pearl Silver & Platinum) */
[data-theme="light-platinum"] {
  --bg-page: #f1f5f9;
  --bg-jacket: #ffffff;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #ffffff 0%, #f1f5f9 65%, #e2e8f0 100%);
  --bg-sheet: #f8fafc;
  --bg-card: rgba(71, 85, 105, 0.05);
  --bg-card-hover: rgba(71, 85, 105, 0.1);

  --border-cover: 1px solid rgba(71, 85, 105, 0.4);
  --border-inner: 1px solid rgba(71, 85, 105, 0.22);
  --border-sheet: 1px solid rgba(71, 85, 105, 0.28);
  --border-card: 1px solid rgba(0, 0, 0, 0.08);

  --text-title: #0f172a;
  --text-accent: #475569; /* Polished Dark Sterling */
  --text-body: #334155;
  --text-muted: #64748b;

  --spine-color: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 50%, #475569 100%);
  --btn-bg: rgba(71, 85, 105, 0.06);
  --btn-border: 1px solid rgba(71, 85, 105, 0.3);
  --btn-text: #0f172a;
  --btn-hover-bg: rgba(71, 85, 105, 0.14);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.15), 0 0 30px rgba(148, 163, 184, 0.15);
}

/* 10. CRISTAL TITANIO (Light Titanium Frost & Chrome) */
[data-theme="light-frost"] {
  --bg-page: #eef2f6;
  --bg-jacket: #f8fafc;
  --bg-cover: radial-gradient(130% 100% at 50% 0%, #ffffff 0%, #e2e8f0 70%, #cbd5e1 100%);
  --bg-sheet: #f1f5f9;
  --bg-card: rgba(30, 41, 59, 0.05);
  --bg-card-hover: rgba(30, 41, 59, 0.1);

  --border-cover: 1px solid rgba(30, 41, 59, 0.45);
  --border-inner: 1px solid rgba(30, 41, 59, 0.25);
  --border-sheet: 1px solid rgba(30, 41, 59, 0.3);
  --border-card: 1px solid rgba(0, 0, 0, 0.08);

  --text-title: #0f172a;
  --text-accent: #1e293b; /* Steel Titanium Chrome */
  --text-body: #334155;
  --text-muted: #64748b;

  --spine-color: linear-gradient(180deg, #ffffff 0%, #cbd5e1 50%, #64748b 100%);
  --btn-bg: rgba(30, 41, 59, 0.06);
  --btn-border: 1px solid rgba(30, 41, 59, 0.32);
  --btn-text: #0f172a;
  --btn-hover-bg: rgba(30, 41, 59, 0.14);

  --shadow-cover: 0 20px 50px -10px rgba(0, 0, 0, 0.18), 0 0 35px rgba(100, 116, 139, 0.2);
}

/* ==========================================================================
   GLOBAL RESET & LAYOUT
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: background-color var(--transition-normal);
  overflow-x: hidden;
}

/* ==========================================================================
   FLOATING CELESTIAL CONTROL (FIXED BOTTOM RIGHT)
   ========================================================================== */

.celestial-bar.floating-bottom-right {
  position: fixed;
  bottom: 24px;
  right: 24px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  padding: 0.4rem 0.55rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2);
  z-index: 99;
  transition: all var(--transition-fast);
}

.celestial-bar.floating-bottom-right:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 215, 0, 0.5);
}

.celestial-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.celestial-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 215, 0, 0.5);
  transform: scale(1.08);
}

.celestial-btn.active[data-mode="dark"] {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.6) 0%, rgba(59, 7, 100, 0.8) 100%);
  border-color: rgba(192, 132, 252, 0.85);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.5);
}

.celestial-btn.active[data-mode="light"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.6) 0%, rgba(180, 83, 9, 0.8) 100%);
  border-color: rgba(251, 191, 36, 0.9);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
}

.celestial-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moon-icon {
  color: #d8b4fe;
  text-shadow: 0 0 10px rgba(192, 132, 252, 1);
}

.sun-icon {
  color: #fde047;
  text-shadow: 0 0 10px rgba(251, 191, 36, 1);
}

@media (max-width: 600px) {
  .celestial-bar.floating-bottom-right {
    bottom: 16px;
    right: 16px;
  }
}


/* ==========================================================================
   BOOK VIEWPORT & JACKET CONTAINER
   ========================================================================== */

.book-viewport {
  width: 100%;
  max-width: 480px; /* Mobile book ratio by default */
  display: flex;
  justify-content: center;
}

/* Desktop layout adjustment: elegant book frame preview */
@media (min-width: 850px) {
  .book-viewport {
    max-width: 540px;
  }
}

.book-jacket {
  width: 100%;
  position: relative;
  background-color: var(--bg-jacket);
  border-radius: var(--radius-lg);
  box-shadow: none;
  display: flex;
  transition: transform var(--transition-normal);
  border: var(--border-cover);
  overflow: hidden;
}

.book-jacket:hover {
  transform: translateY(-3px);
}

/* Book Spine Visual Edge */
.book-spine {
  width: 14px;
  background: var(--spine-color);
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset -2px 0 5px rgba(0, 0, 0, 0.5);
}

/* Book Cover Main Canvas */
.book-cover {
  flex: 1;
  background: var(--bg-cover);
  padding: 2.2rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  position: relative;
}

/* Frame Inner Decorative Border */
.book-cover::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: var(--border-inner);
  border-radius: var(--radius-md);
  pointer-events: none;
}

/* ==========================================================================
   COVER HEADER & LOGO AREA
   ========================================================================== */

.cover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-accent);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 139, 145, 0.4));
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.website-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition-fast);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}

.website-link:hover {
  color: var(--text-accent);
  background: rgba(255, 255, 255, 0.05);
}

.external-icon {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   COVER BODY CONTENT
   ========================================================================== */

.cover-body {
  text-align: center;
  margin: 1rem 0;
  position: relative;
  z-index: 2;
}

.series-pill {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-accent);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  border: var(--btn-border);
  margin-bottom: 1.2rem;
  transition: all var(--transition-fast);
}

.cover-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-title);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  transition: color var(--transition-fast);
}

.cover-subtitle {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-accent);
  margin-bottom: 1rem;
}

.title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 1.2rem 0;
  color: var(--text-accent);
  opacity: 0.6;
}

.title-divider::before,
.title-divider::after {
  content: '';
  height: 1px;
  width: 40px;
  background: var(--text-accent);
  margin: 0 10px;
  opacity: 0.4;
}

.diamond {
  font-size: 0.6rem;
}

.cover-description {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-body);
  max-width: 380px;
  margin: 0 auto 1.8rem auto;
  font-weight: 300;
}

/* ==========================================================================
   INTERACTIVE COVER MENU
   ========================================================================== */

.cover-menu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-btn {
  background: var(--btn-bg);
  border: var(--btn-border);
  color: var(--btn-text);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.menu-btn:hover {
  background: var(--btn-hover-bg);
  transform: translateX(3px);
  border-color: var(--text-accent);
}

.btn-num {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-accent);
  min-width: 24px;
}

.btn-text {
  flex: 1;
  margin: 0 0.6rem;
}

.btn-arrow {
  font-size: 1rem;
  transition: transform var(--transition-fast);
}

.menu-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Highlight style for Directory Button */
.menu-btn.directory-highlight {
  background: linear-gradient(135deg, rgba(229, 193, 88, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid var(--text-accent);
}

/* ==========================================================================
   COVER FOOTER & AUTHOR BADGE
   ========================================================================== */

.cover-footer {
  margin-top: 1.5rem;
  position: relative;
  z-index: 2;
}

.author-card-trigger {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-body);
  transition: all var(--transition-fast);
  text-align: left;
}

.author-card-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text-accent);
}

.author-avatar-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 139, 145, 0.3));
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.author-role {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.author-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
}

.author-more {
  font-size: 0.72rem;
  color: var(--text-accent);
}


/* ==========================================================================
   OVERLAY BOOK PAGES (SLIDE-UP SHEETS)
   ========================================================================== */

.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 100;
}

.overlay-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.book-overlay-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background-color: var(--bg-sheet);
  border: var(--border-sheet);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: none;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), visibility var(--transition-normal);
  z-index: 101;
  overflow: hidden;
}

.book-overlay-sheet.active {
  transform: translate(-50%, 0%);
  visibility: visible;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.8);
}

.sheet-header {
  padding: 1.4rem 1.6rem 1rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sheet-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-accent);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.sheet-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-title);
}

.sheet-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sheet-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-title);
}

.sheet-content {
  padding: 1.6rem;
  overflow-y: auto;
  flex: 1;
}

.sheet-intro {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-body);
  margin-bottom: 1.4rem;
}

/* ==========================================================================
   OVERLAY SPECIFIC STYLES
   ========================================================================== */

/* About Section */
.objective-quote {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-title);
  border-left: 3px solid var(--text-accent);
  padding-left: 1.1rem;
  margin-bottom: 1.8rem;
}

.section-subtitle {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.pillars-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pillar-card {
  background: var(--bg-card);
  border: var(--border-card);
  padding: 1.1rem;
  border-radius: var(--radius-md);
}

.pillar-icon {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.pillar-card h4 {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--text-title);
  margin-bottom: 0.4rem;
}

.pillar-card p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-body);
}

/* Series Cards */
.series-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.series-item-card {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: all var(--transition-fast);
}

.series-item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-accent);
}

.series-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 0.15em;
  margin-bottom: 0.3rem;
}

.series-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-title);
  margin-bottom: 0.5rem;
}

.series-desc {
  font-size: 0.82rem;
  color: var(--text-body);
  margin-bottom: 0.8rem;
}

.series-topics {
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.btn-load-cover {
  width: 100%;
  background: var(--btn-bg);
  border: var(--btn-border);
  color: var(--btn-text);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-load-cover:hover {
  background: var(--btn-hover-bg);
}

/* Works Cards (11 Publications) */
.works-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .works-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.work-card {
  background: var(--bg-card);
  border: var(--border-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.work-cat {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.work-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-title);
  margin-bottom: 0.4rem;
}

.work-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.9rem;
  flex: 1;
}

.work-link {
  display: inline-block;
  background: var(--btn-bg);
  border: var(--btn-border);
  color: var(--btn-text);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.work-link:hover {
  background: var(--btn-hover-bg);
}

/* Directory Overlay */
.lab-link-box {
  background: linear-gradient(135deg, rgba(229, 193, 88, 0.12) 0%, rgba(0, 0, 0, 0.2) 100%);
  border: 1px solid var(--text-accent);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.lab-icon {
  font-size: 1.8rem;
}

.lab-link-box h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-title);
  margin-bottom: 0.2rem;
}

.lab-link-box p {
  font-size: 0.8rem;
  color: var(--text-body);
}

.lab-main-btn {
  display: block;
  text-align: center;
  background: var(--text-accent);
  color: var(--bg-page);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
}

.lab-main-btn:hover {
  opacity: 0.9;
}

.directory-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dir-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: var(--border-card);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-title);
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

.dir-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-accent);
}

.dir-item code {
  font-size: 0.72rem;
  color: var(--text-accent);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

/* Author Overlay */
.author-profile-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.author-big-avatar-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 139, 145, 0.4));
  flex-shrink: 0;
}

.author-profile-box h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-title);
}

.author-title-tag {
  font-size: 0.78rem;
  color: var(--text-accent);
  font-weight: 600;
  margin-top: 2px;
}

.author-sub-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1px;
}

.author-bio {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: 1.4rem;
}

.author-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}

.highlight-chip {
  font-size: 0.72rem;
  background: var(--bg-card);
  border: var(--border-card);
  color: var(--text-accent);
  padding: 0.35rem 0.7rem;
  border-radius: 30px;
}

.author-link-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.author-main-link,
.author-cv-link {
  display: block;
  text-align: center;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.author-main-link {
  background: var(--btn-bg);
  border: var(--btn-border);
  color: var(--btn-text);
}

.author-cv-link {
  background: transparent;
  border: 1px dashed var(--text-muted);
  color: var(--text-body);
}

.author-main-link:hover,
.author-cv-link:hover {
  border-color: var(--text-accent);
  color: var(--text-title);
}

/* ==========================================================================
   MOBILE & SMALL SCREENS RESPONSIVE OPTIMIZATION
   ========================================================================== */

@media (max-width: 600px) {
  body {
    padding: 0.5rem 0.4rem;
  }

  .theme-bar {
    margin-bottom: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .theme-bar-label {
    font-size: 0.68rem;
  }

  .theme-btn {
    font-size: 0.7rem;
    padding: 0.28rem 0.55rem;
  }

  .book-viewport {
    max-width: 100%;
  }

  .book-jacket {
    border-radius: 14px;
  }

  .book-spine {
    width: 10px;
  }

  .book-cover {
    padding: 1.4rem 1.1rem;
    min-height: auto;
  }

  .book-cover::before {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .cover-header {
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    justify-content: center;
  }

  .brand-badge {
    flex-shrink: 0;
  }

  .brand-logo-img {
    width: 24px;
    height: 24px;
  }

  .brand-text {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .website-link {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
  }

  .series-pill {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    padding: 0.28rem 0.75rem;
    margin-bottom: 0.8rem;
  }

  .cover-title {
    font-size: 1.45rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
  }

  .cover-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
  }

  .title-divider {
    margin: 0.6rem 0 0.8rem 0;
  }

  .cover-description {
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 1.2rem;
  }

  .cover-menu {
    gap: 0.6rem;
  }

  .menu-btn {
    padding: 0.75rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .btn-num {
    font-size: 0.7rem;
    min-width: 20px;
  }

  .btn-text {
    margin: 0 0.4rem;
  }

  .cover-footer {
    margin-top: 1rem;
  }

  .author-card-trigger {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
  }

  .author-avatar-img {
    width: 32px;
    height: 32px;
  }

  .author-role {
    font-size: 0.58rem;
  }

  .author-name {
    font-size: 0.8rem;
  }

  .author-more {
    font-size: 0.68rem;
  }

  .book-overlay-sheet {
    max-width: 100%;
    max-height: 92vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }

  .sheet-header {
    padding: 1.1rem 1.2rem 0.8rem 1.2rem;
  }

  .sheet-title {
    font-size: 1.1rem;
  }

  .sheet-content {
    padding: 1.2rem 1rem;
  }

  .objective-quote {
    font-size: 0.9rem;
    padding-left: 0.85rem;
    margin-bottom: 1.2rem;
  }

  .dir-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .dir-item code {
    align-self: flex-start;
  }

  .cover-title,
  .cover-subtitle,
  .cover-description,
  .btn-text,
  .sheet-title,
  .dir-item span {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .work-card {
    padding: 0.85rem;
  }
}

@media (max-width: 375px) {
  .cover-title {
    font-size: 1.3rem;
  }

  .brand-text {
    font-size: 0.68rem;
  }

  .menu-btn {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
  }
}

