/*
  markpesce.com · site.css · "Sunroom" v3
  Drop-in replacement for /css/site.css. Works with the existing markup on every page.

  Fonts load from Google Fonts via <link> tags in each page's <head> (see HANDOFF.md).

  Map of this file
    1. Tokens
    2. Base and prose
    3. Header, buttons, footer
    4. Page frame and rhythm (homepage wide; reading pages narrower; collection pages wide)
    5. Homepage: hero, topic bento, polaroid strip, Current
    6. Topic identity: tints and glyphs, keyed to each talk's URL (homepage tiles and program pages)
    7. Inner pages: intro panel, sheets, talk pages, catalogue, books, papers, video, media, bio, essays
    8. Responsive
    9. Reduced motion
*/

/* 1. Tokens ---------------------------------------------------------------- */

@property --loop { syntax: "<angle>"; inherits: false; initial-value: 290deg; }
@property --ring { syntax: "<length>"; inherits: false; initial-value: 9px; }

:root {
  --sky: #f3f6fb;
  --white: #ffffff;
  --ink: #151c2b;
  --muted: #4a5568;
  --line: rgba(21, 28, 43, .09);
  --line-strong: rgba(21, 28, 43, .24);
  --cobalt: #2350e6;
  --sun: #ffbf1f;

  /* Tints (tiles) and deeps (glyphs, dots) */
  --t-sky: #dce8ff;    --d-sky: #5f8cf3;
  --t-butter: #fff0bf; --d-butter: #e7a500;
  --t-mint: #d6f1e4;   --d-mint: #2f9e6e;
  --t-lilac: #e8e0ff;  --d-lilac: #5b3fc4;
  --t-peach: #ffe2d3;  --d-peach: #e8673d;
  --t-rose: #ffe0ea;   --d-rose: #cf4a76;
  --t-teal: #d3f0f2;   --d-teal: #1f8a93;
  --t-stone: #e8edf3;  --d-stone: #6b7a90;

  --on-ink: #e9eef6;
  --on-ink-muted: #aab4c4;

  /* Set per program page in section 6; white elsewhere */
  --topic: var(--white);
  --topic-deep: var(--d-butter);

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wide: 82rem;
  --read: 56rem;
  --r-lg: 32px;
  --r-md: 26px;
  --tile-shadow: 0 0 0 1px var(--line);
  --lift-shadow: 0 30px 50px -30px rgba(21, 28, 43, .45);
  --sheet-shadow: 0 0 0 1px var(--line), 0 30px 50px -44px rgba(21, 28, 43, .35);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

/* 2. Base and prose -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  background:
    radial-gradient(56rem 28rem at 90% -6%, #ffe6d6, transparent 62%),
    radial-gradient(48rem 30rem at -6% 4%, #dbe7ff, transparent 62%),
    var(--sky);
}
img { max-width: 100%; }
:where(h1, h2, h3, p, ul, ol, figure, blockquote) { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; line-height: 1.05; letter-spacing: -.04em; }
h3 { font-size: 1.3rem; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .45em; }
:where(.site-main) :is(p, li) { max-width: 68ch; overflow-wrap: break-word; }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: .86em; padding: .12em .42em; border-radius: 6px; background: var(--t-stone); overflow-wrap: anywhere; }
figcaption { font-size: .88rem; line-height: 1.4; color: var(--muted); }

a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--cobalt); }
:where(.site-main) a:not([class]) { text-decoration-color: rgba(35, 80, 230, .45); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 8px; }

.eyebrow { font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lede { max-width: 52ch; font-size: clamp(1.12rem, 1.7vw, 1.38rem); line-height: 1.5; color: var(--muted); }
.text-link {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1.3rem;
  border-radius: 999px; background: var(--white); box-shadow: var(--tile-shadow);
  font-weight: 600; text-decoration: none; transition: box-shadow .2s;
}
.text-link::after { content: "→"; transition: translate .3s var(--spring); }
.text-link:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.text-link:hover::after { translate: 4px 0; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.skip-link {
  position: fixed; z-index: 50; top: .75rem; left: .75rem; transform: translateY(-200%);
  padding: .6rem .9rem; background: var(--white); border-radius: 12px; box-shadow: var(--tile-shadow);
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 3. Header, buttons, footer ----------------------------------------------- */

.site-header { position: sticky; top: .75rem; z-index: 30; margin-top: .75rem; padding-inline: 1rem; }
.header-inner {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center;
  width: min(100%, var(--wide)); margin-inline: auto; padding: .5rem .5rem .5rem 1.3rem;
  border-radius: 24px; background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px var(--line), 0 10px 30px -14px rgba(21, 28, 43, .22);
}
.wordmark { display: inline-flex; align-items: baseline; width: fit-content; font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.035em; text-decoration: none; }
.wordmark::after { content: ""; width: .3em; height: .3em; margin-left: .08em; border-radius: 50%; background: var(--sun); }
.site-nav { grid-column: 1 / -1; overflow-x: auto; scrollbar-width: none; }
.site-nav ul { display: flex; gap: .15rem; width: max-content; margin: 0; padding: 0; list-style: none; }
.site-nav li + li { margin-top: 0; }
.site-nav a { display: block; padding: .6rem .85rem; border-radius: 999px; color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.site-nav a:hover { background: var(--t-stone); color: var(--ink); }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .8rem 1.45rem;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font-family: var(--body); font-size: 1rem; font-weight: 600; line-height: 1; text-decoration: none;
  transition: background .2s, transform .3s var(--spring);
}
.button:hover { background: var(--cobalt); color: #fff; transform: translateY(-2px) scale(1.03); }
.button-small { min-height: 2.75rem; padding: .6rem 1.15rem; font-size: .9rem; }

.site-footer { padding: 0 1rem 1rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  width: min(100%, var(--wide)); margin-inline: auto; padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink);
}
.site-footer p { font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .3); }
.site-footer a:hover { color: #fff; border-bottom-color: var(--sun); }
.copyright { color: var(--on-ink-muted); font-size: .85rem; }

/* 4. Page frame and rhythm ------------------------------------------------- */

.site-main {
  width: min(calc(100% - 2rem), var(--wide));
  min-height: 62vh;
  margin-inline: auto;
  padding-block: clamp(1.25rem, 2.5vw, 2rem) clamp(4rem, 8vw, 6.5rem);
}
/* Reading pages run narrower. Pages built from collections, and talk pages, stay wide. */
.site-main:not(:has(> .hero, .book-list, .watch-grid, .media-appearances-list, .talk-grid, > .program-page > .page-intro > .featured-quote, > .ces-page)) {
  width: min(calc(100% - 2rem), var(--read));
}

/* Stacking: inner pages are tiles on the sky, close together */
:where(.site-main, .site-main > article) > * + * { margin-top: clamp(1rem, 1.6vw, 1.25rem); }
/* Collections get a little more air above their heading */
:where(.site-main, .site-main > article) > :where(.book-list, section:has(> .watch-grid, > .media-appearances-list, > .card-grid, > .testimonial-list, > .paper-list, > .featured-quote)) { margin-top: clamp(2.25rem, 4.5vw, 3.5rem); }
:where(.site-main section[id]) { scroll-margin-top: 6rem; }

/* Sheets: any inner section that holds prose rather than a collection */
:where(.site-main, .site-main > article) > section:where(:not(.hero, .innovation-strip, .book-list, .program-video, :has(> .card-grid, > .split, > .watch-grid, > .media-appearances-list, > .testimonial-list, > .paper-list, > .featured-quote))) {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--sheet-shadow);
}

