/* Joined by scripts/sync-nav.mjs (scripts/lib/asset-bundles.mjs) from /css/fonts.css, /css/base.css, /css/theme.css, /css/book.css.
   Do not edit: change those and run npm run sync:nav. */
/* /css/fonts.css */
/* ============================================================
   fonts.css: self-hosted Google Fonts

   Generated by scripts/build-fonts.py, do not hand-edit. Serve
   directly from /fonts/ so pages don't depend on Google's CDN.

   Each block keeps its unicode-range so browsers only fetch the
   subset containing glyphs the page actually uses: same behaviour
   as Google Fonts' hosted CSS. A variable font is one block with a
   weight range and one file, so every weight shares one download.
   ============================================================ */


/* ── Bricolage Grotesque ────────────────────────────── */
/* vietnamese */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Instrument Serif ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Space Mono ────────────────────────────── */
/* vietnamese */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Geist Mono ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* symbols2 */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-symbols2.woff2') format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
/* vietnamese */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Cinzel ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/cinzel-400-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/cinzel-400-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Cormorant Garamond ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── EB Garamond ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Manrope ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── JetBrains Mono ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── DM Mono ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-mono-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-mono-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-mono-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-mono-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Atkinson Hyperlegible ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Rubik ────────────────────────────── */
/* arabic */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* hebrew */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* /css/base.css */
/* Riso paper + spot inks */
:root {
  --paper:        #e6f5ee;
  --paper-white:  #f4faf6;
  --ink:          #1a3a2a;
  --ink-dim:      #263b2f;
  --ink-faint:    #557063;

  /* Foreground for text sitting ON a brand fill (a filled button), which
     is a different job from --ink: the fill does not follow the page ground,
     so it needs its own pairing in every palette. */
  --on-brand:     #1a3a2a;
  --riso-pink:        #ff7eb6;
  --riso-pink-deep:   #e3589c;
  --riso-green:       #2db876;
  --riso-green-deep:  #1a8a55;
  --riso-coral:       #ff8a6b;
  --riso-yellow:      #f0c33d;

  --line:         rgba(26, 58, 42, 0.16);
  --line-strong:  rgba(26, 58, 42, 0.32);

  --font-display: "Atkinson Hyperlegible", "Inter Tight", system-ui, sans-serif;
  --font-mono:    "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-serif:   "Atkinson Hyperlegible", system-ui, sans-serif;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}

/* Per-element grain.
   The site-wide paper grain is applied to topbar, footer, and `main`
   (the wrapper used on every tab page). The home page's cell stage is
   NOT a `main` -- it's a <section class="stage"> -- so the grain skips
   the cell canvas entirely, keeping the candy plastic look untouched. */
main {
  position: relative;
  z-index: 1;
}
main::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("/img/grain.svg");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.16;
}
main > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
::selection { background: var(--riso-pink); color: var(--paper); }

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ── First-paint paper settle ─────────────────────────────────
   Light entrance for the page: main settles in, like a freshly-
   printed sheet landing. The illos do a separate, more detailed riso
   print-pass inside their own SVGs.
   Short and from most of the way there on purpose: it used to fade from
   nothing over half a second, which kept the page's main heading faint
   (and its largest paint late) on every load. Now the text is readable
   in the first frame.
   Opacity-only on purpose: a transform on <main> would turn it into
   a containing block for fixed descendants and break the apps-page
   lightbox during the animation window. */
@keyframes paper-settle {
  from { opacity: 0.85; }
  to   { opacity: 1; }
}
main { animation: paper-settle 0.15s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
}

/* ── Cursor push on the illos ─────────────────────────────────
   Cursor-driven exaggeration of riso misregistration: as the mouse
   moves over an inlined illo, the pink colour layer drifts toward the
   cursor and the green layer drifts away. The ink outline stays put
   so the shape holds together.
   /js/illos.js sets --px / --py on the <svg> from -1 to 1.
   Mouse-only (no transform on touch). */
svg.illo .riso-pink,
svg.illo .riso-green {
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  svg.illo .riso-pink {
    transform: translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 6px));
  }
  svg.illo .riso-green {
    transform: translate(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -6px));
  }
}
@media (prefers-reduced-motion: reduce) {
  svg.illo .riso-pink,
  svg.illo .riso-green {
    transform: none !important;
    transition: none !important;
  }
}

/* ── Selection: riso-misregistered swipe ─────────────────────── */
::selection {
  background: var(--riso-pink);
  color: var(--ink);
  text-shadow: 1px 0.5px 0 var(--riso-green);
}

/* ── Cross-document View Transitions: mitosis tab swap ───────
   Chrome 126+ uses this for cross-page navigations (when same-origin
   and same View Transition root). The outgoing main pinches and
   slides one way; the new main buds in from the other side. Falls
   back to instant nav in browsers without support. */
@view-transition { navigation: auto; }
main { view-transition-name: page-content; }
::view-transition-old(page-content) {
  animation: 0.42s cubic-bezier(0.4, 0, 0.6, 1) both bb-mitosis-out;
}
::view-transition-new(page-content) {
  animation: 0.48s cubic-bezier(0.2, 0.7, 0.2, 1) both bb-mitosis-in;
}
@keyframes bb-mitosis-out {
  0%   { transform: scale(1) translateX(0); opacity: 1; }
  30%  { transform: scaleX(1.06) scaleY(0.96) translateX(0); }
  100% { transform: scaleX(0.55) scaleY(0.86) translateX(-22%); opacity: 0; }
}
@keyframes bb-mitosis-in {
  0%   { transform: scaleX(0.55) scaleY(0.86) translateX(22%); opacity: 0; }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page-content),
  ::view-transition-new(page-content) { animation: none; }
}

