/* Waken Dev storybook: paper on a wooden desk. Cards have a cut edge (a thin dark line, a pale lip on the upper-left
   edges only), a tight contact shadow and a soft cast shadow in warm umber; cream page, never white; dark ink, never
   black; Fredoka for the game-like display type, Literata for reading. */
:root {
  --ink: #3b2a1e; --ink-2: #5a4636; --page: #f4ead2; --page-2: #f8f1e0; --core: #fbf3e0; --accent: #c84a35; --link: #a63a26;
  --cobalt: #3f7cc4; --teal: #2f9c94; --sun: #f0bf45; --plum: #9a5a9e; --desk: #c39466;
  --edge: #ddcba6;
  --cut: inset 1.5px 1.5px 0 rgb(251 243 224 / .85), 0 0 0 1px rgb(74 44 30 / .7), 1px 1px 0 1px rgb(74 44 30 / .7);
  --contact: 2px 3px 2px rgb(60 32 14 / .42);
  --cast: 12px 18px 28px rgb(60 32 14 / .30);
  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .6' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .15 .32 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='300'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.003 .22' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .17 0 0 0 0 .07 0 0 0 1.1 -.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Literata', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sb {
  margin: 0; min-height: 100vh; color: var(--ink); font: 400 18px/1.7 var(--body);
  background-color: var(--desk);
  background-image: var(--grain),
    repeating-linear-gradient(180deg, rgb(255 230 190 / .07) 0 178px, rgb(70 36 14 / .32) 178px 181px, rgb(60 30 10 / .05) 181px 359px, rgb(70 36 14 / .32) 359px 362px);
  background-size: 900px 300px, auto;
}
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--page); padding: 8px 14px; font: 600 14px/1 var(--display); color: var(--ink); box-shadow: var(--cut), var(--contact); }
.skip:focus { top: 12px; }