/* Flow inside sections */
:where(.site-main, .site-main > article) > :where(section:not(.hero)) > * + * { margin-top: 1em; }
:where(.site-main, .site-main > article) > :where(section:not(.hero)) > * + :is(h2, h3) { margin-top: 1.6em; }
.section-heading { display: grid; gap: .5rem; }
.section-heading + * { margin-top: clamp(1.25rem, 2.5vw, 1.75rem); }

/* 5. Homepage --------------------------------------------------------------- */

.site-main:has(> .hero) > * + * { margin-top: clamp(4rem, 8vw, 6.5rem); }
.site-main:has(> .hero) .section-heading h2 { font-size: clamp(2.2rem, 4.8vw, 3.6rem); line-height: 1; letter-spacing: -.05em; }

/* Hero: a bento of three tiles. The full stop drops in and bounces. */
.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr auto auto; gap: 0 1rem; }
.hero::before { content: ""; grid-column: 1 / span 5; grid-row: 1; margin-bottom: 1rem; border-radius: var(--r-lg); background: var(--white); box-shadow: var(--tile-shadow), 0 30px 50px -40px rgba(21, 28, 43, .4); }
.hero h1 {
  position: relative; grid-column: 1 / span 5; grid-row: 1; align-self: end;
  margin: 0 0 1rem; padding: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(3.6rem, 8.4vw, 8rem); font-weight: 800; line-height: .86; letter-spacing: -.06em;
}
/* Inner pages end their title with a sun-coloured full stop; it never wraps onto its own line */
.page-intro h1::after { content: "."; color: var(--sun); }
.hero h1::after {
  content: ""; display: inline-block; vertical-align: baseline;
  width: .19em; height: .19em; margin: 0 0 .02em .05em; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe58a, var(--sun) 60%, #f5a300);
}
.hero h1::after { transform-origin: 50% 100%; animation: drop 1.4s cubic-bezier(.3, 0, .3, 1) .35s both; }
@keyframes drop {
  0%   { translate: 0 -1.6em; scale: 1; }
  45%  { translate: 0 0; scale: 1; }
  55%  { translate: 0 0; scale: 1.35 .7; }
  70%  { translate: 0 -.3em; scale: .92 1.08; }
  82%  { translate: 0 0; scale: 1.12 .9; }
  92%  { translate: 0 -.06em; scale: 1; }
  100% { translate: 0 0; scale: 1; }
}
.homepage-hero-image { grid-column: 6 / -1; grid-row: 1 / 4; margin: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--t-stone); }
.homepage-hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 100% 20%; transition: scale 1.2s var(--ease); }
.homepage-hero-image:hover img { scale: 1.04; }
.hero .lede, .hero .actions { grid-column: 1 / span 5; background: var(--t-butter); }
.hero .lede {
  grid-row: 2; max-width: none; padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem) 1rem;
  border-radius: var(--r-lg) var(--r-lg) 0 0; color: var(--ink); font-size: clamp(1.08rem, 1.5vw, 1.3rem);
}
.hero .actions { grid-row: 3; padding: .75rem clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* Topic bento. Layout follows position; colour and glyph follow the talk (section 6). */
.card-grid:not(.talk-grid) { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; gap: 1rem; }
.card-grid:not(.talk-grid) > .card {
  --u: 1rem; --gtop: 1.4rem; --gright: 1.4rem;
  position: relative; grid-column: span 2; display: flex; flex-direction: column; gap: .7rem;
  min-height: 17rem; padding: 1.75rem 4.5rem 1.75rem 1.75rem; overflow: hidden;
  border-radius: 30px; background: var(--tint, var(--t-stone));
  transition: transform .5s var(--spring), box-shadow .4s;
}
.card-grid:not(.talk-grid) > .card:first-child { grid-column: span 4; min-height: 20rem; }
.card-grid:not(.talk-grid) > .card .eyebrow { padding-right: 5rem; }
.card-grid:not(.talk-grid) > .card h3 { margin-top: auto; font-size: 1.65rem; line-height: 1.05; letter-spacing: -.04em; }
.card-grid:not(.talk-grid) > .card:first-child h3 { font-size: clamp(2.2rem, 3.8vw, 3.4rem); }
.card-grid:not(.talk-grid) > .card h3 a { text-decoration: none; }
.card-grid:not(.talk-grid) > .card h3 a::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.card-grid:not(.talk-grid) > .card p:last-child { max-width: 36ch; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.card-grid:not(.talk-grid) > .card::after {
  content: "→"; position: absolute; right: 1.25rem; bottom: 1.25rem; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgba(255, 255, 255, .8); font-size: 1.05rem;
  transition: rotate .5s var(--spring), background .3s, color .3s;
}
.card-grid:not(.talk-grid) > .card:hover, .card-grid:not(.talk-grid) > .card:focus-within { transform: translateY(-6px) rotate(-.6deg); box-shadow: var(--lift-shadow); }
.card-grid:not(.talk-grid) > .card:hover::after, .card-grid:not(.talk-grid) > .card:focus-within::after { rotate: -45deg; background: var(--ink); color: #fff; }
.card-grid:not(.talk-grid) > .card:hover h3 a { color: var(--ink); }

/* Every other tile is a small grid: the glyph has its own cell beside the eyebrow,
   so the title always starts below it at any width */
.card-grid:not(.talk-grid) > .card:not(:has(a[href$="programs/more.html"])) {
  --u: clamp(.65rem, 5cqi, 1rem);  /* glyphs shrink in narrow tiles so the eyebrow keeps room */
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto;
  column-gap: 1rem; row-gap: .7rem;
}
.card-grid:not(.talk-grid) > .card:not(:has(a[href$="programs/more.html"]))::before { position: static; grid-column: 2; grid-row: 1; justify-self: end; align-self: start; margin: -.35rem -3.1rem 0 0; }
.card-grid:not(.talk-grid) > .card:not(:has(a[href$="programs/more.html"])) .eyebrow { grid-column: 1; grid-row: 1; padding-right: 0; }
.card-grid:not(.talk-grid) > .card:not(:has(a[href$="programs/more.html"])) h3 { grid-column: 1 / -1; grid-row: 2; align-self: end; margin-top: 0; }
.card-grid:not(.talk-grid) > .card:not(:has(a[href$="programs/more.html"])) p:last-child { grid-column: 1 / -1; grid-row: 3; }

/* The "More" tile runs full width as a single row */
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]) {
  grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 1.5rem; row-gap: .25rem;
  min-height: 0; padding: 1.6rem 15rem 1.6rem 1.75rem; box-shadow: var(--tile-shadow);
}
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]) .eyebrow { padding-right: 0; }
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]) h3 { margin-top: 0; }
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]) p:last-child { max-width: none; }
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"])::after { bottom: auto; top: 50%; margin-top: -1.375rem; background: var(--t-stone); }
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]):hover { box-shadow: var(--tile-shadow), var(--lift-shadow); }