/* ── Etymology tooltip ──────────────────────────────────────── */
/* Terms wrapped by /js/etymology.js with the Greek/Latin roots in
   data-roots. Hover -> tooltip; the dotted underline signals it's
   interactive without shouting. */
.bio-term {
  border-bottom: 1px dotted var(--riso-pink-deep);
  cursor: help;
  position: relative;
}
.bio-term:hover::after,
.bio-term:focus::after {
  content: attr(data-roots);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper-white);
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: 2px 2px 0 var(--riso-pink);
}
.bio-term:hover::before,
.bio-term:focus::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
  z-index: 200;
  pointer-events: none;
}

/* ── Ribosome scroll marker (every page with a <main>, injected by JS) ─ */
.scroll-ribosome {
  position: fixed;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--riso-pink);
  z-index: 80;
  pointer-events: none;
  transition: top 0.08s linear;
}
.scroll-ribosome::after {
  /* Halftone dot pattern inside the ribosome */
  content: "";
  position: absolute; inset: 2px;
  border-radius: 50%;
  background-image: radial-gradient(var(--riso-pink) 1px, transparent 1.6px);
  background-size: 4px 4px;
}
@media (max-width: 760px) {
  .scroll-ribosome { display: none; }
}

/* ── Print stylesheet ────────────────────────────────────────
   Strip the riso furniture so handouts come out as plain readable
   text. Everything interactive disappears; links get their URL
   appended after them for paper trail. */
