/* ==========================================================================
   Variables & Reset
   ========================================================================== */
:root {
    --color-bg: #0b0810;
    --color-bg-alt: #130e1b;
    --color-bg-elevated: #1d1626;
    --color-gold: #c8a36b;
    --color-gold-light: #ecdcc0;
    --color-burgundy: #7a1f3a;
    --color-burgundy-light: #c2496a;
    --color-text: #e7ddcf;
    --color-text-muted: #9c8fa6;

    --hairline: rgba(200, 163, 107, 0.16);
    --hairline-strong: rgba(200, 163, 107, 0.32);

    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-script: 'Pinyon Script', cursive;

    --container-width: 1180px;
    --measure: 38rem;
    --header-height: 84px;
    --frame-inset: 20px;
    --transition: 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

/* Lenis smooth scroll — when active, JS drives the scroll so native
   smoothing is disabled to avoid conflicts. */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1.15rem;
    line-height: 1.75;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "kern" 1;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

::selection {
    background: var(--color-burgundy);
    color: var(--color-gold-light);
}

:focus-visible {
    outline: 1px dashed var(--color-gold);
    outline-offset: 4px;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* Film grain overlay — adds texture across the whole page */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 1.1rem;
}

.signature {
    font-family: var(--font-script);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--color-gold-light);
    margin-top: 1.5rem;
}

.signature--footer {
    font-size: 3.2rem;
    margin: 0 0 0.25rem;
}

.highlight {
    color: var(--color-gold-light);
    font-style: italic;
    font-size: 1.45rem;
    line-height: 1.55;
    margin: 2rem 0;
}

/* ==========================================================================
   Divider
   ========================================================================== */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.75rem 0;
    color: var(--color-gold);
    font-size: 0.85rem;
}

.divider--left {
    justify-content: flex-start;
    margin-left: 0;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.6rem 0;
    transition: background var(--transition), padding var(--transition);
}

.header--scrolled {
    background: rgba(11, 8, 16, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.85rem 0;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-script);
    font-size: 2.1rem;
    color: var(--color-gold-light);
    text-decoration: none;
    line-height: 1;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2.75rem;
}

.nav a {
    font-family: var(--font-display);
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text);
    position: relative;
    padding-bottom: 0.4rem;
    transition: color var(--transition);
}

.nav a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width var(--transition), left var(--transition);
}

.nav a:hover {
    color: var(--color-gold-light);
}

.nav a:hover::after {
    width: 100%;
    left: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--color-gold-light);
    transition: transform var(--transition), opacity var(--transition);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: transparent;
}

.hero__content {
    position: relative;
    z-index: 2;
    padding-top: var(--header-height);
    text-align: center;
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.3rem, 8.5vw, 6.8rem);
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
}

.hero__title-line {
    color: var(--color-gold-light);
}

.hero__title-line--alt {
    margin-left: 0.18em;
    color: var(--color-gold);
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 2.4rem;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-gold-light);
    background: transparent;
    border: 1px solid currentColor;
    clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
    transition: color var(--transition), background var(--transition), letter-spacing var(--transition);
    white-space: nowrap;
}

/* offset keyline — echoes the framed-image motif */
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid currentColor;
    clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
    transform: translate(5px, 5px);
    opacity: 0.38;
    transition: transform var(--transition), opacity var(--transition);
    pointer-events: none;
}

.btn:hover::before {
    transform: translate(0, 0);
    opacity: 0;
}

.btn:hover {
    letter-spacing: 0.26em;
}

.btn--primary {
    color: var(--color-burgundy-light);
}

.btn--primary:hover {
    color: var(--color-gold-light);
    background: var(--color-burgundy);
}

.btn--ghost {
    color: var(--color-gold);
}

.btn--ghost:hover {
    color: var(--color-bg);
    background: var(--color-gold);
}

.btn--lg {
    padding: 1.2rem 2.9rem;
    font-size: 0.82rem;
}

/* ==========================================================================
   Framed images
   ========================================================================== */
.framed {
    position: relative;
    z-index: 0;
}

.framed img {
    width: 100%;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Sections (general)
   ========================================================================== */
.about,
.book {
    position: relative;
    z-index: 1;
    padding: 9rem 0;
    background: transparent;
}

.book {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(122, 31, 58, 0.12) 0%, transparent 45%);
}

.about__inner,
.book__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: 5.5rem;
    align-items: center;
}

.book__inner {
    grid-template-columns: 1.2fr 0.8fr;
}

.book__cover {
    order: 2;
}

.book__text {
    order: 1;
}

.about__photo .framed {
    max-width: 360px;
    margin: 0 auto;
}

.about__photo img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
}

