/* ============================================================
   HOMEPAGE ("Book First" redesign, November 2026)
   Used by app/templates/landing.html (/ and /occasions/<slug>).
   Everything is scoped to body.home so it can't leak into other pages,
   and the old body.landing rules in style.css no longer apply here.
   Sizes are in px: the site root stays 16px, and DESIGN.md / CLAUDE.md
   require 20px body text, 56px buttons and nothing under 13px.
   ============================================================ */

body.home {
    --hp-green: #2D7A5A;
    --hp-green-hover: #246B4D;
    --hp-green-light: #E8F3ED;
    --hp-green-deep: #173D2D;
    --hp-amber: #C4813D;
    --hp-amber-light: #FDF3E8;
    --hp-amber-ink: #8A5416;
    --hp-bg: #FBF7F2;
    --hp-card: #FFFFFF;
    --hp-soft: #F5F0EA;
    --hp-text: #2D2418;
    --hp-text-2: #6B5D50;
    --hp-border: #E8DFD4;
    --hp-border-strong: #8C7E70;
    --hp-error: #9E3636;
    --hp-display: 'Fraunces', Georgia, serif;
    --hp-body: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
    --hp-sh-md: 0 4px 12px rgba(45, 36, 24, 0.10);
    --hp-sh-lg: 0 8px 24px rgba(45, 36, 24, 0.12);

    background: var(--hp-bg);
    color: var(--hp-text);
    font: 400 20px/1.55 var(--hp-body);
}

body.home img { display: block; max-width: 100%; height: auto; }
body.home h1, body.home h2, body.home h3 {
    font-family: var(--hp-display);
    font-weight: 600;
    line-height: 1.12;
    margin: 0;
    color: inherit;
    text-wrap: balance;
}
body.home h1 { font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -0.01em; }
body.home h2 { font-size: clamp(29px, 3.2vw, 36px); }
body.home h3 { font-size: 22px; }
body.home main p { margin: 0; }
/* Zero-specificity scope (same weight as style.css's bare `a`), so button classes
   here and in shared partials (e.g. the resume banner's .btn-primary) keep their colors. */
:where(body.home) a { color: var(--hp-green); text-underline-offset: 3px; }
:where(body.home) a:hover { color: var(--hp-green-hover); }
body.home :focus-visible { outline: 3px solid var(--hp-amber-ink); outline-offset: 3px; border-radius: 4px; }
body.home .hp-band-green :focus-visible,
body.home .hp-foot :focus-visible { outline-color: #E7B77E; }

.hp-wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.hp-narrow { max-width: 960px; margin: 0 auto; padding-inline: 24px; }
body.home .hp-eyebrow {
    font: 700 15px/1.3 var(--hp-body);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hp-amber-ink);
}
.hp-lede { color: var(--hp-text-2); max-width: 34em; }
.hp-muted { color: var(--hp-text-2); }
.hp-visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Buttons (56px minimum) --- */
.hp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 56px; padding: 14px 30px;
    border-radius: 8px; border: 2px solid transparent;
    font: 700 19px/1.2 var(--hp-body); text-align: center;
    text-decoration: none; cursor: pointer;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}
