/* storytimeguru.com marketing home — page-local layout layer.
   shared/tokens.css is the source of truth for every brand value: the warm-editorial
   palette (paper / alt-band / card / ink / gold / Deep Blue / Vibrant Purple), the
   three type tiers (Montserrat display, Fraunces editorial, Open Sans body), the 8pt
   spacing + rhythm variables, radius, shadow, and the .section / .band--* / .card /
   .chip / .phone / .btn recipes. Nothing brand-y is hardcoded here, and this file
   introduces NO color, radius, shadow, or font of its own.

   Page-local additions (layout-only, deliberately not brand values):
     --ease        shared easing curve for the entrance reveal
     --check-mask  inline SVG check glyph, painted with a CSS mask in Vibrant Purple
*/

:root {
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 10.6l4.2 4.2L16.4 5.4'/%3E%3C/svg%3E");
}

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

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 50;
  background: var(--stg-deep-blue); color: var(--paper);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: 700; text-decoration: none;
  transition: top var(--dur-base) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding-block: var(--sp-3);
}
/* The byline links to gradelevelguru.com, so it cannot sit inside the home link.
   The glyph gets its own (decorative, unfocusable) home link and the wordmark carries
   the accessible one; the lockup renders exactly as before. */
.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand__glyph-link { display: flex; flex: none; }
.brand__glyph { width: 40px; height: auto; flex: none; }
.brand__home { text-decoration: none; }
.brand__text { display: grid; gap: var(--sp-1); justify-items: start; }
.brand .byline { line-height: 1.2; }
a.byline { color: var(--muted); text-decoration: none; }
a.byline:hover { text-decoration: underline; }
.site-header .btn { white-space: nowrap; }

/* Header actions: the quiet educators link sits beside the CTA, never below it. */
.site-header__actions { display: flex; align-items: center; gap: var(--sp-4); flex: none; }
.nav-link {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body-md);
  color: var(--ink); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: var(--touch-min);
}
.nav-link:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .brand__glyph { width: 32px; }
  .brand .wordmark--sm { font-size: 1rem; }
  .brand .byline { font-size: 0.625rem; letter-spacing: 1.2px; white-space: nowrap; }
  .site-header .btn { padding-inline: var(--sp-4); font-size: 0.875rem; }
  .site-header__inner { gap: var(--sp-3); }
  .site-header__actions { gap: var(--sp-3); }
  .nav-link { font-size: 0.8125rem; }
}
/* Below ~460px the nav links and the CTA cannot share a row with the lockup, so the
   links stack under the wordmark (never dropped). display:contents promotes all three
   actions into the header grid so they can take separate areas; the two link columns
   are `auto`, so the lockup row above still spans the full width. */
@media (max-width: 460px) {
  .site-header__inner {
    display: grid; align-items: center;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand brand brand cta"
      "nav1  nav2  .     .";
    column-gap: var(--sp-3); row-gap: var(--sp-1);
  }
  .site-header__actions { display: contents; }
  .brand { grid-area: brand; }
  .site-header__actions .nav-link:nth-of-type(1) { grid-area: nav1; }
  .site-header__actions .nav-link:nth-of-type(2) { grid-area: nav2; }
  .site-header .btn { grid-area: cta; }
}
@media (max-width: 380px) {
  .brand__glyph { display: none; }
}

/* ---------- Buttons / store rows ---------- */

