/*
  site.css: the design system for the public site.

  Colour   Every colour is a token from palettes.css; nothing here names a
           hex value. Each section owns a hue (work sun, writing sky,
           playground clay, resume moss, now and booking plum) and a page takes
           --accent from its section (body.s-<section>). Pages outside a
           section, and the mark and main button, use --brand.
  Type     One variable family, Recursive (recursive.css). Headings turn up its
           casual axis, code and small labels turn up its mono axis.
  Shapes   Tape labels, tilted squares, dashed rules, a squiggle under titles.
  Motion   CSS only (the site layout ships no JavaScript) and it stops for
           prefers-reduced-motion.
*/

:root {
  --font: "Recursive", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: "Recursive", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Recursive's axes. Set these, never font-variation-settings directly. */
  --mono: 0;
  --casl: 0;

  --measure: 44rem;
  --gutter: 1.5rem;
  --radius: 0.6rem;
  --press: 0 0.25rem 0 var(--shade);
  --press-up: 0 0.5rem 0 var(--shade);
}

.s-work { --accent: var(--sun); }
.s-writing { --accent: var(--sky); }
.s-playground { --accent: var(--clay); }
.s-resume { --accent: var(--moss); }
.s-now, .s-book { --accent: var(--plum); }

*,
*::before,
*::after {
  box-sizing: border-box;
  font-variation-settings: "MONO" var(--mono), "CASL" var(--casl);
}

html { background: var(--ground); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground) radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0 / 22px 22px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1; padding: 3rem 0 4.5rem; }

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  border-radius: 2px;
}
a:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--accent);
  color: var(--ground);
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; }

/* Layout */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--wide { max-width: 70rem; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

/* The mark: a tilted square with an "a" in the section's colour. On the home
   page it stands alone, because the name is already the page's heading. */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.mark:hover { background: none; }
.mark-glyph {
  --casl: 1;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding-bottom: 0.12em;
  background: var(--accent);
  color: var(--ground);
  border-radius: 0.45rem;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-7deg);
  transition: transform 0.2s ease;
}
.mark-glyph { animation: wobble 0.9s 0.25s ease-in-out 1; }
.mark:hover .mark-glyph { transform: rotate(7deg) scale(1.08); }
.mark-name { --casl: 0.6; font-weight: 750; font-size: 0.98rem; }

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0 -0.6rem 0 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav li { margin: 0; }
.site-nav a {
  --casl: 0.5;
  display: inline-block;
  padding: 0.25rem 0.6rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.3rem;
  transition: transform 0.15s ease;
}
.site-nav a:hover { color: var(--hue); background: none; transform: rotate(-2deg); }
.site-nav a[aria-current="page"] { background: var(--hue); color: var(--ground); transform: rotate(-2deg); }
[data-hue="sun"] { --hue: var(--sun); }
[data-hue="sky"] { --hue: var(--sky); }
[data-hue="clay"] { --hue: var(--clay); }
[data-hue="moss"] { --hue: var(--moss); }
[data-hue="plum"] { --hue: var(--plum); }
[data-hue="brand"] { --hue: var(--brand); }

.site-footer { color: var(--ink-2); font-size: 0.9rem; }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
  padding-bottom: 1.4rem;
}
.site-footer .wrap::before { content: ""; flex: 0 0 100%; border-top: 2px dashed var(--line); margin-bottom: 0.6rem; }
.site-footer ul { display: flex; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer li { margin: 0; }
.site-footer a { color: var(--ink-2); text-decoration-color: var(--line); }
.site-footer a:hover { color: var(--ink); }
.admin-link { color: var(--ink-3); display: inline-flex; padding: 0.25rem; }
.admin-link svg { width: 16px; height: 16px; }

/* Type */

h1, h2, h3, h4 { --casl: 1; line-height: 1.15; letter-spacing: -0.015em; font-weight: 800; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3rem); font-weight: 900; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: 1.4rem; margin-top: 3rem; }
h3 { font-size: 1.12rem; margin-top: 2rem; }
p, ul, ol, blockquote, pre, table, figure { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--accent); }
hr { border: 0; border-top: 2px dashed var(--line); margin: 2.5rem 0; }
strong { font-weight: 750; }

