/* ===== Variables & Reset ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --text-primary: #f0ece4;
    --text-secondary: #b0b0be;
    --accent: #c9a84c;
    --accent-hover: #dbbe6a;
    --accent-glow: rgba(201, 168, 76, 0.15);
    --border: rgba(255, 255, 255, 0.06);
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

img {
    max-width: 100%;
    display: block;
}

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

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.nav-logo:hover {
    color: var(--accent);
}

/* Logo Monogram */
.logo-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    transition: all var(--transition);
}

.nav-logo:hover .logo-monogram {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    border-width: 1.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(100, 100, 180, 0.04) 0%, transparent 50%),
        var(--bg-primary);
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="80" opacity="0.015" fill="white">&#9998;</text></svg>');
    background-size: 200px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 24px;
}

.hero-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-height: 1.2em;
}

.hero-title .cursor {
    display: inline-block;
    width: 3px;
    height: 0.8em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 0.8s step-end infinite;
    vertical-align: baseline;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== Button ===== */
.btn {
    display: inline-block;
    padding: 14px 36px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ===== Sections ===== */
.section {
    padding: 120px 0;
}

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

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 12px;
    transition: text-shadow 0.4s ease;
}

.section-title:hover {
    text-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(201, 168, 76, 0.08);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 60px;
}

/* ===== Decorative Section Dividers ===== */
.section + .section::before,
.section + .section-coming::before,
.section-coming + .section::before,
.quote-section + .section::before {
    content: '\2022 \2022 \2022';
    display: block;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 1em;
    color: var(--accent);
    opacity: 0.4;
    padding: 20px 0;
    margin-top: -20px;
}

/* Wave divider */
.section-wave {
    position: relative;
}

.section-wave::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40'%3E%3Cpath d='M0,20 C200,35 400,5 600,20 C800,35 1000,5 1200,20 L1200,40 L0,40 Z' fill='%2312121a'/%3E%3C/svg%3E") no-repeat center;
    background-size: cover;
    pointer-events: none;
    z-index: 2;
}

.hero.section-wave::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40'%3E%3Cpath d='M0,20 C200,35 400,5 600,20 C800,35 1000,5 1200,20 L1200,40 L0,40 Z' fill='%230a0a0f'/%3E%3C/svg%3E") no-repeat center;
    background-size: cover;
}

.section-racconti.section-wave::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40'%3E%3Cpath d='M0,20 C200,35 400,5 600,20 C800,35 1000,5 1200,20 L1200,40 L0,40 Z' fill='%2312121a'/%3E%3C/svg%3E") no-repeat center;
    background-size: cover;
}

/* ===== Books ===== */
.books-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.book-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    padding: 32px;
    background: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    transition: all var(--transition);
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ctext y='18' font-size='18'%3E%E2%9C%8E%3C/text%3E%3C/svg%3E") 4 20, auto;
}

.book-card:hover {
    border-color: rgba(201, 168, 76, 0.2);
    border-left-color: var(--accent-hover);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
    transform: translateY(-4px);
}

.book-cover {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 2 / 3;
}

.book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 15px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.4));
    pointer-events: none;
    z-index: 2;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 2px;
    left: -4px;
    bottom: 2px;
    width: 6px;
    background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
    border-radius: 2px 0 0 2px;
    z-index: 2;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.book-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-year {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.book-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 16px;
}

.book-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.book-meta {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.book-meta span {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 2px;
}

.book-meta .page-count {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.book-meta .reading-time {
    border-color: rgba(201, 168, 76, 0.3);
    color: var(--accent);
}

.book-meta .nsfw-badge {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.5);
    color: #ef4444;
    font-weight: 500;
    letter-spacing: 0.08em;
}

/* ===== Book Preview (hover excerpt) ===== */
.book-preview {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.88rem;
    color: var(--accent);
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.4s ease;
}

.book-card:hover .book-preview {
    max-height: 80px;
    opacity: 0.85;
    margin: 12px 0 0;
}

.book-soundtrack {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.book-soundtrack a {
    color: var(--accent);
    border-bottom: 1px dotted var(--accent);
}

.book-soundtrack a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

.btn-book {
    margin-top: 20px;
    display: inline-block;
    padding: 10px 28px;
    font-size: 0.8rem;
}

.book-cover-placeholder-sm {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(145deg, #1e1e2e, #2a2a3a);
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    filter: grayscale(0.5);
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.about-image img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.about-content .section-title {
    margin-bottom: 32px;
}

.about-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.9;
}

.about-signature {
    margin-top: 32px;
}

.signature {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--accent);
}

/* ===== Curiosità ===== */
.section-curiosita {
    background: var(--bg-primary);
}

.section-curiosita .section-title {
    color: #f59e0b;
}

.curiosita-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    padding: 40px 36px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    transition: all var(--transition);
}

.curiosita-card:hover {
    border-color: rgba(245, 158, 11, 0.2);
    border-left-color: #f59e0b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(245, 158, 11, 0.08);
}

.curiosita-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #f59e0b;
}