body.home .hp-btn-primary { background: var(--hp-green); color: #fff; box-shadow: var(--hp-sh-md); }
body.home .hp-btn-primary:hover { background: var(--hp-green-hover); color: #fff; }
body.home .hp-btn-amber { background: var(--hp-amber-ink); color: #fff; box-shadow: var(--hp-sh-md); }
body.home .hp-btn-amber:hover { background: #74460F; color: #fff; }
body.home .hp-btn-ghost { background: transparent; color: var(--hp-green); border-color: var(--hp-green); }
body.home .hp-btn-ghost:hover { background: var(--hp-green-light); color: var(--hp-green-hover); }
.hp-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hp-btn-wide { width: 100%; }
.hp-textlink { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* --- Seasonal banner + header --- */
.hp-banner {
    background: var(--hp-green-deep); color: #fff; text-align: center;
    padding: 10px 16px; font-weight: 600; font-size: 17px;
}
.hp-head { background: var(--hp-bg); border-bottom: 1px solid var(--hp-border); }
.hp-head-inner { display: flex; align-items: center; gap: 28px; min-height: 80px; }
body.home .hp-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--hp-text); text-decoration: none;
    font: 400 23px/1 var(--hp-display); white-space: nowrap;
}
.hp-logo b { font-weight: 700; color: var(--hp-green); }
.hp-logo-icon { width: 36px; height: 36px; flex: none; }
.hp-nav { display: flex; gap: 26px; margin-left: auto; }
body.home .hp-nav a {
    color: var(--hp-text); text-decoration: none; font-weight: 600; font-size: 18px;
    padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center;
}
body.home .hp-nav a:hover { color: var(--hp-green); text-decoration: underline; }
.hp-head-btn { padding: 10px 22px; font-size: 18px; }

/* --- Check lists --- */
.hp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hp-checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.hp-checks .hp-ico { width: 24px; height: 24px; margin-top: 4px; color: var(--hp-green); }

/* --- Hero --- */
.hp-hero { padding-block: 56px 72px; }
.hp-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hp-hero h1 { margin-top: 16px; }
.hp-hero .hp-lede { margin-top: 20px; }
.hp-hero-cta { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 30px; }
.hp-hero .hp-checks { margin-top: 28px; }
body.home .hp-order-note {
    margin-top: 22px; padding: 12px 18px;
    background: var(--hp-amber-light); border-left: 4px solid var(--hp-amber);
    border-radius: 0 8px 8px 0; font-weight: 600;
}
.hp-promo { margin-top: 16px; }
.hp-promo-toggle {
    min-height: 56px; padding: 0; background: none; border: 0; cursor: pointer;
    font: 600 18px/1.2 var(--hp-body); color: var(--hp-green); text-decoration: underline; text-underline-offset: 3px;
}
.hp-promo-form { max-width: 420px; }
body.home .hp-promo-form label { display: block; font-weight: 700; font-size: 18px; margin: 6px 0 6px; }
.hp-promo-row { display: flex; gap: 10px; }
body.home .hp-promo-row input {
    flex: 1; min-width: 0; min-height: 56px; padding: 12px 14px;
    font: 400 20px/1.2 var(--hp-body); color: var(--hp-text);
    background: #fff; border: 2px solid var(--hp-border-strong); border-radius: 8px;
}
.hp-promo-row .hp-btn { padding-inline: 22px; }
body.home .hp-promo-msg { margin-top: 8px; font-size: 18px; font-weight: 600; }
.hp-promo-msg.is-ok { color: var(--hp-green-hover); }
.hp-promo-msg.is-err { color: var(--hp-error); }

/* Hero: a picture of the sample book as a printed hardcover */
.hp-hero-art { position: relative; margin: 0; padding: 0 18px 92px 0; }
.hp-hero-photo { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: var(--hp-sh-lg); background: var(--hp-soft); }
.hp-peek {
    position: absolute; right: 0; bottom: 34px; width: 46%;
    transform: rotate(4deg); border: 6px solid #fff; border-radius: 4px; box-shadow: var(--hp-sh-lg);
}
.hp-hero-art figcaption {
    position: absolute; left: 4px; bottom: 4px; max-width: 48%;
    font-size: 16px; line-height: 1.35; color: var(--hp-text-2);
}

/* --- Facts strip --- */
.hp-facts { border-block: 1px solid var(--hp-border); background: var(--hp-card); }
.hp-facts ul {
    list-style: none; margin: 0 auto; padding-block: 20px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 28px;
}
.hp-facts li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; }
.hp-facts .hp-ico { width: 28px; height: 28px; color: var(--hp-amber-ink); }
.hp-facts b { display: block; line-height: 1.2; font-size: 18px; }
body.home .hp-facts b a { color: var(--hp-text); }
.hp-facts span { display: block; color: var(--hp-text-2); font-size: 16px; line-height: 1.3; margin-top: 2px; }

/* --- Sections --- */
.hp-band { padding-block: 80px; }
.hp-band-soft { background: var(--hp-soft); }
.hp-band-green { background: var(--hp-green-deep); color: #F3EEE6; }
.hp-band-green h2, .hp-band-green h3 { color: #fff; }
body.home .hp-band-green a { color: #BFE3D0; }
body.home .hp-band-green .hp-eyebrow { color: #E7B77E; }
body.home .hp-band-text { margin-top: 16px; color: #D8E7DE; }
.hp-band-green .hp-checks .hp-ico { color: #8ED1AF; }
.hp-sec-head { max-width: 40em; margin-bottom: 36px; }
.hp-sec-head h2 { margin-top: 8px; }
body.home .hp-sec-head p.hp-muted { margin-top: 12px; }

/* --- See the real thing (photo -> portrait) --- */
.hp-pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.hp-pair { margin: 0; background: var(--hp-card); border: 1px solid var(--hp-border); border-radius: 16px; padding: 16px; box-shadow: var(--hp-sh-md); }
.hp-pair-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp-pair-imgs > div { position: relative; }
.hp-pair-imgs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--hp-soft); }
.hp-pair-label {
    position: absolute; left: 8px; bottom: 8px;
    background: rgba(45, 36, 24, 0.85); color: #fff;
    font: 700 14px/1 var(--hp-body); letter-spacing: 0.04em;
    padding: 6px 9px; border-radius: 999px;
}
.hp-pair-imgs > div + div .hp-pair-label { background: var(--hp-green-deep); }
.hp-pair figcaption { margin-top: 12px; font: 600 22px/1.25 var(--hp-display); }
.hp-pair figcaption small { display: block; margin-top: 4px; font: 400 17px/1.35 var(--hp-body); color: var(--hp-text-2); }
body.home .hp-note { margin-top: 22px; color: var(--hp-text-2); font-style: italic; }

/* --- The hardcover (pictures of the sample book; tap to open full size) --- */
#hardcover .hp-wrap { max-width: 1008px; } /* 960px of content, centered like the page */
.hp-printed { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.home .hp-photo-btn { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; }
.hp-photo-btn img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--hp-soft); box-shadow: var(--hp-sh-md); transition: box-shadow 150ms ease-out; }
.hp-photo-btn:hover img { box-shadow: var(--hp-sh-lg); }
body.home .hp-photo-btn:focus-visible { outline: 3px solid #8A5416; outline-offset: 3px; }
@media (max-width: 860px) {
    .hp-printed { grid-template-columns: 1fr; gap: 16px; }
}
}

/* --- Look inside --- */
.hp-inside { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: center; }
.hp-spread {
    position: relative; display: grid; grid-template-columns: 1fr 1fr;
    background: #fff; border-radius: 6px; overflow: hidden;
    box-shadow: 0 16px 36px rgba(45, 36, 24, 0.22), 0 3px 8px rgba(45, 36, 24, 0.14);
}
.hp-spread::after { /* gutter shadow */
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 34px; transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.20) 50%, rgba(0,0,0,0)); pointer-events: none;
}
.hp-spread img { width: 100%; height: 100%; aspect-ratio: 11 / 8.5; object-fit: cover; }
.hp-inside-pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.hp-inside-pages button {
    padding: 0; border: 4px solid transparent; border-radius: 8px;
    background: none; cursor: pointer; overflow: hidden; min-height: 56px;
}
.hp-inside-pages button:hover { border-color: var(--hp-border-strong); }
.hp-inside-pages button[aria-pressed="true"] { border-color: var(--hp-green); }
.hp-inside-pages img { width: 100%; aspect-ratio: 11 / 8.5; object-fit: cover; }
.hp-inside-aside { display: grid; gap: 16px; }

/* --- How it works --- */
.hp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: hp-step; list-style: none; margin: 0; padding: 0; }
.hp-steps li { counter-increment: hp-step; }
.hp-steps img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; box-shadow: var(--hp-sh-md); }
body.home .hp-steps h3 { margin-top: 18px; display: flex; gap: 12px; align-items: baseline; }
.hp-steps h3::before {
    content: counter(hp-step); flex: none; width: 36px; height: 36px; border-radius: 50%;
    display: inline-grid; place-items: center; transform: translateY(-2px);
    font: 700 18px/1 var(--hp-body); color: #fff; background: var(--hp-amber-ink);
}
body.home .hp-steps p { margin-top: 8px; color: var(--hp-text-2); }

/* --- Price --- */
.hp-price-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: stretch; }
.hp-price-card {
    background: var(--hp-card); border: 1px solid var(--hp-border); border-radius: 16px;
    padding: 32px; display: flex; flex-direction: column; gap: 18px;
}
.hp-price-main { border: 2px solid var(--hp-green); box-shadow: var(--hp-sh-lg); }
body.home .hp-tag {
    align-self: flex-start; padding: 8px 12px; border-radius: 999px;
    font: 700 15px/1 var(--hp-body); letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--hp-green-hover); background: var(--hp-green-light);
}
body.home .hp-tag-plain { color: var(--hp-text-2); background: var(--hp-soft); }
body.home .hp-price { font: 700 48px/1 var(--hp-display); font-variant-numeric: tabular-nums; }
.hp-price small { display: block; margin-top: 10px; font: 400 18px/1.35 var(--hp-body); color: var(--hp-text-2); }
.hp-push-down { margin-top: auto; }

