/* ==========================================================================
   W. D. Mueller site styles
   Drop-in replacement for src/main/resources/static/css/site.css
   ========================================================================== */

:root {
    --ink: #0c111a;
    --ink-forest: #090e15;
    --navy: #121b28;
    --cream: #eee9dd;
    --panel: #d3cec0;

    --text: #f4efe4;
    --muted: rgba(244, 239, 228, .74);
    --faint: rgba(244, 239, 228, .58);
    --line: rgba(244, 239, 228, .13);

    --paper-ink: #17181c;
    --paper-muted: #4b4840;
    --paper-faint: #655f54;
    --paper-line: rgba(23, 24, 28, .15);

    --gold: #c8ad7f;
    --gold-deep: #8d6f3a;
    --red: #8e2c36;
    --red-bright: #a43543;

    --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --topbar-height: 88px;
    --cover-shadow: 0 22px 54px rgba(0, 0, 0, .52);

    /* The Google Fonts subset of Inter has no arrows, so they are drawn here. */
    --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8h11M9.25 3.75 13.5 8l-4.25 4.25'/%3E%3C/svg%3E");
    --arrow-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 12.5l9-9M5.5 3.5h7v7'/%3E%3C/svg%3E");
}

/* Base
   ========================================================================== */

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

body {
    margin: 0;
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    background: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

figure,
blockquote {
    margin: 0;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.container {
    width: min(1250px, calc(100% - 96px));
    margin-inline: auto;
}

.page {
    flex: 1 0 auto;
}

.page:focus {
    outline: none;
}

#books,
#redd,
#reviews,
#series-roadmap,
#author {
    scroll-margin-top: var(--topbar-height);
}

/* Accessibility
   ========================================================================== */

.skip-link {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 999;
    transform: translateY(-170%);
    padding: 10px 14px;
    color: var(--paper-ink);
    background: var(--cream);
    font-size: 14px;
    line-height: 1;
    transition: transform .16s ease;
}

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

/* Shared pieces
   ========================================================================== */

.eyebrow {
    margin: 0 0 16px;
    color: var(--gold);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.book--bloom .eyebrow,
.praise .eyebrow,
.author .eyebrow,
.reviews--paper .eyebrow {
    color: var(--paper-faint);
}

.arrow {
    display: inline-block;
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--arrow) center / contain no-repeat;
    mask: var(--arrow) center / contain no-repeat;
    transition: translate .18s ease;
}

.arrow--out {
    -webkit-mask-image: var(--arrow-out);
    mask-image: var(--arrow-out);
}

.arrow--down {
    rotate: 90deg;
}

.cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.btn--primary {
    color: #fff;
    background: var(--red);
}

.btn--primary:hover {
    background: var(--red-bright);
}

.btn--text {
    padding-inline: 0;
}

.btn--text .arrow {
    color: var(--gold);
}

.btn--text:hover {
    color: var(--gold);
}

.book--bloom .btn--text .arrow {
    color: inherit;
}

.book--bloom .btn--text:hover {
    color: var(--red);
}

.btn:hover .arrow {
    translate: 3px 0;
}

.btn:hover .arrow--down {
    translate: 0 3px;
}

.bookcover {
    width: 100%;
    box-shadow: var(--cover-shadow);
}

/* Header / navigation
   ========================================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(12, 17, 26, .93);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    min-height: var(--topbar-height);
    padding-block: 14px;
}

.brand {
    display: grid;
    gap: 5px;
}

.brand__name,
.footer__brand {
    font-family: var(--serif);
    font-size: 27px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.brand__tagline {
    color: var(--faint);
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .25em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: 38px;
    font-size: 14px;
    line-height: 1.2;
}

.nav__link {
    position: relative;
    padding: 6px 0 8px;
}

.nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .18s ease;
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
    transform: scaleX(1);
}

/* Hero
   ========================================================================== */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--ink);
}

.hero__art {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: 60% 50%;
}

.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    min-height: clamp(560px, 44vw, 700px);
    padding-block: 64px;
}

.hero h1 {
    max-width: 8em;
    margin-bottom: 20px;
    font-size: clamp(50px, 5.9vw, 86px);
    line-height: 1.06;
    text-wrap: balance;
}

