/* Novels Haven — Modern Design System */
:root {
    --color-bg: #f8f9fc;
    --color-surface: #ffffff;
    --color-text: #1a1d26;
    --color-muted: #6b7280;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-accent: #6366f1;
    --color-accent-hover: #4f46e5;
    --color-accent-soft: rgba(99, 102, 241, 0.1);
    --color-accent-muted: #818cf8;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
    --font-display: 'DM Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --transition: 0.2s ease;
    --header-height: 72px;
    /* Legacy aliases for JS/PDF reader compat */
    --primary-color: var(--color-accent);
    --primary-dark: var(--color-accent-hover);
    --primary-light: var(--color-accent-muted);
    --secondary-color: #1a1d26;
    --accent-color: var(--color-danger);
    --light-color: #f1f3f9;
    --dark-color: var(--color-text);
    --text-color: var(--color-text);
    --text-light: var(--color-muted);
    --white: #ffffff;
    --shadow: var(--shadow-sm);
    --shadow-hover: var(--shadow-md);
    --border-radius: var(--radius-md);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.25;
}

.urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    text-align: right;
    line-height: 2;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-hover); }

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.site-header.header-over-hero {
    background: rgba(15, 18, 35, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.site-header.header-over-hero .main-nav a {
    color: rgba(255, 255, 255, 0.88);
}

.site-header.header-over-hero .main-nav a:hover,
.site-header.header-over-hero .main-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.site-header.header-over-hero .header-search input {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.site-header.header-over-hero .header-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.site-header.header-over-hero .header-search i {
    color: rgba(255, 255, 255, 0.6);
}

.site-header.header-over-hero .mobile-menu-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.site-header.header-over-hero.scrolled {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: var(--color-border);
}

.site-header.header-over-hero.scrolled .main-nav a {
    color: var(--color-text);
}

.site-header.header-over-hero.scrolled .main-nav a:hover,
.site-header.header-over-hero.scrolled .main-nav a.active {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

.site-header.header-over-hero.scrolled .header-search input {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}

.site-header.header-over-hero.scrolled .header-search input::placeholder {
    color: var(--color-muted);
}

.site-header.header-over-hero.scrolled .header-search i {
    color: var(--color-muted);
}

.site-header.header-over-hero.scrolled .mobile-menu-btn {
    color: var(--color-text);
    border-color: var(--color-border);
}

.site-header.header-over-hero:not(.scrolled) .logo-img {
    filter: brightness(0) invert(1);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: height var(--transition);
}

.site-header.scrolled .logo-img { height: 36px; }

.header-search {
    flex: 1;
    max-width: 320px;
    position: relative;
    display: none;
}

@media (min-width: 900px) {
    .header-search { display: block; }
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 14px;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.main-nav { margin-left: auto; }

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: color var(--transition), background var(--transition);
}

.main-nav a:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.main-nav a.active {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--color-surface);
    z-index: 1101;
    padding: 24px;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.mobile-drawer.open { right: 0; }

.mobile-drawer-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.mobile-drawer-close button {
    background: var(--color-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text);
}

.mobile-drawer .header-search {
    display: block;
    max-width: none;
    margin-bottom: 20px;
}

.mobile-drawer nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    list-style: none;
}

.mobile-drawer nav a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.mobile-drawer nav a:hover,
.mobile-drawer nav a.active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

/* ─── 3D Hero ─── */
.hero-3d {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f1223 0%, #1a1f3a 35%, #252b52 65%, #1e1b4b 100%);
    color: #fff;
    min-height: clamp(520px, 85vh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-3d-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: orbFloat 12s ease-in-out infinite;
}

.hero-orb--1 {
    width: 420px;
    height: 420px;
    background: #6366f1;
    top: -10%;
    right: 5%;
    animation-delay: 0s;
}

.hero-orb--2 {
    width: 320px;
    height: 320px;
    background: #a855f7;
    bottom: 10%;
    left: -5%;
    animation-delay: -4s;
}

.hero-orb--3 {
    width: 200px;
    height: 200px;
    background: #38bdf8;
    top: 40%;
    left: 40%;
    animation-delay: -8s;
    opacity: 0.35;
}

.hero-grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 75%);
}

.hero-3d-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
    padding: 48px 0 80px;
}

@media (min-width: 960px) {
    .hero-3d-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 72px 0 96px;
    }
}