@media print {
  .topbar, footer,
  .joke-strip-wrap, .roots-strip-wrap, .joke-deck, .joke-actions,
  .joke-card-wrap, .staffroom-download, .roots-download,
  .notfound-actions, .stage, .scroll-ribosome,
  iframe, video, audio, .video-section { display: none !important; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body, main {
    background: white !important;
    color: black !important;
    padding: 0 !important;
  }
  main::after { display: none !important; }
  h1, h2, h3, h4 { color: black !important; }
  em { color: #333 !important; font-style: italic; }
  a { color: black; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  a[href^="/"]::after { content: ""; }
  .bio-term { border-bottom: none; }
  .post-card, .article-body, .legal-page { break-inside: avoid; }
}

/* ── Accessibility: visible focus rings ──────────────────────
   Keyboard users need a clear hit-state. :focus-visible fires for
   keyboard nav but not mouse clicks, so visual chrome stays clean. */
:focus-visible {
  outline: 2px solid var(--riso-pink-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Buttons / pills already have their own rounding -- tighter offset */
button:focus-visible,
.tab:focus-visible,
.cb:focus-visible, .lchip:focus-visible, .tc:focus-visible,
.joke-pill:focus-visible, .joke-deal:focus-visible,
.roots-strip-deal:focus-visible, .joke-strip-deal:focus-visible {
  outline-offset: 2px;
}

/* ── Skip-to-content link ────────────────────────────────────
   Always the first focusable element on the page. Visually hidden
   until a keyboard user tabs into it, then it slides into view. */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper-white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--riso-pink);
  z-index: 1000;
  transform: translateY(-200%);
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* Visually hidden but still announced by screen readers and seen by
   crawlers. Used for semantic headings that we don't want to render. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile niceties ─────────────────────────────────────────
   Drop the iOS Safari gray tap-flash, replace it with a quick
   opacity dim on press. Subtler, on-brand, less startling. */
* { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  a:active, button:active {
    opacity: 0.65;
    transition: opacity 0.05s;
  }
}

/* ── Konami easter egg flash (home page) ────────────────────
   Small overlay confirming the sequence registered. Pairs with
   the cell explode-and-reassemble triggered by /js/konami.js.  */
.konami-flash {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(8px);
  z-index: 200;
  padding: 14px 22px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--riso-pink);
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2,0.7,0.2,1);
  pointer-events: none;
}
.konami-flash.is-in { opacity: 1; transform: translateX(-50%) translateY(0); }
.konami-flash.is-out { opacity: 0; transform: translateX(-50%) translateY(-8px); }
.konami-seq {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.konami-note {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--riso-pink);
}

/* Page headings lead with what the page is, then the line in Mr Bradford's
   voice. The descriptor sets small so the italic stays the hero and the
   header does not grow a third and fourth line of display type. */
h1 .h1-what {
  display: block;
  font-family: var(--font-display);
  /* This line is the page's actual title - what it is, and what a search
     result shows. At 0.36em it read as a kicker above the italic rather
     than as the heading. */
  font-size: 0.58em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.28em;
  text-wrap: balance;
}
@media (max-width: 700px) {
  h1 .h1-what { font-size: 0.66em; margin-bottom: 0.3em; }
}

/* /css/theme.css */
/* ============================================================
   theme.css: four independent display axes, all opt-in.
   Loaded site-wide via each page's head + js/theme.js.

   Axis 1  data-theme="dark"        light  <->  dark
   Axis 2  data-palette="accessible" riso  <->  high-contrast, colourblind-safe
   Axis 3  data-textsize="lg|xl"     everything a size up, or two
   Axis 4  data-font="reading"       a face built to be unambiguous, with air

   Everything is driven by redefining the ~12 core tokens from
   base.css. Because the site's chrome and components read those tokens
   (var(--ink), var(--paper), var(--riso-pink)…), overriding them here
   restyles the whole page with no per-component work.

   The default (no attributes) stays the riso brand exactly as it was.
   ============================================================ */

/* ── DARK · riso identity, dark ground ─────────────────────── */
:root[data-theme="dark"] {
  --paper:            #14201b;
  --on-brand:         #14201b;   /* brand fills are light here, so dark text */
  --paper-white:      #1b2a24;
  --ink:              #e9f1ea;
  --ink-dim:          #b1c3b8;
  --ink-faint:        #7d8f85;

  --riso-pink:        #ff9ec4;
  --riso-pink-deep:   #ffb3d1;   /* emphasis reads *lighter* on dark */
  --riso-green:       #46d99f;
  --riso-green-deep:  #6fe6b8;
  --riso-coral:       #ff9e80;
  --riso-yellow:      #f2cf5c;

  --line:             rgba(233, 241, 234, 0.18);
  --line-strong:      rgba(233, 241, 234, 0.34);
}

/* ── ACCESSIBLE · light ────────────────────────────────────
   High contrast (near-black ink on white, AA+), and the pink/green
   pairing, the red-green colourblind trap, is replaced by
   blue/orange, which stays distinguishable in every common colour-
   vision deficiency. Hue never carries meaning alone on this site
   (labels, borders and shape do too), which is what makes the swap
   safe rather than merely different. */
:root[data-palette="accessible"] {
  --paper:            #ffffff;
  --on-brand:         #ffffff;   /* accessible fills are deep, so light text */
  --paper-white:      #ffffff;
  --ink:              #111418;
  --ink-dim:          #3d444d;   /* AA on white */
  --ink-faint:        #5a626c;   /* lifted from the faint riso tone */

  --riso-pink:        #c2410c;   /* orange, was pink */
  --riso-pink-deep:   #9a3412;
  --riso-green:       #1d63c9;   /* blue, was green */
  --riso-green-deep:  #174ea6;
  --riso-coral:       #b45309;   /* amber-brown, third distinct hue */
  --riso-yellow:      #a16207;   /* darkened so it holds on white */

  --line:             rgba(17, 20, 24, 0.30);
  --line-strong:      rgba(17, 20, 24, 0.52);
}

/* ── ACCESSIBLE · dark ─────────────────────────────────────
   Same blue/orange logic, brightened to hold contrast on a near-black
   neutral ground. */
:root[data-theme="dark"][data-palette="accessible"] {
  --paper:            #0c0e12;
  --on-brand:         #0c0e12;   /* fills lighten again on dark */
  --paper-white:      #15181e;
  --ink:              #f4f6f9;
  --ink-dim:          #c3ccd6;
  --ink-faint:        #98a2ae;

  --riso-pink:        #ff9e5c;   /* orange */
  --riso-pink-deep:   #ffb784;
  --riso-green:       #6ba6f5;   /* blue */
  --riso-green-deep:  #9cc4fb;
  --riso-coral:       #f0a35e;
  --riso-yellow:      #e2c14e;

  --line:             rgba(244, 246, 249, 0.22);
  --line-strong:      rgba(244, 246, 249, 0.40);
}

/* Smooth the switch, but never fight reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 0.18s ease, color 0.18s ease; }
}

/* ============================================================
   The control. A small fixed panel, bottom-right, legible in all four
   modes because it too is built from tokens.
   ============================================================ */
.a11y-controls {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--riso-green);
}
.a11y-tab { display: none; border: 0; background: none; color: var(--ink); cursor: pointer; padding: 2px; line-height: 0; }
.a11y-tab svg { width: 18px; height: 18px; }
/* The closed button says what it is: a bare half-moon was missed by readers who came looking for text size. */
.a11y-tab-lbl { display: none; font-family: var(--font-body, inherit); font-size: 14px; font-weight: 700; color: var(--ink); }
.a11y-controls.a11y-min .a11y-tab { display: inline-flex; align-items: center; gap: 7px; }
.a11y-controls.a11y-min .a11y-tab-lbl { display: inline; }
.a11y-controls.a11y-min { border-radius: 999px; padding: 9px 14px; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a11y-hide { border: 0; background: none; color: var(--ink-faint); cursor: pointer; padding: 0 2px 2px; line-height: 0; }
.a11y-hide:hover { color: var(--ink); }
@media (pointer: coarse) {
  .a11y-hide { min-width: 26px; min-height: 26px; padding: 6px; line-height: 0; }
}
.a11y-hide svg { width: 12px; height: 12px; }
.a11y-controls.a11y-min .a11y-head,
.a11y-controls.a11y-min .a11y-btn,
.a11y-controls.a11y-min .a11y-rule,
.a11y-controls.a11y-min .a11y-seg-lbl,
.a11y-controls.a11y-min .a11y-seg,
.a11y-controls.a11y-min .a11y-lang-sel { display: none; }

.a11y-controls-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 2px 2px;
}
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.a11y-btn:hover { border-color: var(--ink); }
.a11y-btn svg { width: 15px; height: 15px; flex: none; }
.a11y-btn .on-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  margin-left: auto;
}
/* Pressed = this mode is active. */
.a11y-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-white);
  border-color: var(--ink);
}
.a11y-btn[aria-pressed="true"] .on-dot { background: var(--riso-green); border-color: var(--paper-white); }
.a11y-btn:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* Text size: three stops, not a slider; a slider invites fiddling, three
   stops is a decision. The letters are drawn at the sizes they stand for. */
