/* v4 experiment: the bookshop.
   Warm paper, the book as an object (straddling a seam, standing on a shelf), pastel lesson
   cards, split dark/light panels. Newsreader for titles, DM Sans for text. The navy cover and
   saffron rule carry over from v3; gold is the new accent, one pastel per part of the book. */
:root {
  --paper: #F3EEE6;
  --sand: #EAE3D7;
  --panel: #FBF9F5;
  --white: #FFFFFF;
  --ink: #1F1C18;
  --ink-2: #645D53;
  --line: #E3DBCD;
  --line-2: #CFC5B4;
  --navy: #0F2A47;
  --navy-2: #1B3D63;
  --slate: linear-gradient(170deg, #9AACC6 0%, #4C6A93 48%, #1F3D66 100%);
  --gold: #D6A65C;
  --gold-ink: #7E5719;   /* ≥4.5:1 on sand, paper and every part pastel */
  --saffron: #E39B2D;
  --t1: #DCE4D2; --t2: #F0DAD1; --t3: #EADFC8; --t4: #D8E1E9; --t5: #E4DDEB; --t6: #F3E1C7;
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --book-shadow: 26px 38px 60px -14px rgba(52, 36, 12, .38), 0 14px 26px -12px rgba(52, 36, 12, .3);
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
html { background: var(--paper); }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
main { flex: 1; }   /* short pages keep the footer at the bottom */
a { color: var(--navy-2); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); }
p { margin: 0 0 1em; }
cite { font-style: italic; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 6px 10px; z-index: 20; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 58ch; }
.eyebrow { display: block; font: 600 .76rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 12px; }
.tagline { font: 400 1.25rem/1.45 var(--serif); color: var(--ink-2); max-width: 42ch; }
.muted { color: var(--ink-2); font-style: italic; }
.rule { width: 72px; height: 0; border: 0; border-top: 2px solid var(--gold); margin: 18px 0 22px; }
.i { width: 20px; height: 20px; flex: none; }
.band { padding-block: clamp(64px, 8vw, 104px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.sec-head h2 { margin: 0; max-width: 22ch; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 500 .95rem/1 var(--sans); padding: 15px 24px; background: var(--ink); color: #fff; text-decoration: none; border: 1.5px solid var(--ink); border-radius: 999px; transition: background .15s, color .15s, transform .15s; white-space: nowrap; cursor: pointer; }
.btn:hover { background: #3A352E; border-color: #3A352E; }
.btn .i { width: 17px; height: 17px; }
.btn-sm { padding: 10px 16px; font-size: .86rem; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.icon-btn { width: 46px; height: 46px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; padding: 0; }
.icon-btn:hover { background: var(--white); border-color: var(--line-2); }
.round-btns { display: flex; gap: 10px; }
.pill-outline { display: inline-block; align-self: flex-start; margin-top: 12px; padding: 6px 14px; border: 1.5px solid var(--gold); border-radius: 999px; color: var(--gold-ink); font: 600 .8rem/1.2 var(--sans); }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(243, 238, 230, .9); backdrop-filter: saturate(1.3) blur(8px); }
.top-in { display: flex; align-items: center; gap: 14px; height: 76px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font: 500 1.2rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; margin: 0; }
.mark-i { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--gold); }
.mark-i .i { width: 18px; height: 18px; }
.pills { display: flex; gap: 2px; padding: 5px; margin-inline: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.pills a { padding: 8px 16px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.pills a:hover { background: var(--sand); }
.pills a[aria-current] { background: var(--gold); }
.top-search { width: 42px; height: 42px; }
.social.top-social { margin: 0; gap: 6px; }   /* .social adds a top margin for the footer; none in the header row */
.top-in .icon-btn, .top-in .social .icon-btn { width: 42px; height: 42px; }   /* socials, search and menu: one size, one line */
.menu-panel .social { margin: 8px 0 2px; padding-inline: 8px; }
/* small screens: the pills fold into a menu */
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: #fff; border-color: var(--ink); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 50px -20px rgba(52, 36, 12, .35); }
.menu-panel a:not(.btn) { padding: 10px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.menu-panel a:not(.btn):hover, .menu-panel a[aria-current] { background: var(--sand); }
.menu-panel .btn { margin-top: 6px; justify-content: center; }
.top { transition: box-shadow .3s, background .3s; }
.top.scrolled { background: rgba(243, 238, 230, .96); box-shadow: 0 1px 0 var(--line), 0 12px 30px -24px rgba(52, 36, 12, .45); }
.read-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 20; height: 3px; background: var(--gold); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

/* the book object (markup from build.py's cover()): the front cover image, with a spine shade so it reads as a book */
.book { position: relative; width: 100%; max-width: 330px; margin-inline: auto; border-radius: 3px 7px 7px 3px; box-shadow: var(--book-shadow); }
.book img { display: block; width: 100%; height: auto; border-radius: inherit; }
.book::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none;   /* ::after is the hover glare (.tilt) */
  background: linear-gradient(90deg, rgba(0,0,0,.16) 0, rgba(255,255,255,.18) 1.6%, rgba(0,0,0,.06) 3.4%, transparent 7%); }
.book.small { max-width: 210px; }


/* frames: the rounded app-panel the hero and page heads sit in */
.hero { padding: 8px 0 clamp(40px, 5vw, 64px); }
.frame { width: min(1280px, 100% - 32px); margin-inline: auto; background: var(--sand); border-radius: 30px; overflow: hidden; }

/* home hero: cover straddles the seam between the sand frame and the light sheet */
.hero-grid {
  display: grid;
  grid-template-columns: [full-start] minmax(24px, 1fr) [book-start] minmax(0, 340px) [book-end] clamp(32px, 6vw, 96px) [text-start] minmax(0, 620px) [text-end] minmax(24px, 1fr) [full-end];
  grid-template-rows: auto auto;
}
.hero-book { grid-column: book; grid-row: 1 / 3; align-self: start; position: relative; z-index: 2; padding-block: clamp(48px, 6vw, 80px) 40px; }
.hero-head { grid-column: text; grid-row: 1; padding-block: clamp(56px, 7vw, 92px) 36px; }
.hero-head h1 { font-size: clamp(2.9rem, 6vw, 4.8rem); line-height: .98; letter-spacing: -.03em; margin-bottom: 18px; }
.by { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.08rem; margin-bottom: 14px; }
.by img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.hero-sheet { grid-column: book-start / full-end; grid-row: 2; margin-left: -56px; background: var(--panel); border-radius: 26px 0 0 0; box-shadow: 0 -1px 0 var(--line); }
.hero-panel { grid-column: text; grid-row: 2; position: relative; z-index: 1; padding-block: 28px 52px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.panel-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px 44px; }
.label { font: 600 1rem var(--sans); letter-spacing: 0; margin-bottom: 10px; }
.panel-cols p { color: var(--ink-2); font-size: .98rem; }
.facts { margin: 0; }
.facts dt { font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: 10px; }
.facts .ico { flex: none; width: 20px; height: 20px; color: var(--gold-ink); }
.facts dd { margin: 2px 0 0; color: var(--ink-2); font-size: .95rem; }
/* The description and the facts end on one line: both columns take the row's height, and whichever is shorter
   spreads out (the facts groups space evenly, or the description's last paragraph drops). */
.panel-cols > div, .facts { display: flex; flex-direction: column; }
.facts { justify-content: space-between; gap: 10px; }
.panel-cols > div > p:last-of-type { margin-top: auto; margin-bottom: 0; }
.review { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 14px; margin: 26px 0 0; }
.review .avatar { grid-row: 1 / span 2; }
.review > figcaption, .review > blockquote { grid-column: 2; }
.review > figcaption { grid-row: 1; }   /* last in the markup (valid figure), shown above the quote */
.review > blockquote { grid-row: 2; }
/* wide screens: the quote fills the space under the cover; narrow screens: it stays under the description */
.review-l { display: none; }
@media (min-width: 861px) { .review-l { display: grid; margin-top: 56px; } .review-r { display: none; } }
.review figcaption { font-size: .95rem; }
.review blockquote { margin: 4px 0 0; font: italic 400 1.02rem/1.55 var(--serif); color: var(--ink-2); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--ink); font: 600 .85rem var(--sans); flex: none; }

/* discover: pastel maxim cards in a plain grid (one scroll direction only) */
.discover { padding-top: clamp(24px, 3vw, 40px); }
.d-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.d-card a { display: flex; flex-direction: column; gap: 20px; height: 100%; min-height: 250px; padding: 24px; border-radius: 20px; background: var(--t1); color: var(--ink); text-decoration: none; transition: transform .2s; }
.d-card a:hover { transform: translateY(-4px); }
.d-card:nth-child(6n+2) a { background: var(--t2); } .d-card:nth-child(6n+3) a { background: var(--t3); }
.d-card:nth-child(6n+4) a { background: var(--t4); } .d-card:nth-child(6n+5) a { background: var(--t5); }
.d-card:nth-child(6n) a { background: var(--t6); }
.d-n { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--gold); font: 500 1.05rem var(--serif); }
.d-q { flex: 1; font: italic 400 1.32rem/1.32 var(--serif); }
.d-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .86rem; font-weight: 600; }
.d-link .i { width: 17px; height: 17px; }
.d-n { transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.d-card a:hover .d-n { transform: rotate(-8deg) scale(1.1); }
.d-link .i, .btn .i { transition: transform .25s ease; }
.d-card a:hover .d-link .i, .btn:hover .i { transform: translate(3px, -3px); }

/* lesson-as-a-book: illustration on the part's pastel, or a typographic cover */
.lc { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; padding: 10%; background-color: var(--tint, var(--t3)); border-radius: 3px 7px 7px 3px; box-shadow: var(--book-shadow);
  background-image: linear-gradient(90deg, rgba(0,0,0,.12) 0, rgba(255,255,255,.4) 2%, rgba(0,0,0,.04) 4%, transparent 8%); }
.lc img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.lc img, .card-art, .portrait img, .prev-book img, .ob-cover img, .talk-play img, .avatar img { color: transparent; }   /* never show alt text in place of a loading illustration */
.lc-type { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); }
.lc-wk { font: 600 .62rem var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.lc-n { font: 300 4.2rem/1 var(--serif); margin-top: 6px; }
.lc-p { font: italic 400 .98rem/1.3 var(--serif); margin-top: 14px; }
.t1 { --tint: var(--t1); } .t2 { --tint: var(--t2); } .t3 { --tint: var(--t3); }
.t4 { --tint: var(--t4); } .t5 { --tint: var(--t5); } .t6 { --tint: var(--t6); }

/* this week's lesson: three-up carousel, last week small, this week big, next week small */
.shelf-band { padding-block: 0 clamp(64px, 8vw, 104px); overflow-x: clip; }   /* off-stage books slide out of view here; a plain clip, not a rounded one */
.shelf-frame { overflow: visible; background: var(--panel);   /* no rounded clip over the 3D carousel: Chrome can drop clipped 3D layers mid-scroll */
   padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 56px) clamp(28px, 4vw, 44px); box-shadow: 0 1px 0 var(--line), 0 40px 70px -40px rgba(52, 36, 12, .25); }
.shelf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.shelf-head h2 { margin-bottom: 8px; }
.shelf-head .sub { color: var(--ink-2); margin: 0; }
.search-pill { display: flex; align-items: center; gap: 10px; width: min(100%, 420px); padding: 6px 6px 6px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
.search-pill:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 4px rgba(214, 166, 92, .3); }
.search-pill input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 1rem var(--sans); color: var(--ink); padding: 8px 0; }
.cf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 36px; }
.cf > .icon-btn:disabled { opacity: .35; cursor: default; }
/* One timing for every part of the move, and a fixed stage height, so opening never shifts the page. */
.cf-stage { --cf-w: clamp(150px, 19vw, 260px); --cf-step: clamp(118px, 18vw, 270px); --side: .56; --ease: cubic-bezier(.65, 0, .35, 1);
  position: relative; height: calc(var(--cf-w) * 1.5 + 58px); perspective: 1400px; touch-action: pan-y; container-type: inline-size; }
/* open: side books make room for the spread, but never past the stage edge */
.cf-stage.opened .cf-item { --cf-step: min(calc(var(--cf-w) * (1 + var(--side) / 2) + 36px), calc(50cqw - var(--cf-w) * var(--side) / 2)); }
.cf-stage:focus-visible { outline-offset: 10px; border-radius: 14px; }
/* Each book is placed by its offset --o from the current week: 0 = big and flat, ±1 = small and turned in, beyond = slid out and faded. */
.cf-item { --abs: max(var(--o), calc(var(--o) * -1));
  position: absolute; left: 50%; top: 0; width: var(--cf-w); margin-left: calc(var(--cf-w) / -2); color: var(--ink); text-decoration: none; text-align: center;
  transform: translateX(calc(var(--o) * var(--cf-step))) translateY(calc(min(var(--abs), 1) * var(--cf-w) * 1.5 * (1 - var(--side)) / 2))
    rotateY(clamp(-28deg, calc(var(--o) * -28deg), 28deg)) scale(calc(1 - min(var(--abs), 1) * (1 - var(--side))));
  transform-origin: 50% 0; opacity: clamp(0, calc(1.75 - var(--abs) * .9), 1); z-index: calc(10 - var(--abs));
  transition: transform .5s var(--ease), opacity .35s ease; -webkit-user-drag: none; user-select: none; }
.cf-item[aria-hidden="true"] { pointer-events: none; visibility: hidden; transition: transform .5s var(--ease), opacity .35s ease, visibility 0s linear .35s; }   /* stop drawing books once they have faded off */
.cf-item:not(.is-main):hover { opacity: 1; }
.cf-item img { pointer-events: none; }
.cf-item .lc-n { font-size: 4.4rem; }
.cf-item:not(.is-main) .lc { box-shadow: 14px 20px 30px -12px rgba(52, 36, 12, .35); }
.cf-wk { display: block; margin-top: 14px; font: 600 .82rem/1.4 var(--sans); color: var(--ink-2); }
.cf-item.is-main .cf-wk, .cf-item:not(.has-art) .cf-wk { visibility: hidden; }
.cf-title { display: none; margin: 26px -30% 0; white-space: nowrap; font: 400 1.3rem/1.2 var(--serif); letter-spacing: -.01em; color: var(--ink); transition: opacity .4s ease; }

/* the open book: a leaf hinged on the spine, cover on its front, the left page on its back; the right page waits underneath */
.bk { position: relative; display: block; perspective: 2400px; transition: transform .8s var(--ease); }
.leaf { position: relative; display: block; transform-origin: 0 50%; transition: transform .8s var(--ease); }
.leaf-front { display: block; }
/* the 3D book (hinged leaf, two faces) exists only on the middle book and while one is closing; the rest stay flat */
.cf-item.is-main .leaf, .cf-item.closing .leaf { transform-style: preserve-3d; }
.cf-item.is-main .leaf-front, .cf-item.closing .leaf-front { backface-visibility: hidden; }
.cf-item:not(.is-main):not(.closing) .pg { display: none; }
.cf-item.open .bk { transform: translateX(50%); }
.cf-item.open .leaf { transform: rotateY(-180deg); }
.pg { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 9% 9% 6%; overflow: hidden; container-type: inline-size;
  background-color: #FFFDF8; color: #1C1A16; font-family: var(--serif); text-align: left; }
.pg:empty { display: none; }
.pg-l { transform: rotateY(180deg); backface-visibility: hidden; align-items: center; text-align: center; border-radius: 6px 0 0 6px;
  background-image: linear-gradient(270deg, rgba(60, 40, 10, .16), rgba(60, 40, 10, 0) 9%); box-shadow: -20px 28px 44px -24px rgba(52, 36, 12, .5); }
.pg-r { opacity: 0; transition: opacity .1s linear .75s; border-radius: 0 6px 6px 0;
  background-image: linear-gradient(90deg, rgba(60, 40, 10, .16), rgba(60, 40, 10, 0) 9%); box-shadow: 20px 28px 44px -24px rgba(52, 36, 12, .5); }
.cf-item.open .pg-r { opacity: 1; transition-delay: 0s; }
/* left page: the chapter title page. right page: the illustration and the quote. */
.pg-l { justify-content: center; }
.pg-r { align-items: center; justify-content: center; text-align: center; }   /* illustration + quote sit together in the middle */
.pg-chap { font-size: 6.4cqi; }
.pg-title { font: 400 15cqi/1.02 "Patrick Hand", "Comic Neue", cursive; margin: 4% 0 0; }
.pg .pg-foot { position: absolute; left: 0; right: 0; bottom: 6%; margin: 0; }
.pg-art { flex: 0 1 auto; min-height: 0; width: 88%; display: flex; align-items: center; justify-content: center; }
.pg-art img { max-width: 100%; max-height: 92cqi; object-fit: contain; mix-blend-mode: multiply; color: transparent; }
.pg-wk { font: 300 46cqi/1 var(--serif); color: rgba(28, 26, 22, .12); }
.pg-quote { position: relative; margin: 7% 0 9%; padding: 0 9%; font-size: 5.6cqi; line-height: 1.24; }
.pg-quote:not(.quoted)::before, .pg-quote:not(.quoted)::after { position: absolute; font: 500 15cqi/1 var(--serif); }
.pg-quote:not(.quoted)::before { content: "\201C"; left: -.05em; top: -.12em; }
.pg-quote:not(.quoted)::after { content: "\201D"; right: -.05em; bottom: -.62em; }
.pg-foot { margin-top: 6%; font-size: 3.8cqi; color: #6A6359; text-align: center; }
@media (min-width: 760px) {
  /* wide screens: the title sits under the middle book inside the stage's own space and fades when the book opens;
     the open pages carry the title and quote, so below the stage there is only the label and the button */
  .cf-item.is-main .cf-wk { display: none; }
  .cf-item.is-main .cf-title { display: block; }
  .cf-item.open .cf-title { opacity: 0; }
  .cf-text .tw-title, .cf-text .tw-maxim { display: none; }
  .cf-text { margin-top: 18px; }
  .cf-text .eyebrow { margin-bottom: 10px; }
}
.cf-text { max-width: 640px; margin: 28px auto 0; text-align: center; }
.motion .cf-text.swap > * { animation: rise .5s cubic-bezier(.2, .75, .25, 1) backwards; }
.motion .cf-text.swap > :nth-child(2) { animation-delay: 60ms; } .motion .cf-text.swap > :nth-child(3) { animation-delay: 120ms; } .motion .cf-text.swap > :nth-child(4) { animation-delay: 180ms; }
.tw-title { font: 400 clamp(1.8rem, 3vw, 2.4rem)/1.08 var(--serif); letter-spacing: -.02em; margin: 0; }
.tw-maxim { font: italic 300 1.1rem/1.5 var(--serif); color: var(--ink-2); margin: 12px auto 20px; max-width: 52ch; }
.cf-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; }
.vlabel { writing-mode: vertical-rl; transform: rotate(180deg); margin: 0; font: 400 1.05rem/1 var(--serif); color: var(--ink-2); white-space: nowrap; }
.sl-wk { display: block; font: 600 .82rem/1.4 var(--sans); color: var(--gold-ink); }

/* praise */
/* praise now follows the author band, so it keeps the band's own top padding */
.qs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.q { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.q blockquote { margin: 0; font: italic 400 1.14rem/1.6 var(--serif); }
.q blockquote p { margin: 0; }
.q blockquote p::before { content: "\201C"; } .q blockquote p::after { content: "\201D"; }
.q figcaption { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.q figcaption strong { display: block; color: var(--ink); font-size: .98rem; }
.avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* table of contents */
.toc-band { background: var(--panel); border-block: 1px solid var(--line); }
.toc { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px 72px; align-items: start; }
.toc-cover { position: sticky; top: 104px; padding: 44px 32px; background: var(--sand); border-radius: 24px; }
.toc h2 { max-width: 20ch; }
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 28px 0 36px; align-items: start; }
.part { border-bottom: 1px solid var(--line); }
.part summary { display: flex; align-items: center; gap: 14px; padding: 16px 0; cursor: pointer; list-style: none; }
.part summary::-webkit-details-marker { display: none; }
.part summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; line-height: 1; color: var(--ink-2); }
.part summary::after { transition: transform .3s ease; }
.part[open] summary::after { transform: rotate(45deg); }
:root { interpolate-size: allow-keywords; }
.part::details-content { block-size: 0; overflow: clip; transition: block-size .4s cubic-bezier(.2, .75, .25, 1), content-visibility .4s allow-discrete; }
.part[open]::details-content { block-size: auto; }
.num { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 600 .9rem var(--sans); }
.part summary strong { display: block; font-weight: 600; }
.part summary small { color: var(--ink-2); font-size: .85rem; }
.part ol { list-style: none; margin: 0 0 14px; padding: 0 0 0 52px; }
.part li a { display: flex; gap: 12px; padding: 5px 0; color: var(--ink); text-decoration: none; font-size: .95rem; line-height: 1.4; }
.part li a:hover { color: var(--gold-ink); }
.part .w { flex: 0 0 22px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* author: plain portrait, soft corners, no box behind it (markup from build.py's portrait()) */
.author-band { background: var(--sand); }
.author-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px 80px; align-items: center; }
.portrait { margin: 0; }
.portrait img { display: block; width: 100%; }
.portrait figcaption { font-size: .82rem; line-height: 1.4; color: var(--ink-2); margin-top: 10px; }
.portrait.arch img, .portrait.large img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; border-radius: 22px; box-shadow: 0 30px 50px -28px rgba(52, 36, 12, .45); }
.role { font-weight: 600; color: var(--ink-2); font-size: .95rem; }
.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* closer: the book and how to get it, on the light panel (no blue box) */
.closer { background: var(--panel); border-top: 1px solid var(--line); padding-block: clamp(56px, 7vw, 88px); }
.closer-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 40px 64px; align-items: center; }
.closer-side { padding: 26px 26px 14px; background: var(--sand); border-radius: 22px; }
.closer-side .eyebrow { margin-bottom: 6px; }
.cs-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.closer-side .eyebrow + .cs-link { border-top: 0; }
.cs-t { display: block; font: 400 1.18rem/1.25 var(--serif); margin-top: 3px; }
.cs-link .i { flex: none; width: 18px; height: 18px; transition: transform .25s ease; }
.cs-link:hover .cs-t { text-decoration: underline; text-underline-offset: .18em; }
.cs-link:hover .i { transform: translate(3px, -3px); }
/* the last section: one big Pre-order and its form (the page has already shown the book) */
.pre-h { font-size: clamp(3.4rem, 8vw, 6.2rem); line-height: .95; letter-spacing: -.03em; margin: 0 0 18px; }
.pre-sub { font-size: 1.08rem; color: var(--ink-2); max-width: 46ch; margin: 0 0 24px; }
.order { margin-top: 26px; }
.order-label { font-weight: 600; margin-bottom: 4px; }
.order-note { font-size: .92rem; color: var(--ink-2); margin-bottom: 16px; }
.retail { display: flex; flex-wrap: wrap; gap: 10px; }
.notify-row { display: flex; flex-wrap: wrap; gap: 10px; max-width: 560px; }
.notify-row input:not(.hp) { flex: 1 1 180px; min-width: 0; min-height: 52px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font: inherit; color: var(--ink); }
.notify-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.notify-row .btn { flex: none; justify-content: center; }
.notify-preorder .btn { padding-inline: 32px; font-size: 1.02rem; }
.closer .notify-row { max-width: none; }   /* the pre-order fields run up to the side panel: no dead gap between them */
.notify .hp { position: absolute; left: -9999px; }   /* honeypot: bots fill it, people never see it */
.notify-msg { margin: 10px 0 0; font-weight: 600; color: var(--ink); }
.notify-msg:empty { display: none; }
.notify-fine { margin: 8px 0 0; font-size: .82rem; color: var(--ink-2); }
.notify.done .notify-row, .notify.done .notify-fine { display: none; }
/* weekly lessons by email, under the home page's coverflow */
.weekly { max-width: 580px; margin: 48px auto 0; padding-top: 34px; border-top: 1px solid var(--line); text-align: center; }
.weekly h3 { font-size: 1.55rem; margin-bottom: 6px; }
.weekly > p { color: var(--ink-2); margin: 0 0 18px; }
.weekly .notify-row { justify-content: center; margin-inline: auto; }
/* "Pre-order now" stays in reach; it steps aside while the form itself is on screen (motion.js) */
.float-cta { position: fixed; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 28px); z-index: 30; box-shadow: 0 16px 34px -12px rgba(31, 28, 24, .5);
  transition: transform .35s cubic-bezier(.2, .75, .25, 1), opacity .35s; }