/* A hand-drawn squiggle under every page title, in the section's colour. */
main h1::after {
  content: "";
  display: block;
  width: 4.75rem;
  height: 0.65rem;
  margin-top: 0.7rem;
  background: var(--accent);
  -webkit-mask: var(--squiggle) no-repeat left center / contain;
  mask: var(--squiggle) no-repeat left center / contain;
  animation: squiggle 0.7s 0.2s ease-out both;
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 76 10'%3E%3Cpath d='M2 6 Q8 0 14 5 T26 5 T38 5 T50 5 T62 5 T74 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.muted { color: var(--ink-2); }
.meta, .eyebrow { --mono: 1; font-size: 0.8rem; color: var(--ink-2); }
.eyebrow { display: block; margin-bottom: 0.5rem; }

/* Tape label: section names and small headings. */
.label, .section-title {
  --mono: 1;
  --casl: 1;
  width: fit-content;
  background: var(--hue, var(--accent));
  color: var(--ground);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem 0.22rem;
  border-radius: 0.2rem;
  transform: rotate(-1.5deg);
}
.section-title { margin: 3.25rem 0 1rem; }
.label { display: block; margin: 0 0 0.75rem; }

/* Rows: work and writing indexes */

.rows { list-style: none; padding: 0; margin: 0; }
.rows > li { margin: 0; border-bottom: 2px dashed var(--line); }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0.95rem 0.7rem;
  margin: 0 -0.7rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
a.row:hover { background: var(--ground-2); }
.row-title { --casl: 0.8; grid-column: 1; font-size: 1.12rem; font-weight: 750; }
.row-title::after { content: "→"; display: inline-block; margin-left: 0.45rem; color: var(--accent); opacity: 0; transform: translateX(-0.4rem); transition: opacity 0.15s, transform 0.15s; }
a.row:hover .row-title::after, a.row:focus-visible .row-title::after { opacity: 1; transform: none; }
.row-when { --mono: 1; grid-column: 2; grid-row: 1; align-self: baseline; font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; }
.row-summary { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.97rem; text-wrap: pretty; }
.row-stack { --mono: 1; grid-column: 1 / -1; font-size: 0.74rem; color: var(--ink-3); }

/* Home: everything on one screen. Two columns: who and proof on the left,
   the call to action, the toys and the writing on the right. */

.s-home main { padding: clamp(0.75rem, 2.5vh, 2rem) 0 0.5rem; }
.s-home .site-footer .wrap { padding-top: 0.35rem; padding-bottom: 0.7rem; }
.s-home .site-footer .wrap::before { margin-bottom: 0.35rem; }
.home { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 clamp(1.75rem, 4.5vw, 4rem); align-items: start; }
.home-main, .home-side { display: flex; flex-direction: column; gap: clamp(1rem, 3vh, 1.6rem); }
.home h2 { margin: 0; }
.home p { margin-bottom: 0.7rem; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.home-head a { --mono: 1; font-size: 0.78rem; color: var(--ink-2); text-decoration-color: var(--line); white-space: nowrap; }
.home-head a::after { content: " →"; }

.home-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.9rem; }
.home-id h1 { font-size: 1.15rem; font-weight: 850; letter-spacing: 0; margin: 0; }
.home-id h1::after { content: none; }
.home-id .eyebrow { margin: 0; }
.home-pitch {
  --casl: 1;
  font-size: clamp(2rem, 1rem + 2.2vw, 2.7rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0.5rem 0 0.75rem !important;
}
.home-pitch mark {
  color: inherit;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--brand) 50%, transparent) 58% 92%, transparent 92%);
  padding: 0 0.08em;
  margin: 0 -0.08em;
}
.home-sub { color: var(--ink-2); font-size: 0.97rem; line-height: 1.5; text-wrap: pretty; }
.home-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.15rem; list-style: none; padding: 0; margin: 0.65rem 0 0; }
.home-links li { margin: 0; }
.home-links a { font-weight: 600; }
.home-more { font-size: 0.9rem; color: var(--ink-2); margin: 0.55rem 0 0 !important; }

/* Selected work: a name, a year, and one line of what happened. */
.worklist { list-style: none; margin: 0; padding: 0; }
.worklist li { margin: 0; }
.worklist a { display: block; padding: 0.2rem 0.6rem; margin: 0 -0.6rem; color: var(--ink); text-decoration: none; border-radius: 0.5rem; }
.worklist a:hover { background: var(--ground-2); }
.worklist-top { display: flex; align-items: baseline; gap: 0.6rem; }
.worklist-title { --casl: 0.6; font-weight: 750; }
.worklist-dots { flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--line); transform: translateY(-0.28em); }
.worklist-when { --mono: 1; font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; }
.worklist-line { display: block; font-size: 0.87rem; line-height: 1.3; color: var(--ink-2); }
.worklist a:hover .worklist-title, .worklist a:focus-visible .worklist-title { color: var(--sun); }
.worklist a:hover .worklist-dots { border-color: var(--sun); }

