/* Design A "Marble" (comps and rationale: ~/hammond/apfw-design). Designed so far: the header and
   footer and every page. Principles: indigo #283593; photos shown whole in a white mat, never as
   backgrounds; book covers are the only thing with a shadow; buttons are white with a hairline,
   or filled indigo for the main action. */

@font-face { font-family: "Lora"; src: url("../fonts/lora-v37-latin-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-v37-latin-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-v37-latin-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-v37-latin-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-v37-latin-700italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-v25-latin-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-v25-latin-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-v25-latin-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-v25-latin-700italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --indigo: #283593;       /* the old site's header bar; keep it */
  --indigo-deep: #1a237e;
  --marble: #f3f4f6;
  --plate: #ffffff;
  --ink: #2b2b2b;
  --muted: #5a5d66;
  --vein: #c9cdd6;
  --serif: "Lora", Georgia, serif;
  --sans: "Lato", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* A column, so the footer sits at the bottom of the window on short pages (404, Search). */
body {
  display: flex; flex-direction: column; min-height: 100vh;
  margin: 0;
  background: var(--marble) url("../img/marble-light-512.jpg");
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
h1 { color: var(--indigo); }

a { color: var(--indigo); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--indigo-deep); }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }

img, iframe { max-width: 100%; }
img { height: auto; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 1; padding: 0.5rem 1rem; background: var(--plate); }

/* The π logo, coloured by the surrounding text. */
.mark {
  display: inline-block; flex: none; width: 2.25rem; height: 2.25rem; background: currentColor;
  -webkit-mask: url("../img/pyth.png") center / contain no-repeat;
          mask: url("../img/pyth.png") center / contain no-repeat;
}

/* Header: the indigo bar. Without JS the nav wraps onto extra lines on narrow screens. */
.site-header { background: var(--indigo); color: #fff; }
.site-header :focus-visible { outline-color: #fff; }
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem;
  max-width: 80rem; min-height: 4.5rem; margin: 0 auto; padding: 0.9rem 1.5rem;
}
.site-title {
  display: flex; align-items: center; gap: 0.75rem;
  color: #fff; text-decoration: none; font: 400 1.375rem/1.2 var(--serif);
}
.site-title:hover { color: #fff; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-block; padding: 0.2rem 0; border-bottom: 2px solid transparent;
  color: rgb(255 255 255 / 0.86); text-decoration: none; font-size: 1.0625rem;
}
.site-nav a:hover { color: #fff; border-color: rgb(255 255 255 / 0.45); }
.site-nav a[aria-current="page"] { color: #fff; border-color: #fff; }

/* Below 63rem the nav no longer fits beside the title, so (with JS: html.js, menu.js) it collapses
   behind a Menu button and opens as a panel under the bar, one large row per section. Keep 63rem
   in step with menu.js. */
.menu-button { display: none; }
@media (max-width: 63rem) {
  .js .site-header__inner { row-gap: 0; }
  .js .menu-button {
    display: inline-flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; padding: 0.45rem 0.85rem;
    background: none; border: 1px solid rgb(255 255 255 / 0.45); cursor: pointer;
    color: #fff; font: 400 1.0625rem/1 var(--sans);
  }
  .js .menu-button:hover, .js .menu-button[aria-expanded="true"] { border-color: #fff; }
  /* Three bars that turn into a cross while the menu is open. */
  .menu-button__icon { position: relative; width: 1.25rem; height: 2px; background: currentColor; transition: background-color 0.2s; }
  .menu-button__icon::before, .menu-button__icon::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; transition: transform 0.2s;
  }
  .menu-button__icon::before { top: -6px; }
  .menu-button__icon::after { top: 6px; }
  [aria-expanded="true"] .menu-button__icon { background-color: transparent; }
  [aria-expanded="true"] .menu-button__icon::before { transform: translateY(6px) rotate(45deg); }
  [aria-expanded="true"] .menu-button__icon::after { transform: translateY(-6px) rotate(-45deg); }

  /* The panel opens downward (rows 0fr → 1fr) and is hidden from keyboards while closed. */
  .js .site-nav {
    flex-basis: 100%; display: grid; grid-template-rows: 0fr; visibility: hidden;
    transition: grid-template-rows 0.25s ease, visibility 0s 0.25s;
  }
  .js .is-open .site-nav { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.25s ease; }
  /* The side and bottom padding leaves room for focus rings inside the clipped list. */
  .js .site-nav ul { display: block; min-height: 0; overflow: hidden; margin: 0 -0.4rem; padding: 0 0.4rem 0.25rem; }
  .js .site-nav li:first-child { margin-top: 0.9rem; }
  .js .site-nav li { border-top: 1px solid rgb(255 255 255 / 0.2); }
  .js .site-nav a { display: block; padding: 0.8rem 0; border: 0; font-size: 1.1875rem; }
  .js .site-nav a:focus-visible { outline-offset: 0; }
  /* The current section is marked as in the wide nav: white, with a 2px underline. */
  .js .site-nav a[aria-current="page"] { text-decoration: underline 2px; text-underline-offset: 0.4em; }
}
/* The narrowest phones: the button shows just its icon (its name stays "Menu"). */
@media (max-width: 22rem) {
  .menu-button__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 63rem) and (prefers-reduced-motion: reduce) {
  .js .site-nav, .js .is-open .site-nav, .menu-button__icon, .menu-button__icon::before, .menu-button__icon::after { transition: none; }
}

.site-main { flex: 1 0 auto; width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.5rem 0; }

/* Footer: an indigo band like the header. The mark and name, the sections, the interview topics
   (the deepest pages), other sites (in a new tab), then the copyright line. */
.site-footer { margin-top: 5rem; background: var(--indigo); color: rgb(255 255 255 / 0.86); font-size: 1rem; }
.site-footer :focus-visible { outline-color: #fff; }
.site-footer a { color: rgb(255 255 255 / 0.86); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 0.5rem; }
.site-footer__inner {
  display: grid; grid-template-columns: minmax(15rem, 1.4fr) minmax(0, 3.6fr); gap: 2.5rem;
  max-width: 80rem; margin: 0 auto; padding: 3.25rem 1.5rem 2rem;
}
.site-footer__brand { display: flex; align-items: center; align-self: start; gap: 0.9rem; }
.site-footer__brand:hover { text-decoration: none; }
.site-footer__brand .mark { width: 3.25rem; height: 3.25rem; color: #fff; }
.site-footer__name { display: block; color: #fff; font: 400 1.375rem/1.2 var(--serif); }
.site-footer__site { display: block; margin-top: 0.15rem; color: rgb(255 255 255 / 0.75); font-size: 0.9375rem; }
.site-footer__nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.4fr); gap: 2rem; }
.site-footer__head { display: block; margin: 0 0 0.75rem; color: #fff; font-weight: 700; }
.site-footer a.site-footer__head { color: #fff; }
.site-footer__topics ul { display: grid; grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 0.5rem 2rem; justify-content: start; }
.site-footer__topics li + li { margin-top: 0; }
.site-footer__legal {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 2rem;
  padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / 0.25); color: rgb(255 255 255 / 0.72); font-size: 0.875rem;
}
.site-footer__legal p { margin: 0; }


/* Home: the whole photo in a white mat, title, George's quote, then the sections as an index. */
.plate { max-width: 72rem; margin: 1rem auto 0; }
.plate__mat { padding: 0.75rem; background: var(--plate); border: 1px solid var(--vein); }
.plate img { display: block; width: 100%; }
.home-title { margin: 3.5rem 0 2.25rem; text-align: center; font-size: clamp(2.25rem, 5vw, 3.4rem); line-height: 1.15; }
.home-intro { display: flex; gap: 1.75rem; align-items: flex-start; max-width: 43rem; margin: 0 auto; }
.home-intro__portrait { width: 8.5rem; flex: none; border: 0.375rem solid var(--plate); outline: 1px solid var(--vein); }
.home-intro__quote { margin: 0; }
.home-intro__quote p { margin: 0; font: 400 clamp(1.25rem, 2.4vw, 1.6rem)/1.45 var(--serif); }
.home-intro__quote footer { margin-top: 0.75rem; color: var(--muted); }

.home-index { max-width: 43rem; margin: 4rem auto 0; padding: 0; list-style: none; }
.home-index li { border-top: 1px solid var(--vein); }
.home-index li:last-child { border-bottom: 1px solid var(--vein); }
.home-index a {
  display: grid; grid-template-columns: 1fr auto; column-gap: 1.5rem;
  padding: 1.25rem 0; color: inherit; text-decoration: none;
}
.home-index__name { font: 400 1.75rem/1.2 var(--serif); color: var(--indigo); }
.home-index__count { grid-column: 2; grid-row: 1; align-self: baseline; color: var(--muted); font-size: 1rem; }
.home-index__desc { grid-column: 1; margin-top: 0.25rem; color: var(--muted); font-size: 1.0625rem; }
.home-index a:hover .home-index__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* Section pages: title and one line on the left, the section's photo matted on the right. */
.page-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 1.5rem 3rem; align-items: center;
  margin: 1rem 0 3rem;
}
.page-head__title { margin: 0; font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1.1; }
.page-head__intro { max-width: 34rem; margin: 1rem 0 0; font-size: 1.1875rem; }
.page-head__photo { margin: 0; }
.page-head__photo img { display: block; width: 100%; }
.page-head--topic { display: block; margin-bottom: 2.5rem; }
.page-head--topic .trail { margin-top: 0; }
.page-head--topic .category-nav { margin-top: 1.5rem; }

/* Author Interviews: the 50 featured names as a scannable column list, then George's second
   sentence and the topics. */
.featured { padding-top: 2rem; border-top: 1px solid var(--vein); }
.featured__title { margin: 0 0 1rem; font-size: 1.5rem; }
.featured-authors { margin: 0; padding: 0; list-style: none; columns: 4 9.5rem; column-gap: 2rem; }
.featured-authors li { break-inside: avoid; padding: 0.15rem 0; }
.featured-authors a { text-decoration-color: rgb(40 53 147 / 0.3); }
.featured-authors a:hover { text-decoration-color: currentColor; }
.featured__after { max-width: 40rem; margin: 2.25rem 0 0; font-size: 1.1875rem; }
.featured .category-nav { margin-top: 1.25rem; }

/* Topics: white buttons with their count; the current one filled indigo. */
.category-nav ul { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.category-nav a {
  display: inline-block; padding: 0.5rem 0.95rem; background: var(--plate); border: 1px solid var(--vein);
  text-decoration: none; font-size: 1.0625rem;
}
.category-nav a:hover { border-color: var(--indigo); }
.category-nav__count { margin-left: 0.3rem; color: var(--muted); font-size: 0.9375rem; }
.category-nav a[aria-current="page"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.category-nav a[aria-current="page"] .category-nav__count { color: rgb(255 255 255 / 0.8); }

/* Program cards: thumbnail in a thin white mat, guest, then title (in Lato, for reading at a
   glance). Video cards stack; audio cards put a square thumbnail beside the text. On hover or
   keyboard focus the hairline turns indigo and a play mark rises on the photo. */
.cards { display: grid; margin: 0; padding: 0; list-style: none; }
.cards--video { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2.25rem 1.75rem; }
.cards--audio { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1.5rem 1.75rem; }
.card a { display: block; color: inherit; text-decoration: none; }
.card__frame { position: relative; display: block; overflow: hidden; border: 0.25rem solid var(--plate); outline: 1px solid var(--vein); transition: outline-color 0.3s; }
.card__img { display: block; width: 100%; object-fit: cover; }
/* The play mark: a disc in --indigo with a white ring and triangle. */
.card__frame::after {
  content: ""; position: absolute; inset: 0; width: 3.25rem; height: 3.25rem; margin: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Ccircle cx='26' cy='26' r='25' fill='%23283593' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M21 16.5v19l15-9.5z' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transform: translateY(0.4rem) scale(0.9); transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card--audio .card__frame::after { width: 2.25rem; height: 2.25rem; }
.card--video .card__img { aspect-ratio: 16 / 9; }
.card--video .card__text { display: block; margin-top: 0.75rem; }
.card__guest, .card__title { display: block; }
.card__guest { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.card__title { margin-top: 0.1rem; font: 700 1.0625rem/1.35 var(--sans); color: var(--indigo); }
.card a:is(:hover, :focus-visible) .card__frame { outline-color: var(--indigo); }
.card a:is(:hover, :focus-visible) .card__frame::after { opacity: 1; transform: none; }
.card a:is(:hover, :focus-visible) .card__title { color: var(--indigo-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.card--audio a { display: flex; gap: 1rem; align-items: center; }
.card--audio .card__frame { width: 5.5rem; flex: none; }
.card--audio .card__img { aspect-ratio: 1; }
@media (prefers-reduced-motion: reduce) {
  .card__frame, .card__frame::after { transition: none; }
  .card__frame::after { transform: none; }
}

.list-title { margin: 3.5rem 0 1.5rem; padding-top: 2rem; border-top: 1px solid var(--vein); font-size: 1.6rem; }

/* Program pages (video and audio): trail, player, text in a reading column, then prev/next. */
.program-page { max-width: 60rem; margin: 0 auto; }
.trail { margin: 0.5rem 0 1.25rem; color: var(--muted); font-size: 1rem; }
.video-embed { aspect-ratio: 16 / 9; background: #000; }
.video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Audio player: the artwork in the cards' mat beside the controls. The play button is the cards'
   play mark (an indigo disc); skip and speed are white hairline buttons. audio-player.js reveals
   .player and hides the browser's controls. */
.audio-player {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem; align-items: center;
  padding: 1.5rem; background: var(--plate); border: 1px solid var(--vein);
}
.audio-player__art { display: block; border: 0.25rem solid var(--plate); outline: 1px solid var(--vein); }
.audio-player__art img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.audio-player audio { width: 100%; }
.audio-player__main > p { margin: 0; }
.audio-player__main > .audio-player__download { margin-top: 0.75rem; font-size: 1rem; }
.audio-player__pending, .audio-player__error { font-size: 1.0625rem; }

.player { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1.25rem 1.5rem; align-items: center; }
.player[hidden] { display: none; }
.player__play {
  position: relative; width: 4.5rem; height: 4.5rem; padding: 0; border: 0; border-radius: 50%;
  background: var(--indigo); color: #fff; cursor: pointer;
}
.player__play:hover { background: var(--indigo-deep); }
/* Play triangle; pause bars while playing. */
.player__play::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 1.35rem; height: 1.55rem; translate: 0.15rem 0;
  background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.is-playing .player__play::before {
  width: 1.2rem; height: 1.4rem; translate: none; clip-path: none;
  background: linear-gradient(to right, currentColor 0 34%, transparent 34% 66%, currentColor 66%);
}
/* While the audio loads after Play: a ring turning round the disc. */
.is-waiting .player__play::after {
  content: ""; position: absolute; inset: -0.4rem; border: 2px solid var(--vein); border-top-color: var(--indigo);
  border-radius: 50%; animation: player-turn 0.9s linear infinite;
}
@keyframes player-turn { to { rotate: 1turn; } }

.player__seek {
  --progress: 0%;
  display: block; width: 100%; height: 1.5rem; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.player__seek::-webkit-slider-runnable-track { height: 0.375rem; background: linear-gradient(to right, var(--indigo) var(--progress), var(--vein) var(--progress)); }
.player__seek::-moz-range-track { height: 0.375rem; background: var(--vein); }
.player__seek::-moz-range-progress { height: 0.375rem; background: var(--indigo); }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.125rem; height: 1.125rem; margin-top: -0.375rem;
  border: 2px solid var(--plate); border-radius: 50%; background: var(--indigo);
}
.player__seek::-moz-range-thumb { width: 1.125rem; height: 1.125rem; border: 2px solid var(--plate); border-radius: 50%; background: var(--indigo); box-sizing: border-box; }
.player__seek:focus-visible { outline-offset: 1px; }
.player__times { display: flex; justify-content: space-between; margin-top: 0.4rem; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

.player__extras { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.player__extras button {
  min-width: 4.25rem; padding: 0.4rem 0.75rem; background: var(--plate); border: 1px solid var(--vein); cursor: pointer;
  color: var(--indigo); font: 400 1rem/1.3 var(--sans); font-variant-numeric: tabular-nums;
}
.player__extras button:hover { border-color: var(--indigo); }
.player__extras a { margin-left: auto; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .is-waiting .player__play::after { animation: none; }
}

.program__text { max-width: 42rem; margin: 2.25rem auto 0; }
.program__title { margin: 0; font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.15; }
.program__with { margin: 0.5rem 0 0; font: italic 400 1.4rem/1.35 var(--serif); }
.program__date { margin: 0.35rem 0 0; color: var(--muted); font-size: 1rem; }
.program__description { margin-top: 1.75rem; }
.program__description p { margin: 0 0 1.1em; }
.program__cc-link { margin: 1.5rem 0 0; }

.sequence { margin: 3.5rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--vein); }
.sequence__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 1.25rem; }
.sequence h2 { margin: 0; font-size: 1.4rem; line-height: 1.3; }
.sequence__pos { color: var(--muted); font-size: 1rem; }
.sequence ul { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.seq--next { grid-column: 2; }
.seq a { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; color: inherit; text-decoration: none; }
.seq img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.seq__dir { display: block; color: var(--muted); font-size: 0.9375rem; }
.seq__title { display: block; font: 700 1.0625rem/1.35 var(--sans); color: var(--indigo); }
.seq__guest { display: block; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.seq a:hover .seq__title { text-decoration: underline; text-decoration-thickness: 1px; }
.sequence__all { margin: 1.75rem 0 0; }

/* Pythy Maxims. Without JS: a plain numbered list. maxims.js sets html[data-maxims] ("one" or "all")
   before paint and adds the controls bar, numbers and copy buttons. */
.maxims-page { max-width: 48rem; margin: 0 auto; }
.maxims { margin: 0; padding-left: 2.5rem; }
.maxim p { margin: 0 0 1.25rem; font: 400 1.1875rem/1.55 var(--serif); }

.maxims-bar { display: none; }
.maxim__num, .maxim__copy { display: none; }
[data-maxims] .maxims-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin: 0 0 1.25rem;
}
.maxims-bar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.maxims-bar__counter { min-width: 6.5em; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.maxims-bar button:disabled { cursor: default; opacity: 0.45; border-color: var(--vein); }
[data-maxims] .maxims { padding: 0; list-style: none; }

/* One at a time: the maxim on a white page, the controls above it so they stay put. Until the
   script marks one current, show the first. */
[data-maxims="one"] .maxims {
  display: grid; align-content: center; min-height: 14rem;
  padding: clamp(1.5rem, 5vw, 3rem); background: var(--plate); border: 1px solid var(--vein);
}
[data-maxims="one"] .maxim:not(.is-current) { display: none; }
[data-maxims="one"] .maxims:not(:has(.is-current)) .maxim:first-child { display: block; }
[data-maxims="one"] .maxim p { margin: 0; font-size: clamp(1.4rem, 3vw, 1.85rem); line-height: 1.45; text-wrap: pretty; }
[data-maxims="one"] .maxim__copy { display: inline-block; margin-top: 1.75rem; padding: 0.4rem 0.8rem; font-size: 0.9375rem; }

/* Full list: numbers in the margin open that maxim one at a time; the one you were reading sits
   on the white page. */
/* Previous/Next/Random belong to the one-at-a-time view; the list keeps only the way back to it. */
[data-maxims="all"] .maxims-bar__group:first-child, [data-maxims="all"] .maxims-bar__random { display: none; }
[data-maxims="all"] .maxims-bar { justify-content: flex-end; }
[data-maxims="all"] .maxim {
  display: grid; grid-template-columns: 2.5rem 1fr; column-gap: 1rem;
  padding: 0.9rem 1.25rem; border: 1px solid transparent;
}
[data-maxims="all"] .maxim__num {
  display: block; padding-top: 0.2rem; text-align: right; color: var(--muted); font-size: 0.9375rem;
  text-decoration: none; font-variant-numeric: tabular-nums;
}
[data-maxims="all"] .maxim__num:hover { color: var(--indigo); text-decoration: underline; }
[data-maxims="all"] .maxim > p { grid-column: 2; margin: 0; }
[data-maxims="all"] .maxim.is-current { background: var(--plate); border-color: var(--vein); }

/* Books. Covers are objects, so they get the site's only shadow; photos are prints in a mat. */
.book-cover { display: block; box-shadow: 0 1px 2px rgb(0 0 0 / 0.14), 0 10px 18px -10px rgb(0 0 0 / 0.4); }
.books {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr)); gap: 2.75rem 3rem;
  margin: 0; padding: 0; list-style: none;
}
.book-card { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.book-card__cover img { width: 100%; }
.book-card__title { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.book-card__title a { text-decoration: none; }
.book-card__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.book-card__excerpt { margin: 0.6rem 0 0; font-size: 1.0625rem; }
.book-card__link { margin: 0.75rem 0 0; font-size: 1rem; }

.book-page { max-width: 58rem; margin: 0 auto; }
.book { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.book__cover { width: 100%; }
.book__title { margin: 0; font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.15; }
.book__description { margin-top: 1.25rem; font-size: 1.1875rem; }
.book__description p { margin: 0 0 1em; }
.book__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }
.book__details-title { margin: 2.5rem 0 0.75rem; font-size: 1.4rem; }
.book__details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1.5rem; margin: 0; }
.book__details dt { color: var(--muted); }
.book__details dd { margin: 0; }
.sequence--books .seq a { grid-template-columns: 4.5rem 1fr; }
.sequence--books .seq img { aspect-ratio: auto; }

/* Buttons: white with a hairline, or filled indigo for the main action (same look as the topics). */
.button {
  display: inline-block; padding: 0.65rem 1.1rem; background: var(--plate); border: 1px solid var(--vein);
  color: var(--indigo); text-decoration: none; font-size: 1.0625rem; line-height: 1.3;
}
.button:hover { border-color: var(--indigo); }
.button--primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.button--primary:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); color: #fff; }
/* The Maxims reader's buttons (made by maxims.js) look the same; Next is its main action. */
.maxims-bar button, .maxim__copy {
  padding: 0.6rem 1rem; background: var(--plate); border: 1px solid var(--vein); cursor: pointer;
  color: var(--indigo); font: 400 1.0625rem/1.3 var(--sans);
}
.maxims-bar button:not(:disabled):hover, .maxim__copy:hover { border-color: var(--indigo); }
.maxims-bar .maxims-bar__next:not(:disabled) { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.maxims-bar .maxims-bar__next:not(:disabled):hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }

/* About: the bio continues in the column of its first paragraph, under the title. */
.prose { max-width: 43rem; font-size: 1.1875rem; }
.prose p { margin: 0 0 1.1em; }

/* Search: Pagefind's UI, themed through its own variables (its stylesheet loads after this one,
   so overrides need the #search id). */
#search .pagefind-ui {
  --pagefind-ui-scale: 1; --pagefind-ui-primary: var(--indigo); --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--plate); --pagefind-ui-border: var(--vein); --pagefind-ui-tag: var(--marble);
  --pagefind-ui-border-width: 1px; --pagefind-ui-border-radius: 0; --pagefind-ui-image-border-radius: 0;
  --pagefind-ui-font: var(--sans);
}
#search .pagefind-ui__result-link { font-family: var(--serif); font-weight: 400; color: var(--indigo); }
#search .pagefind-ui__result-excerpt, #search .pagefind-ui__filter-label { font-size: 1rem; }
#search mark { background: rgb(40 53 147 / 0.12); color: inherit; }
/* Its 60px gap separates filters and results side by side; stacked (phones) it left a big hole. */
#search .pagefind-ui__drawer { row-gap: 0; }

/* 404 */
.not-found { max-width: 36rem; font-size: 1.1875rem; }
.site-search { margin: 1.5rem 0; }
.site-search label { display: block; margin-bottom: 0.4rem; color: var(--muted); font-size: 1rem; }
.site-search__row { display: flex; gap: 0.5rem; }
.site-search input {
  flex: 1; min-width: 0; padding: 0.6rem 0.8rem; background: var(--plate); border: 1px solid var(--vein);
  color: var(--ink); font: inherit; font-size: 1.0625rem;
}
.site-search input:focus-visible { border-color: var(--indigo); }


@media (max-width: 52rem) {
  .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .page-head { grid-template-columns: 1fr; }
  .page-head__photo { max-width: 32rem; }
}

@media (max-width: 40rem) {
  .site-header__inner { padding: 0.9rem 1rem; column-gap: 1rem; }
  .site-title { gap: 0.6rem; font-size: 1.25rem; }
  .site-title .mark { width: 2rem; height: 2rem; }
  .js .menu-button { gap: 0.55rem; padding: 0.45rem 0.7rem; }
  .site-footer { margin-top: 3.5rem; }
  .site-footer__inner { padding: 2.5rem 1rem 1.5rem; }
  /* Phones: each group full width between hairlines (as in the menu panel), links in two
     columns with rows tall enough to tap. */
  .site-footer__inner { row-gap: 0; }
  .site-footer__brand { margin-bottom: 1.5rem; }
  .site-footer__nav { grid-template-columns: 1fr; gap: 0; }
  .site-footer .site-footer__nav > * { padding: 0.9rem 0 1rem; border-top: 1px solid rgb(255 255 255 / 0.25); }
  .site-footer__nav ul { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-flow: row; gap: 0 1.5rem; }
  .site-footer__nav li + li { margin-top: 0; }
  .site-footer__nav li a { display: block; padding: 0.55rem 0; }
  .site-footer__head { margin-bottom: 0.2rem; padding: 0.35rem 0; }
  .site-footer__legal { flex-direction: column; }
  .site-nav ul { gap: 0.1rem 1.1rem; }
  .site-main { padding: 1rem 1rem 0; }
  .plate { margin-top: 0.25rem; }
  .plate__mat { padding: 0.4rem; }
  .home-intro { flex-direction: column; align-items: center; text-align: center; }
  .home-intro__portrait { width: 7rem; }
  .home-index__name { font-size: 1.5rem; }
  .home-index__desc { grid-column: 1 / -1; }
  .sequence ul { grid-template-columns: 1fr; gap: 1.25rem; }
  .seq--next { grid-column: 1; }
  .seq a { grid-template-columns: 8rem 1fr; }
  .audio-player { grid-template-columns: 1fr; gap: 1.25rem; padding: 1rem; }
  .audio-player__art { width: 9rem; }
  .player { grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; }
  .player__play { width: 4rem; height: 4rem; }
  .page-head { margin-bottom: 2rem; }
  .cards--video, .cards--audio { grid-template-columns: 1fr; gap: 1.25rem; }
  .card--video a { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: start; }
  .card--video .card__text { margin-top: 0; }
  .card--audio .card__frame { width: 4.5rem; }
  .card--video .card__frame::after { width: 2.5rem; height: 2.5rem; }
  .maxims-bar__group:first-child { flex: 1 1 100%; justify-content: space-between; }
  [data-maxims="all"] .maxim { grid-template-columns: 2rem 1fr; column-gap: 0.75rem; padding: 0.8rem 0.75rem; }
  /* Cover beside the title; the excerpt takes the full width below. */
  .book-card { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 1.1rem; align-items: center; }
  .book-card > div { display: contents; }
  .book-card__title { font-size: 1.3rem; }
  .book-card__excerpt, .book-card__link { grid-column: 1 / -1; }
  .book-card__excerpt { margin-top: 1rem; }
  .book { grid-template-columns: 1fr; }
  .book__cover { width: 11rem; }
}
