@import url('https://fonts.googleapis.com/css2?family=Alumni+Sans+SC:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
    --bg: #0e0e10;
    --text: #e8e4df;
    --text-muted: #9a9590;
    --gold: #c9a96e;
    --gold-light: #e2ca8a;
    --plum: #b48db7;
}

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

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ── Noise overlay to prevent gradient banding ── */

.noise {
    position: fixed;
    inset: -10%;
    z-index: 1;
    pointer-events: none;
    filter: url(#grain);
    opacity: 0.035;
    width: 120%;
    height: 120%;
}

/* ── Animated background ── */

.bokeh {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bokeh span {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation: pulse ease-in-out infinite;
}

.bokeh .b1 {
    width: 400px; height: 400px;
    background: rgba(137, 106, 140, 0.28);
    top: 5%; left: 5%;
    animation-duration: 10s; animation-delay: 0s;
}

.bokeh .b2 {
    width: 350px; height: 350px;
    background: rgba(142, 178, 146, 0.23);
    bottom: 5%; right: 5%;
    animation-duration: 13s; animation-delay: -3s;
}

.bokeh .b3 {
    width: 300px; height: 300px;
    background: rgba(211, 189, 130, 0.21);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 11s; animation-delay: -7s;
}

.bokeh .b4 {
    width: 250px; height: 250px;
    background: rgba(137, 106, 140, 0.18);
    top: 20%; right: 20%;
    animation-duration: 14s; animation-delay: -5s;
}

.bokeh .b5 {
    width: 280px; height: 280px;
    background: rgba(142, 178, 146, 0.19);
    bottom: 20%; left: 25%;
    animation-duration: 12s; animation-delay: -9s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.25);
    }
}

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

/* ── Content ── */

main {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 24px 48px;
    gap: 16px;
}

/* ── 3D Book Container ── */

#book-container {
    width: 500px;
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -16px 0 -8px;
}

#book-container canvas {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}


/* Front cover — pivots open from the left (spine) edge */
.book-cover-wrap {
    position: relative;
    z-index: 1;
    display: inline-block;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    transform: rotateY(-8deg);
}

.book-cover {
    display: block;
    width: 260px;
    height: auto;
    border-radius: 6px 1px 1px 6px;
    box-shadow:
        6px 10px 30px rgba(0, 0, 0, 0.50),
        2px 4px 10px rgba(0, 0, 0, 0.25);
}

/* Deboss / gloss overlay */
.book-overlay {
    position: absolute;
    inset: 0;
    border-radius: 4px 3px 3px 4px;
    pointer-events: none;
    background:
        /* Gloss highlight */
        linear-gradient(
            130deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.04) 15%,
            transparent 40%
        ),
        /* Spine-side shadow (slightly wider to blend into spine) */
        linear-gradient(
            to right,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0) 10px,
            transparent 20%
        ),
        /* Right-edge highlight */
        linear-gradient(
            to left,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 3%
        ),
        /* Bottom shadow */
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.10) 0%,
            transparent 6%
        );
    box-shadow:
        inset 3px 0 8px rgba(0, 0, 0, 0.20),
        inset -1px 0 4px rgba(255, 255, 255, 0.04),
        inset 0 2px 6px rgba(0, 0, 0, 0.10),
        inset 0 -1px 3px rgba(255, 255, 255, 0.03);
}

/* ── Typography ── */