/* ---- bookmark ribbons (site nav) ---------------------------------------------------------------------------------- */
.ribbons { position: absolute; z-index: 20; right: 34px; top: 0; display: flex; gap: 10px; }
.rib { display: block; width: 92px; padding: 20px 0 26px; text-align: center; font: 600 15px/1 var(--display); letter-spacing: .04em; text-decoration: none;
  color: var(--core); background: var(--fibre), var(--c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  filter: drop-shadow(0 0 .6px rgb(74 30 20 / .9)) drop-shadow(2px 3px 1.5px rgb(60 36 20 / .45)) drop-shadow(8px 10px 10px rgb(60 36 20 / .25));
  transition: padding-top .25s cubic-bezier(.3, 1.6, .5, 1); }
.rib.dark { color: var(--ink); }
.rib:hover, .rib[aria-current] { padding-top: 32px; color: var(--core); }
.rib.dark:hover, .rib.dark[aria-current] { color: var(--ink); }

/* ---- the paper page on the desk (posts, about, archive, tags) ------------------------------------------------------ */
.desk { padding: 104px 18px 40px; }
.page-sheet { position: relative; max-width: 780px; margin: 0 auto; padding: clamp(26px, 6vw, 62px) clamp(20px, 6vw, 64px) clamp(30px, 6vw, 58px);
  background: var(--fibre), var(--page); border-radius: 4px 6px 5px 7px;
  box-shadow: var(--cut), 0 3px 0 -1px #ece0c4, 0 3px 0 0 rgb(74 44 30 / .35), 0 6px 0 -1px #e4d6b6, 0 6px 0 0 rgb(74 44 30 / .3), var(--contact), var(--cast); }
.chapter-head { margin-bottom: 30px; }
.back { font: 600 14px/1 var(--display); letter-spacing: .06em; text-decoration: none; color: var(--ink-2); }
.back:hover { color: var(--accent); }
.badge { float: right; width: 74px; height: 74px; margin: -8px -6px 8px 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fibre), var(--core); box-shadow: var(--cut), 0 0 0 5px color-mix(in srgb, var(--c, var(--accent)) 70%, #fff 0%), 0 0 0 6px rgb(74 44 30 / .6), var(--contact), 6px 9px 12px rgb(60 32 14 / .22); transform: rotate(-4deg); }
.sb-icon { width: 48px; height: 48px; display: block; }
.chapter-no { margin: 26px 0 6px; font: 600 14px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--c, var(--accent)) 78%, var(--ink)); }
.chapter-head h1 { margin: 0 0 12px; font: 700 clamp(30px, 5.2vw, 46px)/1.1 var(--display); letter-spacing: .005em; text-wrap: balance; }
.meta { margin: 0; font-style: italic; font-size: 15px; color: var(--ink-2); }
.tags { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-block; padding: 3px 10px 4px; font: 500 13px/1.2 var(--display); text-decoration: none; color: var(--ink); background: var(--fibre), var(--page-2);
  border-radius: 3px 4px 3px 5px; box-shadow: var(--cut), 1px 2px 0 var(--edge), 2px 3px 3px rgb(60 32 14 / .2); }
.tags a:hover { background: var(--fibre), var(--sun); }

/* the chapter's bookmark table of contents: beside the page on wide screens, above it on narrow ones */
.chapter-wrap { display: grid; grid-template-columns: minmax(0, 780px) 250px; gap: 30px; justify-content: center; align-items: start; }
.chapter-wrap .page-sheet { margin: 0; }
.toc { position: sticky; top: 24px; margin-top: 150px; padding: 16px 18px 14px; background: var(--fibre), var(--page-2); border-radius: 3px 5px 4px 6px; font-size: 14.5px; line-height: 1.35;
  box-shadow: var(--cut), 1px 2px 0 var(--edge), var(--contact), 8px 12px 18px rgb(60 32 14 / .24); border-top: 8px solid var(--c, var(--accent)); transform: rotate(.8deg); }
.toc summary { font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; color: var(--ink-2); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; max-height: calc(100vh - 140px); overflow: auto; }
.toc li { margin: 6px 0; }
.toc li.h3 { padding-left: 14px; font-size: 13.5px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover, .toc a.here { color: var(--accent); text-decoration: underline; text-decoration-style: wavy; text-decoration-thickness: 1px; }
@media (max-width: 1180px) {
  .chapter-wrap { grid-template-columns: minmax(0, 780px); }
  .toc { position: static; order: -1; margin: 0; transform: none; }
  .toc ol { max-height: none; }
}

/* ---- reading: prose ------------------------------------------------------------------------------------------------ */
.prose { font-size: 18.5px; line-height: 1.72; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4 { position: relative; font-family: var(--display); line-height: 1.2; margin: 1.9em 0 .6em; scroll-margin-top: 20px; }
.prose h2 { font-size: 28px; font-weight: 700; }
.prose h2::before { content: ''; position: absolute; left: -26px; top: .28em; width: 12px; height: 18px; background: var(--c, var(--accent)); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.prose h3 { font-size: 22px; font-weight: 600; }
.prose h4 { font-size: 18px; font-weight: 600; }
.prose h3 + .when { margin: -.3em 0 .8em; font: italic 400 15.5px/1.45 var(--body); color: var(--ink-2); }   /* a role and its dates, under an employer or a school */
.prose .anchor { margin-left: 8px; font-size: .7em; color: var(--ink-2); opacity: 0; text-decoration: none; }
.prose :is(h2, h3, h4):hover .anchor { opacity: .6; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--c, var(--accent)); font-family: var(--display); }
.prose strong { font-weight: 600; }
.prose img { max-width: 100%; height: auto; background: var(--core); padding: 8px; border-radius: 2px; box-shadow: var(--cut), var(--contact), 6px 9px 14px rgb(60 32 14 / .22); }
.prose hr { border: 0; height: 22px; margin: 2em 0; background: radial-gradient(circle, var(--ink-2) 1.4px, transparent 1.6px) center / 14px 22px repeat-x; opacity: .5; }
.prose blockquote { margin: 1.5em 6px; padding: 16px 22px 14px; background: var(--fibre), #f6dd85; border-radius: 2px; transform: rotate(-.5deg); font-size: 17px;
  box-shadow: inset 0 18px 0 rgb(0 0 0 / .04), 0 0 0 1px rgb(74 44 30 / .35), var(--contact), 8px 12px 16px rgb(60 32 14 / .2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose :not(pre) > code { font: 500 .84em/1 var(--mono); padding: .14em .38em; background: #ecdfbf; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(74 44 30 / .14); white-space: break-spaces; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15.5px; line-height: 1.45; background: var(--page-2);
  box-shadow: var(--cut), var(--contact), 6px 9px 14px rgb(60 32 14 / .18); display: block; overflow-x: auto; }
.prose th { font: 600 14px/1.3 var(--display); letter-spacing: .04em; text-align: left; background: color-mix(in srgb, var(--c, var(--accent)) 22%, var(--page-2)); }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid rgb(74 44 30 / .18); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }

/* code on index cards: a red margin rule, a header strip with the language and a copy button; rouge tokens in inks */
.prose div.highlighter-rouge { position: relative; margin: 1.5em -8px; background: var(--fibre), #fbf6e8; border-radius: 3px 5px 4px 6px;
  box-shadow: var(--cut), 1px 2px 0 var(--edge), var(--contact), 8px 12px 18px rgb(60 32 14 / .2); }
.prose .card-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 5px 16px; border-bottom: 1.5px solid rgb(200 74 53 / .35);
  font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.prose .card-head button { font: 600 12px/1 var(--display); letter-spacing: .06em; color: var(--ink-2); background: transparent; border: 0; padding: 4px 6px; border-radius: 3px; cursor: pointer; }
.prose .card-head button:hover { background: rgb(74 44 30 / .08); color: var(--ink); }
.prose pre { margin: 0; padding: 12px 16px 14px; overflow-x: auto; font: 400 14.5px/1.6 var(--mono); tab-size: 4; }
.prose pre code { font: inherit; }
.prose .rouge-table { border-collapse: collapse; margin: 0; background: none; box-shadow: none; display: table; width: auto; font-size: inherit; }
.prose .rouge-table td { padding: 0; border: 0; }
.prose .rouge-gutter { padding-right: 14px !important; user-select: none; }
.prose .rouge-gutter pre { padding: 0; color: rgb(74 44 30 / .38); text-align: right; border-right: 1.5px dashed rgb(200 74 53 / .35); padding-right: 12px; }
.prose .rouge-code pre { padding: 0; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .cd { color: #8a7660; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv, .highlight .ow { color: #b23a2a; font-weight: 600; }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .ne { color: #7a3e8a; }
.highlight .kc, .highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il, .highlight .se { color: #a85a0c; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .si, .highlight .dl { color: #2a7a5a; }
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .bp, .highlight .na, .highlight .nd { color: #2c5aa0; }
.highlight .nt { color: #b23a2a; }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc, .highlight .no { color: #8a4a20; }
.highlight .o, .highlight .p { color: #5a4636; }
.highlight .gd { color: #b23a2a; background: rgb(200 74 53 / .1); }
.highlight .gi { color: #2a7a5a; background: rgb(42 122 90 / .1); }
.highlight .gh, .highlight .gu { color: #2c5aa0; font-weight: 600; }
.highlight .err { color: inherit; background: none; }

/* the chapter's foot: the previous and next chapters as two cards */
.chapter-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 46px; padding-top: 24px; border-top: 2px dashed rgb(74 44 30 / .22); }
.turn { display: block; padding: 14px 16px 15px; text-decoration: none; color: var(--ink); background: var(--fibre), var(--page-2); border-radius: 3px 5px 4px 6px;
  box-shadow: var(--cut), 1px 2px 0 var(--edge), var(--contact), 6px 9px 12px rgb(60 32 14 / .2); transition: transform .12s; }
.turn:hover { transform: translateY(-2px) rotate(-.4deg); color: var(--ink); }
.turn span { display: block; font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.turn b { font: 600 16px/1.3 var(--body); }
.turn.newer { text-align: right; grid-column: 2; }

/* ---- archive, tags ------------------------------------------------------------------------------------------------- */
.year h2 { font: 700 26px/1 var(--display); margin: 30px 0 8px; }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: grid; grid-template-columns: 84px 1fr 14px; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgb(74 44 30 / .15); }
.ledger time { font: 500 14px/1 var(--display); color: var(--ink-2); }
.ledger a { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.ledger a:hover { color: var(--accent); text-decoration: underline; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgb(74 44 30 / .7), inset 1px 1px 0 rgb(255 255 240 / .5); }
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 30px; }
.place { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--page-2); border-radius: 3px 5px 4px 6px; box-shadow: var(--cut), 1px 2px 0 var(--edge), var(--contact); scroll-margin-top: 20px; }
.place:target { background: color-mix(in srgb, var(--c) 18%, var(--page-2)); }
.place .badge { float: none; margin: 0; width: 58px; height: 58px; flex: none; transform: none; }
.place .badge .sb-icon { width: 38px; height: 38px; }
.place h2 { margin: 2px 0 2px; font: 700 19px/1.2 var(--display); }
.place p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.place .via a { font-size: 13px; margin-right: 4px; }
.tag-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { display: inline-block; padding: 4px 10px 5px; font: 500 14px/1.2 var(--display); text-decoration: none; color: var(--ink); background: var(--fibre), var(--page-2);
  border-radius: 3px 4px 3px 5px; box-shadow: var(--cut), 1px 2px 0 var(--edge), 2px 3px 3px rgb(60 32 14 / .2); }
.tag-cloud a:hover { background: var(--fibre), var(--sun); }
.tag-cloud i { font-style: normal; font-size: 12px; color: var(--ink-2); margin-left: 2px; }

.desk-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 16px 30px; font: 500 13px/1.4 var(--display); letter-spacing: .04em; color: #f6e8cc; text-shadow: 0 1px 0 rgb(60 30 10 / .5); }
.desk-foot a { color: #fff3da; text-decoration: none; text-transform: capitalize; }
.desk-foot a:hover { text-decoration: underline; color: #fff; }

/* ---- the home page: the book on the desk ----------------------------------------------------------------------------
   Without the scene (no JS, no WebGL) and in narrow windows the sheets are cards in normal flow (sized in page units,
   --u); with the scene on a wide window book.js prints them onto the book's pages and the HTML steps out of sight. */
.home .book-overlay { --u: clamp(15px, 3.4vw, 22px); padding: 96px 16px 20px; display: grid; gap: 22px; justify-items: center; }
.home .sheet { display: block; width: min(100%, calc(21.5 * var(--u))); color: var(--ink); background: var(--fibre), var(--page); border-radius: 4px 6px 5px 7px;
  box-shadow: var(--cut), var(--contact), var(--cast); }
.left-sheet { padding: calc(1.2 * var(--u)) calc(1.3 * var(--u)) calc(1 * var(--u)) calc(2.1 * var(--u)); font-size: var(--u); line-height: 1.3; }
.kicker { margin: 0; font: italic 400 calc(.78 * var(--u))/1.2 var(--body); color: var(--ink-2); }
.book-title { margin: calc(.2 * var(--u)) 0 0; font: 700 calc(3.1 * var(--u))/1 var(--display); color: var(--ink); text-shadow: calc(.07 * var(--u)) calc(.07 * var(--u)) 0 rgb(200 74 53 / .55); letter-spacing: .01em; }
.book-title span { color: var(--accent); text-shadow: calc(.07 * var(--u)) calc(.07 * var(--u)) 0 rgb(59 42 30 / .5); }
.byline { margin: calc(.35 * var(--u)) 0 0; font: italic 400 calc(.66 * var(--u))/1.3 var(--body); color: var(--ink-2); padding-bottom: calc(.6 * var(--u));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8'%3E%3Cpath d='M0 4q5-4 10 0t10 0 10 0 10 0' fill='none' stroke='%233b2a1e' stroke-opacity='.5' stroke-width='1.2'/%3E%3C/svg%3E") left bottom / calc(1.6 * var(--u)) auto repeat-x; }
.contents-head { display: flex; justify-content: space-between; align-items: baseline; margin: calc(.8 * var(--u)) 0 calc(.3 * var(--u)); }
.contents-head > span:first-child { font: 600 calc(.92 * var(--u))/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.leaf-no { font: italic 400 calc(.6 * var(--u))/1 var(--body); color: var(--ink-2); }
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters li { display: grid; grid-template-columns: calc(1.4 * var(--u)) 1fr auto; gap: 0 calc(.4 * var(--u)); align-items: baseline; padding: calc(.26 * var(--u)) 0;
  border-bottom: calc(.05 * var(--u)) dotted rgb(74 44 30 / .35); }
.chapters .no { font: 600 calc(.78 * var(--u))/1 var(--display); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.chapters a { font: 400 calc(.78 * var(--u))/1.22 var(--body); color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapters a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: calc(.04 * var(--u)); }
.chapters time { font: italic 400 calc(.66 * var(--u))/1 var(--body); color: var(--ink-2); white-space: nowrap; }
.leaf-nav { display: none; justify-content: space-between; margin-top: calc(.5 * var(--u)); }
.leaf-nav button { font: 600 calc(.66 * var(--u))/1 var(--display); letter-spacing: .06em; color: var(--accent); background: none; border: 0; padding: calc(.3 * var(--u)) 0; cursor: pointer; }
.leaf-nav button:disabled { opacity: .3; cursor: default; }
.series-row { display: flex; justify-content: space-between; margin-top: calc(.3 * var(--u)); padding-top: calc(.3 * var(--u)); }
.series-row .sb-icon { width: calc(1.35 * var(--u)); height: calc(1.35 * var(--u)); }
.series-row a { border-radius: 50%; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.series-row a:hover { transform: translateY(calc(-.15 * var(--u))) rotate(-6deg); }
.caption-sheet { display: flex !important; align-items: center; gap: calc(.35 * var(--u)); height: auto; padding: calc(.45 * var(--u)) calc(.8 * var(--u)); text-decoration: none;
  font: italic 400 calc(.72 * var(--u))/1.25 var(--body); color: var(--ink) !important; }
.caption-sheet em { font-style: normal; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.caption-sheet .lbl { font: 600 calc(.55 * var(--u))/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--core); background: var(--accent); padding: calc(.18 * var(--u)) calc(.3 * var(--u)); border-radius: 3px; font-style: normal; }
.caption-sheet .go { font-style: normal; color: var(--accent); }
.caption-sheet:hover em { color: var(--accent); text-decoration: underline; }
.desk-hint { display: none; }
.stage-spacer { display: none; }

/* the scene is up (book.js): the canvas is the first screen */
.home.book-live .book-canvas { touch-action: pan-y; }
.home.book-live .stage-spacer { display: block; height: calc(100svh - 150px); }
.home.book-live.book-narrow .book-overlay { position: relative; z-index: 6; }
.home.book-live .book-overlay { padding-top: 0; }
/* ... and on a wide window the contents are printed onto the book's left page by book.js (a canvas texture in the
   scene): the HTML stays for screen readers, keyboards and search engines, out of sight; one screen, no scroll */
.home.book-live:not(.book-narrow) { height: 100vh; overflow: hidden; }
.home.book-live:not(.book-narrow) .stage-spacer, .home.book-live:not(.book-narrow) .desk-foot { display: none; }
.home.book-live:not(.book-narrow) .book-overlay { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; margin: -1px; }
.home.book-live:not(.book-narrow) .desk-hint { display: block; position: absolute; left: 22px; bottom: 18px; z-index: 6; padding: 7px 12px; font: italic 400 13px/1 var(--body); color: var(--ink-2);
  background: var(--fibre), var(--page); border-radius: 3px; box-shadow: var(--cut), var(--contact); opacity: .9; pointer-events: none; }

/* while the book loads on a wide window (html.book-loading, set inline in the home layout): the desk and a paper
   note; the HTML contents wait out of sight (still read by screen readers) unless the book fails or times out */
.book-loader { display: none; }
.book-loading body.home:not(.book-live) { height: 100vh; overflow: hidden; }
.book-loading body.home:not(.book-live) .desk-foot { display: none; }
.book-loading body.home:not(.book-live) .book-overlay { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; margin: -1px; }
.book-loading body.home:not(.book-live) .book-loader { display: flex; align-items: center; gap: 12px; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-1deg);
  padding: 12px 20px 12px 16px; font: italic 400 16px/1 var(--body); color: var(--ink-2); background: var(--fibre), var(--page); border-radius: 3px 5px 4px 6px; box-shadow: var(--cut), var(--contact), var(--cast);
  animation: loader-in .4s .5s both; }
.book-loader .flap { width: 22px; height: 16px; background: var(--accent); border-radius: 2px; transform-origin: 50% 100%; box-shadow: 0 0 0 1px rgb(74 30 20 / .7);
  animation: flap 1.1s cubic-bezier(.3, 1.4, .5, 1) infinite alternate; }
@keyframes flap { from { transform: perspective(60px) rotateX(70deg); } to { transform: perspective(60px) rotateX(0); } }
@keyframes loader-in { from { opacity: 0; } }   /* only shows if the book takes more than half a second */

@media (max-width: 640px) {
  .ribbons { right: 10px; gap: 5px; }
  .rib { width: 70px; font-size: 12.5px; padding: 14px 0 20px; }
  .rib:hover, .rib[aria-current] { padding-top: 22px; }
  .desk { padding: 80px 10px 30px; }
  .badge { width: 60px; height: 60px; }
  .badge .sb-icon { width: 38px; height: 38px; }
  .prose { font-size: 17.5px; }
  .prose h2::before { display: none; }
  .prose div.highlighter-rouge { margin: 1.4em -12px; border-radius: 2px; }
  .prose pre { font-size: 13.5px; }
  .chapter-foot { grid-template-columns: 1fr; }
  .turn.newer { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
