:root {
    --ink: #0e1e3a;
    --ink-2: #1d3358;
    --paper: #faf4e6;
    --paper-2: #f1e7cd;
    --paper-3: #e6dab8;
    --rule: #d4c79a;
    --accent: #b08d3c;
    --accent-2: #8b6e2e;
    --accent-3: #d4a847;
    --muted: #5e5440;
    --body: #1a1612;
    --link: #1a3a5c;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--body);
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* CRITICAL — prevent horizontal overflow that causes Safari to auto-zoom-out */
    overflow-x: hidden;
    max-width: 100vw;
}
html { width: 100%; }
body { width: 100%; min-width: 0; }
img, svg, video, iframe { max-width: 100%; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(26,58,92,0.25); }
a:hover { border-bottom-color: var(--accent); color: var(--accent-2); }

h1, h2, h3, h4 {
    font-family: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.005em;
    color: var(--ink);
}

h1 { font-size: 2.8rem; margin: 0 0 0.6em; }
h2 { font-size: 1.9rem; margin: 1.8em 0 0.7em; }
h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---- top bar ---- intrinsic-responsive: clamp() for fluid sizing, no @media required */
header.top {
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
    position: sticky; top: 0; z-index: 50;
}
.top-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 18px;
    align-items: center;
    padding: 14px 0;
}
.brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 800;
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    color: var(--ink);
    border: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 0;
}
.brand small {
    display: block;
    font-size: clamp(0.5rem, 1.2vw, 0.62rem);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 4px;
    white-space: nowrap;
}
nav.main { min-width: 0; justify-self: end; }
nav.main ul {
    list-style: none; margin: 0; padding: 0;
    display: flex;
    gap: clamp(6px, 2.5vw, 30px);
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}
nav.main a {
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.78rem, 2vw, 0.92rem);
    font-weight: 500;
    border: none;
    letter-spacing: 0.01em;
    padding: 6px 2px;
    white-space: nowrap;
}
nav.main a:hover { color: var(--accent); }
nav.main a.cta {
    background: var(--accent);
    color: var(--ink);
    padding: clamp(7px, 1.4vw, 9px) clamp(12px, 2vw, 18px);
    border-radius: 2px;
    font-weight: 700;
    font-size: clamp(0.78rem, 2vw, 0.92rem);
}
nav.main a.cta:hover { background: var(--accent-3); color: var(--ink); }

/* Stack to 2 rows on small screens — brand on row 1 (centered), nav on row 2 */
@media (max-width: 700px) {
    .top-inner {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 0 18px;  /* extra bottom padding so the gold CTA doesn't sit flush against the hero below */
        justify-items: center;
    }
    .brand { text-align: center; font-size: 1.3rem; }
    .brand small { display: none; }
    nav.main { justify-self: stretch; width: 100%; }
    nav.main ul { justify-content: space-around; gap: 4px; width: 100%; }
    nav.main a { font-size: 0.82rem; padding: 6px 4px; }
    nav.main a.cta { padding: 7px 12px; font-size: 0.8rem; }
    /* Stronger separator line so the header reads as its own band against any color below */
    header.top { border-bottom-width: 3px; }
}

/* ---- hero ---- */
.hero {
    padding: 90px 0 80px;
    border-bottom: 1px solid var(--rule);
    background:
        radial-gradient(circle at 80% 30%, rgba(176,141,60,0.18) 0%, transparent 55%),
        linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
    color: var(--paper);
}
.hero .eyebrow { color: var(--accent-3); }
.hero h1 {
    font-size: 3.6rem;
    line-height: 1.04;
    margin-bottom: 0.4em;
    color: #fff;
}
.hero h1 em {
    color: var(--accent-3);
    font-style: normal;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero p.lede {
    font-size: 1.2rem;
    line-height: 1.55;
    color: #e8dfc4;
    margin: 0 0 32px;
    max-width: 42ch;
}
.hero-cta {
    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    padding: 14px 28px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
}
.hero-cta:hover { background: var(--accent-3); color: var(--ink); }
.hero-meta {
    margin-top: 22px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.88rem;
    color: #c4b893;
}
.hero-stack {
    position: relative;
    perspective: 1200px;
    min-height: 380px;
    /* contain absolutely-positioned children so they don't push viewport */
    overflow: visible;
    max-width: 100%;
}
.hero-stack .cover {
    width: 200px;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.6), 0 12px 22px -8px rgba(0,0,0,0.35);
    border: 1px solid rgba(176,141,60,0.4);
}
.hero-stack .cover.c1 { transform: rotate(-7deg) translate(-20px, 0); position: relative; z-index: 3; }
.hero-stack .cover.c2 { transform: rotate(3deg) translate(50px, -30px); position: absolute; top: 0; left: 0; z-index: 2; }
.hero-stack .cover.c3 { transform: rotate(-2deg) translate(130px, 40px); position: absolute; top: 0; left: 0; z-index: 1; }