.hero-3d-content {
    text-align: center;
}

@media (min-width: 960px) {
    .hero-3d-content { text-align: left; }
}

.hero-3d-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.hero-3d-badge i { color: #fbbf24; font-size: 12px; }

.hero-3d h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: #fff;
}

.hero-gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 50%, #f0abfc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-3d .hero-sub {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.72);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.75;
}

@media (min-width: 960px) {
    .hero-3d .hero-sub { margin: 0 0 32px; }
}

.hero-3d .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 36px;
}

@media (min-width: 960px) {
    .hero-3d .hero-actions { justify-content: flex-start; }
}

.btn-glow {
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.btn-glow:hover {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transform: translateY(-2px);
}

.btn-hero-ghost {
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
}

.btn-hero-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.hero-3d .hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

@media (min-width: 960px) {
    .hero-3d .hero-stats { justify-content: flex-start; }
}

.stat-chip--glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.stat-chip--glass i { color: #a5b4fc; }

/* 3D circular ring carousel */
.hero-3d-stage {
    position: relative;
    height: clamp(360px, 46vw, 480px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-carousel-viewport {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 340px;
    margin: 0 auto;
    user-select: none;
    cursor: grab;
    touch-action: none;
}

.hero-carousel-viewport:active {
    cursor: grabbing;
}

.hero-carousel-scene {
    width: 100%;
    height: 100%;
    perspective: 1100px;
    perspective-origin: 50% 42%;
    transform-style: preserve-3d;
    transform: rotateX(14deg);
    transition: transform 0.25s ease-out;
}

.hero-carousel-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateY(0deg);
    will-change: transform;
}

.hero-carousel-glow {
    position: absolute;
    top: 58%;
    left: 50%;
    width: 260px;
    height: 50px;
    margin-left: -130px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.55) 0%, transparent 72%);
    transform: rotateX(90deg) translateZ(-20px);
    filter: blur(14px);
    pointer-events: none;
}

.hero-book-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 130px;
    height: 195px;
    margin-left: -65px;
    margin-top: -97px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.hero-book-card:hover {
    filter: brightness(1.15) drop-shadow(0 8px 24px rgba(99, 102, 241, 0.5));
}

.hero-book-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

.hero-book-card:hover .hero-book-card-inner {
    transform: translateZ(24px) scale(1.06);
}

.hero-book-cover {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
    background: #1a1d26;
}

.hero-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-book-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 8px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
}

.hero-carousel-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.hero-carousel-hint i {
    margin-right: 6px;
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    .hero-orb { animation: none; }
    .hero-carousel-scene { transform: rotateX(10deg); }
}

@media (max-width: 959px) {
    .hero-3d-stage { margin-top: 8px; }
    .hero-carousel-viewport { height: 300px; }
    .hero-book-card { width: 110px; height: 165px; margin-left: -55px; margin-top: -82px; }
}

.hero-3d-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--color-bg);
    clip-path: ellipse(75% 100% at 50% 100%);
    z-index: 3;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -15px) scale(1.05); }
    66% { transform: translate(-15px, 10px) scale(0.95); }
}

/* Legacy hero alias */
.hero-modern {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eef2ff 0%, #f8f9fc 40%, #fdf4ff 100%);
    border-bottom: 1px solid var(--color-border);
}

.hero-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.hero-modern-inner {
    position: relative;
    padding: 64px 0 72px;
    text-align: center;
}

.hero-modern h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-modern .hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--color-muted);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    box-shadow: var(--shadow-sm);
}

.stat-chip i { color: var(--color-accent); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-ghost {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-accent-muted);
}

.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-outline:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
}

/* ─── Sections ─── */
.section { padding: 64px 0; }

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    color: var(--color-text);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-description {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto;
}