.store-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.btn--store svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.btn--outline-on-brand { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn--outline-on-brand:hover { background: var(--paper); color: var(--ink); }

/* Pre-launch store marks. Same size/shape as .btn--secondary, but they are <span>s,
   not links: no hover change, no press shift, and none of the dimmed
   "disabled control" treatment tokens.css gives .btn[aria-disabled="true"] --
   these are labels for a store that is not open yet, not broken buttons. */
.btn--static { cursor: default; }
.btn--static:hover { background: var(--card); color: var(--stg-deep-blue); box-shadow: none; }
.btn--static:active { transform: none; }
.btn--static[aria-disabled="true"] { opacity: 1; cursor: default; }
.prelaunch-note { font-family: var(--font-body); font-size: var(--fs-body-md); color: var(--muted); margin-top: var(--sp-3); }
.band--brand .prelaunch-note { color: var(--muted-on-dark); }

/* ---------- Section scaffolding ---------- */

/* Rhythm (locked): eyebrow -> heading 8 (the .eyebrow margin), heading -> lead 16,
   lead -> content 40, paragraph -> paragraph 16, statement -> body 24. */
.section__head { max-width: 46ch; margin-bottom: var(--gap-content); }
/* A head that carries a lead line under the heading needs a wider measure than the
   heading-only default; the rhythm stays heading -> lead 16, lead -> content 40. */
.section__head--wide { max-width: 58ch; }
.section__lead { margin-top: var(--gap-lead); }
.muted { color: var(--muted); }
.band--dark .wordmark { color: var(--paper); }

/* ---------- Hero ---------- */

.hero__grid { display: grid; gap: var(--col-gap); align-items: center; }
/* No measure cap on the COLUMN: tokens already caps every <p> at 64ch, and capping
   the column instead leaves the locked-pattern "leftover whitespace" beside it. */
.hero__copy h1 { margin-bottom: var(--gap-lead); max-width: 20ch; }
.hero__copy .tagline { margin-bottom: var(--gap-statement); max-width: 46ch; }
.hero__body { max-width: 46ch; margin-bottom: var(--gap-content); font-size: var(--fs-body-xl); }

.hero__art { justify-self: center; }
.hero__shot { width: min(100%, 220px); }

@media (min-width: 1025px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .hero__art { justify-self: end; }
  .hero__shot { width: 280px; }
}

/* ---------- How it works (4 cards) ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--card-gap); }
.step {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--sp-2);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); }
.step h3 { margin: 0; }
.step p { margin: 0; color: var(--muted); font-size: var(--fs-body-md); max-width: 34ch; }
.step .eyebrow { margin-bottom: 0; }
.step__figure { display: flex; justify-content: center; margin-top: var(--sp-6); }
.step__shot { width: min(100%, 180px); }

@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1025px) { .steps { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Two-column content sections ---------- */

.split { display: grid; gap: var(--col-gap); align-items: center; }
.split__art { justify-self: center; }
.split__art img { width: min(100%, 220px); }

@media (min-width: 1025px) {
  .split { grid-template-columns: minmax(0, 1fr) 260px; }
  .split--art-first { grid-template-columns: 260px minmax(0, 1fr); }
  .split__art img { width: 260px; }
}

.split__copy h2 { margin-bottom: var(--gap-lead); }
.split__copy .statement { margin-bottom: var(--gap-statement); }

/* Stats: Montserrat, ink, flat (no gradient text) */
.stats { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin: var(--gap-content) 0; }
.stat__value {
  font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1; color: var(--ink);
}
.stat__label { font-size: var(--fs-body-md); color: var(--muted); margin-top: var(--sp-1); }

/* Feature list: purple check marks (Storytime's secondary accent) */
.inside-list { list-style: none; margin: 0 0 var(--gap-content); padding: 0; }
.inside-list li {
  position: relative; padding-left: var(--sp-8); padding-block: var(--sp-4);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-heading); font-weight: 600; font-size: var(--fs-body-lg);
}
.inside-list li:first-child { border-top: 1px solid var(--hairline); }
.inside-list li::before {
  content: ""; position: absolute; left: 0; top: 50%; margin-top: -10px;
  width: 20px; height: 20px; background-color: var(--stg-vibrant-purple);
  -webkit-mask-image: var(--check-mask); mask-image: var(--check-mask);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px; mask-size: 20px 20px;
}

.callout {
  background: var(--tint-purple-bg); color: var(--ink);
  border-radius: var(--radius-lg); padding: var(--sp-6);
  font-size: var(--fs-body-lg); margin: 0; max-width: var(--measure);
}