/* ---- stat strip ---- */
.stats {
    background: var(--paper-2);
    border-top: 3px solid var(--accent);
    border-bottom: 1px solid var(--rule);
    padding: 36px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.stat .n {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}
.stat .l {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-top: 8px;
    font-weight: 500;
}

/* ---- section ---- */
section.block { padding: 80px 0; }
section.block + section.block { border-top: 1px solid var(--rule); }
.eyebrow {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-2);
    font-weight: 700;
    margin-bottom: 10px;
}
.section-intro {
    max-width: 70ch;
    margin-bottom: 50px;
}
.section-intro p { font-size: 1.1rem; color: var(--muted); }

/* ---- pillar block ---- */
.pillar {
    margin-bottom: 60px;
}
.pillar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 14px;
    margin-bottom: 26px;
}
.pillar-head h2 {
    margin: 0;
    font-size: 1.7rem;
}
.pillar-head .count {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.pillar-blurb {
    color: var(--muted);
    max-width: 65ch;
    margin: 0 0 24px;
    font-size: 1.02rem;
}

/* ---- series cards ---- */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.series-card {
    background: #fff;
    border: 1px solid var(--rule);
    border-top: 3px solid var(--accent);
    padding: 22px 22px 18px;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: var(--ink);
    border-bottom-color: var(--rule) !important;
}
.series-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px rgba(14,30,58,0.22); border-top-color: var(--accent-3); }
.series-card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    line-height: 1.3;
}
.series-card .count {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.series-card .arrow {
    color: var(--accent-2);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    margin-top: 14px;
    font-weight: 600;
}

/* ---- about ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 70px;
    align-items: start;
}
.about p { font-size: 1.06rem; }
.about .pull {
    background: var(--paper-2);
    padding: 30px 34px;
    border-left: 4px solid var(--accent);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.32rem;
    line-height: 1.45;
    font-style: italic;
    color: var(--ink);
}

/* ---- youtube band ---- */
.yt-band {
    background: var(--ink);
    color: var(--paper);
    border-top: 3px solid var(--accent);
    border-bottom: 3px solid var(--accent);
    padding: 70px 0;
}
.yt-band h2 { color: #fff; margin-top: 0; }
.yt-band .eyebrow { color: var(--accent-3); }
.yt-band p { color: #d4c79a; }
.yt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.yt-embed {
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid var(--accent);
    box-shadow: 0 18px 36px -12px rgba(0,0,0,0.5);
}
.yt-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-band .hero-cta { background: var(--accent); color: var(--ink); }
.yt-band .hero-cta:hover { background: var(--accent-3); }

/* ---- newsletter ---- */
.news {
    background: var(--ink);
    color: var(--paper);
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid var(--accent);
}
.news h2 { color: #fff; }
.news p { color: #d4c79a; max-width: 50ch; margin: 0 auto 28px; }
.news a.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    padding: 14px 32px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
}
.news a.btn:hover { background: var(--accent-3); color: var(--ink); }
.news .small {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.82rem;
    color: #837a64;
    margin-top: 18px;
}

/* ---- footer ---- */
footer.foot {
    background: var(--paper-2);
    padding: 50px 0 30px;
    color: var(--muted);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.92rem;
    border-top: 1px solid var(--rule);
}
footer .grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}
footer h4 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink);
    margin: 0 0 14px;
    font-weight: 700;
}
footer ul { list-style: none; margin: 0; padding: 0; }
footer ul li { margin-bottom: 8px; }
footer a { color: var(--muted); border: none; }
footer a:hover { color: var(--accent-2); }
footer .copyright {
    border-top: 1px solid var(--rule);
    padding-top: 22px;
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---- books index ---- */
.books-index .series-section { padding: 50px 0; border-bottom: 1px solid var(--rule); }
.books-index .series-section:last-child { border-bottom: none; }
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 32px 22px;
    margin-top: 28px;
}
.book-card {
    text-align: left;
    border: none;
    color: var(--ink);
    display: block;
}
.book-card .cover-wrap {
    aspect-ratio: 2 / 3;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 6px 14px -6px rgba(14,30,58,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.book-card .t {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- book detail ---- */
.book-detail { padding: 70px 0; }
.book-detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 60px;
}
.book-detail .cover-hero {
    aspect-ratio: 2/3;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    overflow: hidden;
    box-shadow: 0 25px 50px -15px rgba(14,30,58,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-detail .cover-hero img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.book-detail h1 {
    font-size: 2.1rem;
    margin-top: 0;
}
.book-detail .meta {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 18px 0 28px;
}
.book-detail .meta span { margin-right: 20px; }
.book-detail .buy {
    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    padding: 13px 26px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 12px;
    border: none;
    border-radius: 2px;
}
.book-detail .buy:hover { background: var(--accent-3); color: var(--ink); }
.book-detail .buy.alt { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.book-detail .buy.alt:hover { background: var(--ink); color: var(--paper); }
.book-detail .section-h { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent-2); margin: 36px 0 10px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; }
.crumb {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.crumb a { border: none; }

/* ============ RESPONSIVE ============ */

/* Tablet — tighten layout */
@media (max-width: 1024px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 1.7rem; }
    .hero h1 { font-size: 2.8rem; }
    .hero { padding: 70px 0 60px; }
    section.block { padding: 60px 0; }
    .hero-stack .cover { width: 180px; }
    .hero-stack .cover.c2 { transform: rotate(3deg) translate(50px, -25px); }
    .hero-stack .cover.c3 { transform: rotate(-2deg) translate(130px, 35px); }
}

/* Mobile — phones and small tablets */
@media (max-width: 800px) {
    body { font-size: 17px; line-height: 1.6; }

    .wrap { padding: 0 20px; }

    /* Stacked grids */
    .hero-grid, .about-grid, .yt-grid, .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    /* (Header is handled by intrinsic-responsive rules above, not @media-dependent.) */
    header.top { position: relative; }

    /* Hero — mobile-first stack */
    .hero { padding: 48px 0 56px; }
    .hero-grid { gap: 40px; }
    .hero h1 { font-size: 2.2rem; line-height: 1.1; }
    .hero p.lede { font-size: 1.05rem; max-width: 100%; }
    .hero-cta {
        display: block;
        text-align: center;
        padding: 16px 24px;
        font-size: 0.95rem;
    }
    .hero-meta { text-align: center; }
    .eyebrow { font-size: 0.72rem; letter-spacing: 0.16em; }

    /* Hero covers — hide entirely on mobile (cleaner than a fanned stack that overflows) */
    .hero-stack { display: none; }

    /* Stats */
    .stats { padding: 28px 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
    .stat .n { font-size: 1.9rem; }
    .stat .l { font-size: 0.7rem; letter-spacing: 0.1em; }

    /* Sections */
    section.block { padding: 48px 0; }
    .section-intro { margin-bottom: 32px; }
    .section-intro h2 { font-size: 1.55rem; }
    .section-intro p { font-size: 1rem; }

    /* Pillars */
    .pillar { margin-bottom: 40px; }
    .pillar-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-bottom: 10px;
        margin-bottom: 18px;
    }
    .pillar-head h2 { font-size: 1.4rem; }
    .pillar-head .count { font-size: 0.75rem; }
    .pillar-blurb { font-size: 0.96rem; margin-bottom: 18px; }

    /* Series cards — 1 column on small phones, 2 on bigger phones */
    .series-grid { grid-template-columns: 1fr; gap: 12px; }
    .series-card {
        min-height: 100px;
        padding: 18px 20px 16px;
    }
    .series-card h3 { font-size: 1rem; }

    /* Book grid */
    .book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px 12px;
    }
    .book-card .t { font-size: 0.82rem; line-height: 1.3; }

    /* Books index TOC */
    .books-index details summary { font-size: 0.82rem; }

    /* About */
    .about-grid { gap: 32px; }
    .about .pull {
        font-size: 1.12rem;
        padding: 22px 24px;
        line-height: 1.4;
    }

    /* Testimonials — override inline grid (3 cols) to stack on mobile */
    section.block .wrap > div[style*="grid-template-columns:repeat(3,1fr)"],
    section.block .wrap > div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    section.block figure[style*="border-left"] blockquote { font-size: 1rem; }

    /* YouTube band */
    .yt-band { padding: 50px 0; }
    .yt-band h2 { font-size: 1.7rem; }

    /* Newsletter */
    .news { padding: 56px 0; }
    .news h2 { font-size: 1.8rem; }
    .news p { font-size: 1rem; }

    /* Footer */
    footer.foot { padding: 40px 0 24px; }
    footer .grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 30px; }
    footer .copyright {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        font-size: 0.78rem;
    }

    /* Book detail */
    .book-detail { padding: 40px 0; }
    .book-detail .cover-hero { max-width: 240px; margin: 0 auto; }
    .book-detail h1 { font-size: 1.7rem; }
    .book-detail .meta { font-size: 0.85rem; }
    .book-detail .meta span { display: block; margin: 4px 0; }
    .book-detail .buy {
        display: block;
        text-align: center;
        margin-right: 0;
        margin-bottom: 10px;
        padding: 14px 20px;
    }

    /* Breadcrumb */
    .crumb { font-size: 0.78rem; margin-bottom: 14px; }
}

/* Very small phones */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.95rem; }
    .hero p.lede { font-size: 1rem; }
    .section-intro h2, .pillar-head h2 { font-size: 1.3rem; }
    .stats-grid { gap: 18px 10px; }
    .stat .n { font-size: 1.6rem; }
    .stat .l { font-size: 0.66rem; }
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
    .book-card .t { font-size: 0.78rem; -webkit-line-clamp: 2; }
    .brand { font-size: 1.05rem; }
    nav.main a { font-size: 0.8rem; padding: 6px 8px; }
    nav.main a.cta { padding: 7px 12px; font-size: 0.78rem; }
    .yt-band h2, .news h2 { font-size: 1.5rem; }
    .about .pull { font-size: 1.05rem; padding: 18px 20px; }
}

/* Books-index TOC — switch to 1 column on phones */
@media (max-width: 700px) {
    .books-index details ul { columns: 1 !important; }
}