@supports (animation-timeline: view()) {
  .card-grid:not(.talk-grid) > .card { animation: pop linear both; animation-timeline: view(); animation-range: cover 0% cover 28%; }
}
@keyframes pop { from { translate: 0 70px; scale: .92; } }

/* Inventing the future: polaroids taped to the page */
.innovation-strip > .innovation-list { margin-top: 2rem; }
.innovation-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(1rem, 2.2vw, 2rem); padding-block: 1rem 1.5rem; }
.innovation-item {
  --r: -3deg; --y: 0rem;
  position: relative; margin: 0; padding: .6rem .6rem 1.1rem; border-radius: 6px; background: var(--white);
  box-shadow: 0 1px 2px rgba(21, 28, 43, .12), 0 18px 30px -18px rgba(21, 28, 43, .45);
  rotate: var(--r); translate: 0 var(--y);
  transition: rotate .5s var(--spring), scale .5s var(--spring), box-shadow .4s;
}
.innovation-item:nth-child(5n+2) { --r: 2.5deg; --y: 1.25rem; }
.innovation-item:nth-child(5n+3) { --r: -1.5deg; --y: -.5rem; }
.innovation-item:nth-child(5n+4) { --r: 3.5deg; --y: .9rem; }
.innovation-item:nth-child(5n+5) { --r: -2.5deg; --y: .2rem; }
.innovation-item::before, .bio-photo::before, .historical-figure::before {
  content: ""; position: absolute; z-index: 1; top: -.7rem; left: 50%; width: 4.5rem; height: 1.4rem;
  translate: -50% 0; rotate: -4deg; background: rgba(255, 226, 140, .78); box-shadow: 0 1px 2px rgba(21, 28, 43, .08);
}
.innovation-item:nth-child(even)::before { rotate: 5deg; background: rgba(200, 220, 255, .8); }
.innovation-item img { display: block; width: 100%; height: clamp(7.5rem, 10.5vw, 10rem); object-fit: cover; border-radius: 2px; background: var(--t-stone); }
.innovation-item figcaption { margin-top: .8rem; padding-inline: .25rem; color: var(--ink); font-size: .86rem; font-weight: 600; line-height: 1.35; }
.innovation-item:hover { z-index: 3; rotate: 0deg; scale: 1.07; box-shadow: 0 2px 4px rgba(21, 28, 43, .12), 0 30px 40px -20px rgba(21, 28, 43, .5); }
@supports (animation-timeline: view()) {
  .innovation-item { animation: land linear both; animation-timeline: view(); animation-range: cover 0% cover 30%; }
}
@keyframes land { from { transform: translateY(-60px) rotate(10deg); opacity: .4; } }