.about__caption {
    margin-top: 2rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.66rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.about__text h2,
.book__text h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    color: var(--color-gold-light);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.about__text p,
.book__text p {
    margin-top: 1.3rem;
    max-width: var(--measure);
    color: var(--color-text);
}

.about__text .signature {
    margin-top: 2rem;
}

/* ==========================================================================
   Book section
   ========================================================================== */
/* Only the front cover is shown (the source file is the full print wrap),
   cropped to a standing-book ratio. */
.book__cover-wrap {
    position: relative;
    max-width: 340px;
    margin: 0 auto;
    aspect-ratio: 2 / 3;
    box-shadow:
        16px 16px 0 rgba(122, 31, 58, 0.32),
        0 34px 64px rgba(0, 0, 0, 0.55);
    transition: transform var(--transition), box-shadow var(--transition);
}

.book__cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% center;
}

.book__cover-wrap:hover {
    transform: translate(3px, -3px);
    box-shadow:
        20px 22px 0 rgba(122, 31, 58, 0.36),
        0 40px 72px rgba(0, 0, 0, 0.6);
}

.book__cover-badge {
    position: absolute;
    top: 1.1rem;
    left: -0.7rem;
    z-index: 2;
    background: var(--color-burgundy);
    color: var(--color-gold-light);
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    padding: 0.42rem 0.95rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.book__lead {
    margin-top: 2.2rem !important;
}

.dropcap {
    float: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.8rem;
    line-height: 0.78;
    padding: 0.1rem 0.65rem 0 0;
    color: var(--color-gold-light);
}

.book__title {
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.book__title-small {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.42em;
    color: var(--color-gold);
    text-transform: uppercase;
}

.book__title-big {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    color: var(--color-gold-light);
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

.book__title-sub {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.2em;
    color: var(--color-gold);
    text-transform: uppercase;
    margin-top: 0.4rem;
}

.book__text .btn {
    margin-top: 1.75rem;
}

/* ==========================================================================
   Wattpad CTA
   ========================================================================== */
.wattpad-cta {
    position: relative;
    z-index: 1;
    padding: 9rem 0;
    background:
        radial-gradient(ellipse at 50% 120%, rgba(122, 31, 58, 0.18) 0%, transparent 55%);
}

.wattpad-cta__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 5rem;
    align-items: center;
}

.wattpad-cta__visual {
    max-width: 440px;
    width: 100%;
}

.wattpad-cta__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: var(--color-gold-light);
}

.wattpad-cta__body p:not(.eyebrow) {
    max-width: 32rem;
    margin-top: 1.3rem;
    color: var(--color-text);
}

.wattpad-cta__body .btn {
    margin-top: 2rem;
}

.framed--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    position: relative;
    z-index: 1;
    padding: 5rem 0 3.5rem;
    text-align: center;
    background: rgba(11, 8, 16, 0.55);
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.25rem;
    margin-top: 1.5rem;
}

.footer__nav a {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: color var(--transition);
}

.footer__nav a:hover {
    color: var(--color-gold);
}

.footer .divider {
    width: 100%;
    max-width: 320px;
}

.footer__copy {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 1s ease, transform 1s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .wattpad-cta__inner {
        grid-template-columns: 1fr;
        gap: 3rem;
        justify-items: center;
        text-align: center;
    }

    .wattpad-cta__body {
        max-width: 36rem;
    }

    .wattpad-cta__body .eyebrow,
    .wattpad-cta__body .divider--left {
        justify-content: center;
    }

    .wattpad-cta__body p:not(.eyebrow) {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 860px) {
    :root {
        --frame-inset: 12px;
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(320px, 80vw);
        background: rgba(11, 8, 16, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2.25rem;
        padding: 2rem 3rem;
        border-left: 1px solid var(--hairline);
        transform: translateX(100%);
        transition: transform var(--transition);
    }

    .nav.is-open {
        transform: translateX(0);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.is-active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.is-active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .about__inner,
    .book__inner {
        grid-template-columns: 1fr;
        gap: 3.5rem;
        text-align: center;
    }

    .book__cover,
    .book__text {
        order: initial;
    }

    .about__text p,
    .book__text p {
        margin-left: auto;
        margin-right: auto;
    }

    .book__lead {
        text-align: left;
    }

    .dropcap {
        float: none;
        padding-right: 0.15rem;
        font-size: inherit;
        line-height: inherit;
        color: var(--color-gold-light);
    }

    .about__text .divider--left,
    .book__text .divider--left {
        justify-content: center;
    }

    .hero__cta {
        justify-content: center;
    }

    .book__cover-wrap {
        max-width: 300px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 1.05rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .btn {
        padding: 0.9rem 1.9rem;
    }

    .about,
    .book,
    .wattpad-cta {
        padding: 6.5rem 0;
    }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
