/* Shared by the homepage, docs and privacy policy. Pollen Robotics' main
   website informs the cool gray palette, system typography and orange pills. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --dim: #636368;
  --line: #d2d2d7;
  --accent: #925200;
  --accent-fill: #ff9500;
  --on-fill: #1d1d1f;
  --brand: #ff9500;
  --focus: #925200;
  --good: #286340;
  --warn: #925200;
  --tint: #fff3df;
  --soft-line: #e8e8ed;
  --header: rgba(245, 245, 247, .96);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101018;
    --card: #1c1c28;
    --ink: #f5f5f7;
    --dim: #b0b0ba;
    --line: #41414d;
    --accent: #ffb340;
    --focus: #ffb340;
    --good: #89d8a5;
    --warn: #ffb340;
    --tint: #30251c;
    --soft-line: #30303c;
    --header: rgba(16, 16, 24, .96);
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 7rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible, pre:focus-visible, .scroller:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
  border-radius: 3px;
}
p { margin: 0 0 1rem; }
li { margin: .4rem 0; }
ul, ol { padding-left: 1.3rem; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 0 0 1.25rem; }
h2 { font-size: clamp(1.9rem, 3.5vw, 3rem); margin: 0 0 1.25rem; }
h3 { font-size: 1.25rem; margin: 0 0 .75rem; }
.wrap { width: min(100% - 3rem, 1100px); margin-inline: auto; }
.skip {
  position: fixed;
  left: 1rem;
  top: -6rem;
  z-index: 100;
  background: var(--card);
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.skip:focus { top: 1rem; }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--header); border-bottom: 1px solid var(--soft-line); }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand small { display: block; color: var(--dim); font-size: .68rem; font-weight: 400; letter-spacing: 0; margin-top: .2rem; }
.site-nav { display: flex; align-items: center; gap: 1.8rem; }
.site-nav a { color: var(--dim); text-decoration: none; font-size: .86rem; padding-block: .75rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: .65rem; }
.site-nav .nav-source { border: 1px solid var(--line); padding: .4rem 1rem; border-radius: 999px; color: var(--ink); }
.hero { padding: 76px 0 62px; text-align: center; }
.hero .product-name { color: var(--dim); font-size: 1rem; margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2.65rem, 6.6vw, 5rem); line-height: 1.05; letter-spacing: -.035em; }
.hero .lede { max-width: 42ch; margin: 0 auto 1.4rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.45; color: var(--dim); text-wrap: pretty; }
.facts { list-style: none; padding: 0; display: flex; justify-content: center; gap: .4rem 1.25rem; flex-wrap: wrap; margin: 0 auto 1.6rem; color: var(--dim); font-size: .8rem; }
.facts li { margin: 0; }
.facts li::before { content: ""; display: inline-block; width: 5px; height: 5px; background: var(--brand); border-radius: 50%; margin: 0 .45rem .12rem 0; }
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.hero .ctas { justify-content: center; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .7rem 1.45rem; color: var(--on-fill); background: var(--accent-fill); border: 1px solid var(--accent-fill); border-radius: 999px; text-decoration: none; font-size: .98rem; line-height: 1.25; font-weight: 550; transition: background-color .15s ease; }
.cta:hover { background: #ffb340; border-color: #ffb340; }
.cta.secondary { background: transparent; color: var(--accent); border-color: var(--brand); }
.cta.secondary:hover { background: var(--tint); }
.hair, .meta, .updated { font-size: .85rem; color: var(--dim); }
.hero .hair { max-width: 45ch; margin: 1rem auto 0; font-size: .75rem; }
.studio-feature { display: grid; grid-template-columns: .9fr 1.1fr; background: var(--card); border-radius: 24px; overflow: hidden; }
.studio-art { margin: 0; position: relative; background: #7ac9cb; }
.studio-art img { width: 100%; height: 100%; object-fit: cover; }
.studio-art figcaption { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #ffffffed; color: #1d1d1f; font-size: .72rem; padding: .3rem .75rem; border-radius: 999px; }
.studio-feature-copy { padding: clamp(2rem, 4vw, 3.5rem); align-self: center; }
.studio-feature-copy h2 { max-width: 17ch; }
.studio-feature-copy p { color: var(--dim); max-width: 39ch; }
.text-link { font-weight: 550; }
.text-link span { display: inline-block; margin-left: .3rem; font-size: 1.2em; }
.section { padding-top: 88px; }
.section-heading { max-width: 43rem; margin-bottom: 2rem; }
.section-heading p { color: var(--dim); font-size: 1.1rem; max-width: 52ch; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--soft-line); border-radius: 18px; padding: 1.5rem; }
.feature-grid .card { padding: 1.8rem; }
.feature-grid h3 { font-size: 1.3rem; margin-bottom: .9rem; }
.feature-grid p { color: var(--dim); font-size: .94rem; margin: 0; }
.feature-grid .card:first-child { border-top: 3px solid var(--brand); }
/* The training chooser: four machines, two by two, in a guide's column, none of them singled out. */
.feature-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 1.5rem 0; }
.feature-grid.two-up .card:first-child { border-top: 1px solid var(--soft-line); }
.feature-grid .card h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
.note { margin: 1.75rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--brand); color: var(--dim); background: var(--tint); border-radius: 0 12px 12px 0; font-size: .9rem; }
.note p { margin: 0; }
.note strong { color: var(--ink); }
.docs-hub { display: grid; grid-template-columns: 1fr 1.15fr; gap: 3.5rem; background: var(--card); border-radius: 24px; padding: 3rem; }
.docs-hub h2 { font-size: clamp(2rem, 3.2vw, 2.8rem); }
.docs-hub .intro { color: var(--dim); max-width: 32ch; margin-bottom: 1.5rem; }
.guide-links { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 2rem; align-content: start; }
.guide-links a { display: flex; flex-direction: column; padding: 1rem 0; border-bottom: 1px solid var(--soft-line); color: var(--ink); text-decoration: none; }
.guide-links a:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.guide-links strong { font-size: .95rem; font-weight: 600; }
.guide-links span { color: var(--dim); font-size: .82rem; margin-top: .3rem; }
.download-section { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding-bottom: 80px; }
.download-section h2 { max-width: 13ch; }
.download-section p { color: var(--dim); max-width: 38ch; }
.download-links { list-style: none; padding: 0; margin: 0; }
.download-links li { margin: 0; border-bottom: 1px solid var(--line); }
.download-links a { display: flex; align-items: center; justify-content: space-between; padding: .9rem 0; text-decoration: none; color: var(--ink); font-weight: 550; gap: 1rem; }
.download-links a:hover { color: var(--accent); }
.download-links span { color: var(--dim); font-size: .8rem; font-weight: 400; text-align: right; }
.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; }
.footer-title { font-size: 1rem; font-weight: 600; color: var(--ink); }
.footer-copy { color: var(--dim); font-size: .8rem; }
.footer-copy p { max-width: 78ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .8rem; }
.footer-links a { color: var(--dim); }