/* ---------- Twelve themes (shared: home #themes) ----------
   3-up on desktop, 2-up on mobile, single column on very narrow phones. */

.themes {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--sp-6) var(--col-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.themes > li { border-top: 1px solid var(--hairline); padding-top: var(--sp-4); }
.themes h3 { font-size: var(--fs-body-lg); margin-bottom: var(--sp-1); }
.themes p { font-size: var(--fs-body-md); color: var(--muted); max-width: 30ch; }
@media (min-width: 900px) { .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 359px) { .themes { grid-template-columns: minmax(0, 1fr); } }

.themes__cta { margin-top: var(--gap-content); }
.themes__note { margin-top: var(--sp-3); font-size: var(--fs-body-md); }

/* ---------- For educators (compact: text + CTA, no screenshot) ---------- */

.educators { max-width: 46ch; }
.educators h2 { margin-bottom: var(--gap-lead); }
.educators .btn { margin-top: var(--gap-content); }

/* ---------- Download band (flat Deep Blue) ---------- */

.band--brand { background: var(--stg-deep-blue); color: var(--paper); }
.band--brand h2 { color: var(--paper); }
.band--brand p { color: var(--paper); }
.band--brand .eyebrow { color: var(--paper); }
.band__inner { max-width: 46ch; }
.band__inner h2 { margin-bottom: var(--gap-lead); }
.band__inner .store-row { margin-top: var(--gap-content); }

/* ---------- Redeem (universal-link fallback page, /redeem/) ---------- */

.redeem { max-width: 46rem; }
.redeem__panel[hidden] { display: none; }
.redeem h1 { margin-bottom: var(--gap-lead); }
.redeem .lead { margin-bottom: var(--gap-content); }
.redeem__card { margin-bottom: var(--gap-content); }
.redeem__h2 { margin-bottom: var(--gap-lead); }

.coderow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.btn--copy { padding-inline: var(--sp-4); }
.btn--block { width: 100%; }
.code-inline { font-family: var(--font-mono); letter-spacing: 0.06em; color: var(--stg-deep-blue); }

/* Open in app: the primary action, with the stores reachable directly beneath it. */
.openrow { display: grid; gap: var(--sp-3); }
.openrow .btn svg { flex: none; }
.store-row--tight .btn { flex: 1 1 auto; }
.openrow .help { margin: 0; color: var(--muted); font-size: var(--fs-body-md); }
.openrow .status { margin: 0; font-size: var(--fs-body-md); color: var(--muted); }
.openrow .status:empty { display: none; }
.openrow .status[data-tone="error"] { color: #9B2C1E; font-weight: 600; }

.howto { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.howto li {
  counter-increment: step; position: relative;
  padding-left: calc(var(--sp-8) + var(--sp-2)); min-height: 32px; max-width: var(--measure);
}
.howto li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: var(--radius-md);
  background: var(--tint-blue-bg); color: var(--stg-deep-blue);
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
}
.howto__text { display: block; padding-top: 3px; }

/* ---------- Footer ---------- */

.site-footer { padding-block: var(--sp-12); }
.site-footer__inner { display: grid; gap: var(--sp-8); }
.site-footer p { margin: var(--sp-2) 0 0; max-width: none; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); }
.site-footer a {
  color: var(--paper); text-decoration: none;
  border-bottom: 1px solid var(--muted-on-dark);
  display: inline-flex; align-items: center; min-height: var(--touch-min);
}
.site-footer a:hover { border-bottom-color: var(--paper); }
.site-footer small { color: var(--muted-on-dark); font-size: var(--fs-body-md); }
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: auto 1fr; align-items: start; justify-content: space-between; }
  .site-footer nav { justify-self: end; }
}