.a11y-rule { border: 0; border-top: 1px dashed var(--line-strong); margin: 8px 2px 7px; }
.a11y-seg-lbl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); padding: 0 2px 4px;
}
.a11y-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.a11y-size {
  border: 0; border-right: 1.5px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  padding: 7px 0 8px; cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.a11y-size { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.a11y-size-w { font-family: var(--font-body, inherit); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.a11y-size:last-child { border-right: 0; }
.a11y-size:hover { background: var(--paper-white); }
.a11y-size[aria-checked="true"] { background: var(--ink); color: var(--paper-white); }
.a11y-size:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; }
/* Language is a dropdown: one row however many languages there are. */
.a11y-seg-lbl[for] { display: block; }
.a11y-lang-sel {
  display: block; width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body, inherit); font-size: 14px;
  padding: 6px 12px; cursor: pointer;
}
.a11y-lang-sel:hover { background: var(--paper-white); }
.a11y-lang-sel:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* The moon shows in light, the sun in dark: mirrors the games' toggle. */
.a11y-btn .icon-sun { display: none; }
:root[data-theme="dark"] .a11y-btn .icon-sun { display: block; }
:root[data-theme="dark"] .a11y-btn .icon-moon { display: none; }

@media (max-width: 560px) {
  /* A phone gets the whole panel, as a sheet along the bottom: labels, text
     size and language included. A student who needs bigger text is the
     student on a phone, so none of it is left to a wider screen. The small
     round button (a11y-min) still keeps it out of the page until pressed. */
  .a11y-controls { right: 10px; bottom: 10px; padding: 8px; }
  .a11y-controls:not(.a11y-min) { left: 10px; max-height: 80vh; overflow-y: auto; padding: 14px; gap: 10px; }
  .a11y-controls:not(.a11y-min) .a11y-btn { padding: 12px 14px; font-size: 14px; }
  .a11y-controls:not(.a11y-min) .a11y-size { padding: 12px 0; }
  .a11y-controls:not(.a11y-min) .a11y-lang-sel { padding: 11px 12px; font-size: 16px; }
  .a11y-controls.a11y-min { min-height: 44px; display: inline-flex; align-items: center; }
  .a11y-controls.a11y-min .a11y-tab { min-height: 44px; }
}

/* Cosmetic leak handling: the lesson-card icons are external two-tone
   (green/pink) SVG images, so page tokens can't reach inside them. In
   the accessible palette that green/pink clashes with the blue/orange
   scheme, so neutralise them to a quiet monochrome - decorative only,
   no meaning is carried by their colour. */
:root[data-palette="accessible"] .lesson-card-icon { filter: grayscale(1) contrast(0.95); }

/* Flat type in the accessible palette. The riso "misregistration" offset
   (a coloured text-shadow ghost behind headings) is a brand flourish, but
   it doubles the letterforms and lowers legibility - the opposite of what
   a high-contrast mode is for. Strip it so accessible type is crisp. */
:root[data-palette="accessible"] * { text-shadow: none !important; }
:root[data-palette="accessible"] main::after { opacity: 0 !important; }


/* ── TEXT SIZE · scale the surface, don't stretch the type ──
   The exam maker is drawn in fixed pixels, so growing only the words would
   burst its buttons and squeeze its option letters. Zooming the whole body
   keeps every proportion the design already has: bigger words in bigger
   boxes, with the same air between them.

   Two things zoom does not do for us. Media queries still measure the real
   viewport, so a desktop layout does not fall back to its phone one just
   because it got 30% bigger; the steps are therefore gentler the narrower
   the screen. And viewport units are not scaled, so `100vw` inside a zoomed
   body paints wider than the window; --zoom is published here for the
   handful of rules that need to divide it back out. */
:root { --zoom: 1; }
/* Steps sized for a reader who needs them, eased on a narrower window: the top
   bar is about 900px wide before zoom, and media queries do not see the zoom, so
   a big step on a small window pushed the bar off the screen. */
:root { --zoom: 1; }
:root[data-textsize="lg"] { --zoom: 1.25; }
:root[data-textsize="xl"] { --zoom: 1.5; }
:root[data-textsize="lg"] body { zoom: 1.25; }
:root[data-textsize="xl"] body { zoom: 1.5; }
@media (max-width: 1450px) {
  :root[data-textsize="xl"] { --zoom: 1.3; }
  :root[data-textsize="xl"] body { zoom: 1.3; }
}
@media (max-width: 1200px) {
  :root[data-textsize="lg"] { --zoom: 1.12; }
  :root[data-textsize="lg"] body { zoom: 1.12; }
  :root[data-textsize="xl"] { --zoom: 1.2; }
  :root[data-textsize="xl"] body { zoom: 1.2; }
}
@media (max-width: 1000px) {
  :root[data-textsize="lg"] { --zoom: 1.05; }
  :root[data-textsize="lg"] body { zoom: 1.05; }
  :root[data-textsize="xl"] { --zoom: 1.1; }
  :root[data-textsize="xl"] body { zoom: 1.1; }
}
@media (max-width: 820px) {
  :root[data-textsize="lg"] { --zoom: 1.2; }
  :root[data-textsize="lg"] body { zoom: 1.2; }
  :root[data-textsize="xl"] { --zoom: 1.35; }
  :root[data-textsize="xl"] body { zoom: 1.35; }
}
/* Zoom can leave a few pixels of a wide child past the edge; a reader at this size should never have to scroll sideways for them. */
:root[data-textsize], :root[data-textsize] body { overflow-x: clip; }
/* Wider spacing: the British Dyslexia Association's guidance is wider letter,
   word and line spacing; this is the whole of it, left to the reader to turn on. */
:root[data-spacing="wide"] body { letter-spacing: 0.04em; word-spacing: 0.12em; }
:root[data-spacing="wide"] p, :root[data-spacing="wide"] li, :root[data-spacing="wide"] td { line-height: 1.8; }
/* A lesson's own switches (HL, theme) are a fixed corner toolbar that zoom pushes past the right edge: let it scroll with the page, inside it. */
:root[data-textsize] .toolbar { position: absolute; left: .5rem; right: .5rem; justify-content: flex-end; }
/* Paper is paper: the setting is about this screen, not the printout. */
@media print { :root[data-textsize] body { zoom: 1 !important; } }

/* ── READING FONT · unambiguous letterforms, and room to breathe ──
   Not a "dyslexia font": those do not survive testing. What does help is a
   face whose b/d/p/q and I/l/1 cannot be confused, more space between the
   letters and the lines, and a shorter line to return from. Atkinson
   Hyperlegible was drawn for low vision by the Braille Institute; the rest
   is spacing. The stylesheet is fetched by js/theme.js only when the switch
   is on, so nobody downloads a font they never asked for. */
:root[data-font="reading"] {
  --font-display: 'Atkinson Hyperlegible', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --sans: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --serif: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  letter-spacing: 0.012em;
  word-spacing: 0.08em;
  line-height: 1.65;
}
/* The exam paper is set in a serif on purpose, it is a facsimile of a real
   paper, so it changes with everything else rather than staying the odd
   one out. */
:root[data-font="reading"] .sheet,
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .qdemo,
:root[data-font="reading"] .lede,
:root[data-font="reading"] .sub,
:root[data-font="reading"] .figcap,
:root[data-font="reading"] .mis,
:root[data-font="reading"] h1, :root[data-font="reading"] h2, :root[data-font="reading"] h3 {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .sheet .stem,
:root[data-font="reading"] .sheet .part,
:root[data-font="reading"] .sheet .opts li { line-height: 1.7; }
/* A long line is the other half of the problem: the eye has to find the
   start of the next one. */
:root[data-font="reading"] .sheet .stem-body,
:root[data-font="reading"] .sheet .ptext,
:root[data-font="reading"] .passage,
:root[data-font="reading"] .card p,
:root[data-font="reading"] .sub { max-width: 62ch; }
/* Mono stays mono: codes, units and the paper code are read character by
   character, and that is what a monospace is for. */
:root[data-font="reading"] .mono,
:root[data-font="reading"] code, :root[data-font="reading"] kbd,
:root[data-font="reading"] .sit-clock, :root[data-font="reading"] .code-chip { font-family: var(--font-mono); letter-spacing: 0; }


/* ── LANGUAGE · support around the question, never inside it ──
   The paper stays in the language of the exam. What arrives beside it is a
   translated rubric, a bilingual command term, and a glossary the reader can
   tap: in two modes, because the exam allows the word and not the
   definition. */
.i18n-rubric { display: block; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-style: normal; color: var(--riso-green-deep); margin-top: 3px; }
.sheet .gl, .gl {
  font-weight: inherit; border-bottom: 1.8px dotted var(--riso-pink-deep);
  cursor: help; background: none;
}
.sheet .gl:hover, .gl:hover { background: color-mix(in srgb, var(--riso-pink) 22%, transparent); }
.gl-pop {
  position: absolute; z-index: 60; width: min(340px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 11px; box-shadow: 4px 4px 0 var(--riso-pink);
  padding: 11px 13px; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-size: 13.5px; line-height: 1.5;
}
.gl-w { font-weight: 700; font-size: 15px; }
.gl-w span { color: var(--riso-pink-deep); }
.gl-d { color: var(--ink-dim); font-size: 12.8px; margin-top: 5px; }
.gl-mode { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; }
/* The paper prints as the exam prints: no dots, no glosses. */
@media print { .sheet .gl { border-bottom: 0; } .gl-pop, .i18n-offer { display: none !important; } }

/* Offered once, to a browser that is already set to the language. */
.i18n-offer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: min(680px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--riso-green); padding: 11px 14px; font-size: 13.5px; color: var(--ink);
}
.i18n-offer-en { color: var(--ink-dim); }
.i18n-offer button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  background: var(--paper); color: var(--ink);
}
.i18n-offer .i18n-yes { background: var(--riso-green); color: var(--on-brand); font-weight: 700; }
.i18n-offer button:hover { background: var(--riso-pink); color: var(--on-brand); }
@media (max-width: 560px) { .i18n-offer { left: 10px; right: 10px; transform: none; max-width: none; } }

/* ---------------------------------------------------------------- Chinese
   Two things the Latin-tuned chrome gets wrong for a language written in
   characters: a line can break between any two of them, so a nav tab or a
   button label splits down the middle; and the tracking that opens up small
   uppercase Latin labels only pushes hanzi apart. Both are fixed on the
   chrome, never on the paper; the questions stay English and keep their own
   typography.  */
:root[data-lang="zh"] .topbar,
:root[data-lang="zh"] .em-rail,
:root[data-lang="zh"] .em-start,
:root[data-lang="zh"] .dt-actions,
:root[data-lang="zh"] .a11y-controls,
:root[data-lang="zh"] .sit-top,
:root[data-lang="zh"] .sit-how { letter-spacing: normal; }

:root[data-lang="zh"] .topbar a,
:root[data-lang="zh"] .tab,
:root[data-lang="zh"] .em-btn,
:root[data-lang="zh"] .share-lbl,
:root[data-lang="zh"] .dice-lbl,
:root[data-lang="zh"] .take-btn,
:root[data-lang="zh"] .a11y-lang,
:root[data-lang="zh"] .sit-mini { white-space: nowrap; }

/* /css/book.css */
/* The textbook view of a guide (a sketch): guides/book/<slug>.html, run by
   js/book.js. A book on a desk: two pages and a spine on a landscape screen,
   one page on a portrait one, an ink layer on every page, notes pinned in the
   margins. The page colours of the ink are fixed (they are drawn on paper,
   which stays paper in the dark theme); everything round the book follows the
   site's tokens. */

:root {
  --bk-desk: var(--paper);
  --bk-bar: var(--paper-white);
  --bk-page-shadow: 0 1px 1px rgba(20, 45, 32, 0.16), 0 10px 28px rgba(20, 45, 32, 0.20);
  --bk-dim: transparent;
  --bk-bar-h: 52px;
  --z: 1;
}
:root[data-theme="dark"] {
  --bk-desk: #0f1814;
  --bk-page-shadow: 0 1px 1px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.55);
  --bk-dim: rgba(10, 20, 15, 0.10);
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bk-desk);
}
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
textarea { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 2px; }

