/*
 * Marcus McCarroll — site styles (layered on Pico CSS).
 * Measurements come from the Figma designs in /design (1440px wide frames).
 */

/* ---------- Fonts (self-hosted, Latin subsets, SIL OFL) ---------- */
@font-face {
    font-family: "Ruwudu";
    src: url("../fonts/ruwudu-700-latin.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/instrument-sans-500-latin.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/instrument-sans-600-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/instrument-sans-400-italic-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
/* Inter 3.19 (the version used in the designs) */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-500-latin.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-600-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    --c-maroon: #870014;
    --c-sky: #98d7e8;
    --c-blue: #4a53cf;
    --c-indigo: #2931a9;
    --c-gold: #fec80e;
    --c-bg: #f0f0f0;
    --c-ink: #171717;
    --c-blush: #e0cccf;
    --c-lavender: #d7d8eb;
    --c-muted: #666;

    --f-serif: "Ruwudu", Georgia, "Times New Roman", serif;
    --f-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --f-inter: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --wrap: 980px;
    --gutter: 24px;
    --shadow-btn: 0 4px 4px rgba(0, 0, 0, .25);

    /* Pico overrides: keep a fixed 16px root (Pico scales it up on wide screens) */
    --pico-font-size: 100%;
    --pico-font-family: var(--f-sans);
    --pico-font-family-sans-serif: var(--f-sans);
    --pico-line-height: 1.25;
    --pico-font-weight: 500;
}
[data-theme=light],
:root:not([data-theme=dark]) {
    --pico-background-color: var(--c-bg);
    --pico-color: #000;
    --pico-primary: var(--c-blue);
    --pico-primary-hover: var(--c-indigo);
    --pico-text-selection-color: rgba(74, 83, 207, .25);
}

/* ---------- Base ---------- */
html {
    font-family: var(--f-sans);
}
body {
    margin: 0;
    background: var(--c-bg);
    color: #000;
    font-family: var(--f-sans);
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-main {
    flex: 1 0 auto;
    padding: 0;
}
.wrap {
    width: min(var(--wrap), 100% - 2 * var(--gutter));
    margin-inline: auto;
}
h1, h2, h3, p {
    margin: 0;
}
a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--c-blue);
    outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--c-maroon);
    height: 150px;
    padding: 2px 0 0;
}
.site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand,
.brand:hover {
    position: relative;
    top: 8px;
    padding-left: 9px;
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 32px;
    line-height: 40px;
    letter-spacing: .06em;
    color: var(--c-sky);
    text-decoration: none;
    white-space: nowrap;
}
.site-nav {
    margin-right: -1px;
}
.site-nav ul,
.site-nav ul:first-of-type,
.site-nav ul:last-of-type {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 0;
}
.site-nav li {
    padding: 0;
    margin: 0;
    list-style: none;
}
.site-nav li + li {
    margin-left: 40px;
}
.site-nav li:last-child {
    margin-left: 43px;
}
.site-nav a:not(.btn) {
    color: #fff;
    font-size: 16px;
    line-height: 20px;
    text-decoration: none;
    padding: 0;
    margin: 0;
}
.site-nav a:not(.btn):hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    font-family: var(--f-sans);
    font-weight: 600;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: var(--shadow-btn);
    transition: filter .15s ease, transform .15s ease;
}
.btn:hover {
    filter: brightness(1.06);
    text-decoration: none;
}
.btn:active {
    transform: translateY(1px);
}
.btn--nav,
.site-nav .btn--nav {
    margin: 0;
    height: 36px;
    padding: 8px 16px;
    border-radius: 3px;
    background: var(--c-sky);
    color: #000;
}
.btn--pill {
    height: 46px;
    padding: 0 20px 0 12px;
    gap: 16px;
    border: 1px solid var(--c-blue);
    border-radius: 16px;
    background: var(--c-indigo);
    color: #fff;
}
.btn--pill:hover {
    color: #fff;
}
.btn--pill img {
    display: block;
    width: 28px;
    height: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--gutter);
    color: var(--c-ink);
}
.site-footer--gold {
    background: var(--c-gold);
}
.site-footer p {
    margin: 0 0 0 46px;
    font-size: 16px;
    line-height: 20px;
}

