:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #7c3aed;
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --gray: #94a3b8;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --tag-bg: #e2e8f0;
    --storm-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --nav-bg: rgba(30, 41, 59, 0.95);
    --card-bg: #111827; /* Darker grey-blue */
    --dark: #f8fafc;
    --light: #1e293b;
    --tag-bg: #334155;
    --primary-dark: #3b82f6; /* Lighter blue in dark mode for better visibility */
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1000;
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--gray);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    color: var(--primary);
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.container-margin {
    margin-top: 10rem !important; /* Lower the images globally */
}

section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--storm-gradient);
    border-radius: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    border: 1px solid var(--gray);
    color: var(--dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
}

/* ── Book Navigation Tabs ── */
.book-markers {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 99999;
}

.book-marker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 18px;
    border-radius: 12px 0 0 12px;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: padding 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    box-shadow: -4px 2px 16px rgba(0,0,0,0.4);
    border-left: 4px solid rgba(255,255,255,0.35);
}

.book-marker:nth-child(1) { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.book-marker:nth-child(2) { background: linear-gradient(135deg, #5b21b6, #8b5cf6); }
.book-marker:nth-child(3) { background: linear-gradient(135deg, #065f46, #10b981); }
.book-marker:nth-child(4) { background: linear-gradient(135deg, #92400e, #f59e0b); }

.book-marker:hover {
    padding-left: 26px;
    filter: brightness(1.15);
    box-shadow: -6px 2px 24px rgba(0,0,0,0.5);
}

.book-marker.active {
    padding-left: 26px;
    filter: brightness(1.2);
    border-left-color: white;
    box-shadow: -6px 2px 28px rgba(255,255,255,0.2);
}

.book-marker i {
    font-size: 1rem;
    min-width: 16px;
    text-align: center;
}

/* Showcase Section Styles */
.showcase-section {
    margin-top: 10rem;
}

.showcase-slider {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: var(--card-shadow);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
    color: white;
    z-index: 2;
    text-align: left;
}

.slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    transform: translateY(-50%);
    z-index: 10;
}

.slider-nav button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.slider-nav button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Game Preview Modal */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(8px);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-content-wrapper {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    width: 95%;
    z-index: 1000001;
    background: var(--darker);
    border-radius: 24px;
    padding: 2.5rem 1.5rem 1.5rem; /* Extra top padding for the X button space */
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
    to { transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: var(--primary); /* Use solid color for maximum visibility */
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000005;
    line-height: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.modal-close:hover {
    background: var(--secondary);
    transform: rotate(90deg) scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.modal-image-container {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 65vh; /* Larger preview as requested implicitly by "take back to page" flow */
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    cursor: pointer; /* Indicates it can be clicked to close */
    transition: var(--transition);
}

.modal-image-container img:hover {
    filter: brightness(1.05);
}

.modal-caption {
    margin-top: 1.5rem;
    text-align: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Featured Section Styles */
.featured-section {
    padding: 6rem 0;
    margin-top: 4rem;
}

.featured-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.featured-desc {
    color: var(--gray);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.featured-features {
    list-style: none;
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.featured-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
    font-weight: 500;
}

.featured-features li i {
    color: #10b981;
    font-size: 1.1rem;
}

.featured-image-wrapper {
    position: relative;
    border-radius: 24px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
}

.featured-image {
    width: 100%;
    border-radius: 16px;
    display: block;
    transition: var(--transition);
}

.featured-image:hover {
    transform: scale(1.02);
}

.featured-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--storm-gradient);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.highlight {
    background: var(--storm-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (max-width: 968px) {
    .featured-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    .section-title {
        text-align: center !important;
    }
    .featured-features {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

