/* Base */
:root {
    --navy: #07111f;
    --cream: #f4e6c3;
    --gold: #d8b26e;
    --dark-gold: #be8e3a;
}

* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--navy);
    color: var(--cream);
    font-family: Georgia, "Times New Roman", serif;
}

/* Shared header */
.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    min-height: 138px;
    padding: 4px 20px;
    background: var(--navy);
}
.brand {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
}
.brand-logo {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    filter: brightness(1.12) contrast(1.28);
    transition: transform .6s ease, filter .6s ease;
}
.brand-logo:hover {
    transform: scale(1.14);
    filter: brightness(1.12) contrast(1.28) saturate(1.35);
}
.brand-logo img {
    width: 110%;
    height: 110%;
    object-fit: contain;
    transform: translate(-3px, -11px);
}
.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.brand-title {
    font-size: 65px;
    line-height: .85;
    letter-spacing: 10px;
    background: linear-gradient(to bottom, #fff4cf, #e8c98b 38%, #be8e3a 82%, #f0d59b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 #fff5d240, 0 3px 8px #0008;
}
.brand-subtitle {
    margin-top: 2px;
    font-size: 19px;
    line-height: .9;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #f7e6bd, #be8e3a 85%, #f0d59b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-divider {
    display: flex;
    align-items: center;
    width: 260px;
    margin-top: 5px;
}
.brand-divider span {
    flex: 1;
    height: 2px;
    background: var(--dark-gold);
    opacity: .75;
}
.brand-divider b {
    margin: 0 12px;
    color: var(--dark-gold);
    font-size: 18px;
    font-weight: 400;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: clamp(24px, 4.2vw, 80px);
    margin-left: auto;
    margin-right: clamp(0px, 4.2vw, 80px);
}
.nav-link {
    padding: 12px 0;
    color: var(--cream);
    text-decoration: none;
    font-size: 19px;
    letter-spacing: 2px;
    transition: color .3s ease;
}
.nav-link:hover {
    color: var(--dark-gold);
}

/* Book presentation */
.book-page {
    min-height: calc(100svh - 138px);
    padding: 55px clamp(24px, 4vw, 80px) 65px;
    background: #030d15 url("images/background/hero.png") center top / 100% auto repeat-y;
}
.book-layout {
    width: min(1500px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(28px, 4vw, 70px);
}
.book-art {
    min-width: 0;
}
.book-art img {
    display: block;
    width: 100%;
    max-width: 720px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 14px 24px #0008);
}
.book-details {
    min-width: 0;
    position: relative;
    isolation: isolate;
    text-align: center;
}
.book-details::before {
    content: "";
    position: absolute;
    inset: -35px -20px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse, #020a12d9, #020a1280 55%, transparent 75%);
}

.book-details h1 {
    margin: 12px 0;
    color: #f1cc87;
    font-size: clamp(23px, 2vw, 34px);
    font-weight: 400;
    font-variant: small-caps;
    line-height: 1.2;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px #000;
}
.ornament {
    width: min(230px, 75%);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px auto;
    color: var(--gold);
}
.ornament-wide {
    width: 100%;
    margin-top: 18px;
}
.ornament span {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--dark-gold));
}
.ornament span:last-child {
    transform: rotate(180deg);
}
.ornament b {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}
.book-description {
    margin: 23px 0;
    text-align: left;
    color: #e3d8bf;
    font-size: 16px;
    line-height: 1.65;
    text-shadow: 0 2px 6px #000;
}
.book-description p {
    margin: 0 0 17px;
}
.book-description p:last-child {
    margin-bottom: 0;
    color: #f0dfbd;
}

/* Chapter button */
.chapter-button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: min(370px, 100%);
    min-height: 68px;
    margin: 22px auto 0;
    padding: 12px 25px;
    border: 1px solid var(--gold);
    border-radius: 12px 2px;
    background: linear-gradient(120deg, #0a1823f5, #02090ff5);
    color: #efc77c;
    font: 21px Georgia, serif;
    font-variant: small-caps;
    cursor: pointer;
    box-shadow: 0 0 0 3px #030c14, 0 0 0 4px #be8e3a99, 0 8px 20px #0005;
    transition: color .25s ease, box-shadow .25s ease;
}
.chapter-button::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid #be8e3a66;
    border-radius: 8px 1px;
    pointer-events: none;
}
.chapter-button svg {
    width: 40px;
    height: 32px;
    flex-shrink: 0;
}
.chapter-arrow {
    font-size: 30px;
    line-height: 1;
}
.chapter-button:hover {
    color: #fff0c9;
    box-shadow: 0 0 0 3px #030c14, 0 0 0 4px #d8b26e, 0 0 25px #be8e3a33;
}

/* Chapter displayed below the book presentation */
.chapter-content {
    width: min(1100px, 100%);
    margin: 70px auto 0;
    padding: 32px clamp(20px, 4vw, 50px) 40px;
    background: rgba(3, 12, 21, 0.9);
    border: 1px solid rgba(216, 178, 110, 0.25);
    border-radius: 8px;
    scroll-margin-top: 24px;
}

.chapter-content[hidden] {
    display: none;
}

.chapter-content h2 {
    margin: 22px 0 32px;
    color: #f1cc87;
    font-size: 20px;
    font-weight: 400;
    text-align: center;
}

