/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f5;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-accent: #c9a84c;
    --color-accent-dark: #1a1a2e;
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

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

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== Site Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.95rem;
    font-weight: 700;
    color: #2a2a2a;
    letter-spacing: 0.02em;
}

.logo-icon {
    height: 54px;
    width: auto;
    position: relative;
    top: -3px;
}

.btn-nav {
    display: inline-block;
    padding: 10px 24px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--color-accent);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-nav:hover {
    background: #d4b355;
}

/* ===== Featured Book Section ===== */
.featured {
    padding: 36px 0 40px;
    background: var(--color-bg-alt);
    border-top: 1px solid #e8e8e8;
    border-bottom: none;
}

.featured-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.featured-text h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.15;
    margin-bottom: 18px;
}

.featured-text p {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    line-height: 1.7;
}

.featured-text em {
    color: var(--color-text);
}

.featured-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.featured-cover {
    display: flex;
    justify-content: center;
}

.featured-cover .book-cover-group {
    width: 300px;
    max-width: 100%;
}

.featured-cover .book-cover-large {
    width: 100%;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    margin-top: 8px;
}

.btn-primary:hover {
    background: #d4b355;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

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

.btn-outline:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-1px);
}

.btn-buy {
    display: block;
    background: var(--color-accent);
    color: #fff;
    padding: 14px 32px;
    border-radius: 0;
}

.btn-buy:hover {
    background: #d4b355;
}

/* ===== Stats Bar ===== */
.stats-bar {
    background: #2a2a2a;
    padding: 28px 0;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 100px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-stars {
    display: block;
    line-height: 1;
}

.stat-stars .rating-stars-stat {
    font-size: 3rem;
    letter-spacing: 4px;
}

.stat-stars .rating-stars-stat .stars-empty {
    color: rgba(255, 255, 255, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 6px;
}

/* ===== Section Headings ===== */
.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 4px;
}

.section-sub {
    font-size: 0.95rem;
    color: var(--color-text-light);
    text-align: center;
    font-style: italic;
    margin-bottom: 6px;
}

/* ===== Books Sections ===== */
.books-section {
    padding: 56px 0;
    background: var(--color-bg);
}

.books-section-alt {
    background: var(--color-bg-alt);
}

.books-row {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.books-row-single {
    justify-content: center;
}

.book-card {
    width: 280px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-card .btn-buy {
    margin-top: auto;
    width: 100%;
}

.book-cover-group {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* hover float removed — overlay interaction replaces it */

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 0;
}

.book-cover-large {
    width: 300px;
    max-width: 100%;
}

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

.book-cover-inner {
    text-align: center;
    padding: 24px 16px;
    color: #fff;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.book-cover-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 10px;
}

.book-cover-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 2px;
}

.book-cover-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.book-cover-subtitle {
    display: block;
    font-size: 0.65rem;
    font-weight: 300;
    line-height: 1.5;
    opacity: 0.7;
    margin-bottom: 12px;
    font-style: italic;
}

.book-cover-author {
    display: block;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
}

.book-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.book-series {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
}

/* Mobile action links — hidden on desktop, visible on touch devices */
.mobile-actions {
    display: none;
}

/* Carousel dots — hidden on desktop */
.carousel-dots {
    display: none;
}

.book-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 0;
    background: #2a2a2a;
    border-radius: 0 0 4px 4px;
    transition: background 0.2s ease;
}

.book-rating:hover {
    background: #3a3a3a;
}

.book-rating-preorder {
    letter-spacing: 0.06em;
}

.rating-stars {
    position: relative;
    display: inline-block;
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 1px;
}

.stars-empty {
    color: rgba(255, 255, 255, 0.2);
}

.stars-filled {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--color-accent);
}

.rating-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
    font-weight: 500;
}

.book-preorder {
    font-size: 0.82rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ===== Book Hover Overlay ===== */
.book-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.book-cover:hover .book-overlay {
    opacity: 1;
}

.overlay-summary {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 20px;
}

.overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 180px;
}