.bk-app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.bk-app > * { grid-column: 1; }

/* ---------- top bar ---------- */
.bk-bar {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bk-bar-h);
  padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--bk-bar);
  border-bottom: 1.5px solid var(--ink);
  position: relative;
  z-index: 8;
}
.bk-bar svg, .bk-btn svg, .bk-nav svg, .bk-tool svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.bk-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); padding: 8px 6px; border-radius: 3px; flex: none;
}
.bk-back:hover { color: var(--riso-green-deep); }
.bk-title {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  white-space: nowrap; overflow: hidden;
}
.bk-title b { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.bk-code { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--riso-green-deep); }
.bk-sketch {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border: 1px dashed var(--ink-dim); border-radius: 2px; color: var(--ink-dim);
}
.bk-bar-r { display: flex; gap: 8px; flex: none; }
.bk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 13px;
  border: 1.5px solid var(--ink); border-radius: 3px;
  background: var(--paper-white); color: var(--ink);
  font-family: var(--font-display); font-size: 14.5px; font-weight: 650;
  text-decoration: none;
}
.bk-btn:hover { background: var(--paper); }
.bk-solid { background: var(--riso-green); border-color: var(--riso-green-deep); color: var(--on-brand); }
.bk-solid:hover { background: var(--riso-green-deep); }
.bk-icon { width: 38px; padding: 0; }