.float-cta.away { transform: translateY(150%); opacity: 0; pointer-events: none; }
.retail-btn { padding: 11px 18px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }

/* lessons index */
.hero-tight { padding-bottom: 12px; }
.page-frame { padding: clamp(40px, 6vw, 72px) clamp(24px, 6vw, 72px); }
.page-frame h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1; letter-spacing: -.03em; }
.page-frame .lead { margin: 0; }
.page-frame.lh { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 32px 56px; align-items: center; }
.collage { position: relative; aspect-ratio: 5 / 3; }
.collage .lc { --dx: var(--fx); --r: var(--fr); position: absolute; left: 33.5%; top: var(--y); width: 33%; padding: 7%; z-index: var(--z);
  transform: translateX(var(--dx)) translateY(var(--ly, 0%)) rotate(var(--r)) scale(var(--s, 1));
  transition: transform .9s cubic-bezier(.2, .75, .25, 1) calc(var(--k) * 90ms), box-shadow .3s; }
.collage .lc:nth-child(1) { --k: 0; --fx: -101.5%; --fr: -9deg; --y: 12%; --z: 1; }
.collage .lc:nth-child(2) { --k: 1; --fx: -50.75%; --fr: -4deg; --y: 3%; --z: 2; }
.collage .lc:nth-child(3) { --k: 2; --fx: 0%; --fr: 1deg; --y: 0%; --z: 5; }
.collage .lc:nth-child(4) { --k: 3; --fx: 50.75%; --fr: 5deg; --y: 3%; --z: 4; }
.collage .lc:nth-child(5) { --k: 4; --fx: 101.5%; --fr: 9deg; --y: 12%; --z: 3; }
.motion .collage:not(.in) .lc { --dx: 0%; --r: 0deg; --ly: 6%; }
.collage.settled .lc { transition-delay: 0s; }
.collage:hover .lc { --dx: calc(var(--fx) * 1.12); }
.collage .lc:hover, .collage .lc:focus-visible { --ly: -8%; --r: 0deg; --s: 1.06; z-index: 6; box-shadow: 30px 44px 60px -14px rgba(52, 36, 12, .45); }
.filters { position: sticky; top: 76px; z-index: 5; background: rgba(243, 238, 230, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-block: 14px 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.filters .search-pill { width: 280px; padding: 4px 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.tabs button, .chips button { font: 500 .86rem var(--sans); color: var(--ink); background: transparent; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.tabs button:hover { background: var(--sand); }
.tabs button[aria-pressed="true"] { background: var(--gold); }
.themes { margin-top: 10px; }
.themes summary { width: max-content; display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; }
.themes summary::-webkit-details-marker { display: none; }
.themes summary::after { content: "+"; font-size: 1.2rem; line-height: 1; color: var(--ink-2); transition: transform .3s ease; }
.themes[open] summary::after { transform: rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button, p.chips a { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; font-size: .84rem; background: var(--panel); color: var(--ink); text-decoration: none; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
p.chips a:hover { border-color: var(--ink); }
.count { font-size: .86rem; color: var(--ink-2); margin: 10px 0 0; }
#clear { font: inherit; background: none; border: 0; padding: 0; margin-left: 10px; color: var(--navy-2); text-decoration: underline; cursor: pointer; }
.lessons { padding-bottom: 96px; }
.group { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 20px; padding-top: 56px; }
.group > .vlabel { align-self: start; font-size: 1.15rem; padding-top: 4px; }
.group[hidden], .card[hidden] { display: none; }
.group-head { margin-bottom: 22px; }
.group-head h2 { font-size: 2rem; margin-bottom: 4px; }
.group-head p { color: var(--ink-2); margin: 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.card a:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -24px rgba(52, 36, 12, .35); }
.card a:hover .pill-outline { background: var(--gold); color: var(--ink); }
.card-face { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 18px 22px; background: var(--tint); }
.card-art { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-face .lc-n { font-size: 4rem; }
.card-face { overflow: hidden; }
.card-art, .card-face .lc-type { transition: transform .5s cubic-bezier(.2, .75, .25, 1); }
.card a:hover .card-art, .card a:hover .card-face .lc-type { transform: scale(1.07); }
.card-quote { font: italic 400 1.04rem/1.45 var(--serif); color: var(--ink); margin-bottom: 12px; }
.card-quote:not(.quoted)::before { content: "\201C"; } .card-quote:not(.quoted)::after { content: "\201D"; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 16px 18px 18px; }
.card-wk { font: 600 .82rem/1.4 var(--sans); color: var(--gold-ink); }
.card-title { font: 400 1.3rem/1.2 var(--serif); }
.card-p { flex: 1; font-size: .88rem; color: var(--ink-2); }
.empty { padding: 48px 0; }

/* lesson page: split hero, the lesson's cover straddling the seam */
.l-hero { overflow: clip; background: var(--panel); border-bottom: 1px solid var(--line); }
.l-hero-in { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
.l-art { position: relative; padding-block: 28px 64px; }
.l-art::before { content: ""; position: absolute; top: 0; bottom: 0; right: 42%; width: 100vw; background: var(--slate); }
.l-art > * { position: relative; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: .86rem; color: rgba(255, 255, 255, .8); margin-bottom: 36px; }   /* one row: the arrow no longer lifts "Lessons" off the line */
@media (min-width: 861px) { .crumbs { max-width: 56%; } }   /* the blue panel covers the left 58% of the art column; the trail wraps inside it */
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .i { width: 16px; height: 16px; }
.lc-hero { width: 100%; box-shadow: 30px 44px 70px -16px rgba(8, 22, 42, .55), 0 14px 26px -12px rgba(8, 22, 42, .35); }
.lc-hero .lc-n { font-size: 7rem; }
.lc-hero .lc-wk { font-size: .78rem; }
.lc-hero .lc-p { font-size: 1.4rem; }
.l-text { padding-block: 28px 56px; }
.l-tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.l-tabs a { padding: 12px 0; font: 600 .92rem var(--sans); color: var(--ink-2); text-decoration: none; }
.l-tabs a:first-child { color: var(--navy-2); box-shadow: inset 0 -2px 0 var(--navy-2); }
.l-tabs a:hover { color: var(--navy-2); }
.l-text h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1; letter-spacing: -.03em; margin-bottom: 20px; }
.maxim { margin: 0 0 22px; font: italic 300 clamp(1.2rem, 2vw, 1.45rem)/1.5 var(--serif); color: var(--ink-2); max-width: 46ch; }
.l-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn-block { border-radius: 6px; background: var(--navy-2); border-color: var(--navy-2); padding: 16px 22px; }
.btn-block:hover { background: var(--navy); border-color: var(--navy); }
.l-body { padding-block: 64px 32px; }
.l-body > p { font-size: 1.1rem; line-height: 1.8; max-width: 68ch; }
.principle { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.principle span { display: block; font: 600 .76rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 10px; }
.toolkit { margin-top: 56px; }
.toolkit h2 { font-size: 2rem; }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.step-n { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); font: 600 .9rem var(--sans); }
.steps h3 { font-size: 1.3rem; margin: 8px 0 8px; }
.steps p { margin-bottom: 8px; }
.why { font-size: .95rem; color: var(--ink-2); }
.why strong { color: var(--ink); font-weight: 600; }
.lesson-meta { margin-top: 36px; font-size: .95rem; color: var(--ink-2); }
.similar { background: var(--sand); }
.similar .cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pn { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.pn a { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.pn .next { flex-direction: row-reverse; text-align: right; }
.pn strong { display: block; font: 400 1.2rem/1.25 var(--serif); }
.pn a:hover .icon-btn { background: var(--ink); color: #fff; border-color: var(--ink); }

/* prose pages kept from v3: corrections, privacy, terms */
.page-head { padding-block: clamp(48px, 6vw, 80px) 32px; }
.page-head h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1; letter-spacing: -.03em; }
.author-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px 80px; align-items: center; }
.page-head + .band { padding-top: 24px; }
.prose-l p { font-size: 1.08rem; line-height: 1.75; max-width: 64ch; }
.prose-l h2 { font-size: 1.9rem; margin-top: 44px; }

/* author page: his first book */
.other-book { background: var(--panel); border-top: 1px solid var(--line); }
.ob { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px 64px; align-items: center; }
.ob-cover img { display: block; width: 100%; border-radius: 3px 6px 6px 3px; box-shadow: var(--book-shadow); }
.ob h2 { margin-bottom: 6px; }
.prev-book { display: flex; align-items: center; gap: 18px; margin: 6px 0 4px; padding: 14px 18px 14px 14px; max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-decoration: none; transition: box-shadow .2s, transform .2s; }
.prev-book:hover { transform: translateY(-2px); box-shadow: 0 20px 34px -22px rgba(52, 36, 12, .4); }
.prev-book img { width: 72px; height: auto; flex: none; border-radius: 2px 4px 4px 2px; box-shadow: 8px 12px 20px -8px rgba(52, 36, 12, .45); }
.prev-book img { transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.prev-book:hover img { transform: rotate(-4deg) translateY(-3px); }
.pb-title { display: block; font: 400 1.3rem/1.2 var(--serif); margin-top: 2px; }
.pb-sub { display: block; font-size: .86rem; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }

/* speaking page */
.topics { list-style: none; margin: 10px 0 26px; padding: 0; display: grid; gap: 10px; }
.topics li { display: flex; align-items: center; gap: 14px; font: 400 1.3rem/1.3 var(--serif); }
.topics .num { width: 34px; height: 34px; font-size: .82rem; }
.talks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.talk { margin: 0; }
.talk-play, .talk iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; overflow: hidden; background: var(--ink); }
.talk-play img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.talk-play:hover img { transform: scale(1.03); }
.play { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.play .i { width: 24px; height: 24px; margin-left: 3px; }
.play { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.talk-play:hover .play { transform: scale(1.14); }
.talk figcaption { margin-top: 14px; }
.talk strong { display: block; font: 400 1.25rem/1.25 var(--serif); }
.talk figcaption span { font-size: .9rem; color: var(--ink-2); }
.talk-note { margin: 24px 0 0; font-size: .86rem; color: var(--ink-2); }

/* social links */
.social { display: flex; gap: 10px; margin: 18px 0 0; }
.social .icon-btn { width: 40px; height: 40px; }
.social .i { width: 18px; height: 18px; }

/* footer */
.foot { background: var(--ink); color: #BDB4A6; padding-block: 48px; font-size: .92rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot .mark { color: #fff; margin-bottom: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: flex-start; }
.foot a { color: #E8E1D5; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .social .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.foot .social .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.foot-r { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.foot-r nav { justify-content: flex-end; }
.credit { margin: 0; font-size: .82rem; color: #9E9587; text-align: right; }
.credit a { color: inherit; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: .2em; }
.credit a:hover { color: #BDB4A6; }
@media (max-width: 760px) { .foot-r { align-items: flex-start; } .foot-r nav { justify-content: flex-start; } .credit { text-align: left; } }

@media (max-width: 1060px) {
  .pills { display: none; }
  .social.top-social { margin-left: auto; }
  .menu { display: block; }
  }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 20px minmax(0, 1fr) 20px; }
  .hero-book { grid-column: 2; grid-row: 1; padding-block: 40px 0; }
  .book { max-width: 230px; }
  .hero-head { grid-column: 2; grid-row: 2; padding-block: 32px 28px; text-align: center; }
  .hero-head .tagline { margin-inline: auto; }
  .hero-sheet { grid-column: 1 / -1; grid-row: 3; margin-left: 0; border-radius: 26px 26px 0 0; }
  .hero-panel { grid-column: 2; grid-row: 3; }
  .panel-cols, .qs, .parts, .toc, .author-grid, .author-head, .l-hero-in, .page-frame.lh, .ob, .closer-in, .talks { grid-template-columns: 1fr; }
  .d-grid { grid-template-columns: 1fr 1fr; }
  .collage { max-width: 440px; }
  .ob-cover { max-width: 200px; margin-inline: auto; }   /* stacked: the book is centred above the text */
  .hero-head .by { justify-content: center; }
  .toc-cover { position: static; max-width: 340px; }
  .author-grid .portrait, .portrait.large { max-width: 300px; margin-inline: auto; }   /* stacked: his photo is centred, like the books */
  .l-art { width: 100%; max-width: 300px; margin-inline: auto; padding-bottom: 0; }
  .l-art::before { right: auto; left: 50%; transform: translateX(-50%); width: 100vw; bottom: 30%; }
  .l-text { padding-top: 8px; }
}
@media (max-width: 640px) {
  .top-social { display: none; }   /* the menu carries them on a phone */
  .notify-row input:not(.hp), .notify-row .btn { flex: 1 1 100%; }   /* one field per line on a phone */
  .top-search { margin-left: auto; }
  .mark { font-size: 1.05rem; }
  .sec-head { flex-wrap: wrap; }
  .d-grid { grid-template-columns: 1fr; }
  .d-card a { min-height: 0; }
  .cf { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .cf-stage { grid-column: 1 / -1; grid-row: 1; gap: 14px; }
  .cf > [data-cf="-1"] { justify-self: end; }
  .cf-stage { --cf-w: 132px; --cf-step: 96px; }
  .cf-item .lc-n { font-size: 3rem; }
  .topics li { font-size: 1.12rem; }
  .group { grid-template-columns: 1fr; }
  .group > .vlabel { writing-mode: horizontal-tb; transform: none; }
  .filters { position: static; }
  .filters .search-pill { width: 100%; }
  .pn strong { font-size: 1rem; }
  .cta-row .btn { flex: 1; justify-content: center; }
  .l-btns .btn { flex: 1 1 100%; justify-content: center; }
  /* home: the hero already shows the cover; the contents list doesn't need a second one on a phone */
  .toc-cover { display: none; }
  .author-grid .portrait { max-width: 230px; }
  /* lesson cards become rows: art on the left, week, title and the quote beside it (52 tall tiles ran 36 screens) */
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card a { flex-direction: row; border-radius: 16px; }
  .card-face { flex: none; width: 96px; aspect-ratio: auto; padding: 10px; }
  .card-face .lc-n { font-size: 2.4rem; }
  .card-body { padding: 14px 16px; gap: 2px; }
  .card-wk { order: -2; } .card-title { order: -1; font-size: 1.12rem; }
  .card-quote { margin: 4px 0 0; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card-p, .card a .pill-outline { display: none; }
  /* lesson page: a smaller book so the title shows on the first screen */
  .l-art { max-width: 190px; padding-block: 20px 36px; }
  .crumbs { margin-bottom: 20px; width: max-content; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  .lc-hero .lc-n { font-size: 4.4rem; } .lc-hero .lc-p { font-size: 1.05rem; }
  /* toolkit: the number sits beside the step's title, the text gets the full width */
  .steps li { display: block; padding: 18px; }
  .step-n { float: left; width: 34px; height: 34px; margin-right: 12px; font-size: .8rem; }
  .steps h3 { display: flow-root; min-height: 34px; margin: 4px 0 10px; font-size: 1.18rem; }
}
/* motion: scroll reveals, entrances, pointer tilt. All of it hangs off .motion, which motion.js adds only when reduced motion is off. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes book-in { from { opacity: 0; transform: translateY(40px) rotate(-4deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
/* never hide content: on a fast scroll anything still mid-fade looked like it had vanished. A small lift only. */
.motion .rv { transform: translateY(14px); transition: transform .6s cubic-bezier(.2, .75, .25, 1) var(--d, 0ms); }
.motion .rv.in { opacity: 1; transform: none; }
.motion .hero-book .book, .motion .lc-hero { animation: book-in 1s cubic-bezier(.2, .75, .25, 1) backwards; }
.motion .hero-head > *, .motion .page-frame > div > *, .motion .l-text > * { animation: rise .7s cubic-bezier(.2, .75, .25, 1) backwards; }
.motion .hero-head > :nth-child(2), .motion .page-frame > div > :nth-child(2), .motion .l-text > :nth-child(2) { animation-delay: .08s; }
.motion .hero-head > :nth-child(3), .motion .page-frame > div > :nth-child(3), .motion .l-text > :nth-child(3) { animation-delay: .16s; }
.motion .hero-head > :nth-child(4), .motion .page-frame > div > :nth-child(4), .motion .l-text > :nth-child(4) { animation-delay: .24s; }
.motion .hero-head > :nth-child(n+5), .motion .page-frame > div > :nth-child(n+5), .motion .l-text > :nth-child(n+5) { animation-delay: .32s; }
.motion .hero-panel { animation: rise .8s .3s cubic-bezier(.2, .75, .25, 1) backwards; }
.motion .lessons.filtering .card:not([hidden]) { animation: pop .4s cubic-bezier(.2, .75, .25, 1) backwards; }
.motion .tilt { position: relative; transition: transform .3s ease-out; }
.motion .tilt:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }   /* 3D only while hovered */
.motion .tilt::after { content: ""; position: absolute; inset: 0; border-radius: 3px 7px 7px 3px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .28), transparent 55%); }
.motion .tilt:hover::after { opacity: 1; }
.motion .book.tilt::after { mix-blend-mode: soft-light; }   /* the white cover: a sheen on the ink, not a wash over the art */
@media (pointer: coarse) {
  .icon-btn, .top-search, .social .icon-btn, .top-in .icon-btn, .top-in .social .icon-btn { width: 44px; height: 44px; }
  .btn-sm { min-height: 44px; }
  .search-pill input { min-height: 44px; padding-block: 0; }
  .tabs button { min-height: 44px; }
  .chips button { min-height: 40px; }
  .themes summary { padding-block: 10px; }
  .l-tabs a { padding-block: 14px; }
  .foot nav a { display: inline-block; padding-block: 10px; }
  .menu-panel a:not(.btn) { padding-block: 12px; }
  .crumbs a { padding-block: 10px; }
  .part li a { padding-block: 11px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } .part::details-content { transition: none; } }
@media print { .float-cta, .top, .foot, .filters, .order, .pn { display: none; } }
.pname { color: inherit; text-decoration: none; }
.pname:hover { text-decoration: underline; text-underline-offset: 3px; }

/* full-text search results (v4/explorer.js) */
.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hits[hidden] { display: none; }
.hits a { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.hits a:hover .card-title { text-decoration: underline; }
.hit-snip { margin: 0; font-size: .95rem; color: var(--ink-2); overflow-wrap: anywhere; }
.hit-snip mark, .hits mark { background: rgba(214, 166, 92, .4); color: inherit; padding: 0 2px; border-radius: 2px; }
.hit-note { padding: 24px 0; color: var(--ink-2); }
