/* ============================================================
   Fly Moonlight — design system condiviso
   Palette estratta dalla copertina di Melancholy
   ============================================================ */
:root {
    /* verdi (dalla foresta della copertina) */
    --verde-nero: #08120a;
    --verde-scuro: #0d2b0d;
    --verde-bosco: #1b3a20;
    --verde-medio: #2f5233;
    --verde-acqua: #7ba87f;
    --verde-chiaro: #cfe6c8;
    --verde-luce: #e8f4e2;

    /* accenti (lucciole + coccinella) */
    --oro: #d9b56a;
    --oro-luce: #f2d999;
    --coccinella: #b71c26;

    --nero: #0a0d0a;
    --testo: #e8f4e2;
    --testo-tenue: #a9c6a5;

    --radius: 14px;
    --radius-sm: 8px;
    --ombra: 0 18px 50px rgba(0, 0, 0, 0.55);
    --bordo: rgba(207, 230, 200, 0.14);

    --font-titolo: 'Cormorant Garamond', 'Playfair Display', serif;
    --font-testo: 'Montserrat', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-testo);
    font-weight: 300;
    color: var(--testo);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    min-height: 100vh;
    background-color: var(--verde-nero);
    background-image:
        radial-gradient(1200px 700px at 78% -8%, rgba(123, 168, 127, 0.20) 0%, transparent 60%),
        radial-gradient(900px 600px at 10% 12%, rgba(217, 181, 106, 0.08) 0%, transparent 55%),
        radial-gradient(1000px 800px at 50% 120%, rgba(47, 82, 51, 0.45) 0%, transparent 60%),
        linear-gradient(165deg, #0b1a0d 0%, var(--verde-nero) 55%, #060a07 100%);
    background-attachment: fixed;
}

/* lucciole animate di sfondo */
.fireflies {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fireflies span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--oro-luce);
    box-shadow: 0 0 10px 3px rgba(242, 217, 153, 0.65);
    opacity: 0;
    animation: drift linear infinite;
}

@keyframes drift {

    0% {
        transform: translateY(12vh) translateX(0) scale(0.6);
        opacity: 0;
    }

    12% {
        opacity: 0.85;
    }

    88% {
        opacity: 0.55;
    }

    100% {
        transform: translateY(-96vh) translateX(40px) scale(1.05);
        opacity: 0;
    }
}

/* ---------------- NAV ---------------- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.9rem 2rem;
    background: rgba(8, 18, 10, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--bordo);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-titolo);
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    color: var(--verde-luce);
    text-decoration: none;
}

.logo .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--coccinella);
    box-shadow: 0 0 10px 2px rgba(183, 28, 38, 0.6);
    flex: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--testo-tenue);
    text-decoration: none;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 1.2px;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--oro), transparent);
    transition: width 0.35s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--verde-luce);
}

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

/* ---------------- HEADER ---------------- */
header {
    position: relative;
    z-index: 1;
    padding: 5.5rem 1.25rem 2.5rem;
    text-align: center;
    overflow: hidden;
}

.kicker {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--oro);
    border: 1px solid rgba(217, 181, 106, 0.45);
    border-radius: 40px;
    padding: 0.45rem 1.3rem;
    margin-bottom: 1.5rem;
    background: rgba(217, 181, 106, 0.06);
    animation: fadeUp 1.2s ease both;
}

h1 {
    font-family: var(--font-titolo);
    font-weight: 500;
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    line-height: 1.02;
    margin: 0;
    color: var(--verde-luce);
    text-shadow: 0 0 34px rgba(123, 168, 127, 0.35);
    animation: fadeUp 1.4s ease both;
}

.subtitle {
    font-family: var(--font-titolo);
    font-style: italic;
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    color: var(--verde-acqua);
    margin: 0.6rem 0 0;
    animation: fadeUp 1.6s ease both;
}

/* ---------------- LAYOUT ---------------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
}

.section-title {
    font-family: var(--font-titolo);
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    font-weight: 500;
    color: var(--verde-luce);
    text-align: center;
    margin: 3.5rem 0 1.2rem;
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 62px;
    height: 1px;
    margin: 0.9rem auto 0;
    background: linear-gradient(90deg, transparent, var(--oro), transparent);
}

/* ---------------- BOOK COVER ---------------- */
.book-cover {
    max-width: 300px;
    margin: 2.5rem auto 2rem;
    position: relative;
    isolation: isolate;
    filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.6));
    animation: coverIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform;
}

.book-cover img {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(207, 230, 200, 0.18);
    animation: breathe 9s ease-in-out infinite;
}

.book-cover::before {
    content: "";
    position: absolute;
    inset: -22px;
    background: radial-gradient(circle, rgba(123, 168, 127, 0.35) 0%, transparent 68%);
    z-index: -1;
    border-radius: 20px;
    opacity: 0;
    animation: haloIn 2s ease-out 0.5s forwards, haloPulse 9s ease-in-out 2.5s infinite;
}