/* Documentation: the same visual language, with a persistent reading index. */
.docs-layout { width: min(100% - 3rem, 1100px); margin: 0 auto; display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 4rem; padding: 3.5rem 0 5rem; }
.docs-sidebar { position: sticky; top: 7.2rem; align-self: start; max-height: calc(100dvh - 8.5rem); overflow-y: auto; padding: .5rem .5rem 1rem 0; }
.docs-sidebar nav { display: flex; flex-direction: column; }
.docs-mobile-nav { display: none; }
.docs-mobile-nav summary { cursor: pointer; color: var(--ink); font-weight: 550; font-size: .9rem; padding: .65rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.docs-mobile-nav[open] summary { margin-bottom: .8rem; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a { display: block; padding: .5rem .75rem; border-radius: 8px; text-decoration: none; color: var(--dim); font-size: .87rem; line-height: 1.5; }
.docs-sidebar a:hover, .docs-sidebar a:focus-visible { color: var(--ink); background: var(--tint); }
.docs-sidebar .sidebar-label { color: var(--ink); font-weight: 600; font-size: .8rem; margin: 1.4rem 0 .45rem .75rem; }
.docs-sidebar .sidebar-label:first-child { margin-top: 0; }
.docs-content { min-width: 0; max-width: 790px; }
.docs-intro { padding-bottom: 1.8rem; border-bottom: 1px solid var(--line); margin-bottom: 2.5rem; }
.eyebrow { color: var(--accent); font-size: .9rem; margin-bottom: .8rem; }
.docs-content h1 { font-size: clamp(2.5rem, 4.5vw, 3.5rem); max-width: 14ch; }
.docs-content .lede { color: var(--dim); font-size: 1.15rem; max-width: 55ch; }
.docs-content h2 { font-size: 1.8rem; margin: 3.5rem 0 1.25rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.docs-intro + h2 { margin-top: 2rem; padding-top: 0; border-top: 0; }
.docs-content h3 { font-size: 1.1rem; margin: 1.8rem 0 .65rem; }
.docs-content p, .docs-content li, .docs-content dd { max-width: 75ch; }
.docs-content .standfirst { font-size: 1.1rem; }
.guide-steps { padding-left: 1.5rem; }
.guide-steps > li { padding: .4rem 0 .4rem .35rem; }
.guide-steps > li::marker { color: var(--accent); font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; margin: 1.25rem 0; }
.grid h3 { margin-top: 0; }
.grid p { font-size: .93rem; }
.grid .card a { overflow-wrap: anywhere; }
.quote { margin: 1rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--brand); }
.quote p { margin: 0; color: var(--dim); }
.spec { margin: 1.5rem 0; }
.spec dt { color: var(--accent); font-weight: 600; margin-top: 1rem; }
.spec dd { margin: .3rem 0 1rem; }
code, kbd { font: .86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--soft-line); padding: .13em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; overflow-x: auto; font-size: .88rem; line-height: 1.65; }
pre code { background: none; padding: 0; overflow-wrap: normal; }
.scroller { overflow-x: auto; margin: 1.5rem 0; }
.scroller table { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
caption { text-align: left; color: var(--dim); font-size: .85rem; padding-bottom: .75rem; }
th, td { text-align: left; padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--dim); }
td code { white-space: normal; }
.docs-content > p a, .docs-content dd a, .docs-content li a { overflow-wrap: anywhere; }
.docs-content :target { scroll-margin-top: 1rem; }

/* The established privacy URL and its text stay readable in the shared theme. */
.privacy-wrap { width: min(100% - 3rem, 760px); margin-inline: auto; padding: 4rem 0; }
.privacy-header { padding-bottom: 1rem; }
.privacy-header .lede { font-size: 1.15rem; color: var(--dim); }
.privacy-wrap h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.privacy-wrap h3 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }
.headline { background: var(--card); border: 1px solid var(--soft-line); border-radius: 18px; padding: 1.5rem; margin: 1rem 0 2rem; }
.headline p { margin: 0; }
.headline strong { color: var(--good); }
.privacy-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.5rem; color: var(--dim); font-size: .87rem; }

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-hub { gap: 2rem; padding: 2rem; }
  .docs-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 2rem; }
  .studio-feature-copy { padding: 2rem; }
  .footer-inner { grid-template-columns: 1fr 2fr; gap: 2rem; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 8rem; }
  .wrap, .docs-layout, .privacy-wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: auto; gap: .6rem; flex-wrap: wrap; padding-block: .7rem .25rem; }
  .brand { font-size: .93rem; }
  .brand img { width: 32px; height: 32px; }
  .brand small { font-size: .65rem; }
  .site-nav { gap: .8rem; width: 100%; justify-content: space-between; }
  .site-nav a { font-size: .78rem; padding-block: .55rem; }
  .site-nav .nav-source { padding: .2rem .8rem; }
  .hero { padding: 35px 0 38px; }
  .hero .product-name { font-size: .85rem; margin-bottom: .8rem; }
  .hero h1 { font-size: clamp(2.2rem, 9.5vw, 3.5rem); margin-bottom: 1rem; }
  .hero .lede { font-size: 1.05rem; max-width: 32ch; margin-bottom: 1.1rem; }
  .facts { max-width: 350px; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .5rem; margin-bottom: 1.25rem; font-size: .7rem; }
  .facts li { text-wrap: balance; }
  .cta { font-size: .86rem; padding: .7rem 1.15rem; }
  .hero .hair { font-size: .7rem; max-width: 42ch; }
  .studio-feature { grid-template-columns: 1fr; border-radius: 20px; }
  .studio-art { max-height: 360px; }
  .studio-art img { object-position: center 38%; }
  .studio-feature-copy { padding: 2rem; }
  .studio-feature-copy h2 { max-width: 16ch; font-size: 2rem; }
  .section { padding-top: 3.5rem; }
  .feature-grid, .feature-grid.two-up { grid-template-columns: 1fr; gap: .75rem; }
  .feature-grid .card { padding: 1.5rem; }
  .feature-grid h3 { font-size: 1.2rem; }
  .docs-hub { grid-template-columns: 1fr; padding: 1.5rem; gap: 1.25rem; }
  .docs-hub h2 { max-width: 16ch; font-size: 2rem; }
  .guide-links { gap: 0 1rem; }
  .guide-links strong { font-size: .85rem; }
  .guide-links span { font-size: .77rem; }
  .download-section { grid-template-columns: 1fr; gap: 1.5rem; padding-bottom: 3.5rem; }
  .footer-inner { grid-template-columns: 1fr; gap: .6rem; }
  .site-footer { padding-block: 2rem; }
  .docs-layout { display: block; padding-top: 1.5rem; }
  .docs-sidebar { position: static; max-height: none; padding: 0 0 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
  .docs-sidebar nav { display: block; }
  .docs-sidebar .docs-desktop-nav { display: none; }
  .docs-mobile-nav { display: block; }
  .docs-sidebar ul { display: flex; flex-wrap: wrap; gap: .35rem; }
  .docs-sidebar nav > a, .docs-sidebar li { display: inline-block; }
  .docs-sidebar a { background: var(--card); border: 1px solid var(--soft-line); font-size: .77rem; padding: .45rem .7rem; }
  .docs-sidebar .sidebar-label { margin: 1rem 0 .55rem; }
  .docs-intro { padding-bottom: 1rem; }
  .docs-content h1 { font-size: 2.5rem; }
  .docs-content h2 { font-size: 1.65rem; margin-top: 2.5rem; }
  .docs-content .lede { font-size: 1.05rem; }
  .privacy-wrap { padding-top: 2.5rem; }
}
/* Between a phone and a laptop the header is still one row: brand and seven links
   ran past the edge from 641px (by 103px there; by 41px with six links before). */
