/* Responsive Design */

/* Tablet Styles */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        right: 5%;
    }
    
    .floating-runes .rune {
        font-size: 2.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(20, 20, 20, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(102, 51, 153, 0.3);
        padding: var(--spacing-md) 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero Section */
    .hero {
        text-align: center;
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-visual {
        position: static;
        transform: none;
        margin-top: var(--spacing-md);
    }
    
    .floating-runes {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-sm);
    }
    
    .floating-runes .rune {
        font-size: 2rem;
    }

    /* Typography */
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }

    /* Books Section */
    .books-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .book-card {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Contact Section */
    .contact-content {
        gap: var(--spacing-sm);
    }
    
    .contact-methods {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    /* Footer */
    .footer-content {
        text-align: center;
    }

    /* Floating Social */
    .floating-social {
        right: var(--spacing-xs);
        bottom: var(--spacing-xs);
    }
    
    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    /* Loader */
    .loader-title {
        font-size: 2.5rem;
    }
    
    .loader-subtitle {
        font-size: 1.1rem;
    }
    
    .runes-animation {
        width: 100px;
        height: 100px;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    /* Base spacing adjustments */
    :root {
        --spacing-sm: 0.8rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }

    /* Navigation */
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }

    /* Hero */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }

    /* Sections */
    .section-title {
        font-size: 1.8rem;
    }

    /* Books */
    .book-cover {
        height: 300px;
    }
    
    .book-title {
        font-size: 1.3rem;
    }

    /* Forms */
    .form-group input,
    .form-group textarea {
        padding: var(--spacing-xs);
        font-size: 0.9rem;
    }

    /* Buttons */
    .cta-button,
    .submit-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }

    /* Loader */
    .loader-content {
        padding: 1rem;
    }
    
    .loader-title {
        font-size: 2rem;
    }
    
    .runes-animation {
        width: 80px;
        height: 80px;
    }
    
    .enter-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Floating elements */
    .floating-runes .rune {
        font-size: 1.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon,
    .runes-animation {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .floating-runes {
        display: none;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loader-spinner,
    .runes-animation,
    .floating-runes .rune {
        animation: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .floating-social,
    .loader-container {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section-title,
    .hero-title {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text-light: 0 0% 100%;
        --text-muted: 0 0% 80%;
        --primary-dark: 0 0% 0%;
        --secondary-dark: 0 0% 10%;
    }
    
    .book-card,
    .contact-form,
    .blog-admin {
        border: 2px solid hsl(var(--text-light));
    }
}