/* copertina segnaposto */
.placeholder-cover {
    aspect-ratio: 2 / 3;
    width: 100%;
    border-radius: var(--radius-sm);
    background:
        radial-gradient(circle at 50% 22%, rgba(217, 181, 106, 0.16) 0%, transparent 55%),
        linear-gradient(160deg, #1b3a20 0%, var(--verde-scuro) 48%, #060b07 100%);
    border: 1px solid rgba(217, 181, 106, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.placeholder-cover::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(207, 230, 200, 0.12);
    border-radius: 6px;
}

.placeholder-cover .pc-num {
    font-family: var(--font-titolo);
    font-size: 3.6rem;
    color: var(--oro);
    line-height: 1;
    margin: 0;
    opacity: 0.9;
}

.placeholder-cover .pc-title {
    font-family: var(--font-titolo);
    font-size: 2rem;
    color: var(--verde-luce);
    margin: 0;
    line-height: 1.05;
}

.placeholder-cover .pc-sub {
    font-family: var(--font-titolo);
    font-style: italic;
    color: var(--verde-acqua);
    font-size: 1.05rem;
    margin: 0;
}

.placeholder-cover .pc-note {
    margin-top: 1.6rem;
    font-size: 0.66rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(207, 230, 200, 0.5);
}

/* ---------------- QUOTE ---------------- */
.quote-section {
    position: relative;
    margin: 3rem 0;
    padding: 2.2rem 2rem 2.2rem 2.6rem;
    background: linear-gradient(120deg, rgba(27, 58, 32, 0.55), rgba(13, 43, 13, 0.2));
    border-left: 2px solid var(--oro);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-section::before {
    content: "\201C";
    position: absolute;
    top: -0.6rem;
    left: 0.4rem;
    font-family: var(--font-titolo);
    font-size: 3.4rem;
    color: var(--oro);
    opacity: 0.5;
    line-height: 1;
}

.quote {
    font-family: var(--font-titolo);
    font-style: italic;
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    margin: 0;
    color: var(--verde-luce);
    line-height: 1.75;
}

/* ---------------- CTA ---------------- */
.cta-button {
    display: inline-block;
    background: linear-gradient(120deg, rgba(217, 181, 106, 0.16), rgba(123, 168, 127, 0.12));
    color: var(--verde-luce);
    padding: 0.95rem 2.4rem;
    text-decoration: none;
    border: 1px solid rgba(217, 181, 106, 0.5);
    border-radius: 40px;
    font-weight: 400;
    font-size: 0.92rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 1rem 0.3rem;
    transition: all 0.35s ease;
    cursor: pointer;
}

.cta-button:hover {
    background: rgba(217, 181, 106, 0.26);
    border-color: var(--oro-luce);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(217, 181, 106, 0.22);
}

.cta-button.ghost {
    background: transparent;
    border-color: rgba(207, 230, 200, 0.4);
}

.cta-button.ghost:hover {
    border-color: var(--verde-chiaro);
    background: rgba(207, 230, 200, 0.08);
}

/* ---------------- SYNOPSIS ---------------- */
.synopsis {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    font-size: 1.05rem;
    color: var(--testo);
}

/* ---------------- COMING SOON (home) ---------------- */
.coming-soon-section {
    position: relative;
    margin: 4.5rem 0 2rem;
    padding: 3.2rem 2rem;
    text-align: center;
    border-radius: var(--radius);
    border: 1px solid var(--bordo);
    background:
        radial-gradient(circle at 50% 0%, rgba(217, 181, 106, 0.12) 0%, transparent 62%),
        linear-gradient(160deg, rgba(27, 58, 32, 0.6), rgba(8, 18, 10, 0.75));
    overflow: hidden;
}

.coming-soon-section::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(207, 230, 200, 0.08);
    border-radius: 8px;
    pointer-events: none;
}

.coming-soon-title {
    font-family: var(--font-titolo);
    font-size: clamp(1.9rem, 5vw, 2.7rem);
    font-weight: 500;
    margin: 0;
    color: var(--verde-luce);
    position: relative;
    z-index: 1;
}

.coming-soon-subtitle {
    font-family: var(--font-titolo);
    font-style: italic;
    color: var(--verde-acqua);
    font-size: 1.2rem;
    margin: 0.3rem 0 1rem;
    position: relative;
    z-index: 1;
}

.coming-soon-text {
    position: relative;
    z-index: 1;
    color: var(--testo-tenue);
    margin: 0 0 1.4rem;
}

/* ---------------- FOOTER ---------------- */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 1.5rem;
    font-size: 0.88rem;
    color: var(--testo-tenue);
    background: linear-gradient(180deg, transparent, rgba(8, 18, 10, 0.6));
    border-top: 1px solid var(--bordo);
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.2rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--verde-acqua);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ---------------- ANIMAZIONI ---------------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

/* Copertina: entrata pulita + respiro impercettibile */
@keyframes coverIn {
    from {
        opacity: 0;
        transform: translateY(34px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes breathe {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes haloIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes haloPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.65;
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 768px) {
    nav {
        padding: 0.8rem 1rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 0.7rem;
    }

    .nav-links {
        gap: 1.4rem;
    }

    header {
        padding: 3.5rem 1rem 1.5rem;
    }

    .container {
        padding: 1rem 1.1rem 3rem;
    }

    .book-cover {
        max-width: 230px;
    }

    .quote-section {
        padding: 1.8rem 1.4rem 1.8rem 1.8rem;
    }

    .cta-button {
        padding: 0.85rem 1.9rem;
    }
}