.hero__lede {
    max-width: 29em;
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero__books {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 222px));
    justify-content: end;
    gap: clamp(20px, 3.6vw, 52px);
    padding-right: clamp(0px, 2.4vw, 35px);
}

.hero-book {
    display: block;
    transition: translate .24s ease;
}

.hero-book:hover {
    translate: 0 -4px;
}

.hero-book img {
    width: 100%;
    box-shadow: var(--cover-shadow);
}

.hero-book--offset {
    margin-top: 64px;
}

.hero-book__series {
    display: block;
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: .2em;
    text-align: center;
    text-transform: uppercase;
}

/* Where will you begin?
   ========================================================================== */

.begin {
    background: var(--ink);
    border-top: 1px solid var(--line);
}

.begin__inner {
    display: grid;
    grid-template-columns: minmax(0, 155px) repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 24px 54px;
    padding-block: 28px 30px;
}

.begin__title {
    max-width: 5.6em;
    color: var(--gold);
    font-size: 28px;
    font-style: italic;
    line-height: 1.2;
}

.begin__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.begin__link .arrow {
    width: 20px;
    height: 20px;
    color: var(--gold);
}

.begin__link:hover .arrow {
    translate: 2px -2px;
}

.begin__text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.begin__genre {
    color: var(--faint);
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.begin__book {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 26px;
    overflow: hidden;
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 500;
    line-height: 1.25;
}

.begin__status {
    position: relative;
    color: var(--faint);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

/* Sits in the gap, so the row's clipped edge hides it if the status wraps. */
.begin__status::before {
    content: "/";
    position: absolute;
    right: calc(100% + 10px);
}

.begin__tagline {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Book bands (home sections and detail pages)
   ========================================================================== */

.book {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(64px, 6.4vw, 92px);
}

.book--bloom {
    color: var(--paper-ink);
    background: var(--cream);
}

.book--redd {
    background: var(--ink-forest);
}

/* Keeps the copy readable over the trees while leaving them visible beside it. */
.book--redd::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(9, 14, 21, .7) 0%, rgba(9, 14, 21, .42) 50%, rgba(9, 14, 21, .1) 100%);
}

.book__art {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.book__grid {
    display: grid;
    align-items: center;
}

.book--bloom .book__grid {
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
    gap: clamp(48px, 7vw, 100px);
}

.book--redd .book__grid {
    grid-template-columns: minmax(0, 574px) minmax(0, 1fr);
    gap: clamp(48px, 12.9vw, 186px);
}

.book--page {
    overflow: clip;
}

.book--page .book__grid {
    align-items: start;
}

/* Long blurbs would otherwise leave the cover far behind. */
.book--page .book__figure {
    position: sticky;
    top: calc(var(--topbar-height) + 32px);
}

.book__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book--bloom .book__figure {
    padding: 46px 24px 28px;
    background: var(--panel) url("/img/bloom-panel-1876bb232ba90ef50e821a5b5ad831fa.webp") center / cover;
}

.book--bloom .bookcover {
    width: 254px;
    border-radius: 6px;
}

.book--bloom .book__figure a,
.book--bloom .book__figure .bookcover {
    max-width: 100%;
}

.book--redd .book__figure a,
.book--redd .bookcover {
    width: 286px;
    max-width: 100%;
}

.book__figure a {
    display: block;
    transition: translate .24s ease;
}

.book__figure a:hover {
    translate: 0 -4px;
}

.book__caption {
    margin-top: 26px;
    color: var(--paper-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .2em;
    text-align: center;
    text-transform: uppercase;
}

.book--redd .book__caption {
    color: var(--muted);
}

.book__title {
    margin-bottom: 18px;
    font-size: clamp(46px, 5vw, 72px);
    line-height: 1.04;
}

.book--redd .book__title {
    font-size: clamp(64px, 6.7vw, 96px);
}

.book__tagline {
    margin: 0 0 20px;
    color: var(--paper-muted);
    font-family: var(--serif);
    font-size: clamp(26px, 2.3vw, 33px);
    font-style: italic;
    line-height: 1.24;
}

.book--redd .book__tagline {
    color: var(--text);
}

.book__copy > p:not([class]) {
    margin: 0 0 18px;
    color: var(--paper-muted);
    line-height: 1.85;
}

.book--redd .book__copy > p:not([class]) {
    color: var(--muted);
}

.book__rule {
    height: 1px;
    margin: 26px 0 22px;
    background: var(--paper-line);
    border: 0;
}

.book--redd .cta {
    margin-top: 26px;
}

.book__meta {
    margin: 14px 0 0;
    color: var(--paper-faint);
    font-size: 12px;
    line-height: 1.5;
}

.book__meta span {
    margin-inline: 6px;
}

.book--redd .book__meta {
    color: var(--gold);
}

/* Reader praise
   ========================================================================== */

.praise {
    padding-block: clamp(56px, 5.2vw, 76px);
    color: var(--paper-ink);
    background: var(--cream);
}

.praise__grid {
    display: grid;
    grid-template-columns: minmax(min-content, 1fr) minmax(0, 472px);
    align-items: center;
    gap: 40px clamp(40px, 8vw, 120px);
}

.praise__title {
    max-width: 8em;
    font-size: clamp(36px, 28px + 1.55vw, 50px);
    line-height: 1.18;
}

.praise__title span {
    white-space: nowrap;
}

.praise__source {
    margin: 18px 0 0;
    color: var(--paper-muted);
    font-size: 11.5px;
    line-height: 1.5;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.praise__aside {
    padding-left: 44px;
    border-left: 1px solid var(--paper-line);
}

.praise__aside p {
    margin: 0;
    color: var(--paper-faint);
    font-family: var(--serif);
    font-size: clamp(23px, 1.9vw, 26px);
    line-height: 1.42;
}

.praise__aside figcaption {
    margin-top: 16px;
    color: var(--paper-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Series roadmap
   ========================================================================== */

.roadmap {
    padding-block: clamp(60px, 5.6vw, 80px);
    background: var(--navy);
}

.roadmap__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 282px);
    align-items: end;
    gap: 16px 48px;
}

.roadmap h2 {
    font-size: clamp(42px, 4.2vw, 60px);
}

.roadmap__note {
    margin: 0 0 8px;
    color: var(--faint);
    font-size: 13px;
    line-height: 1.55;
}

.roadmap__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px clamp(48px, 6.6vw, 94px);
    margin-top: 44px;
}

.series-card__kicker {
    margin: 0 0 12px;
    color: var(--faint);
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.series-card h3 {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
    font-size: clamp(32px, 2.9vw, 41px);
}

.book-progress-list {
    display: grid;
    gap: 28px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.book-progress {
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.book-progress::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 50%;
}

.book-progress--development::before {
    background: transparent;
}

.book-progress__main {
    min-width: 0;
}

.book-progress__number {
    display: block;
    color: var(--faint);
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.book-progress__title {
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 500;
    line-height: 1.25;
}

a.book-progress__title:hover,
a.book-progress__title:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.book-progress__status {
    color: var(--faint);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

.book-progress--available .book-progress__status {
    color: var(--gold);
}

/* Author / contact
   ========================================================================== */

.author {
    padding-block: clamp(56px, 4.6vw, 66px);
    color: var(--paper-ink);
    background: var(--cream);
}

.author__grid {
    display: grid;
    grid-template-columns: minmax(0, 370px) minmax(0, 1fr);
    align-items: center;
    gap: 32px clamp(40px, 7vw, 100px);
}

.author__name {
    max-width: 6.4em;
    font-size: clamp(54px, 5.3vw, 76px);
    line-height: 1.04;
}

.author__bio p {
    margin: 0 0 16px;
    color: var(--paper-muted);
    line-height: 1.75;
}

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

.author__bio a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.author__bio .author__lede {
    margin-bottom: 18px;
    color: var(--paper-ink);
    font-family: var(--serif);
    font-size: clamp(28px, 2.5vw, 35px);
    font-weight: 500;
    line-height: 1.26;
}

.author__bio .author__email {
    color: var(--red);
}

.contact-page {
    display: grid;
    align-content: center;
    min-height: calc(100vh - var(--topbar-height) - 110px);
}

/* Reviews
   ========================================================================== */

.reviews {
    padding-block: clamp(60px, 6vw, 84px);
    background: var(--navy);
}

.reviews--paper {
    color: var(--paper-ink);
    background: var(--cream);
}

.reviews h2 {
    font-size: clamp(42px, 4.2vw, 60px);
}

.reviews__track {
    display: flex;
    gap: 24px;
    margin-top: 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.reviews__track::-webkit-scrollbar {
    display: none;
}

.reviews__card {
    display: flex;
    flex: 0 0 100%;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    scroll-snap-align: start;
}

.reviews__stars {
    color: var(--gold);
    font-size: 15px;
    line-height: 1;
    letter-spacing: .14em;
}

.reviews--paper .reviews__stars {
    color: var(--gold-deep);
}

.reviews__quote {
    max-width: 31em;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.34;
}

.reviews__cite {
    color: var(--faint);
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.reviews--paper .reviews__cite {
    color: var(--paper-muted);
}

.reviews__dots {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0 0 -7px;
}

.reviews__dot {
    width: 24px;
    height: 24px;
    padding: 7px;
    color: inherit;
    background: currentColor;
    background-clip: content-box;
    border: 0;
    border-radius: 50%;
    opacity: .32;
    cursor: pointer;
    transition: opacity .25s;
}

.reviews__dot.is-active {
    opacity: 1;
}

/* Footer
   ========================================================================== */

.footer {
    flex: none;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    background: var(--ink);
}

.footer__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px 32px;
    padding-block: 44px;
}

.footer__brand {
    justify-self: start;
    color: var(--text);
    font-size: 25px;
}

.footer__legal {
    margin: 0;
    text-align: center;
}

.footer__contact {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    color: var(--gold);
}

.footer__contact .arrow {
    width: 13px;
    height: 13px;
}

/* Responsive
   ========================================================================== */

@media (max-width: 1040px) {
    .begin__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .begin__title {
        grid-column: 1 / -1;
        max-width: none;
    }
}

@media (max-width: 900px) {
    .container {
        width: min(100% - 64px, 1250px);
    }

    .hero__art {
        object-position: 57% 50%;
    }

    /* The copy sits on the fog once stacked, so it needs more help. */
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(180deg, rgba(12, 17, 26, .62), rgba(12, 17, 26, .4) 55%, rgba(12, 17, 26, .7));
    }

    .hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
        min-height: 0;
        padding-block: 56px;
    }

    .hero__books {
        justify-content: start;
        padding-right: 0;
    }

    .book--bloom .book__grid,
    .book--redd .book__grid,
    .praise__grid,
    .author__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .book__grid {
        gap: 40px;
    }

    /* The cover leads on both books once stacked. */
    .book--redd .book__figure {
        order: -1;
    }

    .book--page .book__figure {
        position: static;
    }

    .book--bloom .book__figure {
        justify-self: center;
        width: min(460px, 100%);
    }

    .book--redd::before {
        background: rgba(9, 14, 21, .62);
    }

    .praise__aside {
        padding: 28px 0 0;
        border-top: 1px solid var(--paper-line);
        border-left: 0;
    }

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

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

@media (max-width: 640px) {
    .container {
        width: calc(100% - 40px);
    }

    .topbar {
        position: static;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .topbar__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav {
        gap: 24px;
        margin-bottom: -4px;
    }

    .hero h1 {
        font-size: clamp(46px, 13.5vw, 58px);
    }

    .hero__lede {
        font-size: 17px;
    }

    .hero__books {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-book--offset {
        margin-top: 36px;
    }

    .hero-book__series {
        font-size: 10px;
        letter-spacing: .16em;
    }

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

    .book-progress {
        grid-template-columns: 7px minmax(0, 1fr);
        row-gap: 2px;
    }

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

    .footer__inner {
        grid-template-columns: minmax(0, 1fr);
        padding-block: 32px;
    }

    .footer__legal {
        text-align: left;
    }

    .footer__contact {
        justify-self: start;
    }
}