/* Now: the call to action. */
.home-now {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.9rem 1rem 1rem;
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: 1.1rem;
}
.home-now .home-head { margin-bottom: 0.4rem; }
.home-now p { font-size: 0.94rem; line-height: 1.42; margin-bottom: 0.3rem; text-wrap: pretty; }
.home-now .now-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0; }
.home-now .toy-art { border-radius: 0.85rem; }

.home-play .toys { grid-template-columns: repeat(3, minmax(0, 6.3rem)); }
.home-play .toy-name { margin-top: 0.5rem; font-size: 0.9rem; }

/* Writing on the home page: the newest post gets its summary. */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { margin: 0; }
.posts a { display: block; padding: 0.22rem 0.6rem; margin: 0 -0.6rem; color: var(--ink); text-decoration: none; border-radius: 0.5rem; }
.posts a:hover { background: var(--ground-2); }
.posts a:hover .posts-title { color: var(--sky); }
.posts-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.posts-title { --casl: 0.6; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.posts-when { --mono: 1; font-size: 0.76rem; color: var(--ink-2); white-space: nowrap; }
.posts-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.87rem; line-height: 1.33; color: var(--ink-2); margin-top: 0.1rem; }

/* Toys: the things on the site you can play with */

.toys { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; padding: 0; margin: 0; }
.toys li { margin: 0; }
.toy { display: block; color: var(--ink); text-decoration: none; }
.toy:hover { background: none; }
.toy-art {
  display: block;
  aspect-ratio: 1;
  background: var(--hue);
  color: var(--ground);
  border-radius: 1.1rem;
  box-shadow: var(--press);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.toy-art svg { display: block; width: 100%; height: 100%; }
.toy:hover .toy-art, .toy:focus-visible .toy-art { transform: translateY(-0.25rem) rotate(-2deg); box-shadow: var(--press-up); }
.toy:active .toy-art { transform: translateY(0.15rem); box-shadow: none; }
.toy-name { --casl: 0.8; display: block; margin-top: 0.7rem; font-weight: 750; font-size: 0.95rem; line-height: 1.25; }
.toy-text { display: block; color: var(--ink-2); font-size: 0.9rem; margin-top: 0.2rem; }

.toys--big { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 14rem)); gap: 1.5rem; }
.toys--big .toy-art svg { width: 78%; height: 78%; margin: 11% auto; }
.toys--big .toy-name { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 1.05rem; }

/* "live": a small tape tag, like the section labels. */
.live {
  --mono: 1;
  --casl: 1;
  padding: 0.12rem 0.4rem 0.08rem;
  background: var(--moss);
  color: var(--ground);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0.2rem;
  transform: rotate(2deg);
  white-space: nowrap;
}