/* Current, and the two doors on Contact */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.split > article {
  --hover: var(--t-sky);
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem;
  border-radius: var(--r-md); background: var(--white); box-shadow: var(--tile-shadow);
  transition: background .35s, transform .45s var(--spring);
}
.split > article:nth-child(4n+2) { --hover: var(--t-butter); }
.split > article:nth-child(4n+3) { --hover: var(--t-mint); }
.split > article:nth-child(4n+4) { --hover: var(--t-lilac); }
.split > article::after { content: "↗"; margin-top: auto; padding-top: .5rem; color: var(--cobalt); font-weight: 600; transition: translate .4s var(--spring); }
.split > article h3 { font-size: 1.28rem; }
.split > article h3 a { text-decoration: none; }
.split > article h3 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.split > article p { color: var(--muted); font-size: .98rem; line-height: 1.5; }
.split > article:hover { background: var(--hover); transform: translateY(-4px); }
.split > article:hover h3 a { color: var(--ink); }
.split > article:hover::after { translate: 4px -4px; }
.split + p { margin-top: 1.75rem; }

/* 6. Topic identity ---------------------------------------------------------
   Each talk owns a tint and a glyph that draws its argument:
     Crossing the Watershed  water, flowing      sky
     Closing the Loop        a ring that closes   butter
     How We're Getting On    growth rings         mint
     Sand to Software        six layers, 3 + 3    lilac
     Founder's Zen           a balancing cairn    peach
     More                    confetti             white
   Homepage tiles are matched by their link; program pages by their canonical URL.
   The glyph moves on hover on the homepage, and plays once when a program page opens.
   To add a talk: add its tint line and its glyph block below. */

.card:has(a[href$="programs/watershed.html"])        { --tint: var(--t-sky); }
.card:has(a[href$="programs/closing-the-loop.html"]) { --tint: var(--t-butter); }
.card:has(a[href$="programs/getting-on.html"])       { --tint: var(--t-mint); }
.card:has(a[href$="programs/sand-to-software.html"]) { --tint: var(--t-lilac); }
.card:has(a[href$="programs/founders-zen.html"])     { --tint: var(--t-peach); }
.card:has(a[href$="programs/more.html"])             { --tint: var(--white); }

html:has(link[rel="canonical"][href$="/programs/watershed.html"])        { --topic: var(--t-sky);    --topic-deep: var(--d-sky); }
html:has(link[rel="canonical"][href$="/programs/closing-the-loop.html"]) { --topic: var(--t-butter); --topic-deep: var(--d-butter); }
html:has(link[rel="canonical"][href$="/programs/getting-on.html"])       { --topic: var(--t-mint);   --topic-deep: var(--d-mint); }
html:has(link[rel="canonical"][href$="/programs/sand-to-software.html"]) { --topic: var(--t-lilac);  --topic-deep: var(--d-lilac); }
html:has(link[rel="canonical"][href$="/programs/founders-zen.html"])     { --topic: var(--t-peach);  --topic-deep: var(--d-peach); }

/* Glyph hosts (zero specificity, so each glyph below can set its own size and position) */
:where(.card-grid:not(.talk-grid) > .card, html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro)::before {
  content: ""; position: absolute; top: var(--gtop); right: var(--gright);
  width: calc(var(--u) * 6.5); height: calc(var(--u) * 6.5); pointer-events: none;
}
html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro {
  --u: 1.3rem; --gtop: clamp(1.5rem, 3.5vw, 2.75rem); --gright: clamp(1.5rem, 3.5vw, 2.75rem);
}