/* ---------- tools ---------- */
.bk-tools {
  grid-row: 2;
  justify-self: center;
  display: flex; align-items: center; gap: 2px;
  margin: 8px 12px 0;
  padding: 4px;
  background: var(--paper-white);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(17, 30, 24, .16);
  position: relative;
  z-index: 7;
  max-width: calc(100vw - 24px);
}
[data-mode="spread"] .bk-tools {
  grid-row: 3;
  align-self: center;
  justify-self: start;
  flex-direction: column;
  margin: 0 0 0 max(12px, env(safe-area-inset-left));
}
.bk-tool {
  position: relative;
  display: grid; place-items: center;
  width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 4px;
  background: none; color: var(--ink);
  touch-action: manipulation;
}
.bk-tool:hover { background: color-mix(in srgb, var(--riso-green) 14%, transparent); }
.bk-tool[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: inset 0 -3px 0 var(--riso-pink);
}
.bk-tool:disabled { opacity: .35; cursor: default; background: none; }
.bk-tool .sw {
  position: absolute; right: 5px; bottom: 5px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--sw); border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #1a3a2a;
}
.bk-tool .nib { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.bk-sep { width: 1.5px; height: 26px; margin: 0 4px; background: var(--line-strong); border-radius: 1px; }
[data-mode="spread"] .bk-sep { width: 26px; height: 1.5px; margin: 4px 0; }

/* ---------- the desk and the book ---------- */
.bk-stage {
  grid-row: 3;
  position: relative;
  overflow: hidden;
  touch-action: none;
  outline: none;
}
.bk-stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("/img/grain.svg");
  mix-blend-mode: multiply;
  opacity: .14;
  pointer-events: none;
}
:root[data-theme="dark"] .bk-stage::before { opacity: 0; }
.bk-stage[data-tool="pen"], .bk-stage[data-tool="hl"] { cursor: crosshair; }
.bk-stage[data-tool="eraser"] { cursor: cell; }
.bk-stage[data-tool="note"] { cursor: copy; }
.bk-zoomer {
  position: absolute; inset: 0;
  transform-origin: 0 0;
}
.bk-zoomer[data-anim] { transition: transform .22s ease-out; }
.bk-book { position: absolute; }
.bk-slot {
  position: absolute; top: 0;
  background: #fff;
  box-shadow: var(--bk-page-shadow);
}
.bk-slot:empty { display: none; }
.bk-slot-l { border-radius: 3px 0 0 3px; }
.bk-slot-r { border-radius: 0 3px 3px 0; }
[data-mode="single"] .bk-slot-l { display: none; }

