:root {
    --page: #100e0c;
    --panel: #1b1815;
    --line: #35302a;
    --text: #e9e4dc;
    --muted: #a79f94;
    --accent: #c8955f;
    --accent-strong: #9c6238;
}

html {
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
}

section[id] {
    scroll-margin-top: 60px;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ===== Top banner ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px;
    background: #1a1714;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    font-family: Arial, Helvetica, sans-serif;
}

.navbar a {
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12.5px;
    letter-spacing: 1.2px;
    padding: 8px 14px;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.navbar a:hover {
    background: var(--accent-strong);
    color: #fff;
}

/* ===== Page ===== */
.page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Author ===== */
.author {
    padding: 44px 0 34px;
    text-align: center;
}

.author img {
    display: block;
    width: 124px;
    height: 124px;
    margin: 0 auto 14px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-strong);
}

.author h1 {
    margin: 0;
    font-size: 32px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

/* ===== The book ===== */
.book {
    max-width: 720px;
    margin: 0 auto;
    padding: 34px 0 52px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.eyebrow,
.chapter-label {
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 6px;
}

.book h2 {
    margin: 0 0 18px;
    font-size: clamp(44px, 9vw, 68px);
    font-weight: normal;
    line-height: 1.05;
}

.book p.blurb {
    margin: 0;
    color: #d8d2c8;
    font-size: 18.5px;
    text-align: left;
}

.buy-button {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 28px auto 0;
    padding: 13px 30px;
    background: var(--accent-strong);
    color: #fff;
    border-radius: 30px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.buy-button:hover {
    background: var(--accent);
}

/* ===== About Nell ===== */
.about {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 720px;
    margin: 0 auto;
    padding: 38px 0 48px;
    border-top: 1px solid var(--line);
}

.about img {
    flex: 0 0 210px;
    width: 210px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.about .section-heading {
    margin-bottom: 10px;
}

.about p {
    margin: 0 0 12px;
    color: #d8d2c8;
    font-size: 17.5px;
}

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

/* ===== Chapters: 4 in a row ===== */
.chapters {
    padding: 38px 0 56px;
    border-top: 1px solid var(--line);
}

.section-heading {
    margin: 0 0 24px;
    color: var(--accent);
    font-size: 30px;
    font-weight: normal;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 20px;
    align-items: start;
}

.chapter-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.chapter-frame {
    position: relative;
    display: block;
    aspect-ratio: 416 / 640;
    margin-bottom: 11px;
    overflow: hidden;
    background: var(--panel);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.chapter-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transition: transform 0.25s ease;
}

.chapter-card:hover .chapter-frame img {
    transform: scale(1.04);
}

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.62);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0.85;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.play-button::after {
    content: "";
    position: absolute;
    left: 19px;
    top: 13px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #fff;
}

.chapter-card:hover .play-button {
    background: var(--accent-strong);
    opacity: 1;
}

.chapter-card .chapter-label {
    display: block;
    font-size: 11px;
}

.chapter-title {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    line-height: 1.35;
}

/* ===== Contact ===== */
.contact {
    max-width: 720px;
    margin: 0 auto;
    padding: 38px 0 50px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.contact .section-heading {
    margin-bottom: 12px;
}

.contact p {
    margin: 0 0 12px;
    color: #d8d2c8;
    font-size: 18px;
}

.contact .email {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 23px;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-strong);
}

.contact .email:hover {
    color: #e7b98a;
}

.site-footer {
    padding: 22px 16px 30px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    text-align: center;
}

/* ===== Chapter (video) page ===== */
.watch {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 22px;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.watch .chapter-label {
    margin: 0 0 4px;
}

.watch-title {
    margin: 0 0 20px;
    font-size: 27px;
    font-weight: normal;
    line-height: 1.25;
}

.watch-video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 76vh;
    margin: 0 auto;
    background: #000;
    border-radius: 6px;
}

.watch-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

.watch-nav a {
    color: var(--accent);
    text-decoration: none;
    padding: 8px 4px;
}

.watch-nav a:hover {
    text-decoration: underline;
}

/* ===== Phones and small tablets ===== */
@media (max-width: 820px) {
    .chapter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .page {
        padding: 0 16px;
    }

    .chapter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }

    .book p.blurb {
        font-size: 17px;
    }

    .about {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .about img {
        flex: none;
        align-self: center;
        width: 190px;
    }

    .about p {
        font-size: 17px;
    }

    .chapter-title {
        font-size: 15px;
    }

    .contact .email {
        font-size: 20px;
    }

    .navbar a {
        font-size: 11px;
        letter-spacing: 0.6px;
        padding: 6px 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .chapter-frame img,
    .play-button,
    .buy-button {
        transition: none;
    }

    .chapter-card:hover .chapter-frame img {
        transform: none;
    }
}