/* Water */
.card:has(a[href$="programs/watershed.html"])::before,
html:has(link[rel="canonical"][href$="/programs/watershed.html"]) .page-intro::before {
  width: min(calc(var(--u) * 20), 42%); height: calc(var(--u) * 6.75);
  background:
    radial-gradient(circle at 50% 100%, transparent 56%, var(--d-sky) 58% 70%, transparent 72%) 0 0 / calc(var(--u) * 3) calc(var(--u) * 1.5) repeat-x,
    radial-gradient(circle at 50% 100%, transparent 56%, #8fb0fa 58% 70%, transparent 72%) calc(var(--u) * 1.5) calc(var(--u) * 2.6) / calc(var(--u) * 3) calc(var(--u) * 1.5) repeat-x,
    radial-gradient(circle at 50% 100%, transparent 56%, #b9cefc 58% 70%, transparent 72%) 0 calc(var(--u) * 5.2) / calc(var(--u) * 3) calc(var(--u) * 1.5) repeat-x;
  animation: g-flow 6s linear infinite;
}
.card:has(a[href$="programs/watershed.html"]):hover::before { animation-duration: 1.6s; }
@keyframes g-flow { to { background-position: calc(var(--u) * 3) 0, calc(var(--u) * -1.5) calc(var(--u) * 2.6), calc(var(--u) * 3) calc(var(--u) * 5.2); } }

/* A ring that closes */
.card:has(a[href$="programs/closing-the-loop.html"])::before,
html:has(link[rel="canonical"][href$="/programs/closing-the-loop.html"]) .page-intro::before {
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--d-butter) 0 var(--loop), transparent var(--loop));
  -webkit-mask: radial-gradient(farthest-side, transparent 63%, #000 64%);
  mask: radial-gradient(farthest-side, transparent 63%, #000 64%);
  rotate: -20deg;
  transition: --loop .9s cubic-bezier(.3, 1.3, .5, 1), rotate .9s cubic-bezier(.3, 1.3, .5, 1);
}
.card:has(a[href$="programs/closing-the-loop.html"]):hover::before { --loop: 360deg; rotate: 70deg; }
html:has(link[rel="canonical"][href$="/programs/closing-the-loop.html"]) .page-intro::before { animation: g-loop 1.3s cubic-bezier(.3, 1.3, .5, 1) .5s both; }
@keyframes g-loop { from { --loop: 290deg; rotate: -20deg; } to { --loop: 360deg; rotate: 70deg; } }

/* Growth rings */
.card:has(a[href$="programs/getting-on.html"])::before,
html:has(link[rel="canonical"][href$="/programs/getting-on.html"]) .page-intro::before {
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 46% 54%, var(--d-mint) 0 2px, transparent 3px var(--ring));
  transition: --ring .8s cubic-bezier(.3, 1.3, .5, 1);
}
.card:has(a[href$="programs/getting-on.html"]):hover::before { --ring: 13px; }
html:has(link[rel="canonical"][href$="/programs/getting-on.html"]) .page-intro::before { animation: g-rings 1.2s cubic-bezier(.3, 1.3, .5, 1) .5s both; }
@keyframes g-rings { from { --ring: 9px; } to { --ring: 13px; } }

/* Six layers: three hard (deep), three soft (light) */
.card:has(a[href$="programs/sand-to-software.html"])::before,
html:has(link[rel="canonical"][href$="/programs/sand-to-software.html"]) .page-intro::before {
  top: calc(var(--gtop) + var(--u) * 5.2); height: calc(var(--u) * .8); border-radius: 6px;
  background: var(--d-lilac);
  box-shadow:
    0 calc(var(--u) * -1) 0 var(--d-lilac), 0 calc(var(--u) * -2) 0 var(--d-lilac),
    0 calc(var(--u) * -3) 0 #a491ec, 0 calc(var(--u) * -4) 0 #a491ec, 0 calc(var(--u) * -5) 0 #a491ec;
  transition: box-shadow .6s cubic-bezier(.3, 1.4, .5, 1);
}
.card:has(a[href$="programs/sand-to-software.html"]):hover::before {
  box-shadow:
    0 calc(var(--u) * -1.05) 0 var(--d-lilac), 0 calc(var(--u) * -2.1) 0 var(--d-lilac),
    0 calc(var(--u) * -3.65) 0 #a491ec, 0 calc(var(--u) * -4.7) 0 #a491ec, 0 calc(var(--u) * -5.75) 0 #a491ec;
}
html:has(link[rel="canonical"][href$="/programs/sand-to-software.html"]) .page-intro::before { animation: g-layers .9s cubic-bezier(.3, 1.4, .5, 1) .5s both; }
@keyframes g-layers {
  to {
    box-shadow:
      0 calc(var(--u) * -1.05) 0 var(--d-lilac), 0 calc(var(--u) * -2.1) 0 var(--d-lilac),
      0 calc(var(--u) * -3.65) 0 #a491ec, 0 calc(var(--u) * -4.7) 0 #a491ec, 0 calc(var(--u) * -5.75) 0 #a491ec;
  }
}

/* A cairn keeping its balance */
.card:has(a[href$="programs/founders-zen.html"])::before,
html:has(link[rel="canonical"][href$="/programs/founders-zen.html"]) .page-intro::before {
  transform-origin: 50% 100%;
  background:
    radial-gradient(36% 13% at 50% 86%, var(--d-peach) 97%, transparent 100%),
    radial-gradient(27% 11% at 50% 62%, #f0896a 97%, transparent 100%),
    radial-gradient(18% 9% at 50% 42%, #f6ad92 97%, transparent 100%);
}
.card:has(a[href$="programs/founders-zen.html"]):hover::before { animation: g-sway 1.8s ease-in-out infinite; }
html:has(link[rel="canonical"][href$="/programs/founders-zen.html"]) .page-intro::before { animation: g-sway 1.8s ease-in-out .5s 2; }
@keyframes g-sway { 0%, 100% { rotate: 0deg; } 25% { rotate: 4deg; } 75% { rotate: -4deg; } }

/* Confetti */
.card:has(a[href$="programs/more.html"])::before,
html:has(link[rel="canonical"][href$="/programs/more.html"]) .page-intro::before {
  width: calc(var(--u) * 6.8); height: calc(var(--u) * 3);
  background:
    radial-gradient(circle, var(--d-sky) 0 5px, transparent 6px) 0 calc(var(--u) * .3) / calc(var(--u) * 1.7) calc(var(--u) * 1.4),
    radial-gradient(circle, var(--sun) 0 5px, transparent 6px) calc(var(--u) * .85) calc(var(--u) * 1.7) / calc(var(--u) * 1.7) calc(var(--u) * 1.4),
    radial-gradient(circle, var(--d-peach) 0 4px, transparent 5px) calc(var(--u) * .5) calc(var(--u) * .4) / calc(var(--u) * 2.2) calc(var(--u) * 2);
  transition: background-position .6s var(--spring);
}
.card:has(a[href$="programs/more.html"])::before { top: 50%; right: 5rem; translate: 0 -50%; }
.card:has(a[href$="programs/more.html"]):hover::before { background-position: calc(var(--u) * .45) calc(var(--u) * .3), calc(var(--u) * .4) calc(var(--u) * 1.7), calc(var(--u) * 1.05) calc(var(--u) * .4); }
html:has(link[rel="canonical"][href$="/programs/more.html"]) .page-intro::before { animation: g-confetti 1s var(--spring) .5s both; }
@keyframes g-confetti { to { background-position: calc(var(--u) * .45) calc(var(--u) * .3), calc(var(--u) * .4) calc(var(--u) * 1.7), calc(var(--u) * 1.05) calc(var(--u) * .4); } }

/* Glyph sizes inside homepage tiles (the water scales with its tile; the layers sit low in their cell) */
.card:has(a[href$="programs/watershed.html"])::before { width: min(calc(var(--u) * 20), 45cqi); }
.card-grid:not(.talk-grid) > .card:has(a[href$="programs/sand-to-software.html"])::before { margin-top: calc(var(--u) * 5.75 - .35rem); }

/* 7. Inner pages ------------------------------------------------------------ */

/* Intro panel: white, or the talk's tint on program pages */
.page-intro {
  position: relative;
  padding: clamp(1.75rem, 4.5vw, 3.25rem);
  border-radius: var(--r-lg);
  background: var(--topic);
  box-shadow: var(--sheet-shadow);
}
.page-intro > * + * { margin-top: 1rem; }
.page-intro > h1 + * { margin-top: clamp(1.25rem, 2.5vw, 2rem); }
.page-intro h1 { max-width: 18ch; font-size: clamp(2.8rem, 7vw, 6rem); font-weight: 800; line-height: .92; letter-spacing: -.055em; }
.essay-page .page-intro h1::after { display: none; }
.page-intro > .button { justify-self: start; }
.page-intro > p:not(.eyebrow, .lede) { max-width: 68ch; }
html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro > .eyebrow { padding-right: 9rem; }

/* Quotes: white cards with a large mark in the talk's colour */
.featured-quote { position: relative; padding: 1.5rem 1.75rem 1.5rem; border-radius: var(--r-md); background: var(--white); box-shadow: var(--tile-shadow); }
.featured-quote::before { content: "\201C"; display: block; height: .5em; margin-bottom: .1em; font-family: var(--display); font-size: 4.2rem; font-weight: 800; line-height: 1; color: var(--topic-deep); }
.featured-quote > * + * { margin-top: .85rem; }
.featured-quote p { font-size: 1.1rem; line-height: 1.5; }
.featured-quote .quote-attribution { font-size: .9rem; font-weight: 600; color: var(--muted); }
.featured-quote cite { font-style: normal; }
.testimonial-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; align-items: start; }
:where(.site-main section) > .featured-quote + .featured-quote { margin-top: 1rem; }

/* Talk pages (program pages with a quote in the intro): intro across the top, then a bento of tiles */
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > * { margin-top: 0; }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > :is(.page-intro, .program-video) { grid-column: 1 / -1; }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 25rem); column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start; box-shadow: none;
}
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro > * { grid-column: 1; }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro > .featured-quote { grid-column: 2; grid-row: 3 / span 6; margin-top: 0; }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > section > h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > section > h2::before {
  content: ""; display: inline-block; width: .42em; height: .42em; margin-right: .45em; vertical-align: .08em; border-radius: 50%; background: var(--topic-deep);
}
/* Wide screens: the glyph takes its own cell beside the title, so the quote always starts below it */
@media (min-width: 60.0625rem) {
  .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro::before { position: static; grid-column: 2; grid-row: 2; justify-self: end; align-self: start; margin-bottom: 1.5rem; }
  .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro > .eyebrow { padding-right: 0; }
  html:has(link[rel="canonical"][href$="/programs/watershed.html"]) .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro::before { width: 100%; }
  html:has(link[rel="canonical"][href$="/programs/sand-to-software.html"]) .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro::before { margin-top: calc(var(--u) * 5.75); }
}
/* CES: the talk-page bento without a quote. The intro runs across the top, then four tiles. */
.ces-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ces-page > * { margin-top: 0; }
.ces-page > .page-intro { grid-column: 1 / -1; }
.ces-page > section > h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.ces-page > section > h2::before {
  content: ""; display: inline-block; width: .42em; height: .42em; margin-right: .45em; vertical-align: .08em; border-radius: 50%; background: var(--topic-deep);
}
.ces-page > .ces-join { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem 2rem; background: var(--t-butter); box-shadow: none; }
.ces-page > .ces-join > * + * { margin-top: 0; }
.ces-page > .ces-join > .button { grid-column: 2; grid-row: 1 / span 2; }
.program-details > * + * { margin-top: 1em; }
.program-details { font-size: 1.05rem; }
.program-video .video-embed { border-radius: var(--r-lg); }