/* the stack of pages either side: thicker where more of the book lies */
.bk-edge {
  position: absolute; top: 2px; bottom: 2px;
  background: repeating-linear-gradient(to right, #fbfbf8 0 1px, #d9ddd6 1px 2px);
  box-shadow: var(--bk-page-shadow);
}
.bk-edge-l { border-radius: 3px 0 0 3px; }
.bk-edge-r { border-radius: 0 3px 3px 0; }

/* one page, as it sits in a slot or on a turning leaf */
.pg {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #fff;
  pointer-events: none;
  contain: layout paint;
}
.pg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: none;
  -webkit-user-drag: none;
}
.pg-shade { position: absolute; inset: 0; background: var(--bk-dim); }
.bk-slot-l .pg-shade { background: linear-gradient(to left, rgba(0,0,0,.20), rgba(0,0,0,.06) 2.5%, rgba(0,0,0,0) 8%), var(--bk-dim); }
.bk-slot-r .pg-shade { background: linear-gradient(to right, rgba(0,0,0,.22), rgba(0,0,0,.06) 2.5%, rgba(0,0,0,0) 8%), var(--bk-dim); }
[data-mode="single"] .bk-slot-r .pg-shade { background: linear-gradient(to right, rgba(0,0,0,.12), rgba(0,0,0,0) 3%), var(--bk-dim); }
.pg-hl, .pg-ink { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: hidden; }
.pg-hl { mix-blend-mode: multiply; }
.pg-pins { position: absolute; inset: 0; }
.pg-rev .pg-img { transform: scaleX(-1); opacity: .07; }
.pg-rev { background: #fbfbf7; }

/* a note, closed: a pin whose point is where it was dropped */
.pin {
  position: absolute;
  width: 28px; height: 30px; padding: 0;
  border: 0; background: none;
  transform: translate(-50%, -100%) scale(calc(1 / var(--z)));
  transform-origin: 50% 100%;
  pointer-events: auto;
  touch-action: none;
  --pc: #f6d55c;
}
.pin::before {
  content: "";
  position: absolute; left: 4px; top: 1px;
  width: 20px; height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--pc);
  border: 1.6px solid #1a3a2a;
  box-shadow: -1px 2px 3px rgba(0,0,0,.25);
}
.pin::after {
  content: "";
  position: absolute; left: 11px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #1a3a2a;
}
.pin[data-c="pink"] { --pc: #ff9ec4; }
.pin[data-c="green"] { --pc: #7fdcae; }
.pin[data-open] { z-index: 2; }
.pin[data-open]::before { box-shadow: 0 0 0 3px rgba(227, 88, 156, .45); }

/* the turning leaf: strips that bend, each with a front and a back */
.bk-leaf {
  position: absolute; top: 0;
  width: 0;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 3;
}
.bk-strip {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
}
.bk-face {
  position: absolute; inset: 0;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: #fff;
}
.bk-face-back { transform: rotateY(180deg); }
.bk-face .pg { inset: auto; top: 0; }
.bk-face .pin { pointer-events: none; }
.bk-face-shade { position: absolute; inset: 0; pointer-events: none; }
.bk-fade { position: absolute; top: 0; }
.bk-cast {
  position: absolute; top: 0;
  pointer-events: none;
  z-index: 2;
  display: none;
}

/* ---------- Play it live ---------- */
.bk-chips { position: absolute; pointer-events: none; }
.bk-chip {
  position: absolute; bottom: 7px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px 0 9px;
  border: 1px solid var(--ink); border-radius: 3px;
  background: var(--paper-white); color: var(--ink);
  font-family: var(--font-display); font-size: 13px; font-weight: 650; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(17, 30, 24, .18);
  pointer-events: auto;
  transform: scale(calc(1 / var(--z)));
  transform-origin: 0 100%;
}
.bk-chip-r { transform-origin: 100% 100%; }
.bk-chip:hover { border-color: var(--riso-pink-deep); }
.bk-chip svg { width: 11px; height: 11px; fill: var(--riso-pink-deep); stroke: none; }
.bk-chip small { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--riso-green-deep); }

/* ---------- zoom, hint, loading, toast ---------- */
.bk-zoomhud {
  position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right));
  z-index: 6;
  display: inline-flex; gap: 8px; align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--paper-white);
  font-family: var(--font-mono); font-size: 12px;
  box-shadow: 0 6px 22px rgba(17, 30, 24, .16);
}
.bk-zoomhud b { font-family: var(--font-display); font-size: 13.5px; }
.bk-hint {
  position: absolute; left: 50%; bottom: 18px; z-index: 6;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 18px;
  background: var(--paper-white);
  border: 0; border-top: 3px solid var(--riso-pink); border-radius: 4px;
  box-shadow: 0 6px 22px rgba(17, 30, 24, .16);
}
.bk-hint p { font-size: 15px; line-height: 1.4; }
.bk-hint .bk-btn { flex: none; }
.bk-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
  pointer-events: none;
}
.bk-loading[hidden] { display: none; }
.bk-toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 30;
  transform: translateX(-50%);
  padding: 9px 16px;
  background: var(--ink); color: var(--paper-white);
  border-radius: 4px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 22px rgba(17, 30, 24, .16);
  pointer-events: none;
}

/* ---------- bottom bar: scrubber ---------- */
.bk-foot {
  grid-row: 4;
  display: flex; align-items: center; gap: 8px;
  padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--bk-bar);
  border-top: 1.5px solid var(--ink);
  position: relative; z-index: 8;
  min-width: 0;
}
.bk-nav {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--paper-white);
  touch-action: manipulation;
}
.bk-nav:disabled { opacity: .3; }
.bk-scrub {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: flex-end; gap: 3px;
  padding: 15px 6px 4px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
  touch-action: pan-x;
}
.bk-scrub::-webkit-scrollbar { display: none; }
.bk-th {
  position: relative; flex: none;
  width: 32px; height: 45px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 2px;
  background: #fff;
  overflow: visible;
}
[data-mode="spread"] .bk-th:nth-child(even) { margin-left: 7px; }
.bk-th img { width: 100%; height: 100%; display: block; border-radius: 1px; }
.bk-th[aria-current] { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 1px; }
.bk-th[data-ch]::before {
  content: attr(data-ch);
  position: absolute; left: 0; top: -14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--riso-green-deep);
}
.bk-th[data-marked]::after {
  content: "";
  position: absolute; right: -3px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--riso-pink-deep); border: 1.5px solid var(--paper-white);
}
.bk-meta {
  flex: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  min-width: 92px;
  font-family: var(--font-mono);
}
.bk-pageno { font-size: 13px; color: var(--ink); white-space: nowrap; }
.bk-saved { font-size: 12px; color: var(--ink-dim); white-space: nowrap; transition: color .2s; }
.bk-saved[data-busy] { color: var(--riso-pink-deep); }