/* ---------- Entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise 700ms var(--ease) forwards; }
  .reveal--1 { animation-delay: 60ms; }
  .reveal--2 { animation-delay: 150ms; }
  .reveal--3 { animation-delay: 240ms; }
  .reveal--4 { animation-delay: 330ms; }
  .reveal--5 { animation-delay: 420ms; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ==========================================================================
   /educators/ — the PUBLIC educator page. Layout only; every color, type,
   space, radius and shadow comes from shared/tokens.css, same as the rest of
   this file. The accordion is native <details>/<summary>: no JS on the page.
   ========================================================================== */

/* Current page in the header nav. */
.nav-link[aria-current="page"] { color: var(--stg-deep-blue); text-decoration: underline; text-underline-offset: 4px; }

/* Quiet secondary action beside a primary button. */
.text-link {
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
  color: var(--stg-deep-blue); text-decoration: none;
  display: inline-flex; align-items: center; min-height: var(--touch-min);
  border-bottom: 1.5px solid transparent;
}
.text-link:hover { border-bottom-color: var(--stg-deep-blue); }

/* ---------- Hero ---------- */

.edu-hero { display: grid; gap: var(--col-gap); align-items: center; }
.edu-hero h1 { margin-bottom: var(--gap-lead); max-width: 18ch; }
.edu-hero .tagline { margin-bottom: var(--gap-statement); max-width: 46ch; }
.edu-hero__body { max-width: 52ch; margin-bottom: var(--gap-content); }
.edu-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-8); }
.edu-hero__art { justify-self: center; }
.edu-hero__shot { width: min(100%, 220px); }

@media (min-width: 1025px) {
  .edu-hero { grid-template-columns: minmax(0, 1fr) 280px; }
  .edu-hero__art { justify-self: end; }
  .edu-hero__shot { width: 280px; }
}

/* ---------- In the classroom (5 icon cards) ---------- */

.use-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--card-gap); }
.use {
  display: grid; grid-template-rows: auto auto 1fr; gap: var(--sp-3);
  align-content: start;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.use:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); }
.use h3 { font-size: var(--fs-body-xl); }
.use p { margin: 0; color: var(--muted); font-size: var(--fs-body-md); max-width: 34ch; }
@media (min-width: 640px) { .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1025px) {
  .use-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* 5 cards over a 6-track grid: three up, then two centred underneath. */
  .use-grid > li { grid-column: span 2; }
  .use-grid > li:nth-child(4) { grid-column: 2 / span 2; }
  .use-grid > li:nth-child(5) { grid-column: 4 / span 2; }
}

/* ---------- Question frames (native accordion) ---------- */

.section__head--tight { margin-bottom: var(--gap-lead); }
.std__intro { max-width: 58ch; margin-bottom: var(--gap-content); }
.accordion { max-width: var(--container-max); border-top: 1px solid var(--hairline); }
.acc { border-bottom: 1px solid var(--hairline); }
.acc > summary {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-4) calc(var(--sp-8) + var(--sp-2)) var(--sp-4) 0;
  position: relative; cursor: pointer; list-style: none;
  min-height: var(--touch-min);
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover .acc__name,
.acc[open] > summary .acc__name { color: var(--stg-deep-blue); }
.acc__name {
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-heading-md);
  color: var(--ink); transition: color var(--dur-fast) var(--ease);
}
.acc__ref {
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-caption);
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold);
  white-space: nowrap;
}
/* Chevron, drawn from borders so it needs no asset. */
.acc > summary::after {
  content: ""; position: absolute; right: var(--sp-3); top: calc(50% - 7px);
  width: 10px; height: 10px;
  border-right: 2px solid var(--stg-deep-blue); border-bottom: 2px solid var(--stg-deep-blue);
  transform: rotate(45deg); transform-origin: 60% 60%;
  transition: transform var(--dur-base) var(--ease);
}
.acc[open] > summary::after { transform: rotate(-135deg); }
.acc__body { padding: 0 var(--sp-10) var(--sp-6) 0; }
.acc__q {
  font-family: var(--font-editorial); font-weight: 500; font-size: var(--fs-body-xl);
  line-height: 1.4; color: var(--muted); margin: 0;
  padding-left: var(--sp-4); border-left: 2px solid var(--tint-gold-bg);
}
@media (max-width: 480px) { .acc__name { font-size: var(--fs-body-lg); } }