/* Catalogue (More): category chips, and each category's talks in its own tint */
.category-nav ul { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.category-nav li + li { margin-top: 0; }
.category-nav a {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: 0 1.1rem;
  border-radius: 999px; background: var(--white); box-shadow: var(--tile-shadow);
  font-size: .95rem; font-weight: 600; text-decoration: none;
  transition: background .25s, transform .4s var(--spring);
}
.category-nav a::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--deep, var(--d-stone)); }
.category-nav a:hover { color: var(--ink); background: var(--tint, var(--t-stone)); transform: translateY(-2px); }
:is(#artificial-intelligence, .category-nav a[href="#artificial-intelligence"]) { --tint: var(--t-sky);    --deep: var(--d-sky); }
:is(#education, .category-nav a[href="#education"])                             { --tint: var(--t-butter); --deep: var(--d-butter); }
:is(#innovation, .category-nav a[href="#innovation"])                           { --tint: var(--t-mint);   --deep: var(--d-mint); }
:is(#leadership, .category-nav a[href="#leadership"])                           { --tint: var(--t-lilac);  --deep: var(--d-lilac); }
:is(#finance, .category-nav a[href="#finance"])                                 { --tint: var(--t-peach);  --deep: var(--d-peach); }
:is(#futures, .category-nav a[href="#futures"])                                 { --tint: var(--t-rose);   --deep: var(--d-rose); }
:is(#lifestyle-leisure, .category-nav a[href="#lifestyle-leisure"])             { --tint: var(--t-teal);   --deep: var(--d-teal); }
:is(#moderator-facilitator, .category-nav a[href="#moderator-facilitator"])     { --tint: var(--t-stone);  --deep: var(--d-stone); }
:is(#testimonials, .category-nav a[href="#testimonials"])                       { --tint: var(--t-butter); --deep: var(--d-butter); }
.catalogue-page .section-heading h2 { display: flex; align-items: center; gap: .5rem; }
.catalogue-page .section-heading h2::before { content: ""; flex: none; width: .42em; height: .42em; border-radius: 50%; background: var(--deep, var(--d-stone)); }
.category-summary { max-width: 52ch; color: var(--muted); font-size: 1.05rem; }
.talk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.talk-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem 1.5rem 1.6rem; border-radius: var(--r-md); background: var(--tint, var(--white)); }
.talk-card h3 { font-size: 1.22rem; line-height: 1.15; }
.talk-card p { color: var(--muted); font-size: .98rem; line-height: 1.5; }
.catalogue-page > .button { justify-self: start; }

/* Books: the newest book is featured; covers sit at a slight angle and straighten on hover */
.book-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.book-item {
  position: relative; display: grid; grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem); align-items: center; padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: var(--r-lg); background: var(--white); box-shadow: var(--tile-shadow);
  transition: transform .45s var(--spring), box-shadow .4s;
}
.book-item:first-child { grid-column: 1 / -1; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); background: var(--t-butter); box-shadow: none; }
.book-cover, .book-detail-cover, .standalone-book-cover { position: relative; margin: 0; rotate: -2.5deg; transition: rotate .5s var(--spring), translate .5s var(--spring); }
.book-item:nth-child(even) .book-cover { rotate: 2deg; }
.book-cover img, .book-detail-cover img, .standalone-book-cover img {
  display: block; width: 100%; height: auto; border-radius: 3px 8px 8px 3px;
  box-shadow: 0 2px 4px rgba(21, 28, 43, .14), 0 22px 30px -16px rgba(21, 28, 43, .55);
}
.book-cover::after, .book-detail-cover::after, .standalone-book-cover::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .28), rgba(0, 0, 0, .1));
}
.book-item:hover .book-cover, .book-detail-intro:hover .book-detail-cover { rotate: 0deg; translate: 0 -6px; }
.book-info > * + * { margin-top: .6rem; }
.book-info .eyebrow { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: var(--t-stone); color: var(--ink); }
.book-item:first-child .book-info .eyebrow { background: var(--white); }
.book-info h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.1; }
.book-item:first-child .book-info h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.book-info h2 a { text-decoration: none; }
.book-info h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.book-item:has(h2 a)::after { content: "↗"; position: absolute; top: 1.25rem; right: 1.4rem; color: var(--cobalt); font-weight: 600; transition: translate .4s var(--spring); }
.book-item:has(h2 a):hover { transform: translateY(-4px); box-shadow: var(--tile-shadow), var(--lift-shadow); }
.book-item:has(h2 a):hover::after { translate: 4px -4px; }
.book-item:has(h2 a):hover h2 a { color: var(--ink); }
.book-precis { max-width: 52ch; color: var(--muted); font-size: 1.02rem; }
.book-detail-intro { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.book-detail-intro > div > * + * { margin-top: 1em; }
.book-detail-intro h2 { margin-top: 0; }
.book-detail-intro .book-detail-actions { margin-top: 1.5rem; }
.standalone-book-cover { width: min(100%, 22rem); margin-block: 1.5rem; }

/* Papers and reviews */
.paper-list { display: grid; gap: .75rem; }
.paper-item { position: relative; padding: 1.4rem 4rem 1.45rem 1.6rem; border-radius: var(--r-md); background: var(--white); box-shadow: var(--tile-shadow); transition: background .35s, transform .45s var(--spring); }
.paper-item h3 { max-width: 40ch; font-size: clamp(1.12rem, 2vw, 1.4rem); line-height: 1.2; }
.paper-item h3 a { text-decoration: none; }
.paper-item h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.paper-precis { margin-top: .5rem; color: var(--muted); }
.paper-item:has(h3 a)::before { content: "↗"; position: absolute; top: 1.35rem; right: 1.4rem; color: var(--cobalt); font-weight: 600; transition: translate .4s var(--spring); }
.paper-item:has(h3 a):hover { background: var(--t-sky); transform: translateY(-3px); }
.paper-item:has(h3 a):hover::before { translate: 4px -4px; }
.paper-item:has(h3 a):hover h3 a { color: var(--ink); }

/* Video and audio */
.video-embed { position: relative; overflow: hidden; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.watch-item, .media-appearance-item { min-width: 0; padding: .6rem .6rem 1.2rem; border-radius: var(--r-md); background: var(--white); box-shadow: var(--tile-shadow); }
.watch-item > :is(h2, h3), .media-appearance-item > :not(.video-embed, .audio-embed) { padding-inline: .6rem; }
.watch-item > :is(h2, h3) { margin-top: .9rem; font-size: 1.08rem; line-height: 1.3; letter-spacing: -.02em; }
.watch-youtube-link { margin-top: 2rem; }
.media-appearances-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.media-appearance-item > * + * { margin-top: .6rem; }
.media-appearance-item h2 { margin-top: .9rem; font-size: 1.22rem; line-height: 1.2; letter-spacing: -.02em; }
.media-appearance-item p { color: var(--muted); font-size: .98rem; }
.media-appearance-item:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 1.5rem; align-content: start; padding: .6rem; }
.media-appearance-item:last-child:nth-child(odd) > :is(.video-embed, .audio-embed) { grid-row: 1 / span 6; }
.media-appearance-item:last-child:nth-child(odd) > :not(.video-embed, .audio-embed) { grid-column: 2; padding-inline: 0; }
.audio-embed {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  width: 100%; max-width: 100%; aspect-ratio: 16 / 9; padding: clamp(1rem, 3vw, 1.75rem);
  border-radius: 18px; background: linear-gradient(135deg, var(--ink), #2b3350); color: #fff;
}
.audio-embed-heading p { margin: 0 0 .3rem; color: var(--sun); font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.audio-embed-heading strong { display: block; font-family: var(--display); font-size: clamp(1.5rem, 3.4vw, 2.5rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.audio-embed iframe { flex: 0 0 100px; display: block; width: 100%; height: 100px; border: 0; border-radius: 12px; }

/* About: the portrait as a taped polaroid on a warm sheet, and the career timeline */
.bio-intro { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3rem); align-items: start; background: var(--t-butter); box-shadow: none; }
.bio-intro > div > * + * { margin-top: 1em; }
.bio-photo, .historical-figure, .labyrinth-page > figure {
  position: relative; padding: .6rem .6rem 1rem; border-radius: 6px; background: var(--white);
  box-shadow: 0 1px 2px rgba(21, 28, 43, .12), 0 18px 30px -18px rgba(21, 28, 43, .45);
}
.bio-photo { max-width: 25rem; rotate: -2.5deg; }
.bio-photo img, .historical-figure img, .labyrinth-page > figure img { display: block; width: 100%; height: auto; border-radius: 2px; }
.historical-figure figcaption, .labyrinth-page > figure figcaption { margin-top: .7rem; padding-inline: .2rem; }
.timeline { position: relative; margin: 0; padding: 0 0 0 2rem; list-style: none; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: 1.2rem; bottom: 1.2rem; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--d-sky), var(--d-lilac) 35%, var(--d-peach) 70%, var(--sun)); }
.timeline li { --dot: var(--d-sky); position: relative; max-width: none; padding-block: .85rem; }
.timeline li + li { margin-top: 0; }
.timeline li:nth-child(4n+2) { --dot: var(--d-lilac); }
.timeline li:nth-child(4n+3) { --dot: var(--d-peach); }
.timeline li:nth-child(4n+4) { --dot: var(--sun); }
.timeline li::before { content: ""; position: absolute; left: calc(-2rem + .45rem + 1px - .475rem); top: 1.3rem; width: .95rem; height: .95rem; border-radius: 50%; background: var(--white); border: 3px solid var(--dot); }
.timeline li > * + * { margin-top: .75em; }
.timeline li > p:first-child > strong:first-child { display: block; margin-bottom: .2rem; font-family: var(--display); font-size: 1.45rem; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }

/* Essays, archives and one-off pages */
.historical-figure { width: min(100%, 17rem); rotate: 2.5deg; }
.labyrinth-page > figure { width: fit-content; max-width: 100%; margin-inline: auto; rotate: -1.5deg; }
.labyrinth-page section figure { max-width: 100%; }
.labyrinth-page section figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--tile-shadow); }
.download-details { color: var(--muted); font-size: .88rem; }
.feature-figure { margin: 0; }
.feature-image { display: block; width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--sheet-shadow); }
.ces-showfloor img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.syntheverse-video-precis { max-width: 68ch; font-size: 1.05rem; }

/* Contact: two doors in two colours */
.site-main > .split > section { padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--r-lg); background: var(--t-butter); }
.site-main > .split > section + section { background: var(--t-sky); }
.site-main > .split > section > * + * { margin-top: .9em; }