/* ---------- Shared type ---------- */
.display-title {
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 64px;
    line-height: 96px;
    letter-spacing: .06em;
    color: var(--c-maroon);
    text-align: center;
}
/* CSS letter-spacing also trails the last glyph; balance it so centered text sits where Figma puts it */
.display-title,
.feature__card-title,
.poem__title {
    padding-left: .06em;
}
.lead {
    font-size: 24px;
    line-height: 36px;
    letter-spacing: .06em;
    color: var(--c-blue);
}
.lead a {
    color: inherit;
}
.section-title {
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 32px;
    line-height: 48px;
    letter-spacing: .06em;
    color: var(--c-blue);
}

/* ---------- Page intro (Home, About) ---------- */
.page-intro {
    padding-top: 90px;
}
.page-intro .lead {
    margin-top: 39px;
}
.page-intro--404 {
    padding-bottom: 120px;
}

/* ---------- Home collage ---------- */
.collage {
    --u: calc(100cqw / 1080);
    position: relative;
    container-type: inline-size;
    width: min(1080px, 100% - 2 * var(--gutter));
    aspect-ratio: 1080 / 1295;
    margin: 132px auto 62px;
}
.cover {
    position: absolute;
    left: calc(var(--x) * var(--u));
    top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
    display: block;
    transition: transform .2s ease, box-shadow .2s ease;
}
.cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}
.cover--shadow {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 4px rgba(0, 0, 0, .15);
}
.cover--shadow-lg {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .15);
}
.cover--shadow-xl {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 11px rgba(0, 0, 0, .15);
}
/* Cover sits inside a slightly wider shaded frame */
.cover--band {
    background: rgba(0, 0, 0, .15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.cover--band img {
    object-fit: contain;
}
a.cover:hover,
a.cover:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
}

/* ---------- Feature (outlined card + body copy) ---------- */
.feature {
    display: flex;
    align-items: flex-start;
    gap: 57px;
    width: min(var(--wrap), 100% - 2 * var(--gutter));
    margin-inline: auto;
}
.feature--about {
    margin-top: 136px;
    margin-bottom: 77px;
    padding-left: 19px;
}
.feature--book {
    margin-top: 120px;
    margin-bottom: 61px;
    width: min(var(--wrap) + 12px, 100% - 2 * var(--gutter));
}
.feature__card {
    flex: 0 0 302px;
    min-height: 390px;
    padding: 29px 24px 24px;
    border: 1px solid var(--c-sky);
    border-radius: 30px;
    text-align: center;
}
.feature--book .feature__card {
    min-height: 350px;
}
.feature__card-title {
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 24px;
    line-height: 36px;
    letter-spacing: .06em;
    color: var(--c-maroon);
}
.feature__card-title + .feature__card-line {
    margin-top: 24px;
}
.feature__card-line {
    color: var(--c-ink);
}
.feature__body {
    flex: 0 1 572px;
    padding-top: 11px;
    color: #000;
}
.feature--book .feature__body {
    flex-basis: 623px;
}
.feature__body p + p {
    margin-top: 24px;
}

/* ---------- Book hero ---------- */
.book-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    width: min(930px, 100% - 2 * var(--gutter));
    margin: 96px auto 0;
}
.book-hero--poetry {
    margin-top: 80px;
}
.book-hero__title {
    flex: 0 1 480px;
    position: relative;
    top: 2px;
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 64px;
    line-height: 96px;
    letter-spacing: .06em;
    color: var(--c-maroon);
}
.book-hero--poetry .book-hero__title {
    color: var(--c-indigo);
}
.book-hero__cover {
    flex: 0 0 382px;
    height: 480px;
}
.book-hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Dedication ---------- */
.dedication {
    margin: 96px auto 0;
    padding: 65px var(--gutter);
    border-radius: 12px;
    text-align: center;
    font-family: var(--f-inter);
}
.dedication--wide {
    width: min(1280px, 100% - 2 * var(--gutter));
    background: var(--c-blush);
}
.dedication--narrow {
    width: min(1000px, 100% - 2 * var(--gutter));
    margin-top: 80px;
    background: var(--c-lavender);
}
.dedication__title {
    font-family: var(--f-inter);
    font-weight: 600;
    font-size: 24px;
    line-height: 30px;
    letter-spacing: -.02em;
    color: var(--c-ink);
}
.dedication__text {
    margin-top: 16px;
    font-weight: 500;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: -.005em;
    color: var(--c-muted);
}

