/* Fonts live with the site rather than on Google Fonts, so they arrive with the page.
   font-display: block waits a moment for the real font instead of flashing a stand-in
   (a fancy calligraphy font for "cursive" on a Mac), which used to show on the cover and make text jump in size. */
@font-face { font-family: "Amatic SC"; src: url("../assets/fonts/amatic-sc-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: block; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/caveat.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: block; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: block; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/nunito-sans.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: block; }
@font-face { font-family: "Patrick Hand SC"; src: url("../assets/fonts/patrick-hand-sc.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }

:root {
  --ink: #2d2a26;
  --backdrop: #efe8da;
  --page: #f6f0e3;
  --endpaper: #f1e9d8;
  --board: #6f87a0;

  /* Paper colours, taken from the Salt Fat Acid Heat pages */
  --blue: #9fb4c8;   --blue-title: #7d95ae;
  --coral: #e7836d;  --coral-title: #cf6450;
  --green: #93a86c;  --green-title: #5c6e40;
  --yellow: #ecd69c; --yellow-title: #dfa66f;

  /* Book size: one page is 4:5. Two pages side by side must fit the screen. */
  --ph: min(calc(100svh - 5.5rem), calc((100vw - 4rem) * 0.625));
  --pw: calc(var(--ph) * 0.8);
  --in: calc(var(--ph) * 0.014);   /* how far the pages sit inside the hard cover */

  --turn: .95s;
  --ease: cubic-bezier(.62, .04, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* the page itself never scrolls (the book fits the screen), so stop the trackpad's elastic bounce from dragging it up and down */
html, body { overscroll-behavior: none; }

body {
  background:
    radial-gradient(120% 90% at 50% 40%, #f6f1e6 0%, var(--backdrop) 60%, #e6dccb 100%);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  min-height: 100svh;
  overflow-x: hidden;
}

a { color: inherit; }

/* Paper grain: a tiny noise texture laid over every paper surface */
.paper { isolation: isolate; }
.paper::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.18  0 0 0 0 0.15  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  opacity: .3;
  mix-blend-mode: multiply;
}

/* ================= Window light (markup after the stage) =================
   Warm light falls on the room behind the book; leaves outside throw shadows across the closed cover,
   fluttering in a breeze. Once the book opens, the light and the leaves move off it, so pages stay clear. */
.stage { position: relative; z-index: 1; }
.sun-back, .sun-front { position: fixed; pointer-events: none; }
.sun-back { inset: 0; width: 100%; height: 100%; z-index: 0; }
.sun-back .shade { mix-blend-mode: multiply; }
.sun-back .glow { mix-blend-mode: soft-light; }
/* the leaves are laid out on the book itself (sized from its height), so they land on the cover on any screen */
.sun-front {
  z-index: 2;
  left: 50%; top: 50%;
  width: calc(var(--ph) * 2.2); height: calc(var(--ph) * 1.375);
  transform: translate(-50%, -50%);
  overflow: visible;
  mix-blend-mode: multiply;
}
.sun-back .travel, .sun-front .place { transition: transform 1.6s cubic-bezier(.45, 0, .2, 1); }
.sun-front .place { transform: translate(470px, 170px) scale(1.55); }
.stage:not([data-state="closed"]) ~ .sun-back .travel { transform: translate(1010px, -60px) rotate(-5deg); }
.stage:not([data-state="closed"]) ~ .sun-front .place { transform: translate(1395px, -60px) scale(1.55); }
/* the breeze: the branch sways in uneven gusts, each leaf flutters on its own */
.sun-front .wind { animation: wind 6.5s ease-in-out infinite; }
@keyframes wind {
  0% { transform: rotate(-1.6deg); } 18% { transform: rotate(1.4deg); } 32% { transform: rotate(-.3deg); }
  52% { transform: rotate(2.4deg); } 70% { transform: rotate(-1deg); } 84% { transform: rotate(.8deg); } 100% { transform: rotate(-1.6deg); }
}
.sun-front .flutter { animation: flutter 2.3s ease-in-out infinite alternate; }
@keyframes flutter { from { transform: rotate(-6deg); } to { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) {
  .sun-back .travel, .sun-front .place { transition: none; }
  .sun-front .wind, .sun-front .flutter { animation: none; }
}

/* ================= Stage + book mechanics ================= */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .9rem 0;
  perspective: 2600px;
  overflow: hidden;
}

.book {
  position: relative;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  flex: none;
  transform-style: preserve-3d;
  transform: translateX(calc(var(--pw) * -.5));
  transition: transform var(--turn) var(--ease);
}
.book.is-open { transform: translateX(0); }

/* Back cover board, under the right-hand pages */
.board {
  position: absolute;
  left: var(--pw); top: 0;
  width: var(--pw); height: var(--ph);
  background: var(--board);
  border-radius: 3px 12px 12px 3px;
  box-shadow: 0 26px 40px -18px rgba(45, 42, 38, .55), 0 4px 10px rgba(45, 42, 38, .18);
  transition: box-shadow var(--turn) var(--ease);
}
/* Closed and seen from above, only the cover shows: the book's thickness reads from the shadow it casts on the
   desk, offset away from the light (top left). It sits on the board, so it stays put when the cover lifts. */
.stage[data-state="closed"] .board {
  box-shadow:
    5px 7px 3px rgba(40, 28, 15, .3),
    12px 16px 14px rgba(40, 28, 15, .22),
    6px 34px 50px -12px rgba(40, 28, 15, .38);
}

/* Pages that never move (the chapter page underneath) */
.base {
  position: absolute;
  left: var(--pw);
  top: var(--in);
  width: calc(var(--pw) - var(--in));
  height: calc(var(--ph) - var(--in) * 2);
  /* seen from above, only the top page shows; the page block's soft shadow falls on the cover board */
  box-shadow: 1px 2px 3px rgba(40, 28, 15, .22);
  border-radius: 0 4px 4px 0;
  overflow: hidden;
  container-type: size;
}

/* A leaf is one sheet: front on the right, back shows on the left once turned */
.leaf {
  position: absolute;
  left: var(--pw);
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform var(--turn) var(--ease), visibility 0s;
}
.leaf-cover {
  top: 0;
  width: var(--pw); height: var(--ph);
  transform: rotateY(0deg) translateZ(3px);
}
.leaf-cover.turned { transform: rotateY(-180deg) translateZ(3px); }

.leaf-page {
  top: var(--in);
  width: calc(var(--pw) - var(--in));
  height: calc(var(--ph) - var(--in) * 2);
  transform: rotateY(0deg) translateZ(2px);
}
.leaf-page.turned { transform: rotateY(-180deg) translateZ(2px); }
/* A turned-over page can still block clicks on the page beneath it in 3D, so it ignores them.
   Nothing on a left page needs clicking: its back corner sits outside the 3D pages. */
.leaf.turned { pointer-events: none; }
/* except the contact links on the inside cover, which stay clickable. On the Contents spread nothing
   lies over the cover, so it sits just in front of the book's surface; otherwise that surface takes the click */
.leaf.turned .hi-links a { pointer-events: auto; }
.stage[data-state="contents"] .leaf-cover.turned { transform: rotateY(-180deg) translateZ(-3px); }

/* Back cover: hinged on the right edge of the spine like the pages; turning it lays it over the left pages */
.leaf-back {
  top: 0;
  width: var(--pw); height: var(--ph);
  transform: rotateY(0deg) translateZ(-1px);
}
.leaf-back.turned { transform: rotateY(-180deg) translateZ(-4px); }
.back-inside {   /* the inside of the back cover is the board the last page sits on */
  background: var(--board);
  border-radius: 3px 12px 12px 3px;
  box-shadow: 0 26px 40px -18px rgba(45, 42, 38, .55), 0 4px 10px rgba(45, 42, 38, .18);
}
.back-board {
  background: var(--page);
  border-radius: 12px 3px 3px 12px;
  box-shadow: 0 30px 44px -20px rgba(45, 42, 38, .6), 0 6px 12px rgba(45, 42, 38, .16);
}
/* when the back closes, the book slides so the closed back sits in the middle, and the right-hand pages go with it */
.book.is-back { transform: translateX(calc(var(--pw) * .5)); }
.board { transition: opacity .35s ease; }
/* closing at the end, the board and its page go over as the back cover itself, so the real ones vanish at once */
.book.is-back .board, .book.back-landing .board, .book.back-landing .base { opacity: 0; transition: none; }
/* the last page goes over with the back cover: a copy rides on its inside, so the real page hides at once */
.book.is-back .base { opacity: 0; }
.back-page { position: absolute; left: 0; top: var(--in); width: calc(var(--pw) - var(--in)); height: calc(var(--ph) - var(--in) * 2); overflow: hidden; container-type: size; border-radius: 0 4px 4px 0; box-shadow: 1px 2px 3px rgba(40, 28, 15, .22); }

/* the back cover's contents, laid on once it lands */
.backcover {
  position: absolute;
  left: 0; top: 0;
  width: var(--pw); height: var(--ph);
  padding: calc(var(--ph) * .08) calc(var(--pw) * .09) calc(var(--ph) * .05);
  container-type: size;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateZ(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  outline: none;
}
.book.is-back .backcover { opacity: 1; pointer-events: auto; transition: opacity .5s ease calc(var(--turn) * .8); }
.backcover.bc-print { opacity: 1; transform: none; pointer-events: none; transition: none; }
.backcover .kicker { font-size: max(16px, 4.6cqw); }
.bc-title {
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  font-size: max(40px, 17cqw);
  line-height: .9;
  color: #4f6a85;
  margin: auto 0 2.2cqh;     /* auto above the title and below the note: the message sits in the middle of the page */
}
.bc-note { max-width: 78cqw; font-size: max(13px, 3.1cqw); line-height: 1.5; }
.bc-links { list-style: none; margin: 3cqh 0 3.5cqh; display: grid; gap: 1.1cqh; font-size: max(15px, 3.9cqw); font-weight: 700; }
.bc-links a {
  font-size: max(15px, 3.9cqw);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid rgba(217, 130, 107, .7);
}
.bc-links a:hover, .bc-links a:focus-visible { border-bottom-color: var(--ink); }
.bc-plane {                /* a paper plane doodle, flying off the top right: "send me a message" */
  position: absolute;
  top: 9cqh; right: 9cqw;
  width: max(90px, 24cqw); height: auto;
  overflow: visible;
  pointer-events: none;
}
.bc-colophon {             /* how the book was made, on a blue sticky note taped to the back */
  position: relative;
  margin: 1cqh 0 auto;
  padding: 2cqh 4cqw;
  max-width: 62cqw;
  background: color-mix(in srgb, var(--blue) 35%, #fff);
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .15);
  transform: rotate(.8deg);
  font-size: max(12px, 2.8cqw); line-height: 1.45;
}
.bc-colophon::before, .craft-note::before {     /* a strip of washi tape */
  content: "";
  position: absolute;
  top: -.55em; left: 42%;
  width: 16%; height: 1.1em;
  background: color-mix(in srgb, var(--coral) 70%, transparent);
  transform: rotate(3deg);
}
.bc-colophon p + p { margin-top: .5em; }
/* On a short book (small laptops, tablets) the back cover keeps its essentials: the barcode goes first,
   then the colophon */
@container (max-height: 640px) { .bc-foot { display: none; } }
@container (max-height: 540px) { .bc-colophon { display: none; } .bc-links { margin-bottom: auto; } }
.bc-foot { margin-top: 1.2cqh; display: flex; align-items: flex-end; gap: 3cqw; font-family: "Nunito Sans", system-ui, sans-serif; font-size: max(14px, 3.4cqw); opacity: .8; font-size-adjust: .4; }
.bc-barcode { width: 18cqw; height: auto; background: #fff; padding: 4px 6px; border-radius: 2px; }
.bc-nav { align-self: stretch; display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.4cqh; font-family: "Nunito Sans", system-ui, sans-serif; font-size: max(13px, 3cqw); font-size-adjust: .4; }
.bc-nav a { color: var(--ink); text-decoration: none; }
.bc-nav a:hover, .bc-nav a:focus-visible { text-decoration: underline; }
.stage[data-state="contact"] .controls { visibility: hidden; }

/* Closed book: the cover peeks open a touch on hover */
.book:not(.is-open) .leaf-cover:hover {
  transform: rotateY(-5deg) translateZ(3px);
  transition-duration: .45s;
}

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  container-type: size;
}
.face.back { transform: rotateY(180deg); }

/* Shading that sweeps across a page while it turns */
.face .shade {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
}
.face.front .shade { background: linear-gradient(to right, rgba(45,42,38,.35), rgba(45,42,38,.08)); }
.face.back  .shade { background: linear-gradient(to left,  rgba(45,42,38,.35), rgba(45,42,38,.08)); }
.leaf.turning .shade { animation: shade var(--turn) var(--ease); }
@keyframes shade { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* Gutter: the soft shadow where pages dip into the spine */
.gutter-r::before, .gutter-l::before {
  content: "";
  position: absolute; top: 0; bottom: 0;
  width: 14%;
  pointer-events: none;
  z-index: 4;
}
.gutter-r::before { left: 0;  background: linear-gradient(to right, rgba(45,42,38,.2), rgba(45,42,38,.06) 35%, transparent); }
.gutter-l::before { right: 0; background: linear-gradient(to left,  rgba(45,42,38,.2), rgba(45,42,38,.06) 35%, transparent); }

/* ================= Cover (front of the first leaf) ================= */
.cover {
  background: var(--page);
  border-radius: 3px 12px 12px 3px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .65), inset -1px -1px 0 rgba(45, 42, 38, .2);   /* the board's bevelled edge */
  transition: box-shadow var(--turn) var(--ease);
}
.book.is-open .cover { box-shadow: none; }
/* hinge groove + soft sheen, so it reads as a hardcover */
.cover .hinge {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    /* the cover wraps round the spine: the edge darkens as it turns away, light catches the curve,
       then the pressed hinge groove (a shadow line with a lit edge) runs top to bottom */
    linear-gradient(to right,
      rgba(45,42,38,.24) 0, rgba(45,42,38,.07) .8%, rgba(255,255,255,.24) 1.8%, rgba(255,255,255,0) 3%,
      rgba(45,42,38,.05) 3.8%, rgba(45,42,38,.36) 4.4%, rgba(45,42,38,.1) 4.8%,
      rgba(255,255,255,.5) 5.1%, rgba(255,255,255,0) 6.2%, rgba(45,42,38,.05) 7.5%, rgba(45,42,38,0) 10%),
    linear-gradient(115deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(45,42,38,.06) 100%);
}

.cover-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 15cqh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: 5cqw;
}
.role {
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  font-size: 7.4cqh;
  line-height: .95;
  letter-spacing: .04em;
}
.name {
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 4.4cqh;
  line-height: 1;
  margin-top: .3cqh;
}

.quads {
  position: absolute;
  top: 15cqh; bottom: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: .8cqw;
  padding: 0 1.4cqw 1.4cqw 5.2cqw;
}

.quad {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--bg);
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}
.quad:focus-visible { box-shadow: inset 0 0 0 3px var(--ink); }

.work  { --bg: var(--blue);   --title: var(--blue-title); }
.ai, .work.ai { --bg: #ee9a87; --title: var(--coral-title); }   /* a lighter coral, so the text reads well on it */
.about  { --bg: var(--yellow); --title: var(--yellow-title); }
.fun    { --bg: var(--green);  --title: var(--green-title); }
.resume { --bg: #fbf8f1; --title: #4f6f96; }   /* plain paper, with an ink-blue title */

/* Hand-lettered title: thick monoline letters with a thin ink outline.
   Two stacked layers: an ink layer underneath, the coloured letter on top. */
.title {
  position: relative;
  display: inline-block;
  font-family: "Amatic SC", cursive;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: transparent;
}
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
}
.title::before { color: var(--ink);   -webkit-text-stroke: .085em var(--ink); }
.title::after  { color: var(--title); -webkit-text-stroke: .055em var(--title); }

.quad .title {
  position: absolute;
  top: 2.4cqh;
  font-size: 6.4cqw;
  transition: transform .35s ease;
}
.quad.work .title, .quad.fun .title  { left: 2.6cqw; }
.quad.about .title, .quad.resume .title { right: 2.6cqw; }

/* Illustration group: cut-out pieces lying on the coloured paper.
   Each piece is placed by % of the group box with --x, --y, --w, --r (rotation). */
.art-group {
  position: absolute;
  display: block;
  aspect-ratio: 1;
  pointer-events: none;
}
.art-group .piece {
  position: absolute;
  overflow: visible;
  left: var(--x); top: var(--y);
  width: var(--w);
  height: auto;
  z-index: var(--z, 1);
  transform: translateY(var(--lift, 0)) rotate(var(--r, 0deg));
  filter: drop-shadow(2px 4px 3px rgba(45, 42, 38, .28));
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.art-group .piece:nth-child(2) { transition-delay: .04s; }
.art-group .piece:nth-child(3) { transition-delay: .08s; }
.art-group .piece:nth-child(4) { transition-delay: .12s; }
/* washi tape holding the resume page */
.art-group .tape {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 26%; height: 7%;
  z-index: 4;
  background: rgba(159, 180, 200, .78);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 18% 0, 82% 0, 88% 10%, 94% 0, 100% 8%, 100% 92%, 94% 100%, 88% 90%, 82% 100%, 18% 100%, 12% 90%, 6% 100%, 0 92%);
  transform: rotate(var(--r, 0deg));
}

.quad .art-group { bottom: 2cqh; width: 29cqw; }
.quad.work .art-group, .quad.fun .art-group     { left: 2cqw; }
.quad.about .art-group, .quad.resume .art-group { right: 2cqw; }

.quad:hover .title, .quad:focus-visible .title { transform: translateY(-3px); }
.quad:hover .piece, .quad:focus-visible .piece { --lift: -5px; }

.me {
  position: absolute;
  left: calc(50% + 1.9cqw);
  bottom: 2cqh;
  height: 76cqh;
  width: auto;
  transform: translateX(-50%) rotate(-1.5deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 2px 2px rgba(45, 42, 38, .18)) drop-shadow(0 10px 14px rgba(45, 42, 38, .22));
  pointer-events: none;
  z-index: 3;
}

/* ================= Inside cover (back of the first leaf) ================= */
.inside-cover {
  background: var(--board);
  border-radius: 12px 3px 3px 12px;
  box-shadow: 0 26px 40px -18px rgba(45, 42, 38, .55), 0 4px 10px rgba(45, 42, 38, .18);
}
.endpaper {
  position: absolute;
  top: var(--in); bottom: var(--in); left: var(--in); right: 0;
  background: var(--endpaper);
  border-radius: 4px 0 0 4px;
}

/* Welcome note on the inside cover (left page when the book opens) */
.welcome {
  position: absolute;
  inset: 0;
  padding: 9cqh 9cqw 7cqh 10cqw;
  display: flex;
  flex-direction: column;
}
.hello {
  --title: var(--coral);
  align-self: flex-start;
  font-size: 10cqw;
}
.note {
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(16px, 3.8cqw);
  line-height: 1.3;
  margin-top: 3cqh;
  font-size-adjust: .36;
}
.craft-note {              /* how she works, on a blue sticky note like the back cover's */
  position: relative;
  align-self: flex-start;
  margin-top: 3.4cqh;
  padding: 1.6cqh 3.5cqw;
  background: color-mix(in srgb, var(--blue) 35%, #fff);
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .15);
  transform: rotate(.8deg);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(14px, 3.2cqw);
  line-height: 1.4;
  font-size-adjust: .4;
}
/* On a phone the inside cover is never seen, so a copy sits under the Contents list */
.welcome--phone { display: none; }

/* ================= Inner pages ================= */
.sheet {
  background: var(--page);
  border-radius: 0 4px 4px 0;
}
.face.back.sheet { border-radius: 4px 0 0 4px; }

.page-pad {
  position: absolute;
  inset: 0;
  padding: 8cqh 9cqw 6cqh 11cqw;
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 11cqw;
  --title: var(--page);
  align-self: flex-start;
}
.page-title:focus { outline: none; }

/* Contents */
.toc {
  list-style: none;
  margin-top: 6cqh;
  display: flex;
  flex-direction: column;
  gap: 4.6cqh;   /* five rows fit the page */
}
.toc a {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: 0 2.4cqw;
  text-decoration: none;
  border-radius: 4px;
  outline: none;
}
.toc a:focus-visible { box-shadow: 0 0 0 3px var(--ink); }
.toc .num, .toc .pg {
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(14px, 3.6cqw);
  font-size-adjust: .4;
  font-weight: 600;
}
.toc .title { font-size: 7.8cqw; transition: transform .3s ease; }
.toc a:hover .title, .toc a:focus-visible .title { transform: translateX(6px); }
.toc .dots {
  border-bottom: 2px dotted rgba(45, 42, 38, .45);
  transform: translateY(-.5cqw);
}
.toc .sub {
  grid-column: 2 / -1;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(14px, 3.3cqw);
  opacity: .75;
  margin-top: .4cqh;
  font-size-adjust: .4;
}

/* Chapter opener: full coloured page, like SALT / FAT */
.opener {
  background: var(--bg);
  border-radius: 4px 0 0 4px;
}
.opener .title {
  position: absolute;
  top: 7cqh; left: 9cqw; right: 9cqw;
  font-size: 21cqw;
}
.opener.work .title { font-size: 14cqw; }   /* "Work I’ve done" and "Built with AI" on one line, clear of what is under them */
.opener .art-group {
  right: 10cqw; bottom: 7cqh;
  width: 66cqw;
}

/* Chapter page (right side) */
.chapter[hidden] { display: none; }
.chapter .page-pad { padding-top: 6cqh; padding-bottom: 4cqh; }
.chapter.work .page-pad { overflow: hidden; }   /* so the fit check counts the bottom padding and the last row stays off the edge */
.chapter.work .kicker { font-size: max(15px, 4cqw); }        /* a smaller heading leaves room for the list's tags */
.chapter.work .page-title { font-size: 9cqw; }
.kicker {
  font-family: "Caveat", cursive;
  font-size: max(16px, 4.6cqw);
  opacity: .75;
}
.chapter .page-title { font-size: 11cqw; --title: var(--bg); }
.band { display: none; }

.studies {
  list-style: none;
  margin-top: 2.6cqh;
  display: flex;
  flex-direction: column;
}
.studies li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4cqh 3cqw;
  padding: 1.9cqh 0;
  border-top: 1.5px dashed rgba(45, 42, 38, .35);
}
.studies li:last-child { border-bottom: 1.5px dashed rgba(45, 42, 38, .35); }
.studies .n {
  grid-row: span 3;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(18px, 6cqw);
  line-height: 1;
  color: var(--blue-title);
  font-size-adjust: .4;
  font-weight: 600;
}
.studies h3 {
  font-family: "Newsreader", Georgia, serif;
  font-size: max(22px, 6.6cqw);
  line-height: 1;
  letter-spacing: -.01em;
  font-weight: 600;
  font-size-adjust: 0.38;
}
.studies p {
  font-size: clamp(12px, 2.7cqw, 16px);
  line-height: 1.4;
}
.soon {
  justify-self: start;
  font-family: "Caveat", cursive;
  font-size: max(13px, 3.3cqw);
  padding: 0 .9em;
  border-radius: 99px;
  background: var(--blue);
  margin-top: .3cqh;
}

/* What I build with AI: the same rows as the case studies list, with a status pill where a case study has its skills */
.cases .tags i.status { border-color: rgba(45, 42, 38, .45); color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.cases .tags i.status.shipped { background: rgba(199, 219, 176, .6); }
.cases .tags i.status.building { background: rgba(236, 214, 156, .6); }
.status.shipped { background: rgba(199, 219, 176, .6); }
.status.building { background: rgba(236, 214, 156, .6); }

/* ================= Resume chapter =================
   No scrolling, like a real book. Text sizes are multiplied by --fit,
   which the script lowers a little if a short screen can't hold everything. */
.cv-head {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: calc(var(--fit, 1) * max(19px, 5cqw));
  letter-spacing: -.01em;
  line-height: 1;
  margin: calc(var(--fit, 1) * 2.4cqh) 0 calc(var(--fit, 1) * 1.1cqh);
  padding-bottom: .3cqh;
  border-bottom: 2px solid rgba(45, 42, 38, .18);
  outline: none;
  font-size-adjust: 0.33;
}
.cv-head:first-child { margin-top: 0; }
.cv-summary, .cv-job li, .cv-skills dd, .cv-tools, .cv-edu {
  font-size: calc(var(--fit, 1) * clamp(11.5px, 2.3cqw, 14px));
  line-height: 1.38;
}
.cv-job { margin-bottom: calc(var(--fit, 1) * 1.1cqh); }
.cv-job header { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.cv-job h4 { font-size: calc(var(--fit, 1) * clamp(12.5px, 2.7cqw, 15.5px)); font-weight: 600; }
.cv-dates { font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * clamp(14px, 3cqw, 18px)); white-space: nowrap; opacity: .8; font-size-adjust: .4; }
.cv-role { font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * clamp(15px, 3.3cqw, 19px)); line-height: 1.1; margin-bottom: .4cqh; font-size-adjust: .4; font-weight: 600; }
.cv-job ul { padding-left: 1.15em; }
.cv-role.with-dates { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
/* two roles at one company: the second repeats the company only when it starts a new phone page */
.cv .cv-cont > header { display: none; }
.cv-job li { margin-bottom: .25em; }
.cv-job li::marker { color: var(--title); }
.cv-skills dt { font-weight: 600; font-size: calc(var(--fit, 1) * clamp(11.5px, 2.4cqw, 14px)); margin-top: calc(var(--fit, 1) * .9cqh); }
.cv-edu p + p { margin-top: 1cqh; }
.cv-edu .cv-dates { margin-left: .4em; }

/* Right page: Experience, with Download at the top right */
.chapter.resume .cv {
  overflow: hidden;
  padding: 10cqh 7cqw 3cqh 10cqw;
}
/* on text-heavy chapters the ribbon becomes a short tab so it never covers text */
.stage[data-state="resume"] .ribbon, .stage[data-state="about"] .ribbon { height: 8.5cqh; font-size: 0; }
.cv-download {
  position: absolute;
  top: 2.4cqh; right: 19cqw;        /* just left of the ribbon tab */
  z-index: 7;
  padding: .2em .9em;
  border-radius: 99px;
  background: var(--ink);
  color: #fbf6ec;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: max(13px, 2.6cqw);
  text-decoration: none;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .25);
  transition: transform .2s ease, box-shadow .2s ease;
  outline: none;
  font-size-adjust: .4;
}
.cv-download:hover { transform: translateY(-2px); box-shadow: 3px 5px 0 rgba(45, 42, 38, .25); }
.cv-download:focus-visible { box-shadow: 0 0 0 3px #fbf6ec, 0 0 0 5px var(--ink); }

/* Left page: Summary, Skills, Tools, Education under the RESUME title */
.opener.resume .title { font-size: 10cqw; top: 4.5cqh; }
.opener .cv-side {
  position: absolute;
  top: 4.5cqh; bottom: 3cqh; left: 9cqw; right: 7cqw;
  padding-top: 11cqh;               /* room for the RESUME title, with email and LinkedIn beside it */
  overflow: hidden;
  z-index: 5;
}

/* ================= Zed draws (under Fun projects): scrapbook pages, one theme per page ================= */
.opener.drawings .title { display: none; }            /* her own lettering, taped in, is the title */
.opener .draw-side { position: absolute; top: 5cqh; bottom: 4cqh; left: 8cqw; right: 7cqw; z-index: 5; }
.chapter.drawings .page-pad { overflow: hidden; padding: 5cqh 13cqw 4cqh 10cqw; }  /* wider on the right: the ribbon hangs there */
.chapter .draw-side { display: none; }
.theme { height: 100%; display: flex; flex-direction: column; }
.theme-head { display: flex; align-items: center; gap: 3cqw; flex: none; height: 15cqh; }
.zed-label { height: 13cqh; width: auto; border: 3px solid #fff; box-shadow: 0 1px 1px rgba(45, 42, 38, .2), 0 6px 10px -6px rgba(45, 42, 38, .45); transform: rotate(-4deg); }
.theme-name { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: max(22px, 6cqw); white-space: nowrap; line-height: 1; letter-spacing: -.01em; font-size-adjust: 0.36; }
.pile {
  display: flex; align-items: center; gap: 2cqw;
  margin-left: 1cqw; padding: 0; border: 0; background: none;   /* right after the theme name, clear of the ribbon */
  font-family: "Caveat", cursive; font-size: max(15px, 3.6cqw); color: var(--green-title);   /* matches "Fold it back" on the open pile */
  cursor: pointer;
}
.opener .pile { color: var(--ink); }   /* on the green page, ink, matching "Fold it back" there */
.pile span { white-space: nowrap; }
.pile:hover span { text-decoration: underline; }
.prints {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 2cqh 3cqw; align-items: center; justify-items: center;
}
.pasted { margin: 0; }
.print {
  position: relative; display: inline-block;
  padding: .5cqw; background: #fff;
  box-shadow: 0 1px 1px rgba(45, 42, 38, .18), 0 10px 16px -8px rgba(45, 42, 38, .45);
  transform: rotate(var(--tilt, -2deg));
}
.print::before {                /* a strip of washi tape */
  content: "";
  position: absolute;
  top: -1.4cqh; left: 34%;
  width: 32%; height: 2.8cqh;
  background: rgba(159, 180, 200, .8);
  transform: rotate(-4deg);
}
.pasted:nth-child(4n+2) .print { --tilt: 2.2deg; }
.pasted:nth-child(4n+3) .print { --tilt: 1.4deg; }
.pasted:nth-child(4n) .print { --tilt: -1.6deg; }
.pasted:nth-child(4n+2) .print::before { background: rgba(240, 143, 154, .7); transform: rotate(3deg); }
.pasted:nth-child(4n+3) .print::before { background: rgba(242, 201, 76, .75); }
.print img { display: block; max-width: 36cqw; max-height: 31cqh; width: auto; height: auto; cursor: zoom-in; }
.print img:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.book.over-print { cursor: zoom-in; }
.cv-pg .theme-head { height: 9cqh; }
.cv-pg .theme-name { white-space: normal; }   /* a phone page is too narrow for a long name on one line */
.cv-pg .zed-label { height: 8cqh; }
.cv-pg .print img { max-width: 36cqw; max-height: 25cqh; }

/* Zed draws: the pile opens its page as a gatefold (book.js). The book slides aside, then the page's outer edge lifts
   and swings out beside it; the inside of the page and the fold-out hold every drawing in the theme */
.gatefold {
  position: fixed; inset: auto; left: var(--gl); top: var(--gt);
  width: var(--gw); height: var(--gh); max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: var(--ink);
}
.gatefold::backdrop { background: transparent; }
.gf-paper { position: absolute; inset: 0; perspective: 3200px; }
.gf-inside, .gf-flap { position: absolute; top: 0; width: 50%; height: 100%; }
.gf-inside { left: 0; }
.gf-flap { left: 50%; z-index: 1; transform-origin: left center; transform-style: preserve-3d; }
.gatefold[data-side="left"] .gf-inside { left: 50%; }
.gatefold[data-side="left"] .gf-flap { left: 0; transform-origin: right center; }
.gf-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gf-back { transform: rotateY(180deg); }
/* the back of the flap is a copy of the page as it sits in the book, so the real page seems to lift */
.gatefold .gf-back > .gf-copy { position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; transform: none; box-shadow: none; }
/* one page of the gatefold */
.gf-page {
  position: absolute; inset: 0; container-type: size;
  display: flex; flex-direction: column;
  padding: 5cqh 6cqw 4cqh;
  background: var(--page);
}
.gf-inside .gf-page { box-shadow: inset 0 0 0 1px rgba(45, 42, 38, .04); }
.gf-front .gf-page { box-shadow: 0 2px 4px rgba(40, 28, 15, .2); }
.gatefold[data-side="right"] .gf-inside .gf-page { border-radius: 0; background-image: linear-gradient(to left, rgba(45, 42, 38, .1), transparent 8%); }
.gatefold[data-side="right"] .gf-front .gf-page { border-radius: 0 4px 4px 0; background-image: linear-gradient(to right, rgba(45, 42, 38, .1), transparent 8%); }
.gatefold[data-side="left"] .gf-page { background-color: var(--green); }   /* the same paper as the page it folds out of */
.gatefold[data-side="left"] .gf-inside .gf-page { border-radius: 0; background-image: linear-gradient(to right, rgba(45, 42, 38, .1), transparent 8%); }
.gatefold[data-side="left"] .gf-front .gf-page { border-radius: 4px 0 0 4px; background-image: linear-gradient(to left, rgba(45, 42, 38, .1), transparent 8%); }
.gf-head { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 4cqw; min-height: 7cqh; }
.gf-title { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: max(22px, 7cqw); line-height: 1; letter-spacing: -.01em; font-size-adjust: 0.36; }
.gf-title:focus { outline: none; }
.gf-close { margin-left: auto; padding: 0; border: 0; background: none; font-family: "Caveat", cursive; font-size: max(18px, 4cqw); color: #4f6a85; cursor: pointer; }
.gf-close:hover { text-decoration: underline; }
.gf-page .gf-close { color: var(--green-title); }   /* on a beige page, the green of Fun projects */
.gatefold[data-side="left"] .gf-page .gf-close { color: var(--ink); }   /* on a green page, ink: beige is too faint to read */
.gf-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.gf-prints {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); grid-template-rows: repeat(var(--rows, 2), 1fr);
  gap: 1.5cqh 2cqw; align-items: center; justify-items: center;
}
.gf-print { margin: 0; }
.gf-page .print { padding: .8cqw; }
.gf-page .print::before { top: -1.2cqh; height: 2.4cqh; }
.gf-page .print img { max-width: var(--cw); max-height: var(--ch); }
.gf-print:nth-child(4n+2) .print { --tilt: 2.2deg; }
.gf-print:nth-child(4n+3) .print { --tilt: 1.4deg; }
.gf-print:nth-child(4n) .print { --tilt: -1.6deg; }
.gf-print:nth-child(4n+2) .print::before { background: rgba(240, 143, 154, .7); transform: rotate(3deg); }
.gf-print:nth-child(4n+3) .print::before { background: rgba(242, 201, 76, .75); }
/* phones: no spread to open beside, so the page slides up from the bottom and scrolls */
.gatefold.slide { left: 0; top: auto; bottom: 0; width: 100%; height: 90svh; }
.gatefold.slide::backdrop { background: rgba(45, 42, 38, .35); }
.gatefold.slide .gf-flap { display: none; }
.gatefold.slide .gf-inside { left: 0; width: 100%; overflow-y: auto; border-radius: 12px 12px 0 0; background: var(--page); }
.gatefold.slide .gf-page { position: static; container-type: normal; padding: 1.2rem 1rem 2rem; background-image: none; }
.gatefold.slide .gf-title { font-size: 26px; }
.gatefold.slide .gf-close { font-size: 20px; }
.gatefold.slide .gf-prints { flex: none; grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 1.6rem 1rem; }
.gatefold.slide .gf-page .print { padding: 4px; }
.gatefold.slide .gf-page .print::before { top: -9px; height: 18px; }
.gatefold.slide .gf-page .print img { max-width: calc(50vw - 2.5rem); max-height: 50svh; }
@media (min-width: 701px) and (min-height: 501px) {   /* an upright tablet has room for three across */
  .gatefold.slide .gf-prints { grid-template-columns: repeat(3, 1fr); }
  .gatefold.slide .gf-page .print img { max-width: calc(33vw - 2.5rem); max-height: 34svh; }
}

/* ================= Kitchen (under Fun projects): four recipes as index cards taped into the book ================= */
.opener.kitchen .title { font-size: 15cqw; top: 5cqh; }
.opener .kitchen-side {
  position: absolute;
  top: 24.5cqh;   /* level with the first card on the right page */ bottom: 3cqh; left: 9cqw; right: 8cqw;
  z-index: 5;
}
.chapter.kitchen .page-pad { overflow: hidden; padding: 6cqh 9cqw 4cqh 11cqw; }
.kitchen-more a { font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * max(16px, 3.6cqw)); color: #4f6a85; text-decoration: none; font-size-adjust: .4; }
.kitchen-page > .recipe-card:first-of-type { margin-top: calc(var(--fit, 1) * 19.5cqh); }  /* first card lines up with the left page, clear of the ribbon */
.recipe-card h3:focus { outline: none; }
.kitchen-more a:hover { text-decoration: underline; }
.kitchen-more { margin-top: auto; }
.recipe-card {
  position: relative;
  margin: 0 0 calc(var(--fit, 1) * 3.4cqh);
  padding: calc(var(--fit, 1) * 2cqh) 4cqw calc(var(--fit, 1) * 1.6cqh);
  background: #fbfaf5 repeating-linear-gradient(transparent 0 1.5em, rgba(79, 106, 133, .16) 1.5em calc(1.5em + 1px));
  border-top: 3px solid rgba(226, 87, 76, .45);
  box-shadow: 0 1px 1px rgba(45, 42, 38, .18), 0 8px 14px -6px rgba(45, 42, 38, .35);
  transform: rotate(-.8deg);
}
.recipe-card + .recipe-card { transform: rotate(.9deg); }
.recipe-card::before {           /* a strip of washi tape */
  content: "";
  position: absolute;
  top: -.6em; left: 38%;
  width: 24%; height: 1.2em;
  background: rgba(159, 180, 200, .8);
  transform: rotate(-3deg);
}
.recipe-card h3 { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: calc(var(--fit, 1) * max(20px, 5cqw)); line-height: 1.05; letter-spacing: -.01em; font-size-adjust: 0.36; }
.recipe-card .rc-meta { font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * max(14px, 3.2cqw)); color: #4f6a85; margin: .15em 0 .4em; font-size-adjust: .4; }
.recipe-card p { font-size: calc(var(--fit, 1) * clamp(12px, 2.5cqw, 14.5px)); line-height: 1.45; }
.recipe-card .rc-tip { margin-top: .5em; }
.recipe-card .rc-link { display: inline-block; margin-top: .55em; font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * clamp(12.5px, 2.6cqw, 15px)); font-weight: 700; color: #4f6a85; text-decoration: none; font-size-adjust: .4; border-radius: 3px; outline: none; }
.recipe-card .rc-link:hover { text-decoration: underline; }
.recipe-card .rc-link:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.book.over-link { cursor: pointer; }
.recipe-card .rc-tip b {   /* marked with a yellow highlighter */
  font-weight: 700;
  padding: 0 .2em; margin-left: -.2em;
  background: linear-gradient(176deg, transparent 18%, color-mix(in srgb, var(--yellow) 90%, transparent) 22%, var(--yellow) 82%, transparent 86%);
  border-radius: 3px;
}
.chapter .kitchen-side { display: none; }
.cv-pg .recipe-card { margin: 0 4px calc(var(--fit, 1) * 2.6cqh); }   /* side room so a tilted card isn't clipped */
.cv-pg > .recipe-card:first-child { margin-top: 1em; }   /* room for its tape, which a turned page would otherwise cut off */

/* Work and Fun projects: ruled notes taped in.
   Every row of type is one --lh tall, so each line of text sits on a ruled line. */
.notes-page { display: flex; flex-direction: column; }
.notes-page .ruled-note:first-child { margin-top: calc(var(--fit, 1) * 6cqh); }
.recipe-card.ruled-note {
  --fs: calc(var(--fit, 1) * clamp(12px, 2.5cqw, 14.5px));
  --lh: calc(var(--fs) * 1.75);
  --pt: calc(var(--lh) * .6);
  padding: var(--pt) 4cqw calc(var(--lh) * .5);
  background: #fbfaf5;
}
.ruled-note::after {             /* the ruling, under the title, behind the type */
  content: "";
  position: absolute;
  z-index: -1;
  left: 0; right: 0; bottom: 0;
  top: calc(var(--pt) + var(--lh) * 2);
  background: repeating-linear-gradient(transparent 0 calc(var(--lh) - 1px), rgba(79, 106, 133, .2) calc(var(--lh) - 1px) var(--lh));
  background-position: 0 calc(var(--fs) * -.4);
}
.ruled-note h3 { line-height: calc(var(--lh) * 2); }
.recipe-card.ruled-note p, .ruled-note li { margin: 0; font-size: var(--fs); line-height: var(--lh); }
.recipe-card.ruled-note .rc-meta { margin: 0; font-size: calc(var(--fs) * 1.2); }
.journey-fig figcaption { margin-top: var(--lh); font-family: "Caveat", cursive; font-size: calc(var(--fs) * 1.45); line-height: var(--lh); color: #4f6a85; }
.journey { display: block; height: calc(var(--lh) * 7); width: auto; max-width: 100%; margin: 0 auto; overflow: visible; }
.journey--tall { display: none; }
@media (max-width: 700px) {
  .journey--wide { display: none; }
  .journey--tall { display: block; height: calc(var(--lh) * 8); }   /* phones get the taller hub, so labels stay readable */
}
.journey .jn-name { font-family: "Caveat", cursive; font-size: 27px; font-weight: 700; fill: var(--ink); }
.journey .jn-verb { font-family: "Caveat", cursive; font-size: 20px; fill: var(--ink); opacity: .8; }
.ruled-note .rc-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.ruled-note .rc-foot .rc-link { margin: 0; line-height: var(--lh); white-space: nowrap; }
/* the way into a chapter: an outlined pill, so it isn't lost in the card's text */
.ruled-note .rc-foot .rc-cta { align-self: center; padding: .3em 1em; line-height: 1.2; border: 1.5px solid rgba(79, 106, 133, .6); border-radius: 999px; background: rgba(255, 255, 255, .45); }
.ruled-note .ai-list + .rc-foot { margin-top: .5em; }
.ruled-note .rc-foot .rc-cta:hover { text-decoration: none; background: rgba(159, 180, 200, .25); border-color: #4f6a85; }
.ruled-note .rc-note { text-align: right; }
.stamp {                        /* a red rubber stamp */
  display: inline-block;
  margin-right: .55em;
  padding: 0 .4em;
  border: 1.5px solid rgba(226, 87, 76, .85);
  border-radius: 3px;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: .78em; font-weight: 800; line-height: 1.35; letter-spacing: .14em;
  color: #c2453a;
  transform: rotate(-6deg);
}
.ruled-note h3 .doodle { width: 1.25em; height: auto; margin-right: .35em; vertical-align: -.12em; overflow: visible; }
.note-prints { display: flex; align-items: center; gap: 5cqw; height: calc(var(--lh) * 7); padding-left: .6em; }
.note-prints img { width: auto; height: auto; max-height: calc(var(--lh) * 6); max-width: calc((100% - 10cqw - .6em) / 3); min-width: 0; padding: 3px; background: #fff; box-shadow: 0 1px 1px rgba(45, 42, 38, .18), 0 5px 9px -4px rgba(45, 42, 38, .35); transform: rotate(-3deg); }
.note-prints img:nth-child(2) { transform: rotate(2.5deg); }
.ai-list { list-style: none; }
.ai-list li { display: flex; align-items: center; gap: .6em; height: var(--lh); }
.ai-list li::before { content: "\2022"; color: #4f6a85; }
.ai-list b { font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: 1.15em; }
.ai-list .status { font-size: .66em; line-height: 1.4; padding: 0 .7em; border: 1.3px solid rgba(45, 42, 38, .45); border-radius: 99px; font-family: "Nunito Sans", system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
/* Phone pages (built by the script); hidden on larger screens */
.cv-pager { display: none; }
.chapter .cv-side { display: none; }

/* ================= About me chapter ================= */
.opener.about .title { font-size: 12cqw; top: 5cqh; }
.opener .about-side {
  position: absolute;
  top: 19cqh; bottom: 3cqh; left: 9cqw; right: 8cqw;
  overflow: hidden;
  z-index: 5;
  display: flex;
  flex-direction: column;
}
.opener.about .about-side { top: 18cqh; }
.opener .about-intro .see { color: var(--ink); font-size: 1.1em; }   /* on the yellow page, ink; on a phone's beige page it stays blue */
.about-intro {
  font-size: calc(var(--fit, 1) * clamp(13px, 2.7cqw, 16px));
  line-height: 1.5;
  margin-bottom: calc(var(--fit, 1) * 1.4cqh);
}
.about-intro b, .principles b { font-weight: 700; }

.opener .about-side { overflow: visible; }

.looking {
  margin: calc(var(--fit, 1) * .6cqh) 0 calc(var(--fit, 1) * 1.6cqh);
  padding: 1.3cqh 3.5cqw;
  background: #fbf6ec;
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .15);
  transform: rotate(-1deg);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: calc(var(--fit, 1) * max(16px, 3.7cqw));
  line-height: 1.2;
  font-size-adjust: .4;
}
.looking-head { font-size: .72em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4f6a85; margin-bottom: .35em; }  /* a small label, like the case study overview labels */
.welcome .looking { margin: 2.6cqh 0 3.2cqh; font-size: max(15px, 3.4cqw); }

.chapter.about .page-pad { overflow: hidden; padding: 11cqh 9cqw 4cqh 11cqw; }
/* How I work: each principle points to the case study that shows it */
.principles { list-style: none; }
.principles li { margin-bottom: calc(var(--fit, 1) * 1.4cqh); }
.principles p { font-size: calc(var(--fit, 1) * clamp(12.5px, 2.5cqw, 15px)); line-height: 1.4; }
.principles .see, .about-intro .see { display: inline-block; margin-top: .35em; font-family: "Nunito Sans", system-ui, sans-serif; font-size: .9em; font-weight: 700; font-size-adjust: .4; color: #4f6a85; text-decoration: none; white-space: nowrap; text-underline-offset: 3px; border-radius: 3px; outline: none; }
.principles .see:hover, .about-intro .see:hover, .about-intro .see.hover { text-decoration: underline; }
.principles .see:focus-visible, .about-intro .see:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.say-hi {
  margin-top: calc(var(--fit, 1) * 2cqh);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: calc(var(--fit, 1) * max(17px, 4cqw));
  font-size-adjust: .4;
}
/* Resume: email and LinkedIn at the top right of the left page, level with the RESUME title */
.opener .cv-contact { position: absolute; top: 2.2cqh; right: 0; margin: 0; font-size: clamp(12px, 2.5cqw, 15px); }
.cv-pg .cv-contact { margin: 0 0 calc(var(--fit, 1) * 1.6cqh); }
.hi-links { margin-top: 3cqh; }
.welcome .say-hi { font-size: max(15px, 3.4cqw); }
.say-hi a { color: var(--ink); text-underline-offset: 4px; border-radius: 3px; outline: none; }
.say-hi a:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.offclock { list-style: none; }
.offclock li { display: flex; gap: 3cqw; align-items: flex-start; margin-bottom: calc(var(--fit, 1) * 1.6cqh); }
.offclock .doodle { flex: none; width: calc(var(--fit, 1) * max(30px, 6cqw)); overflow: visible; margin-top: .1em; }
.offclock p { font-size: calc(var(--fit, 1) * clamp(12.5px, 2.5cqw, 15px)); line-height: 1.45; }

/* ================= Work: the story spreads ================= */

.story-title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: calc(var(--fit, 1) * max(30px, 9cqw));
  line-height: .95;
  letter-spacing: -.01em;
  color: #4f6a85;
  font-size-adjust: 0.42;
}
.story-sub {
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: calc(var(--fit, 1) * max(18px, 4.4cqw)) !important;
  line-height: 1.2 !important;
  margin-top: 1.4cqh;
  font-size-adjust: .4;
  font-style: italic;
}
.story-meta { opacity: .65; font-size: calc(var(--fit, 1) * clamp(11.5px, 2.3cqw, 13.5px)) !important; }
.lede { font-size: calc(var(--fit, 1) * clamp(14px, 3cqw, 18px)) !important; }
.story-h {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: calc(var(--fit, 1) * max(26px, 7.4cqw));
  line-height: 1;
  margin-bottom: calc(var(--fit, 1) * 1.6cqh);
  letter-spacing: -.01em;
  font-size-adjust: 0.36;
}
.pull {
  font-family: "Newsreader", Georgia, serif;
  font-size: calc(var(--fit, 1) * max(22px, 5.6cqw)) !important;
  line-height: 1.1 !important;
  color: #4f6a85;
  margin: calc(var(--fit, 1) * .6cqh) 0 calc(var(--fit, 1) * 1.8cqh) !important;
  font-style: italic;
  font-weight: 400;
  font-size-adjust: .42;
}
.todo-inline { color: #b8473a; font-style: italic; }

/* screenshots: taped to the page, slightly tilted */
.shot { margin: calc(var(--fit, 1) * 1.6cqh) 0 calc(var(--fit, 1) * 1.8cqh); }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(45, 42, 38, .2), 0 6px 14px -6px rgba(45, 42, 38, .35);
}
.shot img { max-height: calc(var(--fit, 1) * 40cqh); width: auto; max-width: 100%; margin: 0 auto; }
.shot.tall img { max-height: calc(var(--fit, 1) * 46cqh); }
.pair .shot img { max-height: none; width: 100%; }
.shot figcaption, .caption-solo {
  margin-top: 1cqh;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: calc(var(--fit, 1) * max(15px, 3.4cqw)) !important;
  line-height: 1.2 !important;
  opacity: .8;
  font-size-adjust: .4;
  font-style: italic;
}
.pair { display: flex; gap: 4cqw; margin-top: calc(var(--fit, 1) * 1.4cqh); }
.pair .shot { flex: 1; margin: 0; }
.pair .shot:first-child { transform: rotate(-1.2deg); }
.pair .shot:last-child { transform: rotate(1.2deg); }
.pair figcaption { text-align: center; }

.shot img { cursor: zoom-in; }
.zoom {
  margin: auto;                 /* the reset above zeroes it; dialogs centre themselves with auto margins */
  max-width: min(92vw, 1400px);
  max-height: 92svh;
  padding: 1.2rem 1.2rem 1rem;
  border: 0;
  border-radius: 6px;
  background: #fbf8f1;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.zoom::backdrop { background: rgba(45, 42, 38, .55); }
.zoom img { display: block; max-width: 100%; max-height: calc(92svh - 6rem); margin: 0 auto; border-radius: 3px; cursor: zoom-out; }
.zoom-count { margin-top: .2rem; font-size: 12.5px; text-align: center; opacity: .55; }
.foldout .shot img:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.fold-sheet a:focus-visible, .backcover a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
.zoom-cap { margin-top: .7rem; font-family: "Nunito Sans", system-ui, sans-serif; font-size: 1.15rem; text-align: center; font-size-adjust: .4; font-style: italic; }
.zoom-close { position: absolute; top: .2rem; right: .5rem; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--ink); }
/* previous / next, for touch screens with no arrow keys */
.zoom-step {
  display: none;
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.6rem; height: 2.6rem;
  border: 1px solid rgba(45, 42, 38, .15); border-radius: 50%;
  background: rgba(251, 248, 241, .92);
  box-shadow: 0 2px 8px rgba(45, 42, 38, .2);
  font-size: 1.7rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.zoom.many .zoom-step { display: block; }
.zoom-prev { left: .6rem; }
.zoom-next { right: .6rem; }
.zoom-step:hover { background: #fff; }
.zoom-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.numbered { margin-left: 1.3em; }
.numbered li { font-size: calc(var(--fit, 1) * clamp(14px, 3.05cqw, 18px)); line-height: 1.5; margin-bottom: calc(var(--fit, 1) * 1.6cqh); padding-left: .3em; }
.numbered li::marker { font-family: "Caveat", cursive; font-size: 1.3em; color: var(--blue-title); }
.pull.big { font-size: calc(var(--fit, 1) * max(26px, 6.6cqw)) !important; }
.chain { display: block; width: 78%; margin: 0 auto; height: auto; overflow: visible; }

/* hand-drawn diagram */
.diagram { width: 100%; height: auto; overflow: visible; }
.dg-label { font-family: "Caveat", cursive; font-size: 15px; fill: var(--ink); }
.dg-cell { font-family: "Nunito Sans", sans-serif; font-size: 9.5px; font-weight: 600; fill: var(--ink); }
.diagram-fig { margin-top: calc(var(--fit, 1) * 3cqh); }

/* Work index: case studies as peers */
.cases { list-style: none; margin-top: calc(var(--fit, 1) * 2cqh); }
.cases li > a {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  column-gap: 2cqw;
  align-items: baseline;
  padding: calc(var(--fit, 1) * 1.3cqh) 0;
  border-bottom: 1.5px dashed rgba(45, 42, 38, .28);
  color: var(--ink);
  text-decoration: none;
  outline: none;
}
.chapter.builds .cases .n { color: color-mix(in srgb, var(--coral-title) 80%, var(--ink)); }
.cases .n { grid-row: span 3; font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * max(16px, 3.6cqw)); color: #4f6a85; line-height: 1; font-size-adjust: .4; font-weight: 600; }
.cases b { grid-row: 1; grid-column: 2; font-family: "Newsreader", Georgia, serif; font-weight: 600; font-size: calc(var(--fit, 1) * max(20px, 4.4cqw)); line-height: 1; letter-spacing: -.01em; font-size-adjust: 0.38; }
.cases .d { grid-row: 2; grid-column: 2; margin-top: calc(var(--fit, 1) * .5cqh); font-size: calc(var(--fit, 1) * clamp(11.5px, 2.4cqw, 14px)); opacity: .75; line-height: 1.35; }
.cases li > a:hover b, .cases li > a:focus-visible b { color: #4f6a85; }
.chapter.builds .cases li > a:hover b, .chapter.builds .cases li > a:focus-visible b { color: color-mix(in srgb, var(--coral-title) 80%, var(--ink)); }   /* the same deep red as the numbers */
.cases li > a:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
/* what ConvertLens is, before its modules */
.cases-intro {             /* taped in on a paper card, like the note on the About page */
  position: relative;
  margin-top: calc(var(--fit, 1) * 2cqh);
  padding: calc(var(--fit, 1) * 1.2cqh) 3cqw;
  background: color-mix(in srgb, var(--coral) 35%, #fff);
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .15);
  transform: rotate(-.8deg);
  font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * clamp(13.5px, 2.8cqw, 17px)); font-weight: 600; line-height: 1.45; font-size-adjust: .4;
}
.cases-intro p + p { margin-top: .45em; }
.cases-intro::before {     /* a strip of washi tape */
  content: "";
  position: absolute;
  top: -.55em; left: 42%;
  width: 16%; height: 1.1em;
  background: rgba(159, 180, 200, .8);
  transform: rotate(-3deg);
}
/* a case study's skills, under its line; book.js also copies them to the top of the case study */
.cases .tags { grid-row: 3; grid-column: 2; display: flex; flex-wrap: wrap; gap: .35em; margin-top: calc(var(--fit, 1) * .5cqh); }
/* the Work list carries tags too, so its rows and titles are a little tighter */
.work .cases { margin-top: calc(var(--fit, 1) * 1.2cqh); }
.work .cases li > a { padding: calc(var(--fit, 1) * .9cqh) 0; }
.work .cases b { font-size: calc(var(--fit, 1) * max(16px, 3cqw)); }
.work .cases .d { margin-top: calc(var(--fit, 1) * .3cqh); }
.cases .tags i, .fs-tags i {
  font-style: normal;
  font-size: calc(var(--fit, 1) * clamp(10px, 2.1cqw, 12px));
  font-weight: 700;
  letter-spacing: .02em;
  padding: .1em .65em;
  border: 1.3px solid rgba(79, 106, 133, .55);
  border-radius: 99px;
  color: #4f6a85;
  background: rgba(169, 195, 221, .16);
}
/* a case study row answers the pointer by turning its title blue */
.cases li > a { border-radius: 4px; }
.fs-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.fs-tags i { font-size: 13px; }
.sheet-where .mins { margin-left: .5rem; }

/* case study snapshot */
.snapshot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--fit, 1) * 1.1cqh) 3cqw;
  margin-top: calc(var(--fit, 1) * 3cqh);
  padding: calc(var(--fit, 1) * 2.2cqh) 4cqw;
  background: #fbf6ec;
  border-radius: 3px;
  box-shadow: 2px 3px 0 rgba(45, 42, 38, .13);
}
.snapshot dt { font-family: "Nunito Sans", system-ui, sans-serif; font-size: calc(var(--fit, 1) * max(15px, 3.5cqw)); color: #4f6a85; line-height: 1.2; font-size-adjust: .3; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.snapshot dd { font-size: calc(var(--fit, 1) * clamp(13px, 2.8cqw, 16.5px)); line-height: 1.4; }
.dash { margin: 0 0 calc(var(--fit, 1) * 1.4cqh) 1.1em; }
.dash li { font-size: calc(var(--fit, 1) * clamp(14px, 3.05cqw, 18px)); line-height: 1.5; margin-bottom: calc(var(--fit, 1) * .7cqh); }
.dash li::marker { color: var(--blue-title); }
.system-mark { margin-top: calc(var(--fit, 1) * 2.4cqh); padding-top: calc(var(--fit, 1) * 1.6cqh); border-top: 1.5px dashed rgba(45, 42, 38, .25); }
.next-proto { padding: 1.2cqh 3cqw; border: 1.5px dashed rgba(45, 42, 38, .4); border-radius: 4px; }

.soon-note { font-family: "Caveat", cursive; font-weight: 500; font-size: .7em; letter-spacing: 0; text-transform: none; opacity: .6; margin-left: .4em; }
.pieces { list-style: none; counter-reset: p; }
.pieces li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 2.2em 1fr;
  column-gap: 1cqw;
  padding: .75cqh 0;
  border-bottom: 1.5px dashed rgba(45, 42, 38, .25);
  font-size: clamp(12px, 2.5cqw, 14.5px);
  line-height: 1.35;
}
.pieces li::before { content: counter(p); grid-row: span 2; font-family: "Caveat", cursive; font-size: 1.5em; color: var(--blue-title); line-height: 1; }
.pieces b { font-weight: 600; }
.pieces span { opacity: .7; }


/* Ribbon bookmark: back to Contents */
.ribbon {
  position: absolute;
  top: 0; right: 10cqw;
  width: max(30px, 6.5cqw);
  background: #b8473a;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  box-shadow: inset -3px 0 0 rgba(0,0,0,.12);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.85cqh 0 3.55cqh;        /* just long enough for its word, plus the notch; equal space above and below the word */
  color: #fbf3e6;
  text-decoration: none;
  font-family: "Caveat", cursive;
  font-size: max(14px, 3.4cqw);
  writing-mode: vertical-rl;
  z-index: 7;
  transition: padding-bottom .3s ease;
  outline: none;
}
.ribbon:hover, .ribbon:focus-visible { padding-bottom: 6cqh; }
.ribbon:focus-visible { box-shadow: 0 0 0 3px var(--ink); }

/* ================= Moving around the open book ================= */

/* The sheet that turns between two chapters sits just above the other pages */
.leaf-page.flip, .leaf-page.flip.turned { z-index: 4; }
.face.back.flip-cover { transform: rotateY(180deg) translateZ(.5px); }   /* a left page's old look, just above it while a sheet turns */
.leaf-page.flip { transform: rotateY(0deg) translateZ(1px); }
.leaf-page.flip.turned { transform: rotateY(-180deg) translateZ(1px); }

/* Index tabs sticking out of the right edge, like notebook dividers */
.tabs {
  position: absolute;
  left: calc(var(--pw) * 2 - 1px);
  top: 9%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;          /* each tab keeps its own width, so the open one can stick out further */
  gap: calc(var(--ph) * .012);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.book.is-open .tabs { opacity: 1; pointer-events: auto; transition-delay: .35s; }
.tab {
  writing-mode: vertical-rl;
  padding: calc(var(--ph) * .022) calc(var(--ph) * .009);
  background: var(--bg);
  border: 1.5px solid rgba(45, 42, 38, .35);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  box-shadow: 2px 2px 4px rgba(45, 42, 38, .18);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: max(15px, calc(var(--ph) * .024));
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-5px);
  transition: transform .25s ease;
  outline: none;
  font-size-adjust: .3;
}
.tab:hover, .tab:focus-visible { transform: translateX(0); }
/* the open chapter's tab sticks out further by growing, not by moving, so it stays attached to the book */
.tab.on, .tab.on:hover { transform: translateX(-5px); padding-left: calc(var(--ph) * .009 + 8px); box-shadow: 3px 2px 5px rgba(45, 42, 38, .25); }
.tab:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
/* a finger-sized tap area: it reaches out past the tab's edge, so the tab looks the same */
.tab { position: relative; }
.tab::after { content: ""; position: absolute; inset: -2px -16px -2px 0; }

/* Page corners that curl up on hover and turn the page */
.corner {
  position: absolute;
  bottom: 0;
  width: 3rem; height: 3rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 8;
  outline: none;
}
.corner[hidden] { display: none; }
.corner::before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 15px; height: 15px;
  transition: width .25s ease, height .25s ease;
}
.corner-next { right: 0; }
.corner-next::before {
  right: 0;
  background: linear-gradient(315deg, rgba(45, 42, 38, .16) 0 50%, #f4ede0 50% 100%);
  box-shadow: -2px -2px 4px rgba(45, 42, 38, .14);
  border-top-left-radius: 5px;
}
.corner-prev { left: 0; }
.corner-prev::before {
  left: 0;
  background: linear-gradient(45deg, rgba(45, 42, 38, .16) 0 50%, #f4ede0 50% 100%);
  box-shadow: 2px -2px 4px rgba(45, 42, 38, .14);
  border-top-right-radius: 5px;
}
.corner:hover::before, .corner:focus-visible::before { width: 34px; height: 34px; }
.corner:focus-visible::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--ink);
}
.phone-only { display: none; }
.left-corner { left: var(--in); bottom: var(--in); transform: translateZ(6px); z-index: 9; }
.book:not(.is-open) .left-corner { display: none; }

/* Phone: chapters slide in from the side you swiped */
.base.slide-next { animation: slide-in-next .4s ease; }
.base.slide-prev { animation: slide-in-prev .4s ease; }
@keyframes slide-in-next { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-prev { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* ================= Fold-outs (case studies) ================= */
.foldout {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(230, 220, 203, 0);
  transition: background .5s ease;
}
.foldout.shown { background: rgba(230, 220, 203, .94); }
.foldout.unfolding { overflow: hidden; }
body.fold-open { overflow: hidden; }

/* the open sheet: one big piece of paper with faint fold creases */
.fold-sheet {
  position: relative;
  width: min(1000px, calc(100vw - 2.5rem));
  margin: 3vh auto 4vh;
  padding: 0 clamp(1.4rem, 6vw, 5rem) 3rem;
  background-color: var(--page);
  background-image:
    linear-gradient(to right, transparent calc(33.33% - 1px), rgba(45, 42, 38, .07) 33.33%, rgba(255, 255, 255, .5) calc(33.33% + 1px), transparent calc(33.33% + 6px)),
    linear-gradient(to right, transparent calc(66.66% - 1px), rgba(45, 42, 38, .07) 66.66%, rgba(255, 255, 255, .5) calc(66.66% + 1px), transparent calc(66.66% + 6px)),
    repeating-linear-gradient(to bottom, transparent 0 759px, rgba(45, 42, 38, .07) 759px 760px, rgba(255, 255, 255, .5) 760px 761px, transparent 761px 766px);
  border-radius: 3px;
  box-shadow: 0 2px 3px rgba(45, 42, 38, .15), 0 30px 60px -30px rgba(45, 42, 38, .5);
  transform-origin: top left;
  opacity: 0;
}
.foldout.sheet-on .fold-sheet { opacity: 1; }
.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;   /* equal sides, so the menu sits in the true middle */
  align-items: center;
  gap: 1rem;
  margin: 0 calc(-1 * clamp(1.4rem, 6vw, 5rem)) 2.5rem;
  padding: .9rem clamp(1.4rem, 6vw, 5rem);
  background: rgba(246, 240, 227, .92);
  backdrop-filter: blur(4px);
  border-bottom: 1.5px dashed rgba(45, 42, 38, .2);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 1.2rem;
  font-size-adjust: .4;
}
.fold-back {
  color: var(--ink);
  text-decoration: none;
  padding: .15rem .9rem;
  border: 1.5px solid rgba(45, 42, 38, .5);
  border-radius: 99px;
  outline: none;
}
/* the button never wraps; a long part name shortens with "…" instead */
.sheet-bar .fold-back { white-space: nowrap; justify-self: start; }
.fold-back:hover, .fold-back:focus-visible { background: #fff8; }
.fold-back:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.sheet-where { grid-column: 3; justify-self: end; display: flex; align-items: center; white-space: nowrap; }
.sheet-where .case-now, .sheet-where .mins { opacity: .75; }
.sheet-where .case-now:hover, .sheet-where .case-now:focus-visible, .sheet-where .case-now[aria-expanded="true"] { opacity: 1; }
/* the case study menu, opening under the name on the right */
.case-nav { position: relative; }
.case-menu { left: auto; right: 0; transform: none; text-align: left; }
.part-menu.case-menu a { position: relative; padding-left: 1.8rem; }
.case-menu a[aria-current]::before { content: "\2713"; position: absolute; left: .65rem; }
.case-menu a[aria-current] { font-weight: 700; }
.case-menu .sep { border-top: 1.5px dashed rgba(45, 42, 38, .25); margin: .35rem .5rem; }
/* which part you're in, and a menu to jump between parts */
.part-nav { position: relative; min-width: 0; }
.part-now {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: .15rem .5rem;
  border-radius: 6px;
  cursor: pointer;
}
.part-now { display: flex; align-items: center; gap: .3rem; max-width: 100%; white-space: nowrap; }
.part-now span { overflow: hidden; text-overflow: ellipsis; }
.part-now .chev {   /* a thin pen line, the same weight as the arrow in "Fold it back" */
  width: .62em; height: .42em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s ease;
}
.part-now[aria-expanded="true"] .chev { transform: rotate(180deg); }
.part-now:hover, .part-now:focus-visible { background: #fff8; outline: none; }
.part-now:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.part-menu {
  position: absolute;
  left: 50%; top: calc(100% + .4rem);
  transform: translateX(-50%);
  min-width: 15rem;
  list-style: none;
  margin: 0;
  padding: .4rem;
  background: var(--page);
  border: 1.5px solid rgba(45, 42, 38, .35);
  border-radius: 8px;
  box-shadow: 0 14px 30px -12px rgba(45, 42, 38, .45);
  z-index: 8;
}
.part-menu a { display: block; padding: .35rem .7rem; border-radius: 5px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.part-menu a:hover, .part-menu a:focus-visible { background: rgba(169, 195, 221, .3); outline: none; }
.fs-part { scroll-margin-top: 5rem; }
/* the part rail, in the margin right of the sheet */
.part-rail {
  position: fixed;
  left: calc(50% + 500px + 1.6rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: min(44vh, 22rem);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size-adjust: .4;
  transition: opacity .4s ease;
}
.foldout:not(.sheet-on) .part-rail, .foldout.unfolding .part-rail { opacity: 0; pointer-events: none; }
.part-rail a {
  position: relative;
  flex: 1;
  width: 4px;
  border-radius: 2px;
  background: rgba(45, 42, 38, .15);
  outline: none;
}
.part-rail a::before { content: ""; position: absolute; inset: 0 -10px; }   /* a wider area to click */
.rail-fill { position: absolute; inset: 0; border-radius: inherit; background: #4f6a85; transform: scaleY(0); transform-origin: top; }
.rail-tip {   /* the part's name, on the page side of the rail */
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  padding: .25rem .6rem;
  white-space: nowrap;
  font-size: .95rem;
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid rgba(45, 42, 38, .35);
  border-radius: 6px;
  box-shadow: 0 8px 18px -10px rgba(45, 42, 38, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.part-rail a:hover .rail-tip, .part-rail a:focus-visible .rail-tip { opacity: 1; }
.part-rail a:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.rail-now {   /* which part you're in, where the fill has reached */
  position: absolute;
  left: 12px;
  transform: translateY(-50%);
  padding-left: 12px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  color: #4f6a85;
  transition: top .15s linear;
}
.rail-now::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; border-top: 1.5px solid currentColor; }
.rail-now[hidden] { display: none; }
@media (max-width: 1120px) { .part-rail { display: none; } }   /* no margin beside the sheet to hold it */
/* how far along: a thin line along the bottom of the bar */
.sheet-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1.5px;
  height: 2.5px;
  background: #4f6a85;
  transform: scaleX(0);
  transform-origin: left center;
}
.to-top { font: inherit; color: var(--ink); background: none; border: 0; cursor: pointer; opacity: .75; padding: .15rem .5rem; border-radius: 6px; }
.to-top:hover, .to-top:focus-visible { opacity: 1; background: #fff8; outline: none; }
.to-top:focus-visible { box-shadow: 0 0 0 2px var(--ink); }

/* reading column, with pictures allowed wider */
.fs-sec {
  max-width: 640px;
  margin: 0 auto 4.5rem;
  /* how far pictures may reach past the text column: up to 110px, never past the sheet's padding */
  --bleed: clamp(0px, calc((min(1000px, 100vw - 2.5rem) - 2 * clamp(1.4rem, 6vw, 5rem) - 640px) / 2), 110px);
}
.fs-sec .shot, .fs-sec .system-mark { margin-left: calc(-1 * var(--bleed)); margin-right: calc(-1 * var(--bleed)); }
.fs-sec p, .fs-sec li, .fs-sec dd { font-size: clamp(16px, 1.25vw, 18.5px); line-height: 1.6; }
.fs-sec p { margin-bottom: .9em; }
.fs-sec > ul, .fs-sec > ol { margin-bottom: .9em; }
.fs-sec .kicker { font-family: "Caveat", cursive; font-size: 1.25rem; opacity: .7; margin-bottom: .2rem; }
.fs-sec .story-h { font-size: clamp(28px, 2.6vw, 38px); margin: 0 0 .6rem; }
#fold-book .fs-sec { margin-bottom: 2.6rem; }   /* a short page of three plain sections: less air between them than a case study's parts */
/* two screenshots side by side, each in its own frame, at the same height (each grows by its width-to-height ratio) */
.fs-sec .shot.screens .screens-row { display: flex; gap: clamp(10px, 2vw, 22px); align-items: flex-start; }
.fs-sec .shot.screens img { width: 0; min-width: 0; }
.fs-sec .shot.screens img:first-child { flex: 1.6; }
.fs-sec .shot.screens img:last-child { flex: .536; }
/* phone screenshots side by side, each in its own frame, the same size; a single one sits narrower */
.fs-sec .shot.phones .phones-row { display: flex; gap: clamp(10px, 2vw, 22px); align-items: flex-start; justify-content: center; }
.fs-sec .shot.phones img { flex: 1; width: 0; min-width: 0; max-width: 250px; }
.fs-sec .story-title { font-size: clamp(44px, 5.4vw, 72px); }
.fs-sec .story-sub { font-size: clamp(20px, 1.8vw, 25px) !important; margin: .8rem 0 0; }
.fs-sec .pull { font-size: clamp(20px, 1.6vw, 23px) !important; margin: 1rem 0 !important; }
.fs-sec .pull.big { font-size: clamp(24px, 2.2vw, 30px) !important; }
/* the closing reflection stays a step above the other quotes */
.fs-close .pull { font-size: clamp(22px, 1.9vw, 27px) !important; }
.fs-sec .numbered li, .fs-sec .dash li { margin-bottom: .7em; }
.fs-sec .shot img { max-height: none; width: 100%; }
.fs-sec > .shot:not(.drawn):not(.detail) { max-width: 720px; margin-left: auto; margin-right: auto; }
.fs-sec .shot figcaption, .fs-sec .caption-solo { font-size: 1.2rem !important; text-align: center; margin-top: .8rem; }
.fs-sec .chain { width: min(100%, 420px); }
.fs-sec .diagram { max-width: 640px; display: block; margin: 0 auto; }
.fs-sec .system-mark { border-top: 0; padding-top: 0; }
.fs-sec .next-proto { padding: 1.2rem 1.5rem; }
.fs-sec .todo-inline { font-size: inherit; }

/* the title block reads like the reference meta strips */
.fs-head { max-width: 860px; text-align: left; }
.fs-head .snapshot {
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  grid-template-columns: none;
  grid-auto-columns: 1fr;
  gap: .3rem 1.6rem;
  margin-top: 2.2rem;
  padding: 1.3rem 1.6rem;
}
.fs-head .snapshot dt { font-size: 1.2rem; }
.fs-head .snapshot dd { font-size: 15px; line-height: 1.4; }

/* drawn figures, sub-headings, notes */
.fs-sec .drawn .diagram { max-width: 100%; }
.fs-sec .drawn .diagram.mid { max-width: 540px; }
.fs-sec .drawn .insert { max-width: 470px; }
.fs-sec .drawn .runs { max-width: 430px; }
.fs-head .shot { max-width: 600px; margin: 2.4rem auto 0; }
/* a top-of-case-study diagram: drawn across, or stacked on a phone */
.fs-sec .shot.sys-stack { display: none; }
/* what shipped, at the top of a case study: inside the column, not bleeding past it */
.fs-head .status3 { margin: 1.8rem 0 0; }
.fs-sec .shot.detail { max-width: 480px; margin-left: auto; margin-right: auto; }
.fs-sec .shot.navshot { max-width: 240px; margin-left: auto; margin-right: auto; }
.fs-subh {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(22px, 1.9vw, 26px);
  color: #4f6a85;
  margin: 2.2rem 0 .7rem;
  letter-spacing: -.01em;
  font-size-adjust: 0.36;
}
.product-card {
  margin-top: 1.4rem;
  padding: .9rem 1.4rem 1rem;
  background: rgba(199, 219, 176, .32);
  border: 1.6px solid rgba(43, 38, 34, .8);
  border-radius: 14px 4px 12px 5px / 5px 12px 4px 14px;
}
.fs-sec .product-card .kicker { margin: 0; }
.fs-sec .product-card p:last-child { margin: 0; }
/* a hand-drawn underline under the lines that carry the story */
.mark {
  padding-bottom: .12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5 C20 3 40 6.5 60 4.5 S100 3 119 5' fill='none' stroke='%23d9826b' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 100% / 100% 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .9s cubic-bezier(.5, 0, .3, 1) .15s;
}
.annot .hl { mix-blend-mode: multiply; opacity: .8; }

/* one model, four features: When -> Then */
.whenthen { display: grid; gap: .7rem; }
.wt-row { display: grid; grid-template-columns: 9.5rem 1fr 1.25fr; gap: 1.6rem; align-items: stretch; }
.wt-row > span { font-size: 15.5px; line-height: 1.45; }
.wt-name { align-self: center; font-family: "Caveat", cursive; font-size: 1.35rem !important; line-height: 1.1 !important; }
.wt-when, .wt-then {
  position: relative;
  padding: .55rem .85rem;
  border: 1.6px solid rgba(43, 38, 34, .8);
  border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px;
}
.wt-when { background: rgba(242, 165, 142, .34); }
.wt-then { background: rgba(169, 195, 221, .38); }
.wt-then::before { content: "\2192"; position: absolute; left: -1.35rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
.wt-head > span { padding: 0; border: 0; background: none; font-family: "Caveat", cursive; font-size: 1.35rem !important; color: #4f6a85; }
.wt-head .wt-then::before { content: none; }

/* which pairs of routes conflict */
.ctable { display: grid; gap: .5rem; }
.ct-row { display: grid; grid-template-columns: 1fr 1fr 5.5rem 1.15fr; gap: 1rem; align-items: center; padding: .6rem .9rem; border: 1.6px solid rgba(43, 38, 34, .8); border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px; background: rgba(251, 248, 241, .6); }
.ct-row > span { font-size: 15px; line-height: 1.4; }
.ct-head { border: 0; background: none; padding-top: 0; padding-bottom: 0; }
.ct-head > span { font-family: "Caveat", cursive; font-size: 1.3rem; color: #4f6a85; }
.ct-why { opacity: .8; }
.ct-pill { display: inline-block; padding: .05rem .7rem; border: 1.5px solid rgba(43, 38, 34, .7); border-radius: 99px; font-style: normal; font-weight: 800; font-size: 14px; }
.ct-pill.yes { background: rgba(242, 165, 142, .55); }
.ct-pill.no, .ct-pill.ok { background: rgba(199, 219, 176, .6); }
.ct-pill.nope { background: rgba(242, 165, 142, .55); }
.ctable.cando .ct-row { grid-template-columns: 1.4fr 1fr 1fr; }

.ctable.no-why .ct-row { grid-template-columns: 1fr 1fr 6rem; }
.ctable.patterns .ct-row { grid-template-columns: 9rem 1fr 6rem; }
.ctable.principles .ct-row { grid-template-columns: 1fr 1fr; }
.ctable.challenges .ct-row { grid-template-columns: 1.6fr 1fr 6.5rem; }
.ctable.agentpats .ct-row { grid-template-columns: 9rem 1fr 1.3fr; }
.ctable.agentfit .ct-row { grid-template-columns: 9rem 1fr 1.1fr; }
/* a pointer to another section, set apart from the sentence */
.sec-ref { display: inline-block; margin-left: .25rem; padding: 0 .55rem; border-radius: 99px; background: rgba(169, 195, 221, .45); color: #4f6a85; font-size: 13px; font-weight: 700; white-space: nowrap; }
/* the problem statement, as a card */
.ps-card { margin-top: 2rem; margin-bottom: 1.6rem; padding: 1rem 1.4rem .4rem; border: 1.6px solid rgba(43, 38, 34, .8); border-radius: 14px 4px 12px 5px / 5px 12px 4px 14px; background: rgba(169, 195, 221, .2); }
.ps-card .hmw { margin-top: .3rem; }
.ps-card ul { padding-left: 1.4em; margin: .5rem 0 .9rem; }
.ps-card li { margin-bottom: .35em; }
.ps-card li::marker { color: rgba(45, 42, 38, .55); }
/* a card that opens on tap, for help most readers can skip */
.ps-card.words { padding-top: .7rem; padding-bottom: .7rem; }
.ps-card.words summary { cursor: pointer; list-style: none; margin: 0; }
.ps-card.words[open] summary { margin-bottom: .4rem; }
.ps-card.words summary::-webkit-details-marker { display: none; }
.ps-card.words summary::after { content: " \25B8"; font-family: "Nunito Sans", system-ui, sans-serif; font-size: .75em; opacity: .8; }
.ps-card.words[open] summary::after { content: " \25BE"; }
.ps-card.words summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* a few numbers, side by side */
.scorecard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.6rem 0 .6rem; }
.sc { padding: .8rem .9rem; text-align: center; border: 1.6px solid rgba(43, 38, 34, .8); border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px; background: rgba(199, 219, 176, .3); }
.sc b { display: block; font-family: "Newsreader", Georgia, serif; font-size: clamp(34px, 3vw, 44px); line-height: 1.1; color: #4f6a85; }
.sc span { font-size: 15px; line-height: 1.35; }
/* one of each kind of message, labelled by hand */
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.4rem; align-items: start; max-width: 720px; margin: 1.6rem auto .4rem; }
/* each cell is a .shot so it opens full size; its label sits above, on the left */
.fs-sec .shot.wcell { margin: 0; }
.fs-sec .shot.wcell figcaption { font-family: "Caveat", cursive; font-size: 1.3rem !important; color: #4f6a85; text-align: left; margin: 0 0 .25rem; }
.wcell img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 18px -10px rgba(45, 42, 38, .45); }
.wnote { font-family: "Caveat", cursive; font-size: 1.2rem; text-align: center; opacity: .75; margin-top: 0; }

/* the 3-line overview under the title */
.overview {
  margin-top: 1.8rem;
  padding: 1.1rem 1.4rem 1.2rem;
  border-left: 4px solid #4f6a85;
  background: rgba(169, 195, 221, .18);
}
.overview .kicker { margin: 0 0 .55rem; }
.overview dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .55rem 1.2rem; margin: 0; }
.overview dt { font-family: "Nunito Sans", system-ui, sans-serif; font-size: 1.3rem; color: #4f6a85; line-height: 1.3; font-size-adjust: .3; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.fs-sec .overview dd { font-size: 16.5px; line-height: 1.5; }

/* part dividers: problem / solution / decisions / looking back */
.fs-part {
  max-width: 860px;
  margin: 1rem auto 3rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid rgba(79, 106, 133, .35);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(30px, 3vw, 40px);
  color: #4f6a85;
  letter-spacing: -.01em;
  font-size-adjust: 0.33;
}
.fs-part .kicker { display: block; font-size: 1.2rem; opacity: .75; color: var(--ink); }
/* a one-line lead-in under a part heading, kept close to it */
.fs-sec.part-lede { margin-top: -1.5rem; margin-bottom: 2.75rem; }

/* Built with AI case studies take that chapter's deep red in place of the blue, as dark as the blue so small labels read as well */
.foldout[data-home="builds"] { --fold-accent: color-mix(in srgb, var(--coral-title) 70%, var(--ink)); }
.foldout[data-home="builds"] :is(.story-title, .fs-part, .fs-subh, .overview dt, .snapshot dt, .rail-now) { color: var(--fold-accent); }
.foldout[data-home="builds"] .overview { border-left-color: var(--fold-accent); background: color-mix(in srgb, var(--coral) 12%, transparent); }
.foldout[data-home="builds"] .fs-part { border-bottom-color: color-mix(in srgb, var(--fold-accent) 35%, transparent); }
.foldout[data-home="builds"] :is(.rail-fill, .sheet-progress) { background: var(--fold-accent); }

/* text only screen readers hear */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* a product word with a short note on hover, tap or focus */
.term-wrap { position: relative; display: inline; }
.term {
  font: inherit; font-weight: 700; color: inherit;
  background: none; border: 0; padding: 0; cursor: help;
  border-bottom: 1.5px dotted rgba(45, 42, 38, .6);
}
.term:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.term-note {
  position: absolute; left: 0; bottom: calc(100% + .5rem);
  width: min(20rem, 80vw);
  padding: .7rem .9rem;
  background: var(--page);
  border: 1.5px solid rgba(45, 42, 38, .35);
  border-radius: 8px;
  box-shadow: 0 14px 30px -12px rgba(45, 42, 38, .45);
  font-size: 14.5px; font-weight: 400; line-height: 1.5;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s .2s;
  z-index: 7;
}
.term-wrap:hover .term-note, .term-wrap:focus-within .term-note, .term-wrap.open .term-note {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.term-link { display: block; margin-top: .35rem; font-weight: 700; color: #4f6a85; }
/* near the right edge, the note opens leftwards so it isn't cut off */
.term-wrap.flip .term-note { left: auto; right: 0; }

/* the turning point in a case study, lifted off the page */
.fs-sec.eureka {
  max-width: 720px;
  padding: 1.6rem 2rem 1.2rem;
  background: rgba(236, 214, 156, .3);
  border: 1.6px solid rgba(43, 38, 34, .8);
  border-radius: 16px 5px 14px 6px / 6px 14px 5px 16px;
  box-shadow: 4px 5px 0 rgba(45, 42, 38, .12);
}
.fs-sec.eureka .kicker { color: #b8473a; opacity: 1; }
/* inside the card, figures stay within its edges */
.fs-sec.eureka .shot { margin-left: 0; margin-right: 0; }
.status3.two { grid-template-columns: repeat(2, 1fr); }

/* known limitations, carried on purpose */
.limits { margin-top: 1.8rem; padding: 1rem 1.3rem 1.1rem; border: 1.6px dashed rgba(184, 71, 58, .7); border-radius: 10px; background: rgba(242, 165, 142, .12); }
.fs-sec .limits .kicker { color: #b8473a; opacity: 1; margin-bottom: .5rem; }
.lim { font-size: 15.5px; line-height: 1.5; padding: .5rem 0; }
.lim + .lim { border-top: 1.5px dashed rgba(45, 42, 38, .2); }

/* designed / shipped / still open */
.status3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: .4rem calc(-1 * var(--bleed)) 1.6rem; }
.st { padding: .8rem 1rem 1rem; border: 1.6px solid rgba(43, 38, 34, .8); border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px; }
.fs-sec .st .kicker { margin: 0 0 .4rem; opacity: 1; font-size: 1.3rem; }
.st ul { margin: 0 0 0 1.05em; }
.fs-sec .st li { font-size: 15px; line-height: 1.45; margin-bottom: .45em; }
.st-ok { background: rgba(199, 219, 176, .35); }
.st-mid { background: rgba(236, 214, 156, .35); }
.st-open { background: rgba(242, 165, 142, .25); border-style: dashed; }

/* two rules, side by side */
.rules { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.fs-sec .rules .diagram { width: 385px; max-width: 100%; margin: 0; }
.hmw {
  margin-top: 2rem;
  padding: .3rem 0 .3rem 1.2rem;
  border-left: 4px solid #a9c3dd;
  font-size: clamp(18px, 1.5vw, 21px) !important;
  font-weight: 600;
  line-height: 1.5 !important;
}

/* the three parts of the problem, as cards */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 0 calc(-1 * var(--bleed)); }
.pcard {
  padding: 1rem 1.1rem 1.1rem;
  border: 1.6px solid rgba(43, 38, 34, .8);
  border-radius: 14px 4px 12px 5px / 5px 12px 4px 14px;
}
.pcard svg { display: block; width: 84px; height: 60px; overflow: visible; margin-bottom: .5rem; }
.fs-sec .pcard p { font-size: 15.5px; line-height: 1.5; margin: 0; }
.fs-sec .pcard .pc-t { font-size: 17px; font-weight: 800; line-height: 1.35; margin-bottom: .4em; }
.pc-n { font-family: "Caveat", cursive; font-size: 1.4em; color: #4f6a85; margin-right: .15em; }
.c-blue { background: rgba(169, 195, 221, .3); }
.c-yel { background: rgba(236, 214, 156, .34); }
.c-coral { background: rgba(242, 165, 142, .28); }

/* screenshots with drawn notes on top, and a "not shipped" stamp */
.annot, .stamped { position: relative; }
.annot .overlay { position: absolute; left: 0; top: 0; width: 100%; height: auto; pointer-events: none; overflow: visible; }
.stamped .stamp {
  position: absolute;
  top: -5%;
  right: -3%;
  padding: .1rem .8rem;
  border: 2.5px solid #b8473a;
  border-radius: 6px;
  color: #b8473a;
  background: rgba(251, 248, 241, .88);
  font-family: "Caveat", cursive;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 700;
  transform: rotate(6deg);
  pointer-events: none;
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1;
}
.fs-sec .pair { margin: 1.8rem calc(-1 * var(--bleed)) 0; gap: 2rem; }
.fs-sec .pair .shot { margin: 0; }
.back-case[hidden] { display: none; }
/* drawings and screens that sit inside a pointer */
.fs-sec ul.refine .shot { margin: 1rem 0 1.4rem; }
.fs-sec ul.refine .shot.detail { margin-left: auto; margin-right: auto; }
.fs-sec ul.refine ul { padding-left: 1.5em; margin: .2em 0 .3em; }
/* a narrow screen part (like a navigation) beside a wide one */
.fs-sec .pair.lopsided .shot:first-child { flex: 0 0 26%; max-width: 230px; margin: 0 auto; }
.fs-close { text-align: center; }

/* drawings ink themselves in, underlines are drawn, the stamp lands: each once, as it comes into view */
.foldout [pathLength] { stroke-dasharray: 1; transition: stroke-dashoffset 1.3s cubic-bezier(.5, 0, .3, 1); }
.foldout .ink-wait:not(.inked) [pathLength] { stroke-dashoffset: 1; }
.foldout .ink-wait svg text, .foldout .ink-wait svg [filter="url(#wash)"], .foldout .ink-wait svg [stroke-dasharray]:not([pathLength]) { transition: opacity .6s ease .8s; }
.foldout .ink-wait:not(.inked) svg text, .foldout .ink-wait:not(.inked) svg [filter="url(#wash)"], .foldout .ink-wait:not(.inked) svg [stroke-dasharray]:not([pathLength]) { opacity: 0; }
.foldout .mark.ink-wait:not(.inked) { background-size: 0% 8px; }
.stamped .stamp { transition: opacity .15s ease .5s, transform .5s cubic-bezier(.3, 1.6, .5, 1) .5s; }
.stamped.ink-wait:not(.inked) .stamp { opacity: 0; transform: rotate(6deg) scale(1.8); }

/* sections slide in as you reach them */
.fs-sec { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.fs-sec.in { opacity: 1; transform: none; }

.fs-end {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
  padding-top: 1.6rem;
  border-top: 1.5px dashed rgba(45, 42, 38, .25);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 1.2rem;
  font-size-adjust: .4;
}
.next-case { opacity: .6; }
a.next-case { opacity: 1; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid rgba(45, 42, 38, .4); }
a.next-case:hover, a.next-case:focus-visible { border-bottom-color: var(--ink); }

/* the folded sheet while it opens: a middle panel with two flaps folded over it */
.fold-fx { position: fixed; z-index: 600; perspective: 1600px; pointer-events: none; }
.fp {
  position: absolute;
  top: 0; bottom: 0;
  width: 100%;
  background: var(--page);
  border-radius: 2px;
  box-shadow: 0 10px 24px -10px rgba(45, 42, 38, .45);
  backface-visibility: visible;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1), filter .6s ease;
}
.fp.mid   { left: 0; }
.fp.left  { left: -100%; transform-origin: right center; transform: rotateY(-178deg); filter: brightness(.9); }
.fp.right { left: 100%;  transform-origin: left center;  transform: rotateY(178deg);  filter: brightness(.9); transition-delay: .12s; }
.fold-fx.open .fp.left, .fold-fx.open .fp.right { transform: rotateY(0); filter: none; }

@media (max-width: 700px) {
  .fold-sheet { width: 100%; margin: 0; min-height: 100%; border-radius: 0; background-image: none; }
  .fs-sec { margin-bottom: 3.2rem; }
  .fs-sec .shot, .fs-sec .system-mark { margin-left: 0; margin-right: 0; }
  .fs-sec .shot.sys-wide { display: none; }
  .fs-sec .shot.sys-stack { display: block; max-width: 340px; margin-left: auto; margin-right: auto; }
  .cards3 { grid-template-columns: 1fr; gap: .9rem; }
  .status3 { grid-template-columns: 1fr; }
  .wgrid { grid-template-columns: 1fr; }
  .wt-row { grid-template-columns: 1fr; gap: .45rem; padding-bottom: .6rem; }
  .wt-head { display: none; }
  .wt-name { font-size: 1.4rem !important; }
  .wt-when::before { content: "When\2026  "; font-weight: 800; }
  .wt-then::before { content: "Then\2026  "; position: static; transform: none; font-size: inherit; font-weight: 800; }
  .rules { gap: 2rem; }
  .fs-sec.eureka { padding: 1.2rem 1.1rem 1rem; }
  .status3.two { grid-template-columns: 1fr; }
  .term-note, .term-wrap.flip .term-note { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; width: auto; }
  .overview dl { grid-template-columns: 1fr; gap: .1rem; }
  .overview dd { margin-bottom: .6rem; }
  .ct-head { display: none; }
  .ct-row, .ctable.patterns .ct-row, .ctable.principles .ct-row, .ctable.challenges .ct-row, .ctable.agentpats .ct-row, .ctable.agentfit .ct-row { grid-template-columns: 1fr; gap: .3rem; }
  .ct-row > span:nth-child(1)::before { content: "Route A: "; font-weight: 800; }
  .ct-row > span:nth-child(2)::before { content: "Route B: "; font-weight: 800; }
  .cando .ct-row > span:nth-child(1)::before, .patterns .ct-row > span::before { content: none; }
  .cando .ct-row > span:nth-child(2)::before { content: "Temporary list: "; font-weight: 600; }
  .cando .ct-row > span:nth-child(3)::before { content: "Saved list: "; font-weight: 600; }
  .principles .ct-row > span:nth-child(1)::before { content: none; }
  .principles .ct-row > span:nth-child(2)::before { content: "Decision: "; }
  .challenges .ct-row > span:nth-child(1)::before { content: none; }
  .challenges .ct-row > span:nth-child(2)::before { content: "Response: "; }
  .agentpats .ct-row > span:nth-child(1)::before { content: none; }
  .agentpats .ct-row > span:nth-child(2)::before { content: none; }
  .agentpats .ct-row > span:nth-child(3)::before { content: "For the recall goal: "; font-weight: 800; }
  .agentfit .ct-row > span:nth-child(1)::before, .agentfit .ct-row > span:nth-child(2)::before { content: none; }
  .agentfit .ct-row > span:nth-child(3)::before { content: "Fit: "; font-weight: 800; }
  .scorecard { gap: .5rem; }
  .sc { padding: .6rem .4rem; }
  .fs-sec .pair { flex-direction: column; gap: 1.6rem; }
  .fs-sec .pair .shot { transform: none; }
  .stamped .stamp { top: 3%; right: 3%; font-size: 16px; }
  .fs-sec .pair { gap: 2.4rem; }
  .fs-head .snapshot { grid-auto-flow: row; grid-template-columns: auto 1fr; grid-template-rows: none; gap: .5rem 1rem; }
  .sheet-where { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-sec { opacity: 1; transform: none; transition: none; }
}

/* ================= Controls under the book ================= */
.controls {
  height: 2.3rem;
  display: flex;
  align-items: center;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 1.35rem;
  font-size-adjust: .4;
}
.hint { opacity: .7; }
.close-btn {
  display: none;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  padding: .2rem 1rem;
  border: 1.5px solid rgba(45, 42, 38, .5);
  border-radius: 99px;
  background: rgba(255, 255, 255, .35);
}
.close-btn:hover, .close-btn:focus-visible { background: rgba(255, 255, 255, .8); }
.stage.is-open .hint { display: none; }
/* the resume, one click from the closed book */
.stage.is-open .close-btn { display: inline-flex; }

/* ================= Phones and upright tablets: one page at a time =================
   (two pages side by side would be too small to read) */
/* a phone on its side is too short for any page, so it gets an upright phone-sized page and the screen scrolls */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --pw: min(calc(100vw - 1.75rem), 25rem) !important; --ph: calc(var(--pw) * 1.75) !important; }
}
@media (max-width: 700px), (max-width: 1100px) and (orientation: portrait), (max-height: 500px) {
  :root {
    --pw: calc(100vw - 1.75rem);
    --ph: calc(100svh - 8.4rem);
  }
  .stage { gap: .6rem; padding: 2.6rem 0 .8rem; }
  .chapter.work .page-pad, .chapter.fun .page-pad { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .cases .tags { display: none; }   /* no room for them on a phone; each case study still shows its tags at the top */
  .cases.builds .tags { display: flex; }   /* a project keeps its status */

  /* tabs sit along the top edge of the page instead of the side */
  .tabs {
    left: calc(var(--pw) + 1.2rem);
    top: auto;
    bottom: 100%;
    flex-direction: row;
    gap: 3px;
  }
  .tab {
    writing-mode: horizontal-tb;
    padding: .2rem .55rem .1rem;
    border: 1.5px solid rgba(45, 42, 38, .35);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    font-size: 15px;
    transform: translateY(4px);
  }
  .tab:hover, .tab:focus-visible { transform: translateY(2px); }
  .tab.on, .tab.on:hover { transform: translateY(0); padding: .2rem .55rem .1rem; }
  .phone-only { display: block; }
  .left-corner { display: none !important; }
  .book, .book.is-open, .book.is-back { transform: translateX(calc(var(--pw) * -.5)); }
  /* phones show one page: the back cover simply takes the right-hand page's place */
  .leaf-back.turned { transform: rotateY(0deg) translateZ(-1px); visibility: visible; }
  .backcover { left: var(--pw); }
  .book.is-back .backcover { background: var(--page); border-radius: 3px 12px 12px 3px; }
  .bc-foot { display: none; }  /* the barcode is decoration; the colophon needs the room on a phone */
  .bc-plane { top: 3cqh; width: 72px; }  /* the longer note lifts the title on a phone; keep the plane clear of it */
  /* turned pages slide out of view to the left, then hide */
  .leaf.turned { visibility: hidden; transition: transform var(--turn) var(--ease), visibility 0s var(--turn); }


  .page-pad { padding: 6cqh 8cqw 4cqh 10cqw; }
  /* sized by width on a phone; an upright tablet's page is much wider, so height caps them too */
  .page-title { font-size: min(14cqw, 7.2cqh); }
  .toc { margin-top: 5cqh; gap: 4cqh; margin-bottom: 3cqh; }   /* room above the dashed line, now that it has five rows */
  .toc .title { font-size: min(10.5cqw, 5.4cqh); }

  .welcome--phone {
    display: block;
    position: static;
    padding: 0;
    margin-top: auto;
    padding-top: 2.5cqh;
    border-top: 1.5px dashed rgba(45, 42, 38, .3);
  }
  .welcome--phone .hello { font-size: min(8cqw, 4.1cqh); }
  .welcome--phone .note { margin-top: 1cqh; font-size: max(16px, min(4.6cqw, 2.35cqh)); line-height: 1.2; }
  .welcome--phone .craft-note { margin-top: 1.2cqh; padding: .8cqh 3cqw; font-size: max(14px, min(4cqw, 2.05cqh)); }
  .welcome--phone .looking { margin: 1.8cqh 0 0; padding: 1cqh 3cqw; font-size: max(14px, min(4cqw, 2.05cqh)); }

  /* Phone: the text-heavy chapters are always split into pages you turn (see .paged below) */
  .chapter.resume .cv-download { top: 13cqh; right: auto; left: 10cqw; font-size: 17px; }  /* inside the yellow band */
  .chapter.resume .band { position: relative; }
  .cv-pager {
    flex: 1;
    min-height: 0;
    padding: 3cqh 8cqw 2cqh 10cqw;
  }

  /* opener isn't visible on a phone, so the chapter page gets a coloured band */
  .band {
    display: block;
    position: relative;
    height: 22cqh;
    background: var(--bg);
    flex: none;
  }
  .band .title { position: absolute; left: 10cqw; top: 3cqh; font-size: min(17cqw, 10cqh); }
  /* longer words: keep them clear of the drawing. An upright tablet's page is wide for its height, so the band's
     height caps the title and the drawing, or they grow into each other */
  .chapter.kitchen .band .title { font-size: min(13cqw, 7.6cqh); top: 5cqh; }
  .chapter.drawings .band .title { font-size: min(10.5cqw, 6.2cqh); top: 5.5cqh; }
  .chapter[data-chapter="fun"] .band .title { font-size: min(9.5cqw, 5.6cqh); top: 5.5cqh; }
  .chapter.convertlens .band .title { font-size: min(7.4cqw, 4.4cqh); top: 7cqh; }
  .chapter.builds .band .title { font-size: min(9.5cqw, 5.6cqh); top: 5.5cqh; width: 34cqw; }
  .band .art-group { right: 22cqw; bottom: 1cqh; width: min(32cqw, 19cqh); }
  .chapter .page-pad { position: relative; inset: auto; padding-top: 3cqh; flex: 1; }
  .chapter .kicker, .chapter .page-title { display: none; }
  .chapter { display: flex; flex-direction: column; height: 100%; }
  .studies { margin-top: 0; }
  .studies li { padding: 2cqh 0; }
}

/* A phone's narrow cover turns the corner titles on their side. An upright tablet's page has the
   proportions of the two-page book's cover, so it keeps that cover as it is. */
@media (max-width: 700px), (max-height: 500px) {
  .cover-head { height: 13cqh; padding-left: 4cqw; }
  .role { font-size: 5.4cqh; }
  .name { font-size: 3.5cqh; }
  .quads { top: 13cqh; padding-left: 4.5cqw; }

  .quad .title {
    top: 1.4cqh;
    font-size: min(10.5cqw, 5.4cqh);   /* capped by height on an upright tablet's wider page */
    writing-mode: vertical-rl;
  }
  .quad.work .title, .quad.fun .title { left: 1.2cqw; transform: rotate(180deg); }
  .quad.about .title, .quad.resume .title { right: 1.2cqw; }
  .quad:hover .title { transform: none; }
  .quad.work:hover .title, .quad.fun:hover .title { transform: rotate(180deg); }
  .quad .art-group { width: 31cqw; bottom: 1.4cqh; }
  .quad.work .art-group, .quad.fun .art-group { left: 1cqw; }
  .quad.about .art-group, .quad.resume .art-group { right: 1cqw; }
  .me { height: 66cqh; bottom: 6cqh; left: calc(50% + 2.2cqw); }
}

/* Resume and About as pages you turn, never scrolled: always on a phone, and on a larger screen
   whenever the book is too small for a page to fit (the script sets .paged on the chapter and its left page) */
.opener .side ~ .art-group { display: none; }
.opener.paged .side { display: none; }  /* the left page becomes a chapter title page with its drawing */
.opener.paged .side ~ .art-group { display: block; }
.chapter.resume.paged .cv { display: none; }
.chapter.paged .notes-page, .chapter.about.paged .page-pad, .chapter.kitchen.paged .page-pad, .chapter.drawings.paged .page-pad { display: none; }
.chapter.paged .cv-pager { display: flex; flex-direction: column; }
/* on a two-page spread, the text runs on from the left page (under the title) to the right; js/book.js sizes and fills it */
.cv-left { position: absolute; left: 10cqw; right: 7cqw; bottom: calc(3cqh + var(--nav-h, 0px)); z-index: 5; overflow: hidden; }
.cv-left.resume { top: 15.5cqh; }
.cv-left.about { top: 18cqh; }
.cv-left.pg-cont { top: 10cqh; }   /* later spreads: no chapter title, the text starts at the top */
.opener.paged:has(.cv-left.pg-cont) > .title { visibility: hidden; }
.cv-pg .cv-cont > header { display: none; }   /* the second Remedo role carries on without repeating the company */
/* the left page's number, at its foot, level with the right page's arrows and number */
.cv-folio {
  position: absolute; left: 10cqw; right: 7cqw; bottom: 3cqh; z-index: 5; height: var(--nav-h, auto); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  padding-top: 1.5cqh; border-top: 1.5px dashed rgba(45, 42, 38, .3);
  font-family: "Nunito Sans", system-ui, sans-serif; font-size: 17px; font-size-adjust: .4;
}
.opener:not(.paged) .cv-left, .opener:not(.paged) .cv-folio { display: none; }
.opener.paged .cv-left ~ .art-group { display: none; }   /* the text takes the drawing's place */
.cv-left .cv-contact { position: static; }
.cv-pager .cv-nav { margin-top: auto; }   /* stays at the foot even when a spread's right page is empty */
.cv-pg .story-title { font-size: calc(var(--fit, 1) * 40px); }
.cv-pg .story-h { font-size: calc(var(--fit, 1) * 28px); }
.cv-pg p { font-size: calc(var(--fit, 1) * 14px); }
.cv-pg .pair { gap: 3cqw; }
.cv-pg .about-intro, .cv-pg .offclock p, .cv-pg .principles p { font-size: calc(var(--fit, 1) * 14px); }
/* the "What I'm looking for" note on a turned page: the same size as the text around it, its label smaller */
.cv-pg .looking { font-size-adjust: none; }
.cv-pg .looking .looking-head { font-size: calc(var(--fit, 1) * 11px); }
.cv-pg { flex: 1; min-height: 0; overflow: hidden; display: none; }
.cv-pg .cv-summary, .cv-pg .cv-job li, .cv-pg .cv-skills dd, .cv-pg .cv-tools, .cv-pg .cv-edu { font-size: calc(var(--fit, 1) * 13.5px); }
.cv-pg .cv-skills dt { font-size: calc(var(--fit, 1) * 13.5px); }
.cv-pg .cv-job h4 { font-size: calc(var(--fit, 1) * 14.5px); }
/* on a spread, headings and the gaps between sections tighten a little (--hfit, set by js/book.js) when that saves a near-empty last spread */
.cv-pg .cv-head { font-size: calc(max(var(--fit, 1) * var(--hfit, 1), .8) * max(19px, 5cqw)); margin-top: calc(var(--fit, 1) * var(--hfit, 1) * 2.4cqh); margin-bottom: calc(var(--fit, 1) * var(--hfit, 1) * 1.1cqh); }
.cv-pg .cv-head:first-child { margin-top: 0; }
.cv-pg .cv-job { margin-bottom: calc(var(--fit, 1) * var(--hfit, 1) * 1.1cqh); }
.cv-pg .principles li { margin-bottom: calc(var(--fit, 1) * var(--hfit, 1) * 1.4cqh); }
.cv-pg .offclock li { margin-bottom: calc(var(--fit, 1) * var(--hfit, 1) * 1.6cqh); }
.cv-pg .about-intro { margin-bottom: calc(var(--fit, 1) * var(--hfit, 1) * 1.4cqh); }
.cv-pg .looking { margin: calc(var(--fit, 1) * var(--hfit, 1) * .6cqh) 0 calc(var(--fit, 1) * var(--hfit, 1) * 1.6cqh); padding-block: calc(var(--hfit, 1) * 1.3cqh); }
.cv-pg .say-hi { margin-top: calc(var(--fit, 1) * var(--hfit, 1) * 2cqh); }
.cv-pg.on { display: block; }
.cv-pg.pg-fade { animation: pg-in .3s ease; }   /* a page turned with the arrows fades in, in place */
@keyframes pg-in { from { opacity: 0; } }
.cv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5cqh;
  border-top: 1.5px dashed rgba(45, 42, 38, .3);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 17px;
  font-size-adjust: .4;
}
.cv-nav button {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1.5px solid rgba(45, 42, 38, .5);
  border-radius: 99px;
  padding: .05em .9em;
  cursor: pointer;
}
.cv-nav button:disabled { opacity: .3; cursor: default; }
.cv-nav button { position: relative; }
.cv-nav button::after { content: ""; position: absolute; inset: -10px -6px; }   /* finger-sized, looking the same */
/* on a two-page spread the pages sit where the chapter text normally does */
@media (min-width: 1101px) and (min-height: 501px), (min-width: 701px) and (orientation: landscape) and (min-height: 501px) {
  .chapter.paged .cv-pager { position: absolute; inset: 0; padding: 10cqh 7cqw 3cqh 10cqw; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --turn: 0s; }
  .quad .title, .art-group .piece, .toc .title, .ribbon { transition: none; }
  .book:not(.is-open) .leaf-cover:hover { transform: rotateY(0deg) translateZ(3px); }
}

.no-anim, .no-anim * { transition: none !important; animation: none !important; }

/* Headings and pages that receive focus after a page turn (for screen readers) don't show a ring: only controls do */
[tabindex="-1"]:focus { outline: none; }

/* Work's left page: what ConvertLens is, and a map of the six case studies, on a paper note between the title and the drawing */
.opener .work-side { position: absolute; top: 24cqh; bottom: 4cqh; left: 7cqw; right: 7cqw; z-index: 5; display: flex; flex-direction: column; justify-content: center; }   /* centred under the title */
.opener .work-side ~ .art-group, .opener.paged .work-side ~ .art-group { display: none; }   /* the note replaces the drawing here; the cover keeps it */
.opener.paged .work-side { display: block; }
.work-note, .hi-note { position: relative; padding: calc(1.9rem + 2.2cqh) 4cqw 2cqh; border-radius: 2px; transform: rotate(-1.2deg);
  background: radial-gradient(rgba(45, 42, 38, .16) 1px, transparent 1.4px) 7px 7px / 14px 14px, #fffdf7;
  box-shadow: 0 1px 1px rgba(45, 42, 38, .12), 0 12px 20px -12px rgba(45, 42, 38, .45); }
.work-note::before, .hi-note::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1.9rem; border-radius: 2px 2px 0 0; background: var(--yellow-title); }
.work-note::after, .hi-note::after { content: attr(data-label); position: absolute; top: .45rem; left: 4cqw; font-family: "Nunito Sans", system-ui, sans-serif; font-weight: 700; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(45, 42, 38, .85); }
.work-note .wn-hook { font-family: "Caveat", cursive; font-size: clamp(1.3rem, 4.4cqw, 1.75rem); line-height: 1.1; }
.work-note .journey-fig figcaption { margin: 1.4cqh 0 .6cqh; font-size: clamp(1rem, 3.2cqw, 1.3rem); line-height: 1.2; }
.work-note .journey { width: 100%; height: auto; }
.np-scroll .work-side { margin-bottom: 20px; }
/* About's last right page on a spread: "Say hi" as a note card, its strip in About's coral */
.hi-note { width: min(100% - 8px, 24rem); margin: 6cqh auto 0; padding-bottom: 3cqh; transform: rotate(1.2deg); }
.hi-note::before { background: var(--bg, #ee9a87); }
.cv-pg .hi-note .say-hi { margin: 0; font-size: max(17px, 4cqw); line-height: 1.6; }
/* where the book is smaller than a wide laptop (an iPad on its side), the case list drops its tags so the text stays readable; each case study still shows them */
@media not ((min-width: 1200px) and (min-aspect-ratio: 3/2)) { body:not(.notepad) .chapter.work:not(.builds) .cases .tags { display: none; } }

/* The cover: four sections and a Resume strip. Each has its title and a line on what's inside, then its drawing */
.quads { grid-template-rows: 1fr 1fr 10cqh; }
.quads .quad .q-label { position: absolute; top: 2.2cqh; left: 2.6cqw; right: 2cqw; display: flex; flex-direction: column; align-items: flex-start; gap: .5cqh; z-index: 2; }
.quads .quad.ai .q-label, .quads .quad.got-here .q-label { left: 13cqw; }   /* clear of the photo */
.quads .quad .q-label .title { position: relative; inset: auto; font-size: 5.2cqw; writing-mode: horizontal-tb; transform: none; }
/* the subtitles in a hand-printed capitals font, in a darker shade of the section colour: at least 4.5:1 on every section */
.quads .quad .q-sub { font-family: "Patrick Hand SC", cursive; font-weight: 400; font-size: 2.45cqw; letter-spacing: .05em; line-height: 1.25; color: color-mix(in srgb, var(--title) 20%, var(--ink)); }
.quads .quad .q-sub > span { white-space: nowrap; }   /* lines break between items, never inside one */
.quads .quad.work .q-label { right: 16cqw; }   /* wraps before the photo */
.quads .quad.fun .q-label { right: 16cqw; }   /* wraps before the photo */
.quads .quad:hover .q-label .title, .quads .quad:focus-visible .q-label .title { transform: translateY(-3px); }
.quad.ai .art-group { right: 2cqw; }
/* Resume: a strip along the bottom, its title centred over the subtitle */
.quads .quad.cv-strip { grid-column: 1 / -1; background: #fbf8f1; box-shadow: inset 0 0 0 1.5px rgba(45, 42, 38, .2); }
.quads .quad.cv-strip .q-label { top: 50%; left: 0; right: 0; transform: translateY(-50%); flex-direction: column; align-items: center; gap: .2cqh; }
.quads .quad.cv-strip .title { font-size: 4.2cqw; }
.quads .quad.cv-strip .art-group { display: none; }
.me { bottom: 12.6cqh; height: 68cqh; }
@media (max-width: 700px), (max-height: 500px) {   /* a narrow cover: a smaller photo, labels beside her */
  .me { height: 44cqh; bottom: 26.8cqh; }   /* centred on the four sections */
  .quads .quad .q-label, .quads .quad.ai .q-label, .quads .quad.work .q-label { left: 3cqw; right: 3cqw; top: 1.6cqh; }
  .quads .quad.fun .q-label { left: 3cqw; right: 19cqw; }
  .quads .quad.got-here .q-label { left: 18cqw; right: 2cqw; }
  .quads .quad .q-label .title, .quads .quad.cv-strip .title { font-size: min(7.4cqw, 4cqh); line-height: .95; }
  .quads .quad .q-sub, .quads .quad.work .q-sub { font-size: min(4.4cqw, 2.4cqh); white-space: normal; }
  .quads .quad .q-sub > span { white-space: normal; }   /* the columns are too narrow to keep an item whole */
  .quads .quad.cv-strip .q-label { left: 0; }
}