/* 8. Responsive ------------------------------------------------------------- */

/* One-row header only when the whole menu fits */
@media (min-width: 72rem) {
  .header-inner { grid-template-columns: auto 1fr auto; border-radius: 999px; }
  .site-nav { grid-column: 2; grid-row: 1; justify-self: center; }
  .book-button { grid-column: 3; }
}
@media (min-width: 58rem) {
  /* The essay's photo is pinned onto the corner of its intro panel */
  .essay-page > .historical-figure { position: relative; z-index: 1; margin: -4.5rem 2.5rem 0 auto; }
}
@media (max-width: 60rem) {
  .card-grid:not(.talk-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid:not(.talk-grid) > .card { grid-column: span 1; }
  .card-grid:not(.talk-grid) > .card:first-child { grid-column: 1 / -1; }
  .card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"]) { padding-right: 4.5rem; }
  .card-grid:not(.talk-grid) > .card:has(a[href$="programs/more.html"])::before { display: none; }
  .innovation-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1.25rem .5rem 1.5rem; }
  .innovation-item { flex: 0 0 min(62vw, 14rem); scroll-snap-align: start; }
  .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro { grid-template-columns: minmax(0, 1fr); }
  .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) > .page-intro > .featured-quote { grid-column: 1; grid-row: auto; margin-top: 1.5rem; }
  /* Narrower screens: the glyph gets its own row above the title */
  html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro { padding-top: calc(var(--gtop) + var(--u) * 7.25); }
  html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro > .eyebrow { padding-right: 0; }
}
@media (max-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .hero::before { display: none; }
  .hero h1 { grid-column: 1; grid-row: auto; padding-inline: .25rem; }
  .homepage-hero-image, .hero .lede, .hero .actions { grid-column: 1; grid-row: auto; }
  .homepage-hero-image { order: -1; margin-bottom: 1rem; }
  .homepage-hero-image img { height: auto; aspect-ratio: 4 / 3; object-position: 100% 20%; }
  .program-page:not(.catalogue-page):has(> .page-intro > .featured-quote) { grid-template-columns: minmax(0, 1fr); }
  .ces-page { grid-template-columns: minmax(0, 1fr); }
  .ces-page > .ces-join { grid-template-columns: minmax(0, 1fr); }
  .ces-page > .ces-join > .button { grid-column: 1; grid-row: auto; justify-self: start; margin-top: .5rem; }
  .book-list, .watch-grid, .media-appearances-list { grid-template-columns: minmax(0, 1fr); }
  .book-item, .book-item:first-child { grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr); align-items: start; }
  .media-appearance-item:last-child:nth-child(odd) { display: block; padding: .6rem .6rem 1.2rem; }
  .media-appearance-item:last-child:nth-child(odd) > :not(.video-embed, .audio-embed) { padding-inline: .6rem; }
  .bio-intro, .book-detail-intro { grid-template-columns: minmax(0, 1fr); }
  .bio-photo { width: min(100%, 16rem); }
  .book-detail-cover { width: min(100%, 12rem); }
  .historical-figure { margin-inline: auto; }
  .site-main > .split { grid-template-columns: minmax(0, 1fr); }
  html:has(link[rel="canonical"][href*="/programs/"]) .program-page > .page-intro { --u: .85rem; }
  .site-nav { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
}
@media (max-width: 36rem) {
  .card-grid:not(.talk-grid) { grid-template-columns: minmax(0, 1fr); }
  .audio-embed { aspect-ratio: auto; min-height: 12rem; }
}

/* 9. Reduced motion --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
