/* Homepage: compact type and quiet section bands, following HandsOnLLM/website.
   Material/Zensical uses a 20px rem; body copy here is deliberately 0.8rem. */
.md-container:has(.ag-home) .md-main { display: none; }
.ag-home { color: var(--ag-ink); background: var(--ag-bg); font-size: .8rem; line-height: 1.7; }
.ag-home *, .ag-home *::before, .ag-home *::after { box-sizing: border-box; }
.ag-home section { padding-block: 2.6rem; scroll-margin-top: 5rem; }
.ag-home img { max-width: 100%; height: auto; }
.ag-home a { text-decoration: none; }
.ag-home p { margin: 0 0 1rem; }
.ag-home code { font-family: var(--md-code-font-family, monospace); font-size: .9em; }
.ag-home .ag-h2 { font-size: clamp(1.25rem, 2.3vw, 1.6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 1rem; }
.ag-section-head { max-width: 58rem; margin: 0 auto 1.8rem; padding-inline: 1.25rem; text-align: center; }
.ag-lede { max-width: 46rem; margin: 0 auto !important; font-size: .84rem; line-height: 1.75; color: var(--ag-ink-2); }
.ag-section-head .ag-label { margin-bottom: .4rem; }
.ag-home .ag-btn { font-size: .76rem; }
.ag-home .ag-reviews, .ag-home .ag-chapters { background: var(--ag-bg-sunk); }
.ag-home .ag-hero, .ag-home .ag-about, .ag-home .ag-authors { background: var(--ag-bg); }

/* Retain the original moving cover treatment. */
.ag-hero { padding-block: 2.5rem 1.6rem !important; }
.ag-hero__grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); align-items: center; gap: 3rem; max-width: 60rem; margin: auto; padding-inline: 1.25rem; }
.ag-hero__title { font-size: clamp(1.65rem, 3.6vw, 2.5rem); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 1rem; font-weight: 800; text-wrap: balance; }
.ag-hero__title-em { color: var(--ag-accent); }
.ag-hero__standfirst { max-width: 29rem; color: var(--ag-ink-2); font-size: .88rem; line-height: 1.7; margin-bottom: 1.25rem !important; }
.ag-hero__standfirst code { color: var(--ag-agent-ink); background: var(--ag-bg-sunk); padding: .1em .35em; border-radius: 4px; }
.ag-hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.ag-hero__art { display: flex; justify-content: center; }
.ag-cover-link { display: block; border-radius: var(--ag-radius); transition: transform .35s cubic-bezier(.22,1,.36,1); }
.ag-cover-link:hover { transform: translateY(-6px) rotate(-.6deg); }
.ag-cover { display: block; width: 100%; max-width: 20rem; height: auto; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow-lift); }

.ag-video-section { padding-block: .8rem 2.5rem !important; }
.ag-video { max-width: 60rem; margin: 0 auto; padding-inline: 1.25rem; }
.ag-video__media { display: block; width: 100%; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow-lift); }
.ag-video figcaption { margin-top: .65rem; color: var(--ag-ink-3); text-align: center; font-size: .72rem; }

.ag-reviews__grid { max-width: 65rem; margin: auto; padding-inline: 1.25rem; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2.2rem; }
.ag-review { margin: 0; }.ag-review figcaption { text-align: center; min-height: 5.7rem; padding-bottom: .8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--ag-ink-3); }
.ag-review figcaption strong { display: block; font-size: .92rem; margin-bottom: .3rem; }.ag-review figcaption span { font-size: .71rem; line-height: 1.5; color: var(--ag-ink-2); }
.ag-review blockquote { margin: 0; padding: 0; border: 0; font-style: italic; font-size: .78rem; line-height: 1.65; color: var(--ag-ink-2); }
.ag-about__images { max-width: 60rem; margin: 2rem auto 0; padding-inline: 1.25rem; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2rem; align-items: center; }
.ag-about__images img { display: block; width: 100%; border-radius: 5px; box-shadow: var(--ag-shadow); }
.ag-chapters__figures { max-width: 65rem; margin: 0 auto 1.8rem; padding-inline: 1.25rem; display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.5rem; align-items: center; }
.ag-chapters__figures figure { margin: 0; }.ag-chapters__figures .plate { box-shadow: none; padding: .8rem; }.ag-chapters__figures figcaption { margin-top: .65rem; text-align: center; font-size: .7rem; color: var(--ag-ink-3); }
.ag-authors__layout { max-width: 60rem; padding-inline: 1.25rem; margin: auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(14rem,.78fr); gap: 2.5rem; align-items: center; }
.ag-authors__copy .ag-h2 { margin-bottom: 1.35rem; }
.ag-authors__copy p { color: var(--ag-ink-2); font-size: .8rem; }
.ag-authors__copy a { color: var(--ag-accent); text-decoration: underline; text-underline-offset: .16em; text-decoration-thickness: .06em; }
.ag-authors__images { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.ag-author-image { width: 70%; max-width: 15rem; border-radius: 10px; box-shadow: var(--ag-shadow); }
/* Progressive enhancement: absent JS, all content is visible. */
[data-reveal] > * { transition: opacity .5s ease, transform .5s ease; }
[data-reveal].ag-reveal-pending > * { opacity: 0; transform: translateY(20px); }
[data-reveal]:focus-within > * { opacity: 1; transform: none; }
@media(max-width:62rem) { .ag-hero__grid { gap: 2rem; }.ag-cover { max-width: 16rem; }.ag-reviews__grid { gap: 1.3rem; }.ag-about__images { gap: 1.3rem; } }
@media(max-width:45rem) { .ag-home section { padding-block: 2rem; }.ag-hero__grid { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }.ag-hero__art { order: -1; }.ag-cover { max-width: 13rem; }.ag-hero__standfirst { margin-inline: auto; }.ag-hero__actions { justify-content: center; }.ag-hero__title { font-size: 1.8rem; }.ag-reviews__grid { grid-template-columns: 1fr; gap: 1.7rem; max-width: 29rem; }.ag-review figcaption { min-height: 0; margin-bottom: .7rem; }.ag-about__images { grid-template-columns: 1fr; max-width: 20rem; }.ag-chapters__figures { grid-template-columns: 1fr; max-width: 32rem; }.ag-authors__layout { grid-template-columns: 1fr; max-width: 32rem; gap: 1.5rem; }.ag-authors__copy .ag-h2 { text-align: center; }.ag-authors__images { flex-direction: row; flex-wrap: wrap; justify-content: center; }.ag-author-image { width: calc(50% - .5rem); max-width: 9rem; } }
@media(prefers-reduced-motion:reduce) { [data-reveal] > *, [data-reveal].ag-reveal-pending > * { opacity: 1; transform: none; transition: none; } }
