/* Custom Design System & Modern CSS Variables */
:root {
  --bg-noir: #0a0a0c;
  --bg-stone: #121215;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --amber-gold: #f59e0b;
  --amber-light: #fef3c7;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-noir);
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-noir);
  color: #e5e7eb;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient Background Glow */
.ambient-glow {
  background: 
    radial-gradient(circle at 20% 15%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(217, 119, 6, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(30, 30, 40, 0.4) 0%, transparent 100%);
}

/* Typography Helpers */
.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(20, 20, 25, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(245, 158, 11, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef3c7;
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary.btn-purchase {
  background: #15803d;
  border-color: #22c55e;
  color: #fff;
}

.btn-secondary.btn-purchase:hover {
  background: #166534;
  border-color: #4ade80;
  color: #fff;
}

.btn-secondary.btn-purchase:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 4px;
}

/* Language Switcher Button */
.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.lang-btn.active-lang {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  font-weight: 700;
}

.lang-btn:hover:not(.active-lang) {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.05);
}

/* 3D Perspective Book Effect */
.perspective-container {
  perspective: 1200px;
}

.book-card-3d {
  transform-style: preserve-3d;
  box-shadow: 
    0 20px 40px -15px rgba(0, 0, 0, 0.8),
    0 0 25px 0 rgba(245, 158, 11, 0.1);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.book-card-3d:hover {
  box-shadow: 
    0 30px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 35px 5px rgba(245, 158, 11, 0.2);
}

/* Location Card */
.location-card {
  position: relative;
  overflow: hidden;
}

.location-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber-gold), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.location-card:hover::after {
  opacity: 1;
}

/* Reader Tab Styling */
.reader-tab {
  background: rgba(255, 255, 255, 0.03);
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.reader-tab.active {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
  font-weight: 600;
}

.reader-body p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

.reader-body p:first-of-type::first-letter {
  font-size: 3.25em;
  float: left;
  line-height: 0.8;
  margin-right: 0.15em;
  margin-top: 0.05em;
  font-family: var(--font-serif);
  color: #fbbf24;
  font-weight: 700;
}

/* Form Styles */
input, textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  border-color: var(--amber-gold) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0c;
}

::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Animation utilities */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .reader-body p {
    text-align: left;
  }
}