.chapter-prose {
    max-width: 78ch;
    margin-inline: auto;
    color: #DCCDB3;
    font-size: 17px;
    line-height: 1.7;
}

.chapter-prose p {
    margin: 0 0 1.2em;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 5px;
}
/* Tablets */
@media (max-width: 1200px) {
    .site-header {
        flex-direction: column;
        gap: 10px;
        padding: 4px 24px 18px;
    }
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 32px;
        margin: 0;
    }
    .book-page {
        padding: 40px 28px 55px;
    }
    .book-description {
        font-size: 15px;
    }
}

/* Phones and narrow tablets */
@media (max-width: 800px) {
    .book-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
        max-width: 620px;
    }
    .book-art img {
        max-width: 420px;
    }
    
    .book-description {
        font-size: 16px;
    }
}
@media (max-width: 650px) {
    .site-header {
        padding: 10px 16px 18px;
    }
    .brand {
        gap: 14px;
    }
    .brand-logo {
        width: 80px;
        height: 80px;
    }
    .brand-logo img {
        transform: translate(-2px, -7px);
    }
    .brand-title {
        font-size: 40px;
        letter-spacing: 6px;
    }
    .brand-subtitle {
        font-size: 12px;
        letter-spacing: 2px;
    }
    .brand-divider {
        width: 170px;
    }
    .main-nav {
        gap: 4px 22px;
    }
    .nav-link {
        font-size: 14px;
        letter-spacing: 1px;
    }
    .book-page {
        padding: 24px 22px 45px;
    }
    .book-details::before {
        inset-inline: -10px;
    }
    .chapter-button {
        font-size: 20px;
        gap: 15px;
    }
    .chapter-content {
        margin-top: 40px;
        padding: 24px 20px;
    }
    .chapter-prose {
        font-size: 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .brand-logo, .nav-link, .chapter-button {
        transition: none;
    }
}

/* Illustration size and position */
@media (min-width: 801px) {
    .book-art img {
        width: 130%;
        max-width: none;
        margin: 0 0 0 -15%;
        transform: translate(-80px, 10px);
    }
}

/* Desktop text and layout */
@media (min-width: 1201px) {
    .book-page {
        padding-top: 30px;
        padding-bottom: 35px;
    }

    .book-layout {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    }

    .book-description {
        margin: 18px 0;
        font-size: 18px;
        line-height: 1.65;
    }

    .book-description p {
        margin-bottom: 18px;
    }

    .chapter-button {
        margin-top: 16px;
    }
}

/* First chapter typography */
.chapter-dedication {
    margin: 0 0 38px;
    text-align: center;
    font-style: italic;
    color: #e8cd98;
}

.chapter-dedication p {
    margin: 0 0 8px;
}

.chapter-dedication .dedication-author {
    font-size: .9em;
    font-style: normal;
    color: #cbb98f;
}

.chapter-prose .chapter-date {
    margin-top: 32px;
    color: var(--gold);
}

.chapter-prose .chapter-scene-break {
    margin: 32px 0;
    text-align: center;
    color: var(--gold);
    letter-spacing: 12px;
}



html {
    scrollbar-gutter: stable;
}

.chapter-ending {
    margin-top: 30px;
    padding-top: 10px;
    text-align: center;
}

.chapter-ending .ornament {
    width: min(350px, 85%);
    margin-bottom: 20px;
}

.chapter-ending h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    margin: 0 0 12px;
    color: #e8c58b;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 2px;
}

.chapter-ending h3::before,
.chapter-ending h3::after {
    content: "";
    width: clamp(30px, 8vw, 120px);
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        #be8e3a
    );
}

.chapter-ending h3::after {
    transform: rotate(180deg);
}

.chapter-ending p {
    margin: 0;
    color: #d9cdb9;
    font-size: 16px;
    line-height: 1.6;
}

.book-buy-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    width: min(340px, 95%);
    min-height: 60px;
    margin: 24px auto 8px;
    padding: 12px 20px;

    border: 1px solid #c49a57;
    border-radius: 24px 6px;
    background: linear-gradient(120deg, #111b22, #020a11);

    color: #e8c58b;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;

    box-shadow:
        0 0 0 4px #030c14,
        0 0 0 5px rgba(196, 154, 87, 0.45);

    transition: color 0.25s ease, box-shadow 0.25s ease;
}

.book-buy-button::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(196, 154, 87, 0.35);
    border-radius: 19px 3px;
    pointer-events: none;
}

.book-buy-button svg {
    width: 29px;
    height: 28px;
    flex-shrink: 0;
}

.buy-arrow {
    font-size: 24px;
    line-height: 1;
}

.book-buy-button:hover {
    color: #fff0cf;
    box-shadow:
        0 0 0 4px #030c14,
        0 0 0 5px #d8b26e,
        0 0 24px rgba(216, 178, 110, 0.15);
}

@media (max-width: 650px) {
    .chapter-ending h3 {
        font-size: 26px;
    }

    .chapter-ending p {
        font-size: 16px;
    }

    .book-buy-button {
        gap: 14px;
        padding-inline: 16px;
        font-size: 17px;
        letter-spacing: 1px;
    }
}

.chapter-intro {
    font-style: italic;
}

@media (min-width: 1600px) {
    .book-details {
        width: calc(100% + 100px);
    }
}