/* Sketchbook theme: a preview for Ben, 29 November 2026.
   Everything here is scoped to html.theme-sketch, which /theme.js sets from ?theme=sketch (and
   remembers); ?theme=classic switches back. The look follows Sienna's videos: pen-and-wash paper,
   ink lines, red marker, and real photos pinned in with tape. Nothing changes for anyone who has
   not asked for it. */

html.theme-sketch {
  --paper: #f6f1e6;
  --ink: #1d1b18;
  --rule: #cfc6b3;
  --sk-ink: #24211c;
  --sk-wash: #ebe3d1;
  --sk-tape: rgba(236, 226, 196, 0.82);
  --sk-wobble: 255px 14px 225px 16px / 14px 225px 16px 255px;
  --sk-noise: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --sk-scribble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='12' viewBox='0 0 240 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 30 3, 60 10, 90 6 S 150 2, 180 7 S 225 9, 238 4' fill='none' stroke='%23d7141c' stroke-width='3.2' stroke-linecap='round'/%3E%3Cpath d='M6 10 C 50 6, 110 11, 160 8 S 220 6, 234 8' fill='none' stroke='%23d7141c' stroke-width='1.4' stroke-linecap='round' opacity='.7'/%3E%3C/svg%3E");
  --sk-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='8' viewBox='0 0 600 8' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 80 2, 160 6, 240 4 S 400 2, 480 5 S 570 3, 599 4' fill='none' stroke='%2324211c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

html.theme-sketch body { background-color: var(--paper); background-image: var(--sk-noise); color: var(--sk-ink); }

/* Masthead: ink on paper instead of a black bar, with a hand-drawn rule under it. */
html.theme-sketch .site-header { background: var(--paper); background-image: var(--sk-noise); color: var(--sk-ink); border-bottom: 0; }
html.theme-sketch .site-header::after { content: ""; display: block; height: 8px; background: var(--sk-line) center / 100% 100% no-repeat; }
html.theme-sketch .brand, html.theme-sketch .brand:hover { color: var(--sk-ink); }
html.theme-sketch .m-nav a, html.theme-sketch .m-nav .nav-soon { color: var(--sk-ink); }
html.theme-sketch .m-nav a:hover, html.theme-sketch .m-nav a[aria-current="page"] { color: var(--sk-ink); border-bottom-color: transparent; background: var(--sk-scribble) center bottom 6px / 100% 9px no-repeat; }
html.theme-sketch .m-menu, html.theme-sketch .m-menu nav a { color: var(--sk-ink); }
html.theme-sketch .site-header button, html.theme-sketch .site-header svg { color: var(--sk-ink); }
html.theme-sketch .m-ticker { background: transparent; color: var(--sk-ink); border-bottom: 1px dashed var(--rule); }
html.theme-sketch .m-ticker b, html.theme-sketch .m-ticker a { color: var(--sk-ink); }
html.theme-sketch .m-ticker .live { color: #d7141c; }
html.theme-sketch .m-ticker .live::before { background: #d7141c; }

/* Headings get a red marker underline rather than a solid block. */
html.theme-sketch .rule-head { border-bottom: 0; background: var(--sk-line) left bottom / 100% 6px no-repeat; }
html.theme-sketch .rule-head h2 { padding-left: 0; display: inline-block; background: var(--sk-scribble) left bottom / 100% 10px no-repeat; padding-bottom: 6px; }
html.theme-sketch .rule-head h2::before { display: none; }
html.theme-sketch .m-title { transform: rotate(-0.6deg); transform-origin: left; }
html.theme-sketch .m-kicker { color: #b3121a; }

/* Cards: wobbly ink outlines on paper, slightly askew, straighten on hover. */
html.theme-sketch .m-card, html.theme-sketch .m-lead {
  background: #fbf8f1; border: 2px solid var(--sk-ink); border-top-width: 2px; border-radius: var(--sk-wobble);
  box-shadow: 3px 4px 0 rgba(36, 33, 28, 0.13); transition: transform .2s ease;
}
html.theme-sketch .m-grid3 > :nth-child(3n+1) .m-card, html.theme-sketch .m-grid3 > .m-card:nth-child(3n+1) { transform: rotate(-0.5deg); }
html.theme-sketch .m-grid3 > :nth-child(3n+2) .m-card, html.theme-sketch .m-grid3 > .m-card:nth-child(3n+2) { transform: rotate(0.4deg); }
html.theme-sketch .m-card:hover, html.theme-sketch .m-lead:hover { transform: rotate(0) translateY(-2px); }

/* Photos are pinned in: white print border, tape on the corner, a touch of age. Colour returns on hover. */
html.theme-sketch .m-media, html.theme-sketch .m-thumb { background: #fff; padding: 7px; border-radius: 0; box-shadow: 0 2px 6px rgba(36, 33, 28, 0.18); overflow: visible; }
html.theme-sketch .m-media img, html.theme-sketch .m-thumb img { filter: saturate(0.82) sepia(0.12) contrast(1.03); transition: filter .25s ease; }
html.theme-sketch .m-card:hover .m-media img, html.theme-sketch .m-lead:hover .m-media img { filter: none; }
html.theme-sketch .m-card .m-media, html.theme-sketch .m-lead .m-media { margin: 10px 10px 0; transform: rotate(-1deg); }
html.theme-sketch .m-media::before, html.theme-sketch .m-hero-media::before {
  content: ""; position: absolute; z-index: 2; top: -9px; left: 50%; width: 84px; height: 22px; margin-left: -42px;
  background: var(--sk-tape); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* Article hero: a taped print, not a full-bleed banner. */
html.theme-sketch .m-hero { padding: 0 16px; }
html.theme-sketch .m-hero-media { position: relative; overflow: visible; background: #fff; padding: 10px 10px 12px; max-width: 1040px; margin: 14px auto 0; transform: rotate(-0.7deg); box-shadow: 0 6px 18px rgba(36, 33, 28, 0.2); }
html.theme-sketch .m-hero-media picture { display: block; overflow: hidden; }
html.theme-sketch .m-hero figcaption { text-align: center; font-style: italic; }
html.theme-sketch .m-hero-type { background: var(--sk-wash); color: var(--sk-ink); border: 2px solid var(--sk-ink); border-radius: var(--sk-wobble); }

/* The verdict is an index card with a red margin line. */
html.theme-sketch .m-verdict {
  background: #fffdf6 repeating-linear-gradient(transparent 0 25px, #c9d8ea 25px 26px);
  color: var(--sk-ink); border: 0; border-left: 3px solid #d7141c; box-shadow: 2px 3px 8px rgba(36, 33, 28, 0.18); transform: rotate(0.5deg);
}
html.theme-sketch .m-verdict-label { color: #b3121a; }
html.theme-sketch .m-note { border: 2px dashed var(--sk-ink); background: transparent; border-radius: var(--sk-wobble); }
html.theme-sketch .m-chip { background: transparent; color: var(--sk-ink); border: 1.5px solid var(--sk-ink); border-radius: var(--sk-wobble); }
html.theme-sketch .m-chip span { color: #b3121a; }

/* Presenters: a pencil ring round the face. */
html.theme-sketch .m-avatar { border: 2px solid var(--sk-ink); box-shadow: 2px 2px 0 rgba(215, 20, 28, 0.55); }
html.theme-sketch .m-video-frame { border: 8px solid #fff; border-radius: 2px; transform: rotate(-1.2deg); box-shadow: 0 8px 20px rgba(36, 33, 28, 0.25); }

/* Footer: the back page of the sketchbook. */
html.theme-sketch .site-footer { background: var(--sk-wash); background-image: var(--sk-noise); color: var(--sk-ink); border-top: 0; position: relative; }
html.theme-sketch .site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; height: 8px; background: var(--sk-line) center / 100% 100% no-repeat; }
html.theme-sketch .site-footer a { color: var(--sk-ink); }
html.theme-sketch .site-footer a:hover { color: #b3121a; }

/* Article page sits on the same paper; numbered steps become pencilled notes. */
html.theme-sketch .m-article { background: transparent; }
html.theme-sketch .m-share { background: transparent; border-radius: var(--sk-wobble); }
html.theme-sketch .m-steps li { background: #fbf8f1; border-left: 0; border: 1.5px solid var(--sk-ink); border-radius: var(--sk-wobble); }

/* What's on: a page torn from the diary, ink on a wash, not a black slab. */
html.theme-sketch .m-whatson { background: var(--sk-wash); color: var(--sk-ink); border: 2px solid var(--sk-ink); border-top: 2px solid var(--sk-ink); border-radius: var(--sk-wobble); box-shadow: 3px 4px 0 rgba(36, 33, 28, 0.13); }
html.theme-sketch .m-whatson-head { border-bottom: 0; background: var(--sk-line) left bottom / 100% 6px no-repeat; }
html.theme-sketch .m-whatson-head h2, html.theme-sketch .m-whatson-head h3, html.theme-sketch .m-whatson-head a, html.theme-sketch .m-wo-name a { color: var(--sk-ink); }
html.theme-sketch .m-whatson li { border-bottom: 1px dashed #b9ae95; }
html.theme-sketch .m-whatson time { color: #b3121a; }
html.theme-sketch .m-whatson, html.theme-sketch .m-whatson * { --muted-dark: #5d564a; }
html.theme-sketch .m-wo-until { background: transparent; color: var(--sk-ink); border: 1px solid var(--sk-ink); }
html.theme-sketch .m-wo-venue, html.theme-sketch .m-wo-note { color: #4a443a; }
html.theme-sketch .m-video-frame { width: min(100%, 260px); }

/* The preview switch theme.js adds while the preview is in use. */
.theme-switch { position: fixed; z-index: 50; left: 12px; bottom: 12px; display: flex; gap: 0; font: 600 13px/1 var(--font-body, system-ui); box-shadow: 0 3px 12px rgba(0,0,0,.25); border-radius: 999px; overflow: hidden; }
.theme-switch a { padding: 9px 13px; background: #fff; color: #111; text-decoration: none; }
.theme-switch a[aria-current="true"] { background: #d7141c; color: #fff; }
.theme-switch span { padding: 9px 11px; background: #111; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html.theme-sketch .m-card, html.theme-sketch .m-lead { transition: none; }
}
html.theme-sketch .m-series { background: #fbf8f1; border-radius: var(--sk-wobble); }
html.theme-sketch .m-figure img { border: 0; background: transparent; }
html.theme-sketch .m-filters a { border-radius: var(--sk-wobble); }
html.theme-sketch .m-vcard { background: #fbf8f1; border: 2px solid var(--sk-ink); border-radius: var(--sk-wobble); overflow: hidden; }
html.theme-sketch .m-today { background: var(--sk-wash); color: var(--sk-ink); border: 2px solid var(--sk-ink); border-radius: var(--sk-wobble); }
html.theme-sketch .m-today .m-headline { color: var(--sk-ink); }
html.theme-sketch .m-today .m-kicker { color: #b3121a; }
html.theme-sketch .m-today-best { color: #4a443a; }
html.theme-sketch .m-nr-person, html.theme-sketch .m-next { background: #fbf8f1; border: 2px solid var(--sk-ink); border-radius: var(--sk-wobble); }