.art-stroke { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-thin { stroke-width: 2; }
.art-fill { fill: currentColor; }
.art-soft { opacity: 0.35; }
.art-needle { transform-origin: 60px 86px; animation: needle 3.2s ease-in-out infinite; }
.art-playhead { animation: playhead 2.6s linear infinite; }
.art-star { animation: twinkle 2.4s ease-in-out infinite; }
.art-star:nth-of-type(2n) { animation-delay: -0.8s; }
.art-star:nth-of-type(3n) { animation-delay: -1.6s; }
.art-circle { stroke-dasharray: 100; stroke-dashoffset: 100; animation: circle 3.4s ease-in-out infinite; }
.art-draw { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 3.6s ease-in-out infinite; }
.art-bar { transform-box: fill-box; transform-origin: center bottom; animation: bar 1.1s ease-in-out infinite; }
.art-bar--mid { transform-origin: center; }
.art-bar:nth-of-type(2n) { animation-delay: -0.35s; }
.art-bar:nth-of-type(3n) { animation-delay: -0.7s; }
.art-bar:nth-of-type(5n) { animation-delay: -0.5s; }
.art-slide { stroke-dasharray: 14 8; animation: slide 1.6s linear infinite; }
.art-slide:nth-of-type(2n) { animation-duration: 2.3s; animation-direction: reverse; }
.art-slide:nth-of-type(3n) { animation-duration: 1.1s; }
.art-bob { animation: bob 1.2s ease-in-out infinite; }
.art-bob:nth-of-type(2) { animation-delay: 0.15s; }
.art-bob:nth-of-type(3) { animation-delay: 0.3s; }
.art-tumble { transform-box: fill-box; transform-origin: center; animation: tumble 4s ease-in-out infinite; }
.art-hue { fill: var(--hue); }
.toy:hover .art-needle { animation-duration: 0.9s; }
.toy:hover .art-circle, .tile:hover .art-draw { animation-duration: 1.4s; }
.tile:hover .art-bar { animation-duration: 0.5s; }
.tile:hover .art-tumble { animation-duration: 1.2s; }
.toy:hover .art-playhead { animation-duration: 1s; }
.toy:hover .art-star { animation-duration: 0.8s; }

@keyframes needle { 0%, 100% { transform: rotate(-26deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(8deg); } }
@keyframes playhead { from { transform: translateX(0); } to { transform: translateX(76px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes circle { 0% { stroke-dashoffset: 100; } 35%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes draw { 0% { stroke-dashoffset: 100; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes bar { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes slide { to { stroke-dashoffset: -44; } }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes tumble { 0%, 100% { transform: rotate(-9deg) translateY(1px); } 50% { transform: rotate(9deg) translateY(-3px); } }
@keyframes flow { to { stroke-dashoffset: -10; } }
@keyframes rise { from { opacity: 0; translate: 0 0.6rem; } to { opacity: 1; translate: 0 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wobble { 0%, 100% { transform: rotate(-7deg); } 30% { transform: rotate(11deg) scale(1.12); } 62% { transform: rotate(-14deg); } }
@keyframes squiggle { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Tiles: the playground index */

.tiles { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.9rem; padding: 0; margin: 0; }
.tiles li { margin: 0; }
.tile {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.2rem 0.95rem;
  align-content: start;
  height: 100%;
  padding: 0.85rem;
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tile:hover { background: var(--ground-2); border-color: var(--hue, var(--accent)); transform: translateY(-0.15rem) rotate(-0.6deg); }
.tile-art { grid-row: 1 / span 3; aspect-ratio: 1; background: var(--hue, var(--accent)); color: var(--ground); border-radius: 0.75rem; overflow: hidden; }
.tile-art svg { display: block; width: 100%; height: 100%; }
.tile-title { --casl: 0.8; font-weight: 750; font-size: 1.05rem; line-height: 1.25; }
.tile-text { color: var(--ink-2); font-size: 0.9rem; line-height: 1.4; }
.tile-foot { --mono: 1; padding-top: 0.25rem; font-size: 0.7rem; color: var(--ink-3); }
.tile--wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 1rem 1.1rem; border-style: dashed; }
.tile--wide .tile-title::after { content: " →"; color: var(--accent); }

.status {
  --mono: 1;
  width: fit-content;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 0.2rem;
  border: 2px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

/* Case studies and posts */

.prose { font-size: 1.03rem; }
.prose h2 { font-size: 1.35rem; }
.prose h2::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  background: var(--accent);
  border-radius: 0.14em;
  transform: rotate(-9deg);
}
.prose img { border: 2px solid var(--line); border-radius: var(--radius); }
.prose blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--ink-2);
  margin-left: 0;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 2px dashed var(--line); vertical-align: top; }
.prose th { --mono: 1; color: var(--ink-2); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }

code, pre { --mono: 1; font-family: var(--font-code); font-size: 0.88em; }
:not(pre) > code { overflow-wrap: anywhere; background: var(--ground-3); padding: 0.1em 0.38em; border-radius: 0.3rem; }
pre {
  background: var(--sunken);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { font-size: 0.82rem; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem 0;
  border-top: 2px dashed var(--line);
  border-bottom: 2px dashed var(--line);
  font-size: 0.94rem;
}
.facts dt { --mono: 1; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 0.25rem; }
.facts dd { margin: 0; }

.note {
  background: var(--ground-2);
  border-left: 4px solid var(--accent);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.figure { margin: 2rem 0; }
.figure figcaption { font-size: 0.86rem; color: var(--ink-2); margin-top: 0.5rem; }

.diagram {
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}
.diagram svg { display: block; margin: 0 auto; min-width: 560px; }
.diagram text { --mono: 1; font-family: var(--font-code); font-size: 12px; fill: var(--ink); }
.diagram .box { fill: var(--ground); stroke: var(--ink-2); }
.diagram .box--accent { stroke: var(--accent); stroke-width: 2; }
.diagram .edge { stroke: var(--ink-3); fill: none; }
.diagram marker path { fill: var(--ink-3); }
/* .label inside a diagram is a small caption on a box, not the tape label. */
.diagram .label { --casl: 0; fill: var(--ink-2); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; transform: none; }
/* Edges move in the direction they point. */
.diagram .edge { stroke-dasharray: 5 5; animation: flow 0.9s linear infinite; }
.diagram .edge--fast { animation-duration: 0.35s; }

/* Headline numbers at the top of a case study. */
.stats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; padding: 0; margin: 0 0 2.25rem; }
.stats li {
  margin: 0;
  padding: 0.8rem 0.9rem 0.85rem;
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.5s calc(var(--i, 0) * 90ms + 0.15s) ease-out both;
}
.stats li:nth-child(odd) { transform: rotate(-0.6deg); }
.stats li:nth-child(even) { transform: rotate(0.5deg); }
.stats strong { --casl: 1; display: block; font-size: 1.55rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; color: var(--accent); }
.stats span { display: block; margin-top: 0.3rem; font-size: 0.86rem; line-height: 1.35; color: var(--ink-2); }

/* Before and after bars, drawn to scale. */
.compare { display: grid; gap: 1.1rem; padding: 1.1rem 1.15rem 1.2rem; background: var(--ground-2); border: 2px solid var(--line); border-radius: var(--radius); }
.compare-row { display: grid; gap: 0.35rem; }
.compare-what { --mono: 1; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.compare-bar { display: flex; align-items: center; gap: 0.6rem; }
.compare-bar i { flex: 0 0 auto; width: calc(var(--w) * 0.62); min-width: 0.35rem; height: 1.15rem; background: var(--ink-3); border-radius: 0.25rem; transform-origin: left; animation: grow 0.9s 0.2s ease-out both; }
.compare-bar b { font-size: 0.9rem; font-weight: 650; white-space: nowrap; }
.compare-bar--after i { background: var(--accent); animation-delay: 0.9s; }
.compare-bar--after b { color: var(--accent); }

.back { --mono: 1; font-size: 0.8rem; display: inline-block; margin-bottom: 1.75rem; color: var(--ink-2); text-decoration-color: var(--line); }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; font-size: 0.95rem; font-weight: 600; }

/* Buttons */

.button {
  --casl: 0.8;
  display: inline-block;
  background: var(--accent);
  color: var(--ground);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 0;
  box-shadow: var(--press);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { background: var(--accent); transform: translateY(-0.1rem) rotate(-1deg); box-shadow: 0 0.35rem 0 var(--shade); }
.button:active { transform: translateY(0.2rem); box-shadow: none; }
.button--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.button--quiet:hover { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.button--small { padding: 0.3rem 0.7rem; font-size: 0.92rem; }

/* Resume */

.resume-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.resume-contact { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.93rem; }
.resume-contact li { margin: 0; }
.resume-contact a { display: inline-block; padding: 0.35rem 0; }
.job { margin-top: 2.25rem; }
.job-head { display: flex; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; align-items: baseline; }
.job-head h3 { margin: 0; }
.job-note { font-size: 0.9rem; color: var(--ink-2); font-style: italic; margin: 0.25rem 0 0.5rem; }
.job ul { margin-top: 0.5rem; }
.skills dt { font-weight: 750; margin-top: 0.75rem; }
.skills dd { margin: 0; color: var(--ink-2); }

/* Forms (booking) */

.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--ground-2);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }

.cal { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 1.5rem; }
.cal th { --mono: 1; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; padding: 0.5rem 0; }
.cal td { text-align: center; padding: 0.2rem; }
.cal a, .cal span { display: block; padding: 0.6rem 0; border-radius: var(--radius); text-decoration: none; }
.cal a { background: var(--ground-2); color: var(--ink); font-weight: 700; border: 2px solid var(--line); transition: transform 0.12s ease; }
.cal a:hover, .cal a[aria-current="date"] { background: var(--accent); border-color: var(--accent); color: var(--ground); transform: rotate(-3deg); }
.cal span { color: var(--ink-3); }

.slots { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.5rem; }
.slots li { margin: 0; }
.slots label {
  --mono: 1;
  display: block;
  text-align: center;
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.slots input { position: absolute; opacity: 0; pointer-events: none; }
.slots label:hover { border-color: var(--accent); }
.slots input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--ground); }
.slots input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.flash { padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; background: var(--ground-2); margin-bottom: 1.5rem; }
.flash--alert { border-left: 4px solid var(--clay); }
.flash--notice { border-left: 4px solid var(--moss); }

/* Palette picker (footer) and the /palettes page */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.palette-chips { display: inline-flex; gap: 2px; }
.palette-chips i { width: 0.7rem; height: 0.7rem; border-radius: 0.2rem; background: var(--hue); transform: rotate(-6deg); }

.palette-picker { position: relative; margin-left: auto; }
.palette-picker summary {
  --casl: 0.5;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.6rem;
  list-style: none;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0.4rem;
  box-shadow: inset 0 0 0 2px var(--line);
}
.palette-picker summary::-webkit-details-marker { display: none; }
.palette-picker summary:hover, .palette-picker[open] summary { color: var(--ink); box-shadow: inset 0 0 0 2px var(--brand); }
.palette-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 5;
  display: grid;
  gap: 0.35rem;
  width: 13rem;
  padding: 0.6rem;
  background: var(--ground-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--press);
}
.palette-menu form { margin: 0; }
.palette-menu > a { font-size: 0.82rem; padding: 0.25rem 0.1rem 0; width: fit-content; }
.palette-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: var(--ground);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 0.45rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.palette-option:hover, .palette-option[aria-pressed="true"] { border-color: var(--brand); }
.palette-option[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--brand); }

.palette-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; padding: 0; margin: 2rem 0 0; }
.palette-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 1.25rem;
  background: var(--ground) radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0 / 22px 22px;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 1.1rem;
}
.palette-card h2, .palette-card p, .palette-card .label, .palette-card pre { margin: 0; }
.palette-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.palette-card-title { --casl: 1; font-size: 1.45rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; }
.palette-card-title mark { color: inherit; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--brand) 50%, transparent) 58% 92%, transparent 92%); }
.palette-card-labels { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.palette-card .toys { grid-template-columns: repeat(3, 4.6rem); }
.palette-card .raised { background: var(--ground-2); border-radius: var(--radius); padding: 0.7rem 0.85rem; font-size: 0.92rem; }
.palette-card form { margin: auto 0 0; }

/* Small screens */

@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); row-gap: 1.75rem; }
  .home-main, .home-side { display: contents; }
  .home-intro { order: 1; }
  .home-now { order: 2; }
  .home-work { order: 3; }
  .home-play { order: 4; }
  .home-writing { order: 5; }
  .home-pitch { font-size: clamp(1.9rem, 1.2rem + 3.4vw, 2.6rem); }
}
@media (max-width: 560px) {
  :root { --gutter: 1.15rem; }
  main { padding: 2rem 0 3rem; }
  .toys { gap: 0.6rem; }
  .toy-art { border-radius: 0.8rem; }
  .toy-name { font-size: 0.86rem; }
  .home-now { grid-template-columns: 4.75rem minmax(0, 1fr); gap: 0.85rem; padding: 0.85rem; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile--wide { grid-template-columns: minmax(0, 1fr); }
}

/* Short laptop screens: keep the home page on one screen. */
@media (min-width: 901px) and (max-height: 790px) {
  .site-header .wrap { padding-top: 0.55rem; padding-bottom: 0.55rem; }
  .s-home main { padding-top: 0.35rem; padding-bottom: 0.25rem; }
  .home-main, .home-side { gap: 0.8rem; }
  .home-pitch { font-size: clamp(1.75rem, 0.9rem + 2vw, 2.35rem); margin: 0.35rem 0 0.5rem !important; }
  .home-links { margin-top: 0.4rem; }
  .worklist a { padding-top: 0.12rem; padding-bottom: 0.12rem; }
  .home-play .toys { grid-template-columns: repeat(3, minmax(0, 5.9rem)); }
  .home-play .toy-name { font-size: 0.85rem; white-space: nowrap; }
  .home-now { padding: 0.7rem 0.85rem 0.8rem; }
  .posts-line { display: none; }
  .s-home .site-footer .wrap { padding-top: 0.2rem; padding-bottom: 0.4rem; }
}

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

/* Print (resume) */

@media print {
  html, body { --ground: #fff; --ground-2: #fff; --ground-3: #fff; --sunken: #fff; --ink: #111; --ink-2: #444; --ink-3: #666; --line: #ccc; --accent: #111; --brand: #111; --dot: transparent; }
  body { font-size: 11pt; background: #fff; }
  .site-header, .site-footer, .no-print { display: none !important; }
  main { padding: 0; }
  main h1::after { display: none; }
  a { text-decoration: none; }
}