/* ─── Cards ─── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.hero-intro {
    margin-top: 48px;
}

.hero-intro h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 16px;
}

.hero-intro-lead {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-muted);
    max-width: 720px;
    margin: 0 auto 40px;
    line-height: 1.75;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.feature-card {
    text-align: center;
    padding: 28px 20px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.feature-card-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-radius: var(--radius-md);
    font-size: 22px;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--color-text);
}

.feature-card p {
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.6;
}

.author-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.author-spotlight-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.author-spotlight-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent-muted);
}

.author-spotlight-card h3 {
    color: var(--color-accent);
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.author-spotlight-card p {
    color: var(--color-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 15px;
}

.author-spotlight-card .works {
    font-size: 13px;
    color: var(--color-muted);
}

/* ─── Novel grid ─── */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.novel-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.novel-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-danger);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.novel-cover {
    height: 280px;
    overflow: hidden;
    position: relative;
    background: var(--color-bg);
}

.novel-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-info { padding: 16px; }

.novel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-author {
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.novel-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 10px;
}

.novel-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.genre-tag {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.novel-description {
    font-size: 13px;
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Skeleton loading */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.skeleton-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.skeleton-cover {
    height: 280px;
    background: linear-gradient(90deg, var(--color-bg) 25%, #e8eaf0 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line {
    height: 14px;
    margin: 12px 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-bg) 25%, #e8eaf0 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 60%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.empty-state i {
    font-size: 48px;
    color: var(--color-accent-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--color-text);
}

.empty-state p {
    color: var(--color-muted);
    margin-bottom: 20px;
}

/* ─── Authors ─── */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.author-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.author-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.author-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #a78bfa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-display);
}

.author-name {
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: var(--color-text);
}

.author-novels-count {
    font-size: 13px;
    color: var(--color-muted);
}

/* ─── Novel detail ─── */
.novel-detail-page { display: none; padding: 48px 0; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}

.breadcrumb a:hover { color: var(--color-accent); }

.breadcrumb span { color: var(--color-text); font-weight: 500; }

.novel-detail-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.novel-detail-cover {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.novel-detail-cover img { width: 100%; display: block; }

.novel-detail-info {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.novel-detail-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 8px;
}

.novel-detail-author {
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.novel-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-muted);
}

.novel-detail-status {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.novel-detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.novel-detail-genre {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--color-border);
}

.novel-detail-description {
    margin-bottom: 28px;
    line-height: 1.8;
    color: var(--color-muted);
}

.novel-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ─── Search & filters ─── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-filter {
    background: var(--color-surface);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.filter-form { display: flex; flex-direction: column; gap: 16px; }

.filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .filter-toolbar {
        grid-template-columns: minmax(240px, 1.2fr) minmax(0, 2fr);
        align-items: end;
        gap: 20px;
    }
}

.filter-search {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search i.fa-search {
    position: absolute;
    left: 16px;
    color: var(--color-muted);
    font-size: 15px;
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.filter-search-input::placeholder { color: var(--color-muted); }

.filter-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-surface);
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.filter-search-clear {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.filter-search-clear:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.filter-selects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .filter-selects { grid-template-columns: repeat(4, 1fr); }
}

.filter-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-field label i { font-size: 11px; opacity: 0.85; }

.filter-select {
    width: 100%;
    padding: 11px 36px 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.filter-genre-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
}

.filter-chips-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}

.genre-chip {
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.genre-chip:hover {
    border-color: var(--color-accent-muted);
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

.genre-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.filter-results-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    min-height: 28px;
}

.filter-results-count {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.filter-results-count span { color: var(--color-accent); }

.filter-active-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 12px;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
}

.filter-pill:hover { background: rgba(99, 102, 241, 0.18); }

.filter-pill i { font-size: 10px; opacity: 0.8; }

.filter-clear-all {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color var(--transition), background var(--transition);
}

.filter-clear-all:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Legacy form classes (subpages) */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.input-with-icon { position: relative; }

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 14px;
}

.input-with-icon .form-control { padding-left: 38px; }

/* ─── Banner slider ─── */
.banner-slider {
    margin: 48px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.splide__slide {
    position: relative;
    height: 380px;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
}

.banner-title {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.banner-author { opacity: 0.9; margin-bottom: 16px; }

.banner-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
}

/* ─── SEO / content pages ─── */
.seo-section {
    padding: 48px 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.seo-content {
    max-width: 800px;
    margin: 0 auto;
}

.seo-content h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--color-text);
}

.seo-content h3 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
    color: var(--color-text);
}

