/* ═══════════════════════════════════════════════════════════════════
   DARK LUXURY CSS VARIABLES - Adapted for Light Default + Dark Toggle
   ═══════════════════════════════════════════════════════════════════ */

:root { color-scheme: light;
    /* Light Default Palette (for default theme) */
    --primary: #8b5e3c; /* Warm brown/gold */
    --secondary: #c9a66b; /* Champagne */
    --accent: #5c2e2e; /* Deep burgundy */
    
    /* Light Backgrounds */
    --bg-primary: #f8f4eb; /* Parchment light */
    --bg-secondary: #f0e9d9;
    --bg-tertiary: #e8dfc9;
    
    /* Text (Dark on light) */
    --text-primary: #2c2522;
    --text-secondary: #4a4038;
    --text-tertiary: #6b5f54;
    
    /* Gold Accents */
    --gold: #b8860b;
    --gold-light: #d4af37;
    --gold-dark: #8b7355;
    
    /* Spacing (Elegant rhythm - 8px grid) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 64px;
    
    /* Border Radius (Material 3) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows (Subtle gold glows) */
    --shadow-gold: 0 4px 20px rgba(184, 134, 11, 0.15);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] { color-scheme: dark;
    /* Dark Luxury Override */
    --primary: #d4af37;
    --secondary: #8b7355;
    --accent: #722f37;
    
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    
    --text-primary: #f5f5f5;
    --text-secondary: #d4d4d4;
    --text-tertiary: #a3a3a3;
    
    --gold: #d4af37;
    --gold-light: #f4d47d;
    --gold-dark: #b8941e;
    
    --shadow-gold: 0 4px 20px rgba(212,175,55,0.25);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
}

/* Apply theme to body */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════ */

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.3;
    color: var(--gold);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 4vw, 2.5rem); }

p {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.8;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════
   MATERIAL 3 COMPONENTS
   ═══════════════════════════════════════════════════════════════════ */

.btn-primary {
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 14px 28px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 24px;
    padding: 12px 26px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: var(--gold);
    color: #fff;
}

.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--bg-tertiary);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card img {
    border-radius: 12px;
    width: 100%;
    object-fit: cover;
}

input, textarea, select {
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT & GRID
   ═══════════════════════════════════════════════════════════════════ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER & NAV
   ═══════════════════════════════════════════════════════════════════ */

header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--bg-tertiary);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 24px;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    color: var(--gold);
    background: var(--bg-tertiary);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        padding: 1.5rem;
        box-shadow: var(--shadow-md);
    }
    
    nav ul.show {
        display: flex;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--gold);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    z-index: 1000;
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════
   BOOK CARDS & MAGICAL ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */

.book-card {
    position: relative;
    overflow: hidden;
}

.book-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.book-card:hover::after {
    opacity: 1;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════════ */

section {
    padding: var(--space-xl) 0;
}

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.45)), url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?w=1280&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    color: white;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--bg-tertiary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
    }
}