@media (min-width: 641px) and (max-width: 900px) {
  .header-inner { gap: 1rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: .8rem; }
  .site-nav .nav-source { padding: .35rem .8rem; }
}
/* The tight nav up to 420px, not 380px: with seven links (Train joined in October 2026)
   the 640px spacing ran 21px past a 390px phone's edge. */
@media (max-width: 420px) {
  .site-nav { gap: .5rem; }
  .site-nav a { font-size: .72rem; }
  .site-nav .nav-source { padding: .2rem .6rem; }
}
/* On the narrowest phones seven links do not fit one row at a legible size: they wrap. */
@media (max-width: 359px) {
  .site-nav { flex-wrap: wrap; justify-content: flex-start; column-gap: .75rem; row-gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --card: #fff; --ink: #000; --dim: #333; --line: #aaa; --accent: #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .docs-sidebar, .skip, .ctas, .studio-art { display: none; }
  .wrap, .docs-layout, .privacy-wrap { width: 100%; }
  .docs-layout { display: block; padding: 0; }
  .docs-content { max-width: none; }
  .hero { padding: 1rem 0; }
  .section { padding-top: 2rem; }
  .card, .note, pre { break-inside: avoid; }
  .studio-feature { display: block; }
}

/* Duck Cards, at /cards/. A card is paper in both themes: it keeps its white
   ground and its category colours in dark mode, the way a card on a dark table
   would. One component serves the hero row, the gallery, the homepage and the
   cut sheet: every size inside a card is a share of the card's own width
   (container query units), and printed it is a playing card, 63.5 by 88.9 mm.
   Fine print has a floor in pixels, so a card drawn small on a screen stays
   readable; on paper the share is always the larger of the two.

   The cards set their names in Fredoka, served from this site (OFL 1.1, see
   /assets/fonts/OFL-Fredoka.txt). It is the one face on the site that is not
   the system's: the pages are the app's, the cards are a toy's. */
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --dc-face: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --dc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dc-paper: #ffffff;
  --dc-ink: #1d1d1f;
  --dc-dim: #5c5c64;
  --dc-rule: #c7c7cf;
  --dc-walk: #2a64c9;
  --dc-walk-tint: #e6eefc;
  --dc-speed: #0b777a;
  --dc-speed-tint: #ddf2f1;
  --dc-look: #7044c2;
  --dc-look-tint: #efe8fb;
  --dc-trick: #ff9500;
  --dc-trick-ink: #a65a00;
  --dc-trick-tint: #fff1dc;
  --dc-sound: #1b6e3e;
  --dc-sound-tint: #e2f3e8;
  --dc-control: #3c3c44;
  --dc-control-tint: #ebebf0;
  --dc-when: #f2c230;
  --dc-when-ink: #8a6400;
  --dc-when-tint: #fcf3d2;
  --dc-desk: #ece2d0;
  --dc-shadow: rgba(29, 29, 31, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --dc-desk: #2a2219;
    --dc-shadow: rgba(0, 0, 0, .45);
  }
}