.book-title {
    font-family: 'Alumni Sans SC', Georgia, serif;
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 700;
    background: linear-gradient(160deg, #d4b872 0%, #e8d494 25%, #c9a96e 50%, #e2ca8a 75%, #d4b872 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
    line-height: 1.1;
    animation: shimmer 8s ease-in-out infinite;
}

.book-subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.author-name {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.cta-button {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(160deg, var(--gold) 0%, #f0dda0 20%, var(--gold) 40%, var(--gold-light) 60%, var(--gold) 80%, #f0dda0 100%);
    background-size: 300% 300%;
    color: var(--bg);
    text-decoration: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 3px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    animation: shimmer 6s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(201, 169, 110, 0.15);
}

.cta-button:hover:not(.cta-disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.3);
}

.cta-disabled {
    background-color: #3a3635;
    color: var(--text-muted);
    cursor: default;
    opacity: 0.7;
}

/* ── Content Sections ── */

.section-inner,
.section-inner-wide {
    margin: 0 auto;
}

.section-inner {
    max-width: 640px;
}

.section-inner-wide {
    max-width: 720px;
}

.section-inner h2,
.section-inner-wide h2 {
    font-family: 'Alumni Sans SC', Georgia, serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 32px;
    text-align: center;
}

.section-inner p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 16px;
    opacity: 0.85;
}

.section-inner p:last-child {
    margin-bottom: 0;
}

/* ── Excerpts ── */

.excerpts-section {
    position: relative;
    z-index: 2;
    padding: 48px 24px 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.excerpt {
    margin-bottom: 48px;
}

.excerpt:last-child {
    margin-bottom: 0;
}

.excerpt-source {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
    margin-bottom: 12px;
}

.excerpt blockquote {
    margin: 0;
    padding: 0 0 0 24px;
    border-left: 2px solid rgba(201, 169, 110, 0.2);
}

.excerpt blockquote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    line-height: 1.85;
    color: var(--text);
    opacity: 0.82;
    margin-bottom: 14px;
}

.excerpt blockquote p:last-child {
    margin-bottom: 0;
}

.excerpt blockquote em {
    font-style: italic;
}

/* Final excerpt — centred, golden */
.excerpt-final {
    text-align: center;
    margin-top: 56px;
}

.excerpt-final blockquote {
    border-left: none;
    padding: 0;
}

.excerpt-final blockquote p {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--gold-light);
    opacity: 0.9;
    font-style: italic;
}

/* ── Hero Audio Player ── */

.hero-audio {
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    isolation: isolate;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: rgba(201, 169, 110, 0.12);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 50px;
    color: var(--gold-light);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.play-btn:hover {
    background: rgba(201, 169, 110, 0.2);
    border-color: rgba(201, 169, 110, 0.5);
    transform: translateY(-1px);
}

.play-btn:active {
    transform: translateY(0);
}

.play-btn.playing {
    background: rgba(201, 169, 110, 0.18);
    border-color: rgba(201, 169, 110, 0.45);
}

.play-icon,
.pause-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.progress-wrap {
    width: 100%;
    max-width: 240px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-wrap.visible {
    opacity: 1;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.2s linear;
}

.speed-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.speed-control .speed-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-control.visible {
    opacity: 1;
}

.speed-label {
    font-size: 0.75rem;
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 0.05em;
    min-width: 2.5em;
    text-align: center;
}

#speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    transition: transform 0.15s ease;
}

#speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

#speed-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    transition: transform 0.15s ease;
}

#speed-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
}

.turbo-btn {
    display: none;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    font-family: 'Source Sans 3', sans-serif;
    color: var(--gold);
    background: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.turbo-btn.show {
    display: inline-block;
    animation: turboReveal 0.3s ease;
}

.turbo-btn:hover {
    background: rgba(201, 169, 110, 0.2);
    border-color: var(--gold);
}

.turbo-btn.active {
    background: var(--gold);
    color: #1a1a2e;
    border-color: var(--gold);
    animation: turboShake 0.1s linear infinite;
}

.turbo-upsell {
    display: none;
    position: relative;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-family: 'Source Sans 3', sans-serif;
    color: var(--gold);
    background: rgba(201, 169, 110, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.turbo-upsell.show {
    display: inline-block;
    animation: turboReveal 0.4s ease;
}

.upsell-punchline {
    display: none;
}

.turbo-upsell:hover .upsell-bait,
.turbo-upsell.revealed .upsell-bait {
    display: none;
}

.turbo-upsell:hover .upsell-punchline,
.turbo-upsell.revealed .upsell-punchline {
    display: inline;
    font-style: italic;
    opacity: 0.7;
}

@keyframes turboReveal {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes turboShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

.sampler-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.5;
    font-style: italic;
    margin: -4px 0 0;
}

/* ── Explore Section ── */

.explore-section {
    position: relative;
    z-index: 2;
    padding: 48px 24px 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.explore-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.explore-card:hover {
    background: rgba(201, 169, 110, 0.06);
    border-color: rgba(201, 169, 110, 0.2);
    transform: translateY(-2px);
}

.explore-icon {
    font-size: 1.8rem;
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 12px;
}

.explore-title {
    font-family: 'Alumni Sans SC', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.explore-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Footer ── */

.footer-links {
    margin-top: 6px;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer p {
    opacity: 0.4;
}

.affiliate-disclosure {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 6px;
}

/* ── Responsive ── */

@media (max-width: 600px) {
    main {
        padding-top: 0;
    }

    #book-container {
        width: 340px;
        height: 400px;
        margin: -12px 0 -4px;
    }

}
