/*! Joran theme · GPL-3.0-or-later · https://github.com/rmcd0/joran */
/* Cascade layers, lowest priority first. Your content/assets/custom.css is not in a layer, so it always wins. */
@layer reset, tokens, base, layout, components, prose, themes, utilities;

@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "VT323"; src: url("fonts/vt323-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img, video { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
}

/*
 * Design tokens. Override any of them in content/assets/custom.css, e.g.
 *   :root { --accent: light-dark(#b5781f, #ff7ac6); }
 * light-dark(<light value>, <dark value>) follows the visitor's mode automatically,
 * so each token is declared once for both modes.
 */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* type */
    --font-text: "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
    --font-display: var(--font-text);
    --font-retro: "VT323", "IBM Plex Mono", monospace;
    --text-xs: 11px; --text-sm: 13px; --text-base: 15px; --text-md: 17px; --text-lg: 20px; --text-xl: 28px;
    --leading: 1.65;

    /* space & shape */
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 40px; --space-8: 56px;
    --radius-sm: 6px; --radius: 10px; --radius-pill: 999px;
    --sidebar-width: 240px;
    --measure: 760px;
    --shadow: 0 10px 30px rgb(0 0 0 / .18);
  }

  /*
   * Palette "joran" (default): warm paper by day; midnight purple with pink and lilac
   * gradients by night. Indie web, a little retro.
   */
  :root, [data-palette="joran"] {
    --bg:        light-dark(#f4ecdb, #0f0f1f);
    --bg-top:    light-dark(#f4ecdb, #141428);   /* top of the page background gradient */
    --bg-side:   light-dark(#ebe0c9, #151530);
    --side-a:    light-dark(#ebe0c9, #1b1b3d);   /* sidebar gradient, top → bottom */
    --side-b:    light-dark(#ebe0c9, #121228);
    --surface:   light-dark(#f9f3e6, #1b1b36);   /* cards, filters, code */
    --hover:     light-dark(#e2d5ba, #24224a);
    --fg:        light-dark(#2b2418, #ecebff);
    --muted:     light-dark(#7b6d56, #a9a6d0);
    --line:      light-dark(#dccfb3, #2b2952);
    --accent:    light-dark(#b5781f, #ff7ac6);
    --accent-fg: light-dark(#ffffff, #2a0d24);
    --grad-a:    light-dark(#2b2418, #9b8cff);   /* headings and highlights gradient */
    --grad-b:    light-dark(#2b2418, #ff7ac6);
    --active-a:  light-dark(#e2d5ba, rgb(155 140 255 / .26)); /* current menu item, pressed buttons */
    --active-b:  light-dark(#e2d5ba, rgb(255 122 198 / .16));
    --rule-a:    light-dark(#dccfb3, #9b8cff);   /* line under the breadcrumb bar */
    --rule-b:    light-dark(#dccfb3, #ff7ac6);
    --glow-1:    light-dark(transparent, rgb(155 140 255 / .22));
    --glow-2:    light-dark(transparent, rgb(255 122 198 / .14));
    --tag-1:     light-dark(#e9c98d, #4a2a5e);
    --tag-2:     light-dark(#bfd1ad, #2a3466);
    --tag-3:     light-dark(#bccce0, #33306e);
    --tag-4:     light-dark(#e6b9ad, #5c2a4e);
    --lang-en:   light-dark(#bccce0, #b9b0ff);  --lang-en-fg: light-dark(#2b2418, #1d1640);
    --lang-fr:   light-dark(#e9c98d, #ff8fcf);  --lang-fr-fg: light-dark(#2b2418, #2a0d24);
    --lang-other: light-dark(#bfd1ad, #2a3466); --lang-other-fg: light-dark(#2b2418, #ecebff);
    --badge-bg:  linear-gradient(135deg, #141428, #3a2d6e 60%, #ff7ac6);
    --badge-fg:  #ecebff; --badge-accent: #ff7ac6;
  }

  /* Palette "lake": limestone of the Jura by day, Lake Geneva by night. Calmer. */
  [data-palette="lake"] {
    --bg: light-dark(#f6f4ef, #0d1520); --bg-top: light-dark(#f6f4ef, #101b29);
    --bg-side: light-dark(#edeae2, #111b28); --side-a: var(--bg-side); --side-b: var(--bg-side);
    --surface: light-dark(#fbfaf7, #152131); --hover: light-dark(#e3dfd4, #1b2a3d);
    --fg: light-dark(#1b2330, #e4ebf2); --muted: light-dark(#566170, #97a6b6); --line: light-dark(#d9d4c7, #22324a);
    --accent: light-dark(#1b6680, #6cc4da); --accent-fg: light-dark(#ffffff, #07202a);
    --grad-a: var(--fg); --grad-b: var(--fg); --active-a: var(--hover); --active-b: var(--hover);
    --rule-a: var(--line); --rule-b: var(--line);
    --glow-1: light-dark(rgb(27 102 128 / .07), rgb(108 196 218 / .14)); --glow-2: light-dark(transparent, rgb(91 125 214 / .12));
    --tag-1: light-dark(#cfe3e8, #1d3a47); --tag-2: light-dark(#e6dcbf, #2c3a2a); --tag-3: light-dark(#dbe0ee, #262f52); --tag-4: light-dark(#ecd8cc, #43283a);
    --lang-en: light-dark(#cfe3e8, #24506a); --lang-en-fg: var(--fg); --lang-fr: light-dark(#e9dcc2, #5a4a24); --lang-fr-fg: var(--fg);
    --lang-other: light-dark(#d6e6d3, #2e5133); --lang-other-fg: var(--fg);
    --badge-bg: linear-gradient(135deg, #0d1520, #1b6680 60%, #6cc4da); --badge-fg: #e4ebf2; --badge-accent: #e7b94e;
  }

  /* Palette "mono": black on white, for the minimalists. */
  [data-palette="mono"] {
    --bg: light-dark(#ffffff, #0b0b0b); --bg-top: var(--bg); --bg-side: var(--bg); --side-a: var(--bg); --side-b: var(--bg);
    --surface: light-dark(#f6f6f6, #151515); --hover: light-dark(#ececec, #222222);
    --fg: light-dark(#111111, #eeeeee); --muted: light-dark(#595959, #a3a3a3); --line: light-dark(#e2e2e2, #2a2a2a);
    --accent: light-dark(#111111, #ffffff); --accent-fg: light-dark(#ffffff, #000000);
    --grad-a: var(--fg); --grad-b: var(--fg); --active-a: var(--hover); --active-b: var(--hover); --rule-a: var(--line); --rule-b: var(--line);
    --glow-1: transparent; --glow-2: transparent;
    --tag-1: var(--surface); --tag-2: var(--surface); --tag-3: var(--surface); --tag-4: var(--surface);
    --lang-en: var(--hover); --lang-en-fg: var(--fg); --lang-fr: var(--hover); --lang-fr-fg: var(--fg);
    --lang-other: var(--hover); --lang-other-fg: var(--fg);
    --badge-bg: var(--fg); --badge-fg: var(--bg); --badge-accent: var(--bg);
  }

  /* Forced choice from the theme switch (stored in the browser) */
  :root[data-mode="light"] { color-scheme: light; }
  :root[data-mode="dark"]  { color-scheme: dark; }
}

@layer base {
  html { background: var(--bg); color: var(--fg); }
  body {
    font: var(--text-base)/var(--leading) var(--font-text);
    background-color: var(--bg);
    background-image:
      radial-gradient(900px 520px at 85% -10%, var(--glow-1), transparent 60%),
      radial-gradient(700px 480px at 10% 110%, var(--glow-2), transparent 60%),
      linear-gradient(var(--bg-top), var(--bg));
    background-attachment: fixed;
    min-height: 100vh;
  }

  h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; text-wrap: balance; }
  h1 {
    font-size: var(--text-xl); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .6em;
    width: fit-content; max-width: 100%;
    background-image: linear-gradient(90deg, var(--grad-a), var(--grad-b));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  h2 { font-size: var(--text-lg); font-weight: 600; margin: 1.8em 0 .5em; }
  h3 { font-size: var(--text-md); font-weight: 600; margin: 1.6em 0 .4em; }
  p, ul, ol, dl, blockquote, figure, pre, table { margin-block-end: 1em; }
  p { text-wrap: pretty; }

  a { color: var(--fg); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
  #main:focus { outline: none; }

  code, kbd, samp, pre { font-family: var(--font-mono); }
  code { font-size: .92em; }
  kbd { font: 500 12px var(--font-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
  hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
  ::selection { background: var(--accent); color: var(--accent-fg); }
  @keyframes blink { 50% { opacity: 0; } }
}

/* Layout: a sticky sidebar and a reading column with a breadcrumb bar. Below 760px the sidebar becomes a header with a menu button. */
@layer layout {
  .layout { position: relative; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; font-size: var(--text-base); }

  .side {
    position: sticky; top: 0; z-index: 1; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--space-3);
    padding: var(--space-4) var(--space-3); padding-left: max(var(--space-3), env(safe-area-inset-left, 0px));
    background-color: var(--bg-side); background-image: linear-gradient(180deg, var(--side-a), var(--side-b));
    border-inline-end: 1px solid var(--line);
  }
  .side-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .side-panel { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
  .side-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 6px; font-size: var(--text-sm); }

  .main { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; }
  .crumb {
    padding: 10px var(--space-5); padding-right: max(var(--space-5), env(safe-area-inset-right, 0px));
    border-bottom: 1px solid var(--line); border-image: linear-gradient(90deg, var(--rule-a), var(--rule-b)) 1;
    font-size: var(--text-sm); color: var(--muted);
  }
  .crumb a { color: inherit; }
  .body { width: 100%; max-width: var(--measure); padding: 28px var(--space-5) var(--space-7); padding-right: max(var(--space-5), env(safe-area-inset-right, 0px)); }

  @media (max-width: 760px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .side { position: sticky; z-index: 30; height: auto; max-height: 100vh; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: var(--space-3) var(--space-4); }
    .js .side-panel:not([data-open]) { display: none; }
    .crumb, .body { padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: var(--space-4); }
  }
}

@layer components {
  /* ---- skip link ---- */
  .skip { position: absolute; inset-inline-start: var(--space-2); top: -4rem; z-index: 100; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-fg); }
  .skip:focus { top: var(--space-2); }

  /* ---- brand & mobile menu ---- */
  .brand { display: flex; align-items: center; gap: var(--space-2); width: fit-content; padding: 2px 6px; border-radius: var(--radius-sm); color: var(--fg); font-size: 16px; font-weight: 600; text-decoration: none; }
  .brand:hover { background: var(--hover); }
  .brand img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
  .cursor { margin-inline-start: 1px; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
  .menu-toggle { display: none; align-items: center; gap: var(--space-1); padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--fg); font-size: var(--text-sm); }
  .menu-toggle svg { width: 16px; height: 16px; }
  @media (max-width: 760px) { .js .menu-toggle { display: inline-flex; } }

  /* ---- search & terminal button ---- */
  .side-tools { display: flex; gap: 6px; align-items: stretch; }
  .search { position: relative; flex: 1; min-width: 0; margin: 0; }
  .search-box { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); }
  .search-box:focus-within { border-color: var(--accent); }
  .search-box input { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; outline: none; color: var(--fg); font: inherit; font-size: 14px; }
  .search-box input::-webkit-search-cancel-button { display: none; }
  .search-box kbd { font-size: var(--text-xs); color: var(--muted); }
  .search-results { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 40; max-height: 60vh; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
  .search-results a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; font-size: var(--text-sm); line-height: 1.35; }
  .search-results a:hover, .search-results a:focus, .search-results a[aria-selected="true"] { background: var(--hover); outline: none; }
  .search-results small { display: block; color: var(--muted); font: var(--text-xs) var(--font-mono); }
  .search-results .snip { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
  .search-results mark { background: var(--active-a); background-image: linear-gradient(90deg, var(--active-a), var(--active-b)); color: var(--fg); border-radius: 2px; }
  .search-results p { margin: 6px 8px; color: var(--muted); font-size: var(--text-sm); }
  .term-btn { flex: none; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: 600 var(--text-sm) var(--font-mono); }
  .term-btn:hover { color: var(--accent); border-color: var(--accent); }

  /* ---- navigation ---- */
  .nav ul { display: grid; gap: 1px; }
  .nav a { display: block; padding: 5px 8px; border-radius: var(--radius-sm); color: var(--fg); font-size: 14px; text-decoration: none; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav a:hover { background: var(--hover); opacity: 1; }
  .nav a[aria-current] { background-image: linear-gradient(90deg, var(--active-a), var(--active-b)); opacity: 1; font-weight: 500; }
  .nav .dot { display: inline-block; width: 7px; height: 7px; margin-inline-end: 9px; border-radius: 50%; background: var(--line); vertical-align: 1px; }
  .nav a[aria-current] .dot { background: var(--accent); }
  .nav-group { margin: 0; padding: 12px 8px 4px; font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

  /* ---- social, language, theme ---- */
  .social { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 2px; }
  .social a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
  .social a:hover { color: var(--accent); background: var(--hover); }
  .langs ul { display: flex; gap: 2px; }
  .langs a { padding: 0 4px; font: 12px var(--font-mono); color: var(--muted); text-decoration: none; border-radius: 4px; }
  .langs a[aria-current] { color: var(--accent); font-weight: 600; }
  .modes { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); }
  .modes button { display: grid; place-items: center; padding: 3px 9px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font-size: var(--text-sm); line-height: 1; }
  .modes button svg { width: 14px; height: 14px; }
  .modes button:hover { color: var(--fg); }
  .modes button[aria-pressed="true"] { background-image: linear-gradient(90deg, var(--active-a), var(--active-b)); background-color: var(--hover); color: var(--fg); }
  .pill-shape { display: inline-block; width: 18px; height: 8px; border-radius: 5px; background: linear-gradient(90deg, #d8342c 50%, #2f6fd6 50%); transform: rotate(-30deg); box-shadow: 0 0 0 1px rgb(0 0 0 / .15); }
  .modes .pill:not([aria-pressed="true"]) .pill-shape { animation: wink 4.5s ease-in-out infinite; }
  @keyframes wink { 0%, 82%, 100% { transform: rotate(-30deg) scale(1); } 88% { transform: rotate(-12deg) scale(1.25); } 94% { transform: rotate(-40deg) scale(1.1); } }

  /* ---- links in text ---- */
  .u, .prose a { color: var(--fg); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
  .u:hover, .prose a:hover { color: var(--accent); }
  .u2 { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

  /* ---- chips, cards, badges ---- */
  .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--fg); font: 500 12.5px var(--font-text); text-decoration: none; }
  .chip:hover:not(:disabled) { border-color: var(--accent); }
  .chip[aria-pressed="true"] { background-image: linear-gradient(90deg, var(--active-a), var(--active-b)); background-color: var(--hover); border-color: var(--accent); }
  .chip:disabled { opacity: .45; cursor: not-allowed; }
  .chip .n { color: var(--muted); font: 400 var(--text-xs) var(--font-mono); }
  .chip .n:empty { display: none; }

  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 1em; }
  .card { display: grid; gap: 4px; align-content: start; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none; transition: border-color .15s; }
  .card:hover { border-color: var(--accent); }
  .card time { font: 12px var(--font-mono); color: var(--accent); }
  .card b { font-weight: 600; line-height: 1.3; }
  .card small { color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }

  .lang-badge { display: inline-block; padding: 3px 5px; border-radius: 4px; font: 600 10px/1 var(--font-mono); background: var(--lang-other); color: var(--lang-other-fg); vertical-align: 1px; }
  .lang-badge[data-lang="en"] { background: var(--lang-en); color: var(--lang-en-fg); }
  .lang-badge[data-lang="fr"] { background: var(--lang-fr); color: var(--lang-fr-fg); }
  .type-badge { display: inline-block; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; font: 10px/1.2 var(--font-mono); color: var(--muted); vertical-align: 1px; }
  .draft-flag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #c2410c; color: #fff; font: 600 10px/1.5 var(--font-mono); text-transform: uppercase; vertical-align: 2px; }

  /* ---- page & post ---- */
  .lead { font-size: 18px; line-height: 1.55; margin-top: 0; }
  .eyebrow { margin: 0 0 .4em; font-size: var(--text-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
  .rabbit { display: inline-block; margin-top: 1.4em; color: var(--accent); font-family: var(--font-mono); text-decoration: none; }
  .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: -.6em 0 1.6em; font-size: var(--text-sm); color: var(--muted); }
  .meta .lang-badge { margin: 0; }
  .meta .tag { color: var(--muted); }
  .meta .tag:hover { color: var(--accent); }
  .figure { margin: 0 0 1.6em; }
  .figure img { width: 100%; border-radius: 8px; }
  .figure figcaption { margin-top: 6px; text-align: center; font-size: var(--text-sm); color: var(--muted); }
  .figure figcaption a { color: inherit; }
  .also { margin-top: 2em; font-size: var(--text-sm); color: var(--muted); }
  .pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: var(--space-7); }
  .pager-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none; }
  .pager-link:hover { border-color: var(--accent); }
  .pager-link b { font-weight: 600; }
  .pager-link small { color: var(--muted); }
  .pager-link.next { align-items: flex-end; text-align: end; grid-column: 2; }
  .more { font-size: 14px; color: var(--muted); }

  /* ---- home ---- */
  .quotes { display: grid; gap: 18px; margin-bottom: 14px; }
  .quotes figure, .quotes blockquote { margin: 0; }
  .quotes blockquote { font-style: italic; }
  .quotes blockquote p { margin: 0; }
  .quotes figcaption { margin-top: 2px; color: var(--muted); font-size: var(--text-sm); }
  .mail { font-family: var(--font-mono); font-size: 14px; user-select: all; }

  /* ---- journal ---- */
  .filters { display: grid; gap: 8px; margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .filter-label { width: 64px; font: 600 var(--text-xs) var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .view { display: flex; gap: 4px; }
  .view button, .years a { padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); font: 500 12px var(--font-mono); text-decoration: none; }
  .view button[aria-pressed="true"] { background-image: linear-gradient(90deg, var(--active-a), var(--active-b)); border-color: var(--accent); }
  .years { display: flex; flex-wrap: wrap; gap: 4px; }
  .years a:hover { border-color: var(--accent); }
  .spacer { flex: 1; }
  .year { display: flex; align-items: baseline; gap: 10px; margin: 1.8em 0 .2em; font-size: var(--text-lg); font-weight: 600; scroll-margin-top: 60px; }
  .year span { font: 400 12px var(--font-mono); color: var(--muted); }
  .list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .list time { padding-top: 2px; font: 400 var(--text-sm) var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
  .list a { color: var(--fg); font-weight: 500; text-decoration: none; }
  .list a:hover { color: var(--accent); text-decoration: underline; }
  .list small { display: block; color: var(--muted); font-size: var(--text-sm); }
  .list small .lang-badge, .list small .type-badge { margin-inline-end: 6px; }
  .list .d-long { display: none; }
  [data-flat] .d-long { display: inline; } [data-flat] .d-short { display: none; }
  [data-flat] .year { display: none; } [data-flat] .years { display: none; }
  .empty, .empty-state { margin-top: 1.5em; color: var(--muted); }

  /* ---- tags ---- */
  .tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
  .tag-cloud a { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--tc, var(--surface)); color: var(--fg); font-size: var(--text-sm); text-decoration: none; }
  .tag-cloud a:hover { border-color: var(--accent); }
  .tag-cloud span { margin-inline-start: 4px; color: var(--muted); }

  /* ---- footer ---- */
  .foot { display: grid; gap: 10px; margin-top: auto; padding: 14px var(--space-5) 22px; border-top: 1px solid var(--line); font: 12px/1.5 var(--font-mono); color: var(--muted); }
  .foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
  .foot a { color: var(--muted); }
  .foot a:hover { color: var(--fg); }
  .ring { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
  .ring:hover { color: var(--accent) !important; }
  .badge88 { display: inline-grid; grid-auto-flow: column; align-items: center; justify-content: center; gap: 1px; width: 88px; height: 31px; border: 1px solid var(--line); background: var(--badge-bg); color: var(--badge-fg); font: 700 11px/1 var(--font-mono); letter-spacing: .04em; }
  .badge88 b { color: var(--badge-accent); animation: blink 1.1s steps(1) infinite; }
  .badge88 b.still { animation: none; }
  .badge88 i { font-style: normal; font-weight: 400; font-size: 9px; opacity: .8; }
  @media (max-width: 760px) { .foot { padding-inline: var(--space-4); } }

  /* ---- 404 ---- */
  .not-found .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
  .code-block { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font: var(--text-sm)/1.6 var(--font-mono); white-space: pre; overflow-x: auto; }

  @media (max-width: 760px) { .filter-label { width: 100%; } }
  @media (prefers-reduced-motion: reduce) { .cursor, .badge88 b, .modes .pill .pill-shape { animation: none !important; } }
}

@layer utilities {
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  :root:not([data-mode="rain"]) .rain-only { display: none; }
}

/* Long-form text: everything written in Markdown. */
@layer prose {
  .prose { overflow-wrap: break-word; }
  .prose > :first-child { margin-top: 0; }
  .prose :is(h2, h3, h4) { font-size: var(--text-md); font-weight: 600; margin: 1.6em 0 .4em; scroll-margin-top: var(--space-6); }
  .prose li + li { margin-top: 2px; }
  .prose img { display: block; margin: 1em 0; border-radius: var(--radius-sm); }
  .prose img + em, .prose figcaption { display: block; margin-top: 6px; text-align: center; font-size: var(--text-sm); color: var(--muted); }
  .prose blockquote { margin-inline: 0; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); color: var(--muted); }
  .prose pre { overflow-x: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 13px/1.6 var(--font-mono); tab-size: 2; }
  .prose :not(pre) > code { padding: .05em .3em; border-radius: 4px; background: var(--surface); }
  .prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
  .prose th, .prose td { padding: 6px 8px; border: 1px solid var(--line); text-align: start; vertical-align: top; }
  .prose th { background: var(--surface); }
  .prose dt { font-weight: 600; }
  .prose dd { margin-inline-start: var(--space-4); margin-block-end: var(--space-2); }
  .prose mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; }
  .prose iframe, .prose video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }
  .prose .callout { padding: 10px 14px; border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); }
}

/* The hidden "rain" theme, behind the red/blue pill (features.rainTheme). */
@layer themes {
  .rain { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .32; display: none; }
  :root[data-mode="rain"] {
    color-scheme: dark;
    --bg: #020904; --bg-top: #020904; --bg-side: rgb(1 12 5 / .92); --side-a: transparent; --side-b: transparent;
    --surface: rgb(0 22 9 / .9); --hover: #0b2e15;
    --fg: #41ff7a; --muted: #22a548; --line: #0f3d1c; --accent: #b6ffcb; --accent-fg: #021405;
    --grad-a: #41ff7a; --grad-b: #41ff7a; --active-a: #0b2e15; --active-b: #0b2e15; --rule-a: #0f3d1c; --rule-b: #0f3d1c;
    --glow-1: transparent; --glow-2: transparent;
    --tag-1: #0b3318; --tag-2: #0b3318; --tag-3: #0b3318; --tag-4: #0b3318;
    --lang-en: #0b3318; --lang-en-fg: #41ff7a; --lang-fr: #41ff7a; --lang-fr-fg: #021405;
    --lang-other: #0b3318; --lang-other-fg: #41ff7a;
    --badge-bg: #0b3318; --badge-fg: #41ff7a; --badge-accent: #b6ffcb;
    --font-text: "IBM Plex Mono", ui-monospace, monospace;
  }
  :root[data-mode="rain"] body { background: #020904; }
  :root[data-mode="rain"] .rain { display: block; }
  :root[data-mode="rain"] :is(h1, h2) { font-family: var(--font-retro); font-weight: 400; letter-spacing: .02em; text-shadow: 0 0 8px rgb(65 255 122 / .55); }
  :root[data-mode="rain"] h1 { font-size: 40px; color: #41ff7a; background: none; }
  :root[data-mode="rain"] h2 { font-size: 28px; }
  :root[data-mode="rain"] .body { background: rgb(2 9 4 / .82); border-radius: 6px; }
  :root[data-mode="rain"] .crumb::before { content: "> "; color: var(--accent); }
  :root[data-mode="rain"] .crumb::after { content: "_"; animation: blink 1s steps(1) infinite; }
  @media (prefers-reduced-motion: reduce) { :root[data-mode="rain"] .crumb::after { animation: none; } }
}

/* The hidden terminal (features.terminal): a panel docked at the bottom of the screen, built on <dialog>. */
@layer components {
  .term {
    position: fixed; inset: auto 0 0 0; z-index: 50; width: 100%; max-width: none; height: min(46vh, 420px); max-height: none; margin: 0; padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border: 0; border-top: 2px solid #9b8cff;
    background: rgb(12 12 28 / .97); color: #ecebff; box-shadow: 0 -12px 40px rgb(0 0 0 / .35);
    font: 13px/1.55 "IBM Plex Mono", ui-monospace, monospace;
  }
  .term[open] { display: flex; flex-direction: column; }
  .term::backdrop { background: transparent; }
  .term-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; background: linear-gradient(90deg, #9b8cff, #ff7ac6); color: #141428; font-size: 12px; font-weight: 600; }
  .term-x { border: 0; background: transparent; color: #141428; font: 600 12px "IBM Plex Mono", monospace; }
  .term-out { flex: 1; overflow: auto; padding: 10px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .term-out b { color: #ff9fd3; font-weight: 600; }
  .term-d { color: #b9b0ff; }
  .term-pre { margin: 0; font: inherit; white-space: pre; overflow-x: auto; }
  .term-line { display: flex; gap: 8px; padding: 8px 16px 12px; border-top: 1px solid #2b2952; }
  .term-ps { color: #41ff7a; }
  .term-in { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: #ecebff; font: inherit; caret-color: #ff7ac6; }
  .term mark { background: #4a2a5e; color: #ffd6ee; }
  :root[data-mode="rain"] .term { border-top-color: #41ff7a; background: rgb(1 12 5 / .97); color: #41ff7a; }
  :root[data-mode="rain"] .term-bar { background: #0b3318; color: #b6ffcb; }
  :root[data-mode="rain"] .term-x { color: #b6ffcb; }
}

@media print {
  .side, .foot, .pager, .filters, .rain, .skip, .crumb, .post-foot { display: none !important; }
  .layout { display: block; }
  .body { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  h1 { color: #000; background: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}

