:root {
    --color-bg: #0a0a12;
    --color-text: #f0e6ff;
    --color-muted: #a89bc2;
    --color-accent: #d946ef;
    --color-accent-soft: #a855f7;
    --color-glass-bg: rgba(255, 255, 255, 0.08);
    --color-glass-border: rgba(255, 255, 255, 0.15);
    --color-glass-shadow: rgba(0, 0, 0, 0.25);
    --max-width: 1100px;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background gradient + floating shapes */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #0a0a12 0%, #1a0a2e 30%, #0d1117 60%, #12061f 100%);
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-shape:nth-child(1) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #d946ef, transparent 70%);
    top: -10%;
    left: -5%;
    animation-duration: 25s;
}

.bg-shape:nth-child(2) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #a855f7, transparent 70%);
    top: 40%;
    right: -8%;
    animation-duration: 20s;
    animation-delay: -5s;
}

.bg-shape:nth-child(3) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ec4899, transparent 70%);
    bottom: -5%;
    left: 30%;
    animation-duration: 30s;
    animation-delay: -10s;
}

.bg-shape:nth-child(4) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: 20%;
    left: 50%;
    animation-duration: 22s;
    animation-delay: -8s;
}

.bg-shape:nth-child(5) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #d946ef, transparent 70%);
    bottom: 30%;
    right: 20%;
    animation-duration: 28s;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* Links */
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem 0;
}
.site-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}
.site-header a { color: var(--color-text); }
.site-header a:hover { text-decoration: none; opacity: 0.8; }

/* Section headings */
main h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-text);
    margin-top: 2rem;
}

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

/* Glass book cards */
.book-card {
    background: var(--color-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 140px 1fr;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 8px 32px var(--color-glass-shadow);
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(217, 70, 239, 0.15);
    border-color: rgba(217, 70, 239, 0.3);
    text-decoration: none;
}

.book-card img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
    color: transparent;
}

.book-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.book-card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: #ffffff;
}
.book-card-body .author { color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }
.book-card-body .price { color: var(--color-accent); font-weight: 600; margin-top: 0.75rem; font-size: 1.1rem; }

/* Book Detail - Sales Layout */
.book-detail {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Hero section */
.book-hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.book-hero img {
    width: 260px;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(217, 70, 239, 0.2), 0 8px 32px var(--color-glass-shadow);
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
    color: transparent;
}

.book-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.book-hero .subtitle {
    color: var(--color-muted);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.book-hero .author {
    color: var(--color-accent-soft);
    font-size: 1rem;
}

/* Tags under hero */
.book-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
}

.book-tags .tag {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--color-accent-soft);
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
}

/* Buy panel */
.buy-panel {
    background: var(--color-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px var(--color-glass-shadow);
}

.buy-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0 0 1.25rem;
    text-align: center;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
}

.pricing-card:hover {
    border-color: var(--color-accent);
    background: rgba(217, 70, 239, 0.08);
    transform: translateY(-2px);
}

.pricing-card.popular {
    border-color: var(--color-accent);
    background: rgba(217, 70, 239, 0.06);
    position: relative;
}

.pricing-card.popular::before {
    content: 'Best Value';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card .format-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.pricing-card .format-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.pricing-card .format-note {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.4rem;
}

.pricing-card.full-width {
    grid-column: 1 / -1;
}

/* Description section */
.book-description {
    padding: 2.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.book-description h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0 0 1rem;
}

.book-description p {
    color: var(--color-muted);
    line-height: 1.9;
    font-size: 1.05rem;
}

/* Book meta info bar */
.book-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.book-meta-item {
    text-align: center;
}

.book-meta-item .meta-label {
    font-size: 0.75rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.book-meta-item .meta-value {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--color-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
    .book-grid { grid-template-columns: 1fr; }
    .book-card { grid-template-columns: 120px 1fr; }
    .book-card img { min-height: 160px; }
    .book-hero h1 { font-size: 1.8rem; }
    .book-hero img { width: 200px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card.full-width { grid-column: auto; }
    .book-meta { gap: 1.5rem; }
    .bg-shape { opacity: 0.25; }
}