.curiosita-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.9;
    margin-bottom: 28px;
}

.curiosita-btn {
    color: #f59e0b;
    border-color: #f59e0b;
    padding: 10px 28px;
    font-size: 0.8rem;
}

.curiosita-btn:hover {
    background: #f59e0b;
    color: var(--bg-primary);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.15);
}

.curiosita-cta {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.curiosita-cta-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* ===== Quote ===== */
.quote-section {
    padding: 100px 0;
    background: var(--bg-primary);
    text-align: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
}

.contact-icon {
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-item h4 {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.contact-item p,
.contact-item a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== Form ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    outline: none;
    transition: border-color var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

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

.contact-form .btn {
    align-self: flex-start;
}

/* ===== Footer ===== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== Section Colors ===== */
.section-racconti { --section-accent: #c9a84c; }
.section-racconti .section-title { color: #c9a84c; }
.section-racconti .book-card:hover { border-color: rgba(201, 168, 76, 0.3); }

.section-brevi { --section-accent: #4ade80; background: var(--bg-secondary); }
.section-brevi .section-title { color: #4ade80; }
.section-brevi .book-card { border-left-color: #4ade80; }
.section-brevi .book-card:hover { border-color: rgba(74, 222, 128, 0.3); border-left-color: #4ade80; }
.section-brevi .book-year { color: #4ade80; }
.section-brevi .btn-book { color: #4ade80; border-color: #4ade80; }
.section-brevi .btn-book:hover { background: #4ade80; color: var(--bg-primary); box-shadow: 0 0 30px rgba(74, 222, 128, 0.15); }
.section-brevi .reading-time { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }

.section-fanfic { --section-accent: #a78bfa; background: var(--bg-primary); }
.section-fanfic .section-title { color: #a78bfa; }
.section-fanfic .book-card { border-left-color: #a78bfa; }
.section-fanfic .book-card:hover { border-color: rgba(167, 139, 250, 0.3); border-left-color: #a78bfa; }
.section-fanfic .book-year { color: #a78bfa; }
.section-fanfic .btn-book { color: #a78bfa; border-color: #a78bfa; }
.section-fanfic .btn-book:hover { background: #a78bfa; color: var(--bg-primary); box-shadow: 0 0 30px rgba(167, 139, 250, 0.15); }
.section-fanfic .reading-time { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }

/* ===== View Count ===== */
.view-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 8px;
    display: block;
}

/* ===== Coming Soon ===== */
.section-coming {
    background: var(--bg-secondary);
    padding: 100px 0;
}

.section-coming .section-title {
    color: #f472b6;
}

.coming-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.coming-card {
    background: rgba(26, 26, 37, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(244, 114, 182, 0.15);
    border-radius: 12px;
    padding: 32px;
    position: relative;
    transition: all var(--transition);
    overflow: hidden;
}

.coming-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(244, 114, 182, 0.06), transparent 50%);
    pointer-events: none;
}

.coming-card:hover {
    border-color: rgba(244, 114, 182, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(244, 114, 182, 0.1);
}

.coming-badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.4);
    border-radius: 20px;
    margin-bottom: 16px;
    animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 114, 182, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(244, 114, 182, 0.2); }
}

.coming-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.coming-teaser {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
}

/* ===== Newsletter ===== */
.newsletter {
    text-align: center;
    padding-bottom: 40px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.newsletter-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 18px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    outline: none;
    transition: border-color var(--transition);
}

.newsletter-form input::placeholder {
    color: var(--text-secondary);
}

.newsletter-form input:focus {
    border-color: var(--accent);
}

.btn-newsletter {
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-newsletter:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ===== Tilt Effect ===== */
.book-card[data-tilt] {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ===== Page transition ===== */
body {
    animation: pageIn 0.6s ease;
}

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.page-exit {
    animation: pageOut 0.3s ease forwards;
}

@keyframes pageOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transition: right var(--transition);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .section {
        padding: 80px 0;
    }

    .book-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .book-cover {
        max-width: 200px;
        margin: 0 auto;
    }

    .book-cover-placeholder-sm {
        max-width: 200px;
        margin: 0 auto;
    }

    .book-meta {
        justify-content: center;
    }

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

    .about-image {
        max-width: 250px;
        margin: 0 auto;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .coming-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .book-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-links {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Genre Filters ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: #4ade80;
    color: #4ade80;
}

.filter-btn.active {
    background: #4ade80;
    color: var(--bg-primary);
    border-color: #4ade80;
}

/* ===== Read Badge ===== */
.read-badge {
    display: inline-block;
    padding: 3px 12px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
    border-radius: 20px;
    margin-bottom: 10px;
}

.already-read {
    position: relative;
}

/* ===== Footer Stories ===== */
.footer-stories {
    text-align: center;
    padding-bottom: 32px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.footer-stories-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.footer-links li {
    text-align: center;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color var(--transition);
}

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

/* ===== Accessibility ===== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