.overlay-btn {
    display: block;
    padding: 9px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    border-radius: 3px;
    background: var(--color-accent);
    color: #fff;
    transition: background 0.2s ease;
}

.overlay-btn:hover {
    background: #d4b355;
}

.overlay-btn-alt {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
}

.overlay-btn-alt:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ===== About Section ===== */
.about-section {
    padding: 64px 0;
    background: var(--color-bg-alt);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 80px;
    align-items: center;
}

.about-text h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

.about-text p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-text strong {
    color: var(--color-text);
}

.about-logo {
    width: 400px;
    height: auto;
    opacity: 0.85;
}

/* ===== Footer ===== */
.footer {
    background: #3a3a3a;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.footer-links a {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

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

.footer-tagline {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== Contact Section ===== */
.contact-section {
    padding: 60px 0 100px;
    background: var(--color-bg);
}

.contact-section .section-sub {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form-wrapper {
    max-width: 640px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.5;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.btn-submit {
    width: 100%;
    margin-top: 8px;
}

.contact-success {
    text-align: center;
    padding: 60px 0;
}

.contact-success p {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-top: 12px;
    margin-bottom: 32px;
}

/* ===== Section Dividers ===== */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-bottom: 36px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    max-width: 200px;
    height: 1px;
}

.section-divider::before {
    background: linear-gradient(to right, transparent, var(--color-accent));
}

.section-divider::after {
    background: linear-gradient(to left, transparent, var(--color-accent));
}

.divider-icon {
    display: inline-block;
    font-size: 1.1rem;
    color: var(--color-accent);
    padding: 0 16px;
    line-height: 1;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    left: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 99;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #d4b355;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.35);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .container {
        padding: 0 24px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .featured-actions {
        justify-content: center;
    }

    .featured-cover {
        order: -1;
    }

    .book-cover-large {
        width: 240px;
    }

    .stats-grid {
        gap: 48px;
    }

    .books-row {
        flex-wrap: wrap;
        gap: 40px;
    }

    .book-card {
        width: 240px;
    }

    .mobile-actions {
        display: flex;
        gap: 16px;
        justify-content: center;
        margin-bottom: 12px;
    }

    .mobile-actions a {
        font-size: 0.8rem;
        color: var(--color-accent);
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .book-overlay {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .about-avatar {
        display: flex;
        justify-content: center;
        order: -1;
    }

    .about-logo {
        width: 280px;
    }
}

@media (max-width: 600px) {
    .logo {
        font-size: 1.2rem;
        gap: 8px;
    }

    .logo-icon {
        height: 32px;
    }

    .btn-nav {
        padding: 8px 16px;
        font-size: 0.72rem;
    }

    .stats-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .stats-bar::-webkit-scrollbar {
        display: none;
    }

    .stats-grid {
        gap: 48px;
        justify-content: flex-start;
        width: max-content;
        padding: 0 32px;
        scroll-snap-type: x mandatory;
    }

    .stat {
        scroll-snap-align: center;
        min-width: 100px;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .stat-stars .rating-stars-stat {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .btn-full,
    .stat-label-detail {
        display: none;
    }

    /* Carousel for trilogy rows */
    .books-row:not(.books-row-single) {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 24px;
        justify-content: flex-start;
        margin-left: -24px;
        margin-right: -24px;
        padding: 0 calc(50vw - 120px);
    }

    .books-row:not(.books-row-single)::-webkit-scrollbar {
        display: none;
    }

    .books-row:not(.books-row-single) .book-card {
        scroll-snap-align: center;
        width: 240px;
    }

    /* Non-carousel single row stacks vertically */
    .books-row.books-row-single {
        flex-direction: column;
        align-items: center;
        gap: 48px;
    }

    .book-card {
        width: 240px;
    }

    /* Carousel dots */
    .carousel-dots {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 24px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: none;
        background: #d0d0d0;
        cursor: pointer;
        padding: 0;
        transition: background 0.3s ease;
    }

    .carousel-dot.active {
        background: var(--color-accent);
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