/* ---------- Prose book page ---------- */
.book-about {
    margin-top: 79px;
}
.book-about .lead {
    margin-top: 47px;
}

/* ---------- Poetry page ---------- */
.poems {
    margin-top: 16px;
}
.poem {
    width: min(750px, 100% - 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 0 60.75px;
    background: none;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 2px solid var(--c-sky);
    text-align: center;
}
.poem + .poem {
    padding-top: 15px;
}
.poem:last-child {
    padding-bottom: 88.75px;
}
.poem__ornament {
    display: block;
    margin: 0 auto;
}
.poem__title {
    margin-top: 64.5px;
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 24px;
    line-height: 24px;
    letter-spacing: .06em;
    color: var(--c-maroon);
}
.poem__chord {
    font-style: italic;
    font-weight: 400;
    line-height: 20px;
    color: var(--c-blue);
}
.poem__lines {
    margin-top: 23.75px;
    line-height: 28px;
    color: var(--c-ink);
}
.poem__chord + .poem__lines {
    margin-top: 33.75px;
}
.keep-reading {
    display: flex;
    justify-content: center;
    padding-top: 14px;
    margin-bottom: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .site-footer p {
        margin-left: 0;
    }
    .site-header {
        height: auto;
        padding: 28px 0;
    }
    .site-header__inner {
        flex-wrap: wrap;
    }
    .brand {
        padding-left: 0;
    }
    .site-nav {
        margin-right: 0;
    }
    .feature,
    .feature--book {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        padding-left: 0;
    }
    .feature__card {
        flex-basis: auto;
        width: min(302px, 100%);
        min-height: 0;
    }
    .feature--book .feature__card {
        min-height: 0;
    }
    .feature__body,
    .feature--book .feature__body {
        flex-basis: auto;
        width: min(630px, 100%);
        padding-top: 0;
    }
    .book-hero {
        flex-direction: column-reverse;
        gap: 40px;
        text-align: center;
    }
    .book-hero__title {
        flex-basis: auto;
        top: 0;
    }
}
@media (max-width: 720px) {
    .site-header__inner {
        justify-content: center;
    }
    .site-nav li + li {
        margin-left: 24px;
    }
    .site-nav li:last-child {
        margin-left: 24px;
    }
    .display-title,
    .book-hero__title {
        font-size: 42px;
        line-height: 1.3;
    }
    .page-intro {
        padding-top: 56px;
    }
    .lead {
        font-size: 20px;
        line-height: 30px;
        letter-spacing: .03em;
    }
    .section-title {
        font-size: 26px;
        line-height: 1.4;
    }
    .book-hero,
    .book-hero--poetry {
        margin-top: 56px;
    }
    .book-hero__cover {
        flex-basis: auto;
        width: min(382px, 100%);
        height: auto;
        aspect-ratio: 382 / 480;
    }
    .dedication,
    .dedication--narrow {
        margin-top: 56px;
        padding-block: 40px;
    }
    .feature--about,
    .feature--book {
        margin-top: 64px;
        margin-bottom: 56px;
    }
    .book-about {
        margin-top: 56px;
    }
    .book-about .lead {
        margin-top: 24px;
    }
    .collage {
        margin-top: 64px;
        aspect-ratio: auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        container-type: normal;
    }
    .cover {
        position: static;
        width: auto;
        height: auto;
        aspect-ratio: 3 / 4;
    }
}