/* ---------- Send it home ---------- */

.edu-home { max-width: 52ch; }
.edu-home h2 { margin-bottom: var(--gap-lead); }
.edu-home .statement { margin-bottom: var(--gap-statement); }
.edu-home__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-8); margin-top: var(--gap-lead); }

/* ---------- Classroom-access CTA ---------- */

.edu-cta__actions { margin-top: var(--gap-content); }

/* ==========================================================================
   /library/ — the public shelf, generated by scripts/build-library.py.
   Layout only. Every color, font, space, radius and shadow below resolves to a
   token in shared/tokens.css; the cards are the locked .card recipe, the chips
   reuse the .btn sizing language, and nothing here introduces a brand value.
   ========================================================================== */

.lib-hero { padding-bottom: var(--section-pad); }
.lib-hero h1 { margin-bottom: var(--gap-lead); max-width: 18ch; }
.lib-hero__lead { max-width: 58ch; }
.lib-hero__note {
  margin-top: var(--gap-lead); max-width: 58ch;
  font-family: var(--font-editorial); font-weight: 500;
  font-size: var(--fs-body-xl); line-height: 1.4; color: var(--muted);
}

/* ---------- Controls ---------- */

.lib-controls { margin-bottom: var(--sp-8); }
.lib-search { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.lib-search label {
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
  color: var(--ink);
}
.lib-search input {
  width: min(100%, 420px); min-height: 48px;
  padding: var(--sp-3) var(--sp-4); font: inherit; font-size: var(--fs-body-lg);
  border: 1.5px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--card); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.lib-search input:focus { border-color: var(--stg-deep-blue); }
.lib-search input::placeholder { color: var(--muted); opacity: 1; }

/* Chip row. The twelve theme chips are the primary way into the shelf, so they
   are real buttons carrying aria-pressed, not links or a select. */
.lib-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.lib-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: 40px; padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--hairline); border-radius: var(--radius-full);
  background: var(--card); color: var(--ink);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body-md);
  line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.lib-chip:hover { background: var(--alt-band); border-color: var(--gold); }
.lib-chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.lib-chip[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); }
.lib-chip__n { font-size: var(--fs-caption); opacity: 0.65; font-variant-numeric: tabular-nums; }

.lib-controls__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-4);
}
.lib-az {
  min-height: 40px; padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--stg-deep-blue); border-radius: var(--radius-full);
  background: transparent; color: var(--stg-deep-blue);
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lib-az:hover { background: var(--tint-blue-bg); }
.lib-az[aria-pressed="true"] { background: var(--stg-deep-blue); color: var(--paper); }
.lib-count { margin: 0; font-size: var(--fs-body-md); font-variant-numeric: tabular-nums; }

/* Mobile disclosure. Rendered [hidden] and un-hidden by library.js, so a page with
   no JS never ends up with the chips collapsed and no way to open them. */
.lib-disclose {
  display: none; align-items: center; gap: var(--sp-2);
  min-height: var(--touch-min); padding: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3);
  border: 1.5px solid var(--hairline); border-radius: var(--radius-full);
  background: var(--card); color: var(--ink);
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
  cursor: pointer;
}
.lib-disclose__chev {
  width: 8px; height: 8px;
  border-right: 2px solid var(--stg-deep-blue); border-bottom: 2px solid var(--stg-deep-blue);
  transform: rotate(45deg); transform-origin: 60% 60%;
  transition: transform var(--dur-base) var(--ease);
}
.lib-disclose[aria-expanded="true"] .lib-disclose__chev { transform: rotate(-135deg); }
@media (max-width: 767px) {
  .lib-disclose:not([hidden]) { display: inline-flex; }
  .lib-chips--collapsible:not(.is-open) { display: none; }
}