.seo-content p {
    color: var(--color-muted);
    line-height: 1.8;
    margin-bottom: 14px;
}

.page-content { padding: 48px 0 64px; }

.content-card {
    background: var(--color-surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.noscript-catalog {
    background: var(--color-surface);
    padding: 32px;
    margin: 32px 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.noscript-catalog ul { list-style: none; margin-top: 16px; }

.noscript-catalog li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.noscript-catalog a {
    font-weight: 600;
    text-decoration: none;
}

/* ─── FAQ ─── */
.faq-section {
    padding: 64px 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--color-bg);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}

.faq-question:hover { background: var(--color-surface); }

.faq-question i {
    color: var(--color-accent);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.faq-item.open .faq-question i { transform: rotate(180deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer { max-height: 400px; }

.faq-answer-inner {
    padding: 0 20px 18px;
    color: var(--color-muted);
    line-height: 1.7;
    font-size: 15px;
}

.faq-cta {
    text-align: center;
    margin-top: 32px;
}

.info-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.info-box p { margin-bottom: 8px; }

/* ─── Footer ─── */
.site-footer {
    background: #111827;
    color: rgba(255, 255, 255, 0.75);
    padding: 64px 0 0;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 48px;
}

.footer-col h3 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 10px; }

.footer-links a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--color-accent-muted); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

/* Legacy footer class aliases */
footer { background: #111827; color: rgba(255,255,255,0.75); padding: 64px 0 0; margin-top: 48px; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 48px; }
.footer-column h3 { color: #fff; font-size: 0.95rem; margin-bottom: 16px; border: none; padding: 0; background: none; box-shadow: none; }
.footer-column { background: none; padding: 0; border-radius: 0; box-shadow: none; }
.footer-column:hover { transform: none; box-shadow: none; }
.footer-column p { font-size: 14px; color: rgba(255,255,255,0.65); }
.copyright { border-top: 1px solid rgba(255,255,255,0.08); padding: 24px 0; text-align: center; }
.copyright p { font-size: 13px; color: rgba(255,255,255,0.45); }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error { background: var(--color-danger); }

/* ─── Back to top ─── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
    z-index: 900;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

/* ─── Loading spinner ─── */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 16px;
    color: var(--color-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Subpage header (static pages) ─── */
.site-header-nav { /* alias */ }

.page-hero {
    background: linear-gradient(135deg, #eef2ff, #f8f9fc);
    padding: 48px 0;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 8px;
}

.page-hero p { color: var(--color-muted); }

.novel-cover-page {
    float: right;
    margin: 0 0 20px 24px;
    max-width: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 28px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: background var(--transition);
}

.btn-read:hover { background: var(--color-accent-hover); color: #fff; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; margin-left: auto; }
    .novel-detail-container { grid-template-columns: 1fr; }
    .novel-detail-cover { position: static; max-width: 240px; margin: 0 auto 24px; }
}

@media (max-width: 768px) {
    .header-inner { height: 64px; }
    .hero-3d-grid { padding: 40px 0 64px; }
    .splide__slide { height: 280px; }
    .banner-content { padding: 24px; }
    .banner-title { font-size: 1.25rem; }
    .section { padding: 48px 0; }
    .content-card { padding: 24px; }
    .filter-bar { grid-template-columns: 1fr; }
    .novel-cover-page { float: none; display: block; margin: 0 auto 20px; }
}

/* ─── Cookie consent ─── */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    padding: 14px 24px;
    background: rgba(26, 29, 38, 0.95);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
}

.cookie-consent[hidden] { display: none; }

.cookie-consent a { color: #a5b4fc; }

.cookie-consent .btn { padding: 8px 20px; font-size: 14px; }
