/* Classic Makes Future (CMF) — The Grand Sci-Fi Library & Archivium Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Noto+Serif+JP:wght@400;600;700;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --lib-bg: #FAF6EE;
  --lib-paper: #FFFFFF;
  --lib-shelf: #8C6239;
  --lib-shelf-shadow: rgba(68, 43, 20, 0.08);
  --lib-leather: #5C2C16;
  --lib-gold: #B45309;
  --lib-gold-light: #FDE68A;
  --lib-gold-border: rgba(180, 83, 9, 0.25);
  --lib-ink: #1E293B;
  --lib-ink-muted: #64748B;
  --lib-ink-light: #94A3B8;

  --card-bg: rgba(255, 255, 255, 0.96);
  --card-border: #EADBCC;
  --card-shadow: 0 4px 16px -2px rgba(60, 40, 20, 0.06);
  --card-shadow-hover: 0 16px 36px -4px rgba(92, 44, 22, 0.16);
}

body.cmf-body {
  background-color: var(--lib-bg);
  background-image: 
    radial-gradient(at 10% 10%, rgba(245, 230, 211, 0.8) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(235, 220, 198, 0.6) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--lib-ink);
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Serif Typography Utility */
.font-serif-title {
  font-family: 'Noto Serif JP', 'Lora', serif;
}

.font-library-cinzel {
  font-family: 'Cinzel', 'Noto Serif JP', serif;
}

.font-mono-code {
  font-family: 'JetBrains Mono', monospace;
}

/* Library Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: #D4AF37;
  transform: translateY(-2px);
}

/* Library Book Shelf Layout & Card */
.book-card {
  background: #FFFFFF;
  border: 1px solid #EADBCC;
  border-radius: 1rem;
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(68, 43, 20, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Book Spine / Cover Ribbon on the Left */
.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #B45309, #D97706, #78350F);
  opacity: 0.85;
  transition: width 0.2s ease;
}

.book-card:hover {
  border-color: #C5A059;
  box-shadow: 0 16px 32px -4px rgba(92, 44, 22, 0.15);
  transform: translateY(-3px);
}

.book-card:hover::before {
  width: 7px;
  opacity: 1;
}

/* Library Shelf Wooden Floor Line */
.library-shelf-grid {
  position: relative;
}

/* Hero Badge in Library Style */
.hero-badge {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.08), rgba(92, 44, 22, 0.06));
  border: 1px solid rgba(180, 83, 9, 0.25);
  color: #78350F;
}

/* Library Catalog Stamp */
.catalog-stamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #78350F;
  background: #FEF3C7;
  border: 1px dashed #D97706;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Library Due Tag / Call Number */
.call-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #8C6239;
  background: #F5EBE1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #E5D5C5;
}

/* Tab Navigation Active Indicator in Library Style */
.tab-btn {
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: 'Noto Serif JP', sans-serif;
}
.tab-btn.active {
  color: #78350F !important;
  font-weight: 700 !important;
  background-color: #FEF3C7 !important;
  border-color: #FCD34D !important;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 2.5px;
  background: #B45309;
  border-radius: 2px;
}

/* Genre Book Category Badges (Classic Library Tone) */
.badge-ai_cyber { background-color: #EFF6FF !important; color: #1E40AF !important; border: 1px solid #BFDBFE !important; }
.badge-dystopia_governance { background-color: #FEF2F2 !important; color: #991B1B !important; border: 1px solid #FECACA !important; }
.badge-space_exploration { background-color: #ECFEFF !important; color: #155E75 !important; border: 1px solid #A5F3FC !important; }
.badge-time_multiverse { background-color: #FAF5FF !important; color: #6B21A8 !important; border: 1px solid #E9D5FF !important; }
.badge-bio_evolution { background-color: #F0FDF4 !important; color: #166534 !important; border: 1px solid #BBF7D0 !important; }
.badge-language_cognition { background-color: #FDF4FF !important; color: #86198F !important; border: 1px solid #F5D0FE !important; }
.badge-apocalypse_climate { background-color: #FFF7ED !important; color: #9A3412 !important; border: 1px solid #FFEDD5 !important; }
.badge-societal_dialectic { background-color: #F8FAFC !important; color: #334155 !important; border: 1px solid #E2E8F0 !important; }

/* Mixer Slot (Desk of Alchemy) */
.mixer-slot {
  border: 2px dashed #D4AF37;
  background-color: #FFFDF9;
  transition: all 0.2s ease;
}
.mixer-slot.filled {
  border: 2px solid #B45309;
  background: #FFFDF5;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.08);
}
.mixer-slot:hover {
  border-color: #B45309;
}

/* Modal Animation */
.modal-backdrop {
  background: rgba(30, 20, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  background: #FFFDF8;
  border: 1px solid #E5D5C5;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F4EFE6;
}
::-webkit-scrollbar-thumb {
  background: #D7CCC8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #A1887F;
}