.dc-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.dc {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 63.5 / 88.9;
  overflow: hidden;
  background: var(--dc-paper);
  color: var(--dc-ink);
  border-radius: 4.6% / 3.3%;
  box-shadow: 0 1px 2px var(--dc-shadow), 0 8px 22px var(--dc-shadow);
  font-family: var(--dc-face);
  text-align: left;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* Zero specificity, so every class rule below wins over the reset. */
:where(.dc) p, :where(.dc) ul { margin: 0; padding: 0; }
:where(.dc) li { margin: 0; list-style: none; }
.dc-walk { --c: var(--dc-walk); --c-on: #fff; --c-ink: var(--dc-walk); --c-tint: var(--dc-walk-tint); }
.dc-speed { --c: var(--dc-speed); --c-on: #fff; --c-ink: var(--dc-speed); --c-tint: var(--dc-speed-tint); }
.dc-look { --c: var(--dc-look); --c-on: #fff; --c-ink: var(--dc-look); --c-tint: var(--dc-look-tint); }
.dc-trick { --c: var(--dc-trick); --c-on: var(--dc-ink); --c-ink: var(--dc-trick-ink); --c-tint: var(--dc-trick-tint); }
.dc-sound { --c: var(--dc-sound); --c-on: #fff; --c-ink: var(--dc-sound); --c-tint: var(--dc-sound-tint); }
.dc-control { --c: var(--dc-control); --c-on: #fff; --c-ink: var(--dc-control); --c-tint: var(--dc-control-tint); }
.dc-when { --c: var(--dc-when); --c-on: var(--dc-ink); --c-ink: var(--dc-when-ink); --c-tint: var(--dc-when-tint); }
.dc-yours { --c: var(--dc-paper); --c-on: var(--dc-dim); --c-ink: var(--dc-dim); --c-tint: var(--dc-paper); }

/* Band, picture, name, code word, then the foot: where it runs, and the code.
   The picture takes whatever height the words leave, so a one line name and a
   Repeat card with its write-in box both fill the card. */
.dc-band { flex: none; display: flex; align-items: center; height: 13cqi; padding: 0 6cqi; background: var(--c); color: var(--c-on); font: 600 max(5.6cqi, 10px)/1 var(--dc-face); letter-spacing: .01em; white-space: nowrap; overflow: hidden; }
.dc-yours .dc-band { border-bottom: .5cqi dashed var(--dc-rule); }
.dc-art { flex: 1 1 auto; min-height: 50cqi; position: relative; display: grid; place-items: center; color: var(--c-ink); }
.dc-art::before { content: ""; position: absolute; width: 52cqi; height: 52cqi; border-radius: 50%; background: var(--c-tint); }
.dc-art svg { position: relative; width: 40cqi; height: 40cqi; overflow: visible; }
.dc-blank { min-height: 36cqi; margin: 5cqi 6cqi 0; border: .5cqi dashed var(--dc-rule); border-radius: 3cqi; color: var(--dc-dim); font: 500 max(4.4cqi, 9px)/1.2 var(--dc-face); }
.dc-blank::before { display: none; }
.dc-name { margin: 0 6cqi; font: 600 11cqi/1.04 var(--dc-face); letter-spacing: -.005em; text-wrap: balance; overflow-wrap: anywhere; }
.dc-line { margin-top: 4cqi; height: 11cqi; display: flex; align-items: flex-end; border-bottom: .5cqi solid var(--dc-rule); }
.dc-line span, .dc-does { font: 500 max(4.4cqi, 9px)/1 var(--dc-face); color: var(--dc-dim); }
.dc-line span { padding-bottom: 1.4cqi; }
.dc-does { flex: 1; align-self: stretch; display: flex; align-items: flex-start; padding-top: 1cqi; border-bottom: .5cqi solid var(--dc-rule); margin-bottom: 4.6cqi; }
.dc-write { margin: 1.8cqi 6cqi 0; display: flex; align-items: center; gap: 2cqi; font: 600 max(5.6cqi, 10px)/1 var(--dc-face); color: var(--dc-dim); }
.dc-box { display: inline-block; width: 12cqi; height: 8.5cqi; border: .6cqi solid var(--dc-ink); border-radius: 1.4cqi; }
.dc-code { margin: 1.8cqi 6cqi 0; font: 500 max(4.6cqi, 9.5px)/1.2 var(--dc-mono); color: var(--dc-dim); overflow-wrap: anywhere; }
.dc-foot { flex: none; margin-top: 4.5cqi; padding: 0 4.5cqi 4.5cqi 6cqi; display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqi; }
.dc-runs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.4cqi; }
.dc-runs li { font: 650 max(4.3cqi, 9px)/1 var(--dc-sans); color: var(--c-ink); background: var(--c-tint); border-radius: 99cqi; padding: 1.5cqi 2.8cqi; white-space: nowrap; }
.dc-tagbox { flex: none; display: flex; flex-direction: column; align-items: center; gap: .8cqi; }
.dc-tag { display: block; width: 24cqi; height: 24cqi; }
.dc-num { font: 600 max(3.8cqi, 8.5px)/1 var(--dc-mono); color: var(--dc-dim); }

/* The hero: a row laid on a desk, read left to right. The desk is wider than
   the text column on a large screen, because the cards are the point. */
.dc-desk {
  --desk: min(100vw - 3rem, 1240px);
  margin: 0 calc((100% - var(--desk)) / 2);
  background: var(--dc-desk);
  border-radius: 28px;
  padding: clamp(1.75rem, 4vw, 3rem) 0 1.4rem;
}
.dc-row { list-style: none; margin: 0; padding: .5rem clamp(1rem, 3vw, 2rem) 1.25rem; display: flex; align-items: flex-start; gap: clamp(.75rem, 1.4vw, 1.1rem); overflow-x: auto; scroll-snap-type: x proximity; }
.dc-step { margin: 0; flex: 0 0 clamp(124px, 13.2vw, 176px); display: flex; flex-direction: column; gap: .8rem; scroll-snap-align: start; }
.dc-step:first-child { margin-left: auto; }
.dc-step:last-child { margin-right: auto; }
.dc-step > .dc { transform: rotate(-1deg); }
.dc-step:nth-child(even) > .dc { transform: rotate(1.2deg); }
.dc-under .dc { transform: rotate(.6deg) translateX(4%); }
.dc-desk figcaption { padding-inline: 1.5rem; color: var(--dim); font-size: .95rem; text-align: center; text-wrap: balance; }

/* The gallery: each category's rule, then its cards at a size you can read. */
.dc-groups { display: grid; gap: 2.75rem; }
.dc-group { display: grid; gap: 1.25rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.dc-group-text { max-width: 62ch; }
.dc-group-text h3 { margin: 0 0 .35rem; }
.dc-group-text p { color: var(--dim); font-size: .95rem; margin: 0; }
.dc-group-text .dc-goes { color: var(--ink); font-size: .88rem; margin-top: .35rem; }
.dc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 1.25rem; }
.dc-grid > li { margin: 0; }
.dc-deck-ctas { margin-top: 2.75rem; gap: 1.25rem; }

.dc-lessons .eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .55rem; }
.dc-lessons p + p { margin-top: .75rem; }
.feature-grid .dc-ask { color: var(--ink); font-weight: 550; }
.dc-studio .guide-steps { margin: 0; }
.dc-studio q { font-style: italic; }
.dc-faq { max-width: 75ch; }

/* The homepage: three cards fanned on the same desk. */
.dc-promo-art { display: grid; place-items: center; background: var(--dc-desk); padding: 3rem 1.5rem; min-height: 360px; }
.dc-fan { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.dc-fan > li { margin: 0 -1rem; width: clamp(120px, 13vw, 168px); }
.dc-fan > li:nth-child(1) { transform: rotate(-9deg) translateY(10px); }
.dc-fan > li:nth-child(2) { position: relative; z-index: 1; transform: translateY(-8px); }
.dc-fan > li:nth-child(3) { transform: rotate(9deg) translateY(10px); }

/* The format page. */
.dc-anatomy { display: grid; grid-template-columns: minmax(0, 13.5rem) minmax(0, 1fr); gap: 2rem; align-items: start; margin: 1.5rem 0; }
.dc-anatomy .spec { margin: 0; }
.dc-anatomy .spec dt:first-child { margin-top: 0; }
.dc-table td:first-child { font-variant-numeric: tabular-nums; }
.dc-table td code { white-space: nowrap; }

/* The cut sheet. On screen a ticked card prints and an unticked one is
   greyed out; :has() reads the tick, so no script is needed. */
.dc-print-intro { padding-block: 3rem .5rem; }
.dc-print-intro h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.dc-print-intro .lede { color: var(--dim); font-size: 1.15rem; max-width: 52ch; }
.dc-print-intro .eyebrow a { text-decoration: none; }
.dc-pickform { counter-reset: picked; padding-bottom: 1rem; }
.dc-sheet { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.6rem 1.25rem; }
.dc-pick { position: relative; margin: 0; display: grid; gap: .55rem; justify-items: start; }
.dc-pick > input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; margin: 0; }
.dc-pick > input:checked { counter-increment: picked; }
.dc-pick > label { order: 2; position: relative; padding: .3rem .7rem .3rem 1.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--dim); font-size: .8rem; line-height: 1.3; cursor: pointer; }
.dc-pick > label::before { content: ""; position: absolute; left: .5rem; top: 50%; width: .95rem; height: .95rem; margin-top: -.475rem; border: 1.5px solid var(--dim); border-radius: 4px; }
.dc-pick > input:checked + label { color: var(--ink); border-color: var(--brand); }
.dc-pick > input:checked + label::before { background: var(--accent-fill); border-color: var(--accent-fill); }
.dc-pick > input:checked + label::after { content: ""; position: absolute; left: .82rem; top: 50%; width: .3rem; height: .58rem; margin-top: -.4rem; border: solid var(--on-fill); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dc-pick > input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.dc-pick:has(> input:not(:checked)) .dc { opacity: .32; filter: grayscale(1); }
.dc-pick .dc { order: 1; }
.dc-pick-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dc-printbar { position: sticky; bottom: 0; z-index: 5; margin-top: 2rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; background: var(--header); border: 1px solid var(--soft-line); border-radius: 14px; }
.dc-count { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-count::before { content: "Ticked: " counter(picked); }
.dc-printbar .cta { font: inherit; font-weight: 550; cursor: pointer; }
.dc-print-notes { padding-block: 3rem 4rem; }
.dc-print-notes h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }

@media (max-width: 640px) {
  .dc-group { padding-top: 1.5rem; }
  .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .dc-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-anatomy { grid-template-columns: 1fr; }
  .dc-anatomy-card { max-width: 12rem; }
  .dc-promo-art { min-height: 280px; padding: 2.5rem 1rem; }
  .dc-desk { border-radius: 20px; }
}
@media print {
  .dc { box-shadow: none; }
  .dc-step > .dc, .dc-under .dc, .dc-fan > li { transform: none; }
  /* The cut sheet prints the ticked cards and nothing else. Inline blocks,
     because every engine paginates a line of them; a grid split across
     pages is still where printing goes wrong. */
  @page { margin: 5mm; }
  .dc-print-page .site-header, .dc-print-page .site-footer, .dc-print-page .dc-print-intro,
  .dc-print-page .dc-print-notes, .dc-print-page .dc-printbar, .dc-print-page .skip { display: none !important; }
  .dc-print-page .dc-pickform { width: 190.5mm; margin: 0 auto; padding: 0; }
  .dc-print-page .dc-sheet { display: block; margin: 0; font-size: 0; line-height: 0; }
  .dc-print-page .dc-pick { display: inline-block; width: 63.5mm; height: 88.9mm; vertical-align: top; break-inside: avoid; page-break-inside: avoid; font-size: 12pt; line-height: 1.2; }
  .dc-print-page .dc-pick:has(> input:not(:checked)) { display: none; }
  .dc-print-page .dc-pick > input, .dc-print-page .dc-pick > label { display: none; }
  .dc-print-page .dc-pick .dc { width: 63.5mm; height: 88.9mm; aspect-ratio: auto; border-radius: 0; opacity: 1; filter: none; outline: .25mm dashed #9a9aa2; outline-offset: -.125mm; }
}

/* Duck Card packs, at /cards/packs/. An activity card is paper in both themes,
   like a Duck Card, and every size inside it is a share of its own width, so
   the card on a phone and the card on paper are one drawing. Printed it is
   98 by 130 mm: two across and two down on Letter and on A4. */
.pk-intro { padding-block: 3rem .5rem; }
.pk-intro h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.pk-intro .lede { color: var(--dim); font-size: 1.15rem; max-width: 52ch; }
.pk-intro .eyebrow a { text-decoration: none; }
.pk-first { padding-top: 2.5rem; }
.pk-first .section-heading { margin-bottom: 0; }
.pk-facts { list-style: none; padding: 0; margin: 0 0 1.6rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.pk-facts li { margin: 0; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--dim); font-size: .85rem; }
.pk-facts strong { color: var(--ink); font-weight: 600; }
.pk-intro .ctas { gap: 1rem 1.25rem; }
.pk-prose { max-width: 62ch; }
.pk-prose p { color: var(--dim); }
.pk-prose strong { color: var(--ink); }
.pk-sub { margin: 2.75rem 0 .35rem; }
.pk-subtext { color: var(--dim); font-size: .95rem; max-width: 62ch; }
.pk-blanks { margin-top: 1.25rem; }
.pk-yours .pk-row { margin-top: 1rem; gap: .4rem; }
.pk-list h3 a { color: var(--ink); text-decoration-color: var(--brand); }
.pk-list .meta { margin-top: .8rem; }
.pk-sizing .card:first-child { border-top: 3px solid var(--brand); }

.pk-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; }
.pk-cards > li { margin: 0; container-type: inline-size; }
.pk-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 5cqi 5.5cqi 4cqi;
  background: var(--dc-paper);
  color: var(--dc-ink);
  border-radius: 4cqi;
  box-shadow: 0 1px 2px var(--dc-shadow), 0 8px 22px var(--dc-shadow);
  font-family: var(--dc-face);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
:where(.pk-card) p, :where(.pk-card) ol { margin: 0; padding: 0; }
:where(.pk-card) li { margin: 0; list-style: none; }
.pk-card-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 3cqi; }
.pk-num { grid-column: 1 / -1; font: 500 3.6cqi/1.2 var(--dc-face); color: var(--dc-dim); }
.pk-card h3 { margin: .6cqi 0 0; font: 600 6.2cqi/1.08 var(--dc-face); letter-spacing: -.005em; color: var(--dc-ink); }
.pk-par { font: 600 4.2cqi/1 var(--dc-face); color: var(--dc-dim); white-space: nowrap; padding: 1.4cqi 2.8cqi; border-radius: 99cqi; background: var(--dc-trick-tint); }
.pk-par b { font-size: 6.4cqi; color: var(--dc-trick-ink); }
.pk-board-box { margin: 3cqi 0 2.5cqi; display: flex; justify-content: center; }
.pk-board { display: block; width: auto; height: 46cqi; max-width: 100%; overflow: visible; }
.pk-card-row .pk-board { height: 40cqi; }
.pk-ground { fill: var(--dc-paper); }
.pk-grid { fill: none; stroke: var(--dc-rule); stroke-width: .35; }
.pk-edge { fill: none; stroke: var(--dc-ink); stroke-width: 1.2; }
.pk-wall { fill: none; stroke: var(--dc-ink); stroke-width: 1.7; stroke-linecap: round; }
.pk-goal { fill: var(--dc-walk-tint); stroke: var(--dc-walk); stroke-width: .9; }
.pk-start circle { fill: var(--dc-trick); stroke: var(--dc-ink); stroke-width: .5; }
.pk-start path { fill: var(--dc-ink); }
.pk-gate rect { fill: var(--dc-trick-tint); }
.pk-gate path { fill: none; stroke: var(--dc-trick-ink); stroke-width: 1.2; stroke-linecap: round; }
.pk-hint { font: 500 3.9cqi/1.3 var(--dc-face); color: var(--dc-ink); }
.pk-note { margin-top: 1.6cqi; font: italic 500 3.4cqi/1.3 var(--dc-face); color: var(--dc-dim); }
.pk-finish { margin-top: 3cqi; display: flex; align-items: center; gap: 2.5cqi; }
.pk-finish > p, .pk-bug > p { font: 500 3.6cqi/1.3 var(--dc-face); color: var(--dc-dim); }
.pk-finish > p { font-weight: 600; }
.pk-bug { margin-top: 3cqi; }
.pk-bug strong { color: var(--dc-ink); }
.pk-row { list-style: none; display: flex; flex-wrap: wrap; gap: 1.6cqi; margin-top: 1.6cqi; padding: 0; }
.pk-row > li { margin: 0; display: flex; flex-direction: column; gap: .8cqi; }
.pk-mini {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 12.5cqi;
  min-height: 13cqi;
  padding: 1.2cqi .6cqi .8cqi;
  border: .35cqi solid var(--dc-rule);
  border-top: 1.6cqi solid var(--c);
  border-radius: 1.4cqi;
  background: var(--dc-paper);
  color: var(--c-ink);
  text-align: center;
}
.pk-yours .pk-mini { width: 3.6rem; min-height: 4.4rem; padding: .35rem .2rem .3rem; border-width: 1px; border-top-width: .4rem; border-radius: 6px; }
.pk-mini svg { width: 5.6cqi; height: 5.6cqi; flex: none; }
.pk-yours .pk-mini svg { width: 1.6rem; height: 1.6rem; }
.pk-mini-num { font: 600 3.4cqi/1.4 var(--dc-mono); color: var(--dc-dim); }
.pk-mini-name { margin-top: .6cqi; font: 600 2.7cqi/1.1 var(--dc-face); color: var(--dc-ink); overflow-wrap: anywhere; }
.pk-yours .pk-mini-name { margin-top: .2rem; font-size: .62rem; }
.pk-key { margin-top: auto; padding-top: 2.5cqi; display: flex; flex-wrap: wrap; gap: .8cqi 2.6cqi; font: 500 2.6cqi/1.3 var(--dc-sans); color: var(--dc-dim); }
.pk-key span { display: inline-flex; align-items: center; gap: 1cqi; }
.pk-key svg { width: 3.6cqi; height: 3.6cqi; overflow: visible; }
.pk-credit { margin-top: 1.2cqi; font: 500 2.5cqi/1.3 var(--dc-sans); color: var(--dc-dim); }

@media (max-width: 640px) {
  .pk-intro { padding-top: 2rem; }
  .pk-cards { gap: 1rem; }
}
@media print {
  .pk-card { box-shadow: none; }
  /* A pack page prints its challenge cards and nothing else, four to a sheet. */
  .pk-pack-page .site-header, .pk-pack-page .site-footer, .pk-pack-page .skip,
  .pk-pack-page main > section, .pk-pack-page main > .wrap > section:not(.pk-print-area),
  .pk-pack-page .pk-print-area .section-heading { display: none !important; }
  .pk-pack-page .wrap { width: auto; }
  .pk-pack-page .pk-print-area { padding: 0; }
  .pk-pack-page .pk-cards { display: block; width: 196mm; margin: 0 auto; font-size: 0; line-height: 0; }
  .pk-pack-page .pk-cards > li { display: inline-block; width: 98mm; height: 130mm; vertical-align: top; break-inside: avoid; page-break-inside: avoid; font-size: 12pt; line-height: 1.2; }
  .pk-pack-page .pk-card { width: 98mm; height: 130mm; overflow: hidden; border-radius: 0; outline: .25mm dashed #9a9aa2; outline-offset: -.125mm; }
}

/* ===================================================================== Books
   Three reference books at /books/. Without JavaScript a book is one long
   document: each lesson's page beside its figure's steps, then its notes. With
   it, /books/engine/book.js lays the same nodes onto a 3D book (html.bk-3d) or,
   on a narrow screen, shows one lesson at a time with its figure in a card
   (html.bk-flat). Every class the engine adds starts bk-. */
.book-page main { padding-bottom: 3rem; }
.book-intro { padding: 56px 0 28px; }
.book-intro-page { max-width: 46rem; }
.book-eyebrow { color: var(--accent); font-size: .85rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .6rem; }
.book-intro h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); }
.book-intro .lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--dim); max-width: 44ch; }
.book-for { font-size: .95rem; }
.book-toc { margin: 1.4rem 0 0; padding: 0; list-style: none; counter-reset: toc; columns: 2 16rem; column-gap: 2rem; }
.book-toc li { counter-increment: toc; margin: 0 0 .45rem; break-inside: avoid; }
.book-toc a { display: grid; grid-template-columns: 2rem 1fr; text-decoration: none; color: var(--ink); line-height: 1.3; }
.book-toc a::before { content: counter(toc); color: var(--accent); font-weight: 700; }
.book-toc a:hover span { text-decoration: underline; text-decoration-color: var(--brand); }
.book-how { margin-top: 1.4rem; font-size: .92rem; color: var(--dim); max-width: 60ch; }