/* --- Guarantee --- */
.hp-guarantee { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hp-guarantee h2 { margin-top: 10px; }
.hp-guarantee .hp-checks { gap: 16px; }
.hp-guarantee b { color: #fff; }

/* --- Founder --- */
.hp-narrow.hp-founder { max-width: calc(792px + 48px); } /* 36em of 22px quote text + gutters, centered */
.hp-founder-photo { display: block; width: 160px; height: 160px; border-radius: 50%; border: 4px solid var(--hp-card); box-shadow: var(--hp-sh-md); margin: 0 0 20px; }
.hp-founder blockquote { max-width: 36em; margin: 14px 0 0; font: 400 22px/1.55 var(--hp-display); }
body.home .hp-founder blockquote p + p { margin-top: 16px; }
.hp-founder blockquote footer { margin-top: 20px; }
.hp-founder cite { font: 600 18px/1.4 var(--hp-body); font-style: normal; color: var(--hp-text-2); }

/* --- Testimonials (only when the admin setting has real ones) --- */
.hp-quotes { display: grid; gap: 20px; }
.hp-quote { margin: 0; background: var(--hp-card); border: 1px solid var(--hp-border); border-radius: 12px; padding: 24px; }
.hp-quote blockquote { margin: 0; font: italic 400 21px/1.5 var(--hp-display); }
.hp-quote figcaption { margin-top: 10px; font-weight: 700; }

/* --- FAQ (native details/summary: keyboard + screen reader support built in) --- */
.hp-faq { border-top: 1px solid var(--hp-border); }
.hp-faq details { border-bottom: 1px solid var(--hp-border); }
.hp-faq summary {
    position: relative; cursor: pointer; list-style: none;
    min-height: 56px; padding: 18px 48px 18px 0;
    font-weight: 700; font-size: 21px; line-height: 1.35;
}
.hp-faq summary::-webkit-details-marker { display: none; }
.hp-faq summary::after {
    content: "+"; position: absolute; right: 8px; top: 12px;
    font: 400 30px/1 var(--hp-body); color: var(--hp-green);
}
.hp-faq details[open] summary::after { content: "\2212"; }
body.home .hp-faq details p { padding: 0 0 22px; color: var(--hp-text-2); max-width: 44em; }

/* --- Not ready yet / remind me --- */
body.home .hp-remind > p.hp-muted { margin-top: 12px; max-width: 40em; }
.hp-remind-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; margin-top: 24px; }
.hp-field { flex: 1 1 240px; }
body.home .hp-field label { display: block; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.hp-optional { font-weight: 400; color: var(--hp-text-2); }
body.home .hp-field input {
    width: 100%; min-height: 56px; padding: 12px 16px;
    font: 400 20px/1.2 var(--hp-body); color: var(--hp-text);
    background: #fff; border: 2px solid var(--hp-border-strong); border-radius: 8px;
}
body.home .hp-field input:focus { border-color: var(--hp-green); box-shadow: none; }
body.home .hp-remind-err { margin-top: 12px; color: var(--hp-error); font-weight: 600; }
body.home .hp-remind-ok { margin-top: 20px; color: var(--hp-green-hover); font-weight: 700; font-size: 22px; }

/* --- Final CTA --- */
.hp-cta-final { text-align: center; }
body.home .hp-cta-final .hp-band-text { margin: 14px auto 28px; max-width: 30em; }

/* --- Footer --- */
.hp-foot { background: var(--hp-green-deep); color: #CFE2D8; padding-block: 56px 32px; font-size: 18px; }
body.home .hp-foot a { color: #CFE2D8; }
body.home .hp-foot a:hover { color: #fff; }
.hp-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
body.home .hp-foot p { margin: 0; }
.hp-foot-logo { font: 400 24px/1.2 var(--hp-display); color: #fff; margin-bottom: 10px !important; }
.hp-foot-logo b { font-weight: 700; }
.hp-foot-col { display: flex; flex-direction: column; gap: 2px; }
body.home .hp-foot-col h2 { font: 700 15px/1.3 var(--hp-body); letter-spacing: 0.1em; text-transform: uppercase; color: #E7B77E; margin-bottom: 6px; }
.hp-foot-col a { display: inline-flex; align-items: center; min-height: 40px; }
.hp-foot-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(207, 226, 216, 0.25); font-size: 16px;
}

/* --- Occasion intro partial (partials/occasion_intro.html uses these class names) --- */
body.home .landing-section { padding-block: 72px 24px; }
body.home .landing-container { max-width: 960px; margin: 0 auto; padding-inline: 24px; }
body.home .section-title { font-size: clamp(29px, 3.2vw, 36px); margin-bottom: 24px; }

/* --- Sticky bar: phones only --- */
.hp-stickybar { display: none; }

@media (max-width: 860px) {
    .hp-nav { display: none; }
    .hp-head-inner { min-height: 68px; gap: 12px; }
    body.home .hp-logo { font-size: 20px; }
    .hp-logo-icon { width: 30px; height: 30px; }
    .hp-head-btn { margin-left: auto; padding: 10px 16px; font-size: 17px; white-space: nowrap; }
    .hp-wrap, .hp-narrow, body.home .landing-container { padding-inline: 16px; }

    .hp-hero { padding-block: 28px 48px; }
    .hp-hero-grid, .hp-inside, .hp-guarantee { grid-template-columns: 1fr; gap: 28px; }
    .hp-hero-art { order: -1; padding: 0 12px 40px 0; max-width: 440px; width: 100%; }
    .hp-peek { bottom: 0; right: 0; width: 42%; }
    .hp-hero-art figcaption { position: static; max-width: none; margin-top: 18px; padding-right: 44%; }
    .hp-hero-cta .hp-btn { width: 100%; }

    .hp-facts ul { grid-template-columns: 1fr 1fr; }
    .hp-band { padding-block: 56px; }
    body.home .landing-section { padding-block: 56px 8px; }
    .hp-pairs, .hp-steps, .hp-price-grid, .hp-foot-grid { grid-template-columns: 1fr; }
    .hp-pairs { gap: 20px; }
    .hp-price-card { padding: 24px 20px; }
    .hp-promo-form { max-width: none; }

    .hp-stickybar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        gap: 12px; align-items: center;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(251, 247, 242, 0.98); border-top: 1px solid var(--hp-border);
        box-shadow: 0 -4px 14px rgba(45, 36, 24, 0.10);
    }
    body.home .hp-stickybar p { margin: 0; font-size: 16px; line-height: 1.25; color: var(--hp-text); font-weight: 600; white-space: nowrap; }
    .hp-stickybar .hp-btn { flex: 1; padding-inline: 14px; }
    /* keep keyboard focus and anchor targets clear of the sticky bar */
    html:has(body.home) { scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
    /* room for the sticky bar at the very end of the page */
    .hp-foot { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

    /* base.html's feedback button is fixed bottom-right with inline styles; lift it
       (and its panel) above the sticky bar so it never covers the Start button. */
    body.home > div[x-data*="feedbackOpen"] > button,
    body.home > div[x-data*="feedbackOpen"] > [role="dialog"] {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 420px) {
    .hp-facts ul { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    body.home *, body.home *::before, body.home *::after { transition: none !important; animation: none !important; }
}


/* "Look inside": pages are buttons that open the full-size reader */
body.home .hp-page { display: block; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
body.home .hp-page img { display: block; width: 100%; height: 100%; aspect-ratio: 11 / 8.5; object-fit: cover; }
body.home .hp-page:focus-visible { outline: 3px solid #8A5416; outline-offset: -3px; }
body.home .hp-tap-hint { margin: 12px 0 0; font-size: 18px; color: #6B5D50; }
body.home .hp-reader { width: min(96vw, 1400px); max-height: 94vh; padding: 0; border: 0; border-radius: 12px; background: #FBF7F2; overflow: auto; }
/* The whole page fits on screen: bar and text keep their size, the picture
   shrinks to what's left (no scrolling to read the words under it). */
body.home .hp-reader[open] { display: flex; flex-direction: column; overflow: hidden; }
/* Narrow the box to about the picture's width at the height left for it
   (pages are 1800x1400; ~320px goes to the bar and the words). */
@media (min-width: 601px) {
  body.home .hp-reader { width: min(96vw, 1400px, max(640px, calc((94vh - 320px) * 1.2857))); }
}
body.home .hp-reader-bar { flex: none; }
body.home .hp-reader::backdrop { background: rgba(45, 36, 24, 0.75); }
body.home .hp-reader-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; background: #FBF7F2; border-bottom: 1px solid #E8DFD4; }
body.home .hp-reader-title { margin: 0; font-size: 20px; }
body.home .hp-reader-actions { display: flex; flex-wrap: wrap; gap: 10px; }
body.home .hp-reader-actions .hp-btn { min-height: 56px; }
body.home .hp-reader img { display: block; width: 100%; height: auto; flex: 0 1000 auto; min-height: min(30vh, 240px); object-fit: contain; }
body.home .hp-reader-text { flex: 0 1 auto; min-height: 0; margin: 0 auto; padding: 16px 20px 20px; overflow-y: auto; font-family: "Fraunces", Georgia, serif; font-size: 22px; line-height: 1.6; color: #2D2418; max-width: 60ch; }
@media (max-width: 600px) {
  body.home .hp-reader { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  body.home .hp-reader-actions { width: 100%; }
  body.home .hp-reader-actions .hp-btn { flex: 1; padding-inline: 10px; }
}


/* ---------- Hero background wall of real pages (Nov 2026) ---------- */
.hp-hero { position: relative; overflow: hidden; isolation: isolate; }
.hp-hero > .hp-wrap { position: relative; z-index: 2; }
.hp-wall {
    position: absolute; inset: -20px 0; z-index: 0; pointer-events: none;
    display: flex; flex-direction: column; justify-content: center; gap: 14px;
    transform: rotate(-3deg) scale(1.08);
}
.hp-wall::after { content: none; }
.hp-hero::before {
    /* Cream wash: solid behind the copy, lighter behind the book so the
       colour shows. Sits between the wall and the content. */
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg,
        rgba(251, 247, 242, 0.97) 0%, rgba(251, 247, 242, 0.95) 42%,
        rgba(251, 247, 242, 0.72) 62%, rgba(251, 247, 242, 0.55) 100%);
}
.hp-wall-row { display: flex; gap: 14px; width: max-content; will-change: transform; }
.hp-wall-row img {
    width: 240px; height: 180px; object-fit: cover; flex-shrink: 0;
    border-radius: 14px; box-shadow: 0 6px 18px rgba(60, 40, 20, 0.18);
}
/* Each row holds its 8 pages twice: sliding by half loops seamlessly. */
.hp-wall-row-1 { animation: hp-wall-left 70s linear infinite; }
.hp-wall-row-2 { animation: hp-wall-right 80s linear infinite; }
.hp-wall-row-3 { animation: hp-wall-left 76s linear infinite; }
.hp-wall-row-4 { animation: hp-wall-right 84s linear infinite; }
@keyframes hp-wall-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes hp-wall-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.motion-paused .hp-wall-row { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hp-wall-row { animation: none; } }
.hp-wall-toggle {
    position: absolute; z-index: 3; right: 16px; top: 14px;
    font: inherit; font-size: 15px; line-height: 1; padding: 10px 14px; min-height: 44px;
    color: var(--hp-ink, #2B2118); background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(43, 33, 24, 0.25); border-radius: 999px; cursor: pointer;
}
.hp-wall-toggle:focus-visible { outline: 3px solid #2E7D5B; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .hp-wall-toggle { display: none; } }
@media (max-width: 860px) {
    .hp-wall { justify-content: flex-start; inset: 0; transform: rotate(-3deg) scale(1.1); }
    .hp-wall-row-3, .hp-wall-row-4 { display: none; }
    .hp-wall-row img { width: 150px; height: 112px; border-radius: 10px; }
    .hp-hero::before {
        background: linear-gradient(180deg,
            rgba(251, 247, 242, 0.55) 0, rgba(251, 247, 242, 0.62) 240px,
            rgba(251, 247, 242, 0.97) 330px, rgba(251, 247, 242, 0.97) 100%);
    }
    /* Phones: the big book covers most of the wall, so keep it still (no
       motion means no pause button needed, and it saves battery). */
    .hp-wall-row { animation: none; }
    .hp-wall-toggle { display: none; }
}

/* Full-size picture viewer for the hardcover pictures */
body.home .hp-reader.hp-photo-view { width: min(96vw, 1600px); }
@media (min-width: 601px) {
  body.home .hp-reader.hp-photo-view { width: min(96vw, 1600px, max(640px, calc((94vh - 100px) * 1.49))); }
}
body.home .hp-photo-view img { min-height: 0; max-height: calc(94vh - 90px); }
