/* ---------- Base ---------- */

:root {
    --paper: #f3f1ed;
    --paper-2: #eceae5;
    --ink: #202224;
    --muted: #6e6f70;
    --line: #cfcdc7;
    --accent: #a6153a;
    --dark: #1c1f21;
    --max-width: 1180px;
    --gutter: clamp(1.25rem, 4vw, 4.5rem);
    --serif: Georgia, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

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

a {
    color: inherit;
    text-underline-offset: 0.22em;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

::selection {
    background: var(--accent);
    color: white;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    padding: 0.7rem 1rem;
    background: var(--dark);
    color: white;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.section {
    scroll-margin-top: 5rem;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 5rem;
    padding: 0 var(--gutter);
    border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 20%);
    background: color-mix(in srgb, var(--paper), transparent 7%);
    backdrop-filter: blur(12px);
}

.wordmark {
    font-family: var(--serif);
    font-size: 0.95rem;
    letter-spacing: 0.32em;
    text-decoration: none;
}

.site-header ul {
    display: flex;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header nav a,
.social-links a,
.book-action a,
.newsletter label,
.newsletter button {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.site-header nav a {
    text-decoration: none;
}

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

/* ---------- Shared type ---------- */

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.12;
}

.eyebrow,
.book-meta,
.section-heading>p,
.book-action>p {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.eyebrow,
.book-meta span {
    color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
    min-height: min(78vh, 760px);
    display: grid;
    place-items: center;
    align-content: center;
    padding: clamp(6rem, 12vw, 10rem) var(--gutter);
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.6rem;
    font-size: clamp(3.4rem, 8vw, 6.6rem);
    letter-spacing: -0.04em;
}

.hero .eyebrow {
    margin-bottom: 1.8rem;
}

.rule {
    width: 3.8rem;
    height: 1px;
    margin-bottom: 2.2rem;
    background: #aaa7a0;
}

.hero-copy {
    max-width: 42rem;
    margin-bottom: 2.4rem;
    color: #5c5c5c;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    font-style: italic;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        color 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--dark);
    color: white;
}

.button-secondary:hover {
    background: var(--ink);
    color: white;
}

.button-accent {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* ---------- About ---------- */

.about {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    gap: clamp(3rem, 7vw, 6rem);
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(5rem, 8vw, 8rem) var(--gutter);
    border-top: 1px solid var(--line);
}

.about-photo-wrap {
    background:
        repeating-linear-gradient(-45deg,
            #e8e6e1,
            #e8e6e1 8px,
            #d8d5cf 8px,
            #d8d5cf 10px);
    aspect-ratio: 4 / 5;
}

.author-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about h2 {
    max-width: 38rem;
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 4vw, 3.1rem);
}

.about-copy>p:last-child {
    max-width: 43rem;
    color: #555;
}

/* ---------- Books ---------- */

.books {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(5rem, 8vw, 8rem) var(--gutter);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.7rem;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
}

.section-heading>p {
    margin-bottom: 0.35rem;
    color: #8a8882;
}

.book {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 170px;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
    padding: 3.2rem 0;
    border-bottom: 1px solid var(--line);
}

.book-cover {
    width: 150px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background:
        repeating-linear-gradient(-45deg,
            #ebe9e4,
            #ebe9e4 8px,
            #d8d5cf 8px,
            #d8d5cf 10px);
}

.book-meta {
    margin-bottom: 0.9rem;
    color: #aaa7a0;
}

.book-meta span {
    margin-right: 0.7rem;
}

.book h3 {
    margin-bottom: 0.9rem;
    font-size: clamp(1.7rem, 3vw, 2.15rem);
}

.book-info>p:last-child {
    max-width: 42rem;
    margin-bottom: 0;
    color: #626262;
}

.book-action {
    padding-top: 1.1rem;
}

.book-action>p {
    margin-bottom: 0.35rem;
    color: #7d7b76;
}

.book-action a {
    color: var(--accent);
}

/* ---------- Contact ---------- */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: clamp(3rem, 8vw, 7rem);
    padding: clamp(5rem, 8vw, 7rem) var(--gutter);
    background: var(--dark);
    color: #f1efea;
}

.contact>* {
    width: 100%;
    max-width: 520px;
}

.contact-intro {
    justify-self: end;
}

.contact h2 {
    max-width: 25rem;
    margin-bottom: 2rem;
    font-size: clamp(2rem, 4vw, 3rem);
}

.contact .eyebrow {
    color: #aaa;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-links a {
    color: #c7c4bd;
    text-decoration: none;
}

.social-links a:hover {
    color: white;
}

.contact-form {
    justify-self: start;
}

.field {
    margin-bottom: 1.1rem;
}

.field label {
    display: block;
    margin-bottom: 0.25rem;
    color: #a3a3a3;
    font-size: 0.88rem;
}

.field input,
.field textarea {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #5a5c5d;
    border-radius: 0;
    background: transparent;
    color: white;
    outline: 0;
}

.field input {
    min-height: 2.7rem;
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-bottom-color: white;
}

/* ---------- Footer ---------- */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.8rem var(--gutter);
    background: #17191b;
    color: #969696;
}

.site-footer>p {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.newsletter {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.newsletter input {
    width: min(14rem, 32vw);
    border: 0;
    border-bottom: 1px solid #55585a;
    border-radius: 0;
    background: transparent;
    color: white;
    outline: 0;
}

.newsletter input:focus {
    border-bottom-color: white;
}

.newsletter button {
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
}

/* ---------- Motion ---------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 600ms ease,
        transform 600ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
    .site-header {
        min-height: 4.5rem;
    }

    .site-header ul {
        gap: 1rem;
    }

    .site-header nav a {
        font-size: 0.67rem;
    }

    .about,
    .contact {
        grid-template-columns: 1fr;
    }

    .about-photo-wrap {
        max-width: 360px;
    }

    .book {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    .book-cover {
        width: 105px;
    }

    .book-action {
        grid-column: 2;
        padding-top: 0;
    }

    .contact-intro,
    .contact-form {
        justify-self: stretch;
    }

    .contact>* {
        max-width: 100%;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .newsletter {
        width: 100%;
    }

    .newsletter input {
        flex: 1;
        width: auto;
    }
}

@media (max-width: 560px) {
    :root {
        --gutter: 1.15rem;
    }

    .site-header {
        align-items: flex-start;
        gap: 1rem;
        padding-top: 1rem;
        padding-bottom: 0.9rem;
    }

    .wordmark {
        margin-top: 0.05rem;
        font-size: 0.8rem;
        letter-spacing: 0.22em;
    }

    .site-header ul {
        flex-direction: column;
        gap: 0.2rem;
        text-align: right;
    }

    .hero {
        min-height: 72vh;
        padding-top: 7rem;
        padding-bottom: 6rem;
    }

    .hero h1 {
        font-size: clamp(3.4rem, 17vw, 5.4rem);
    }

    .button-row {
        width: 100%;
    }

    .button-row .button {
        flex: 1 1 11rem;
    }

    .about {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }

    .book {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 1.25rem;
        padding: 2.4rem 0;
    }

    .book-cover {
        width: 82px;
    }

    .book-action {
        grid-column: 2;
    }

    .contact {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .newsletter {
        align-items: flex-start;
        flex-direction: column;
    }

    .newsletter input {
        width: 100%;
        min-height: 2.2rem;
    }
}

/* Respect the user's motion preference. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}