.lesson { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; padding: 56px 0; border-top: 1px solid var(--line); }
.lesson-page { min-width: 0; }
.lesson-page .kicker { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .5rem; }
.lesson-page h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.lesson-page .rule { margin: 1.1rem 0; padding: .75rem 1rem; border-left: 3px solid var(--brand); background: var(--tint); border-radius: 0 12px 12px 0; font-weight: 560; }
.lesson-page .rule code, .lesson-notes code { font-size: .88em; }
.predict { margin: 1.4rem 0 0; padding: .9rem 1rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; }
.predict legend { padding: 0 .4rem; font-weight: 750; color: var(--accent); }
.predict > p { margin: 0 0 .5rem; font-weight: 560; }
.predict label { display: flex; gap: .6rem; align-items: baseline; margin: .15rem 0; padding: .35rem .55rem; border-radius: 9px; cursor: pointer; }
.predict label:hover { background: var(--tint); }
.predict input { accent-color: var(--accent-fill); margin: 0; flex: none; transform: translateY(.1em); }
.predict input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.predict details { margin-top: .6rem; }
.predict summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.predict details p { margin: .5rem 0 0; }
.predict.is-revealed label.is-answer { outline: 2px solid var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.predict.is-revealed label.is-wrong { outline: 2px dashed var(--warn); }
.lesson-figure { margin: 0; min-width: 0; padding: 1.25rem 1.4rem; background: var(--card); border: 1px solid var(--soft-line); border-radius: 18px; align-self: start; }
.lesson-figure > p.figure-label { margin: 0 0 .6rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.figure-steps { margin: 0 0 1rem; padding-left: 1.4rem; }
.figure-steps li { margin: .35rem 0 .55rem; }
.lesson-figure figcaption { color: var(--dim); font-size: .92rem; margin-bottom: .8rem; }
.big-idea { margin: 0; padding: .7rem .9rem; border-radius: 12px; background: var(--tint); font-weight: 600; }
.lesson-notes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lesson-notes > section { min-width: 0; }
.lesson-notes > section { background: var(--card); border: 1px solid var(--soft-line); border-radius: 16px; padding: 1.1rem 1.2rem; font-size: .92rem; }
.lesson-notes h3 { font-size: 1rem; margin-bottom: .55rem; }
.lesson-notes p, .lesson-notes li { color: var(--dim); }
.lesson-notes p:last-child { margin-bottom: 0; }
.lesson-notes ul, .lesson-notes ol { margin: 0; }
.lesson-notes pre { margin: .5rem 0; padding: .6rem .75rem; overflow-x: auto; background: var(--bg); border: 1px solid var(--soft-line); border-radius: 10px; font-size: .8rem; }
.book-next { padding-top: 2rem; border-top: 1px solid var(--line); }

/* The shelf at /books/. */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; margin-top: 2rem; }
.shelf-book { display: grid; grid-template-rows: auto 1fr; gap: 1rem; text-decoration: none; color: var(--ink); }
.shelf-cover { position: relative; aspect-ratio: 3 / 3.2; border-radius: 6px 14px 14px 6px; padding: 12% 10%; display: grid; align-content: start; color: var(--c-ink); background: var(--c); box-shadow: inset 10px 0 0 rgba(0,0,0,.14), 0 14px 26px rgba(0,0,0,.18); transition: transform .2s ease; }
.shelf-book:hover .shelf-cover, .shelf-book:focus-visible .shelf-cover { transform: translateY(-5px) rotate(-.6deg); }
.shelf-label { background: #fbf6ea; color: var(--c-ink); border: 3px solid var(--c-ink); border-radius: 12px; padding: .9rem .9rem 1rem; text-align: center; }
.shelf-label small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.shelf-label strong { display: block; margin-top: .3rem; font: 700 clamp(1.15rem, 2.2vw, 1.55rem)/1.1 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.shelf-beginner { --c: #f08c12; --c-ink: #5a2f00; }
.shelf-intermediate { --c: #2c64c0; --c-ink: #0d244a; }
.shelf-advanced { --c: #3b3e47; --c-ink: #15161a; }
.shelf-casebook { --c: #2f6b4f; --c-ink: #0f2a1e; }
.shelf-text h2 { font-size: 1.3rem; margin: 0 0 .35rem; }
.shelf-text p { color: var(--dim); font-size: .95rem; margin: 0 0 .5rem; }
.shelf-text .shelf-for { color: var(--ink); font-weight: 600; font-size: .88rem; }

@media (max-width: 1180px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* minmax(0, ...) so a long line in a code block scrolls instead of widening the page */
  .lesson { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .lesson-notes { grid-template-columns: minmax(0, 1fr); }
  .shelf { grid-template-columns: 1fr; max-width: 30rem; }
  .shelf-book { grid-template-columns: 9rem 1fr; grid-template-rows: none; align-items: start; }
}

/* ---------------------------------------------------------------- live */

html.bk-live .lesson-figure > .figure-steps,
html.bk-live .lesson-figure > figcaption,
html.bk-live .lesson-figure > .big-idea,
html.bk-live .lesson-figure > .figure-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bk-announce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

html.bk-3d .book-page main > .book-intro,
html.bk-3d .book-page main > .lesson,
html.bk-3d .book-page main > .book-next { display: none; }
html.bk-3d .book-page main { padding-bottom: 0; }
.bk-stage { position: relative; height: calc(100svh - 83px); min-height: 560px; overflow: hidden; background: #e4d5bb; }
.bk-stage[hidden] { display: none; }
.bk-gl, .bk-css3d { position: absolute; inset: 0; }
.bk-gl { display: block; }

.bk-page, .bk-rpage { width: 600px; height: 780px; color: var(--ink); }
.bk-page { padding: 46px 52px 28px; overflow: auto; scrollbar-width: thin; font-size: 15.5px; line-height: 1.48; }
.bk-page .lesson-page h2 { font-size: 30px; line-height: 1.12; margin: 0 0 12px; }
.bk-page .kicker { font-size: 12.5px; }
.bk-page p { margin: 0 0 10px; }
.bk-page .rule { margin: 14px 0; padding: 10px 14px; }
.bk-page .predict { margin-top: 16px; padding: 10px 12px 12px; }
.bk-page .predict label { padding: 4px 8px; }
.bk-page.is-intro { padding: 64px 60px; }
.bk-page.is-intro .book-eyebrow { font-size: 13px; }
.bk-page.is-intro h1 { font-size: 50px; margin: 0 0 16px; }
.bk-page.is-intro .lede { font-size: 19px; }
.bk-page.is-intro .book-toc { columns: 1; margin-top: 18px; }
.bk-page.is-intro .book-toc li { margin-bottom: 5px; font-size: 15.5px; }
.bk-page.is-intro .book-how { display: none; }
.book-beginner .bk-page { font-size: 16.5px; }
.book-beginner .bk-page .lesson-page h2 { font-size: 32px; }
.book-advanced .bk-page, .book-casebook .bk-page { font-size: 14.8px; }

.bk-rpage { position: relative; transition: opacity .25s ease; }
.bk-rpage.is-fading { opacity: 0; }
.bk-ui-top { position: absolute; top: 24px; left: 26px; right: 26px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bk-badge { font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1.5px solid currentColor; color: var(--dim); }
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.bk-chip-k { color: var(--dim); }
.bk-chip-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-steps { position: absolute; left: 22px; top: 86px; width: 152px; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bk-steps li { margin: 0; }
.bk-step { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 650 14px/1.2 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: left; cursor: default; }
.bk-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; background: var(--bg); border: 1.5px solid var(--line); }
.bk-step[data-state="next"] { cursor: pointer; border-color: var(--brand); background: var(--accent-fill); color: #1d1d1f; box-shadow: 0 3px 0 #a65a00; }
.bk-step[data-state="next"] .bk-step-n { background: #fff; border-color: #a65a00; color: #1d1d1f; }
.bk-step[data-state="next"]:hover { background: #ffb340; }
.bk-step[data-state="running"] { border-color: var(--brand); background: var(--tint); }
.bk-step[data-state="done"] { opacity: .78; }
.bk-step[data-state="done"] .bk-step-n { font-size: 0; background: var(--good); border-color: var(--good); }
.bk-step[data-state="done"] .bk-step-n::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.bk-step[data-state="later"] { opacity: .45; }
.bk-step:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bk-ui-bottom { position: absolute; left: 26px; right: 26px; bottom: 24px; display: grid; gap: 9px; }
.bk-caption { margin: 0; min-height: 4.4em; font-size: 15px; line-height: 1.45; }
.bk-caption strong { color: var(--accent); }
.bk-verdict { margin: 0; font-weight: 700; font-size: 14.5px; color: var(--warn); }
.bk-next { margin: 0; font-size: 14px; }
.bk-step[aria-disabled="true"] { cursor: default; }
/* a prediction's answer waits for its figure */
.bk-wait { margin: .45rem 0 0; color: var(--dim); font-size: .92em; font-style: italic; }
.bk-verdict[data-right="true"] { color: var(--good); }
.bk-bigidea { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--tint); font-weight: 650; font-size: 15px; line-height: 1.35; }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-actions button, .bk-btn { white-space: nowrap; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 560 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.bk-actions button:hover:not(:disabled), .bk-btn:hover:not(:disabled) { border-color: var(--brand); }
.bk-actions button:disabled, .bk-btn:disabled { opacity: .45; cursor: default; }
.bk-actions button:focus-visible, .bk-btn:focus-visible, .bk-menu-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bk-slider { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.bk-slider input { width: 100%; accent-color: var(--accent-fill); }
.bk-slider-out { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }

.bk-label { --z: var(--bk-zoom, 1); padding: calc(3px * var(--z)) calc(9px * var(--z)); border-radius: 999px; background: #fffaf0; color: #2b2620; border: 1.5px solid #2b2620; font: 650 calc(13px * var(--z))/1.25 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: nowrap; pointer-events: none !important; transition: opacity .2s ease; }
.bk-label.is-big { font-size: calc(16px * var(--z)); padding: calc(4px * var(--z)) calc(11px * var(--z)); }
.bk-label.is-small { font-size: calc(11px * var(--z)); padding: calc(2px * var(--z)) calc(7px * var(--z)); }
.bk-label.is-accent { background: #ff9500; color: #1d1d1f; }
.bk-label.is-blue { background: #2a64c9; color: #fff; border-color: #0d244a; }
.bk-label.is-green { background: #1b6e3e; color: #fff; border-color: #0b3a20; }
.bk-label.is-red { background: #d8432e; color: #fff; border-color: #5a1208; }
.bk-label.is-plain { background: transparent; border-color: transparent; }
.bk-label.is-hidden { opacity: 0 !important; }
.bk-say { font: 800 30px/1 ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, sans-serif; color: #ff9500; -webkit-text-stroke: 1.5px #2b2620; paint-order: stroke fill; text-shadow: 2px 2px 0 #2b2620; letter-spacing: .02em; white-space: nowrap; pointer-events: none !important; }
.bk-say.is-blue { color: #6ea2ff; }
.bk-say.is-green { color: #7ad69a; }
.bk-say.is-red { color: #ff7a63; }

.bk-barwrap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 24px); }
.bk-bar { display: flex; align-items: center; gap: 6px; padding: 6px; background: var(--header); border: 1px solid var(--soft-line); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bk-b-prev, .bk-b-next { width: 40px; padding: 0; font-size: 24px; line-height: 1; }
.bk-where { display: grid; text-align: center; min-width: 200px; max-width: 300px; padding: 0 6px; line-height: 1.2; }
.bk-where-num { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.bk-where-title { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-menu { position: absolute; left: 0; bottom: calc(100% + 10px); width: min(420px, calc(100vw - 24px)); max-height: min(62vh, 520px); overflow: auto; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.bk-menu[hidden] { display: none; }
.bk-menu-next { margin: 10px 8px 4px; font-size: 14px; }
.bk-hint { margin: 6px 8px 2px; color: var(--dim); font-size: 13px; }
.bk-menu-list { list-style: none; margin: 0; padding: 0; }
.bk-menu-list li { margin: 0; }
.bk-menu-item { width: 100%; display: grid; grid-template-columns: 2rem 1fr; gap: .4rem; align-items: baseline; padding: .55rem .7rem; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 550 .95rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: left; cursor: pointer; }
.bk-menu-item:hover, .bk-menu-item[aria-current="page"] { background: var(--tint); }
.bk-menu-num { color: var(--accent); font-weight: 750; }
.bk-notes { position: absolute; top: 14px; right: 14px; bottom: 86px; width: min(460px, 46%); z-index: 6; overflow: auto; padding: 16px 20px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.bk-notes[hidden] { display: none; }
.bk-notes-head { position: sticky; top: -16px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: -16px -20px 12px; padding: 14px 20px 10px; background: var(--card); border-bottom: 1px solid var(--soft-line); }
.bk-notes-title { margin: 0; font-weight: 700; }
.bk-notes .lesson-notes { display: grid; grid-template-columns: 1fr; gap: .8rem; }

/* one lesson at a time, for narrow screens */
html.bk-flat .book-page main > .book-intro:not(.is-current),
html.bk-flat .book-page main > .lesson:not(.is-current),
html.bk-flat .book-page main > .book-next { display: none; }
html.bk-flat.bk-at-end .book-page main > .book-next { display: block; }
html.bk-flat .book-page main { padding-bottom: 96px; }
html.bk-flat .lesson { border-top: 0; padding-top: 28px; }
html.bk-flat .bk-barwrap { position: fixed; bottom: max(10px, env(safe-area-inset-bottom)); width: min(560px, calc(100% - 16px)); max-width: none; }
html.bk-flat .bk-bar { width: 100%; }
html.bk-flat .bk-where { flex: 1; min-width: 0; max-width: none; }
html.bk-flat .bk-b-notes, html.bk-flat .bk-b-sound, html.bk-flat .bk-b-view { display: none; }
html.bk-flat .bk-where-num { white-space: nowrap; }
.bk-menu-foot { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 4px 2px; padding-top: 8px; border-top: 1px solid var(--soft-line); }
.bk-flatcard { margin: 0 0 1rem; }
.bk-flatstage { position: relative; aspect-ratio: 1 / 1; max-height: 64svh; width: 100%; border-radius: 14px; overflow: hidden; background: #e4d5bb; }
.bk-flatcard { position: relative; }
.bk-flatui .bk-ui { position: static; }
.bk-flatcard .bk-ui-top { position: static; margin: .6rem 0 0; }
.bk-flatui .bk-steps { position: static; width: auto; display: flex; flex-wrap: wrap; gap: 6px; margin: .8rem 0 .6rem; }
.bk-flatui .bk-step { width: auto; padding: 6px 10px 6px 7px; font-size: 13.5px; }
.bk-flatui .bk-ui-bottom { position: static; }
.bk-flatui .bk-caption { min-height: 0; }
@media (prefers-color-scheme: dark) {
  .bk-stage, .bk-flatstage { background: #15120f; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-rpage { transition: none; }
  .shelf-cover { transition: none; }
}
@media print {
  .bk-stage, .bk-barwrap, .bk-flatcard, .bk-wait { display: none !important; }
  /* paper cannot play a pop-up, so the figure's words print in its place */
  html.bk-live .lesson-figure > .figure-steps,
  html.bk-live .lesson-figure > figcaption,
  html.bk-live .lesson-figure > .big-idea,
  html.bk-live .lesson-figure > .figure-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  html.bk-3d .book-page main > .lesson, html.bk-3d .book-page main > .book-intro,
  html.bk-flat .book-page main > .lesson, html.bk-flat .book-page main > .book-intro { display: grid !important; }
  .lesson { break-inside: avoid; }
}