/* ---------- Affiliate disclosure ---------- */

.lib-disclosure {
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  padding-block: var(--sp-4); margin-bottom: var(--sp-8);
}
.lib-disclosure p { font-size: var(--fs-body-md); max-width: 72ch; }
.lib-credit { margin-top: var(--sp-1); font-size: var(--fs-caption); }

/* ---------- The shelf ---------- */

.lib-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--card-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.book {
  display: grid; grid-template-rows: auto auto auto 1fr auto; gap: var(--sp-2);
  padding: var(--sp-4);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.book[hidden] { display: none; }
.book:hover { transform: translateY(-3px); box-shadow: var(--shadow-raised); }

/* A square frame with the cover contained inside it: the catalog mixes portrait,
   square and landscape jackets, and a fixed frame keeps the rows aligned without
   cropping anyone's artwork. */
.book__frame {
  display: grid; place-items: center;
  aspect-ratio: 1 / 1; padding: var(--sp-3);
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); overflow: hidden;
}
.book__frame img { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); }
.book__nocover {
  font-family: var(--font-editorial); font-weight: 500; font-size: var(--fs-body-md);
  color: var(--muted); text-align: center; line-height: 1.3; padding: var(--sp-2);
}
.book__title { font-size: var(--fs-body-lg); margin: var(--sp-2) 0 0; }
.book__author { font-size: var(--fs-body-md); color: var(--muted); }

.book__themes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); align-content: start; }
.theme-chip {
  display: inline-flex; align-items: center;
  padding: 3px var(--sp-2); border-radius: var(--radius-full);
  background: var(--tint-blue-bg); color: var(--stg-deep-blue);
  font-size: var(--fs-caption); font-weight: 600; line-height: 1.4;
}
.theme-chip--more { background: transparent; color: var(--muted); padding-inline: var(--sp-1); }

.book__buy {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-min); margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--paper); color: var(--stg-deep-blue); text-decoration: none;
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-body-md);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.book__buy:hover { background: var(--stg-deep-blue); border-color: var(--stg-deep-blue); color: var(--paper); }
.book__nobuy {
  display: flex; align-items: center; min-height: var(--touch-min);
  margin-top: var(--sp-2); font-size: var(--fs-body-md);
}

.lib-empty[hidden] { display: none; }
.lib-empty {
  padding-block: var(--sp-16); text-align: center; max-width: none;
  font-family: var(--font-editorial); font-weight: 500; font-size: var(--fs-body-xl); color: var(--muted);
}
.lib-reset {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--stg-deep-blue); text-decoration: underline; text-underline-offset: 3px;
}

@media (max-width: 480px) {
  .book { padding: var(--sp-3); }
  .book__title { font-size: var(--fs-body-md); }
  .lib-chip, .lib-az { font-size: var(--fs-body-md); }
  /* Two-up on a phone leaves a card ~150px wide: a stack of wrapped theme chips
     swamps the cover and the title. Keep the primary theme only; the chip is a hint
     at what a book is about, and the filter above is the real way in. */
  .book__themes li:nth-child(n + 2) { display: none; }
}

/* ---------- Footer groups (all pages) ---------- */

.site-footer__nav { display: grid; gap: var(--sp-8); }
@media (min-width: 640px) { .site-footer__nav { grid-template-columns: repeat(2, auto); gap: var(--sp-12); } }
.site-footer__label {
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-caption);
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted-on-dark);
  margin: 0 0 var(--sp-1);
}
/* Beats the flat `.site-footer nav ul` row above (same specificity, later in file). */
.site-footer__nav nav ul { display: grid; gap: 0; justify-items: start; }
.site-footer__nav a { border-bottom-color: transparent; }
.site-footer__nav a:hover { border-bottom-color: var(--paper); }
@media (min-width: 768px) {
  .site-footer__nav { justify-self: end; }
  .site-footer__nav nav { justify-self: start; }
}