/* ---------- sheets: contents, export, clear ---------- */
.bk-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(10, 25, 18, .32);
}
.bk-sheet[hidden] { display: none; }
.bk-sheet-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 18px 20px 20px;
  background: var(--paper-white);
  border: 0; border-top: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 0 12px 40px rgba(17, 30, 24, .22);
}
.bk-sheet-card p { font-size: 15px; line-height: 1.45; color: var(--ink-dim); }
.bk-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bk-sheet-h h2 { font-size: 20px; font-weight: 750; }
.bk-x {
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 4px;
  background: none; font-size: 26px; line-height: 1;
}
.bk-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.bk-sheet-foot { margin-top: 14px; font-size: 13.5px !important; }
.bk-sheet-foot a { text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }
.bk-sheet-card p.bk-made { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: 12px; line-height: 1.5; }
.bk-made b { color: var(--ink); font-weight: 650; }
.bk-toc { list-style: none; display: grid; gap: 2px; }
.bk-toc button {
  width: 100%;
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: baseline; gap: 8px;
  padding: 9px 8px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; text-align: left;
  font-size: 15.5px; line-height: 1.3;
}
.bk-toc button:hover, .bk-toc button[aria-current] { background: color-mix(in srgb, var(--riso-green) 16%, transparent); }
.bk-toc .n { font-family: var(--font-mono); font-size: 12px; color: var(--riso-pink-deep); }
.bk-toc .p { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.bk-toc .hl {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  border: 1px solid var(--riso-pink-deep); border-radius: 2px;
  font-family: var(--font-mono); font-size: 12px; color: var(--riso-pink-deep);
  vertical-align: 2px;
}

/* Teacher resources in the Contents sheet: teacher mode only (this page
   has no header.css, so the rule is here). */
html[data-audience="student"] [data-aud="teacher"] { display: none !important; }
.bk-teach { margin-top: 18px; padding-top: 12px; border-top: 1.5px solid var(--ink); }
.bk-teach[hidden] { display: none; }
.bk-teach h3 { font-size: 16px; font-weight: 750; }
.bk-teach > p { margin-top: 4px; font-size: 14px !important; }
.bk-lessons { list-style: none; display: grid; margin-top: 8px; }
.bk-lessons li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.bk-l-t { font-size: 15px !important; font-weight: 650; color: var(--ink) !important; line-height: 1.3 !important; }
.bk-l-t .n { display: inline-block; min-width: 24px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--riso-pink-deep); }
.bk-l-t .hl { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--riso-pink-deep); border-radius: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--riso-pink-deep); vertical-align: 2px; }
.bk-l-m { margin: 2px 0 0 24px; font-family: var(--font-mono); font-size: 12px !important; }
.bk-l-ch { padding: 0 2px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green-deep); text-underline-offset: 3px; cursor: pointer; }
.bk-l-pdf { display: inline-block; white-space: nowrap; margin-left: 10px; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green-deep); text-underline-offset: 3px; }
.bk-l-files, .bk-l-more { margin-top: 10px; font-size: 13.5px !important; }
.bk-l-files a, .bk-l-more a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }

/* ---------- note editor ---------- */
.bk-noteed {
  position: fixed; z-index: 35;
  width: 290px;
  padding: 10px;
  background: #fff6c9;
  color: #1a3a2a;
  border: 1px solid rgba(26, 58, 42, .35); border-radius: 2px 2px 2px 16px;
  box-shadow: 0 8px 24px rgba(26, 58, 42, .28);
}
.bk-noteed[data-c="pink"] { background: #ffe0ee; }
.bk-noteed[data-c="green"] { background: #ddf6e8; }
.bk-noteed[hidden] { display: none; }
.bk-noteed-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bk-noteed-sw { display: flex; gap: 6px; margin-right: auto; }
.bk-noteed-sw button {
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1.5px solid #1a3a2a; background: #f6d55c;
}
.bk-noteed-sw [data-nc="pink"] { background: #ff9ec4; }
.bk-noteed-sw [data-nc="green"] { background: #7fdcae; }
.bk-noteed-sw [aria-checked="true"] { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px #1a3a2a; }
.bk-noteed-del, .bk-noteed-ok {
  min-height: 32px; padding: 4px 11px;
  border: 1px solid #1a3a2a; border-radius: 3px;
  background: rgba(255, 255, 255, .6); color: #1a3a2a;
  font-size: 13.5px; font-weight: 650;
}
.bk-noteed-ok { background: #1a3a2a; color: #fff; }
.bk-noteed textarea {
  display: block; width: 100%;
  min-height: 96px; resize: vertical;
  padding: 8px;
  border: 1.2px solid rgba(26, 58, 42, .3); border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  color: #1a3a2a;
  font-family: var(--font-display); font-size: 16px; line-height: 1.4;
}

/* ---------- narrow screens ---------- */
@media (max-width: 760px) {
  .bk-back span, .bk-btn span, .bk-sketch, .bk-code { display: none; }
  .bk-btn { width: 38px; padding: 0; }
  .bk-title { justify-content: flex-start; }
  .bk-title b { font-size: 15.5px; }
  .bk-tool { width: 38px; height: 38px; }
  .bk-meta { min-width: 64px; }
  .bk-saved { display: none; }
}
@media (max-width: 420px) {
  .bk-tool { width: 34px; height: 36px; }
  .bk-sep { margin: 0 2px; }
  .bk-nav { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-zoomer[data-anim] { transition: none; }
  .bk-btn, .bk-tool { transition: none; }
}

/* ---------- export: the marked pages, printed ---------- */
.bk-print { display: none; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  body > :not(.bk-print) { display: none !important; }
  .bk-print { display: block; }
  .bk-pp {
    position: relative;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }
  .bk-pp:last-child { break-after: auto; page-break-after: auto; }
  .bk-pp .pg { pointer-events: none; }
  .bk-pp .pg-shade { display: none; }
  .bk-pp .pin { transform: translate(-50%, -100%); }
  .bk-pnote {
    position: absolute;
    max-width: 34%;
    padding: 5pt 7pt;
    background: #fff3b8;
    border: 1pt solid #1a3a2a; border-radius: 3pt;
    color: #1a3a2a;
    font-family: var(--font-display); font-size: 8.5pt; line-height: 1.3;
    white-space: pre-wrap;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .bk-pnote[data-c="pink"] { background: #ffd9ea; }
  .bk-pnote[data-c="green"] { background: #d5f3e3; }
  .bk-pp img, .bk-pp svg, .pin::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

