/* Notion-flavoured theme. Colours follow Notion's light and dark palettes. */
:root {
  --bg: #fff; --fg: #37352f; --fg-soft: #5f5e5a; --fg-faint: #6b6963;
  --line: rgba(55, 53, 47, .09); --line-strong: rgba(55, 53, 47, .16); --hover: rgba(55, 53, 47, .06);
  --sidebar: #f7f7f5; --callout: #f1f1ef; --code-bg: rgba(212, 76, 71, .08); --code-fg: #b2342d;
  --blue: #2b6f98; --red-bg: #fdebec; --orange-bg: #fbecdd; --yellow-bg: #fbf3db; --green-bg: #edf3ec; --blue-bg: #e7f3f8; --purple-bg: #f6f3f9;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  --serif: Lyon-Text, Georgia, "Songti TC", "Noto Serif TC", ui-serif, serif;
  --mono: SFMono-Regular, Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace;
  --sidebar-w: 248px; --focus: #2b6f98; --tag-bg: rgba(55, 53, 47, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919; --fg: rgba(255, 255, 255, .81); --fg-soft: rgba(255, 255, 255, .66); --fg-faint: rgba(255, 255, 255, .56);
    --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .16); --hover: rgba(255, 255, 255, .06);
    --sidebar: #202020; --callout: #252525; --code-bg: rgba(255, 115, 105, .12); --code-fg: #ff8f86;
    --blue: #5aa5d4; --focus: #5aa5d4; --tag-bg: rgba(255, 255, 255, .1); --red-bg: #3e2825; --orange-bg: #38281e; --yellow-bg: #3c3221; --green-bg: #243d30; --blue-bg: #1f2e3d; --purple-bg: #2f2639;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--fg-faint); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
img, video { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--bg); color: var(--fg); padding: 8px 14px; border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.skip:focus { top: 8px; }

/* ---- sidebar ---- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 10px 6px; overflow-y: auto; z-index: 30; font-size: 14px; }
.nav, .nav-sub { list-style: none; margin: 0; padding: 0; }
.nav a { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 10px; border-radius: 6px; text-decoration: none; color: var(--fg-soft); font-weight: 500; line-height: 1.3; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--hover); color: var(--fg); font-weight: 600; }
.nav-icon { width: 20px; flex: none; text-align: center; }
.nav-icon img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; display: block; }
/* A page's own sections (table of contents) hang off a thin line under it, smaller and lighter than pages. */
.nav-sub { margin: 2px 0 8px 19px; padding-left: 7px; border-left: 1px solid var(--line-strong); }
.nav-sub a { min-height: 26px; padding: 3px 10px; font-weight: 400; font-size: 13px; color: var(--fg-faint); }
.nav-sub a:hover { color: var(--fg); }
.nav-sub a.current { color: var(--fg); font-weight: 600; background: none; }
.nav-sub a.current::before { content: ""; width: 2px; align-self: stretch; margin: -3px 8px -3px -18px; background: var(--fg); border-radius: 1px; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 4px; font-size: 12px; color: var(--fg-faint); }
.profiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.profiles a { font-size: 13px; color: var(--fg-soft); text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 11px; min-height: 28px; display: inline-flex; align-items: center; }
.profiles a::after { content: "↗"; margin-left: 4px; font-size: 11px; }
.profiles a:hover { background: var(--hover); color: var(--fg); }
.main { margin-left: var(--sidebar-w); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--bg); font-size: 14px; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a, .crumbs span { text-decoration: none; padding: 2px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { background: var(--hover); }
.crumbs .sep { color: var(--fg-faint); padding: 0; }
.menu-btn { display: none; flex: none; width: 40px; height: 40px; margin-left: -8px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--fg); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn:hover { background: var(--hover); }
.crumbs-m { display: none; min-width: 0; font-weight: 500; }
.crumbs-m a, .crumbs-m span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; padding: 8px 4px; }
.scrim { display: none; }
.side-collapse { position: absolute; top: 15px; right: 10px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--fg-faint); cursor: pointer; transition: color .15s, background-color .15s; }
.side-collapse:hover, .side-collapse:focus-visible { background: color-mix(in srgb, var(--fg) 9%, transparent); color: var(--fg); }
.nav > li:first-child > a { padding-right: 40px; }
@media (min-width: 901px) {
  .sidebar { transition: transform .2s ease, visibility 0s linear 0s; }
  .main { transition: margin-left .2s ease; }
  .side-closed .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  .side-closed .main { margin-left: 0; }
  .side-closed .menu-btn { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .main { transition: none !important; } }

/* ---- page ---- */
.cover { height: 30vh; max-height: 280px; min-height: 140px; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-head, .page-intro, .content, .originals, .essay-nav { max-width: 708px; margin: 0 auto; padding: 0 24px; }
.page-head { padding-top: 72px; }
.page-head.has-cover { padding-top: 0; }
.page-icon { display: block; width: 78px; height: 78px; border-radius: 6px; object-fit: cover; margin-bottom: 8px; }
.has-cover .page-icon { margin-top: -39px; position: relative; }
.page-icon.emoji { font-size: 64px; line-height: 78px; width: auto; }
.page-title { font-size: 40px; line-height: 1.2; font-weight: 700; margin: 4px 0 8px; letter-spacing: -.01em; }
.page-title [class^="c-"] { color: inherit; }
.content { padding-bottom: 96px; }
.content p { margin: 2px 0; padding: 3px 0; min-height: 1.5em; }
.spacer { height: 1.5em; }
.nh { font-weight: 600; line-height: 1.3; scroll-margin-top: 56px; }
.nh1 { font-size: 1.875em; margin: 1.4em 0 4px; }
.nh2 { font-size: 1.5em; margin: 1.2em 0 4px; }
.nh3 { font-size: 1.25em; margin: 1em 0 4px; }
.c-blue { color: var(--blue); } .c-gray { color: var(--fg-soft); }
/* Notion's inline code is mostly used for emphasis here: keep the tint, drop the monospace so phrases wrap and read naturally. */
code { font-family: inherit; font-size: .94em; font-weight: 500; color: var(--fg); background: var(--tag-bg); border-radius: 4px; padding: .1em .3em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
ul, ol { margin: 2px 0; padding-left: 1.6em; }
li { padding: 3px 0; }
li > p { margin: 0; }
blockquote { margin: 4px 0; padding: 3px 14px; border-left: 3px solid currentColor; }
hr { border: 0; border-top: 1px solid var(--line-strong); margin: 14px 0; }
.callout { display: flex; gap: 10px; background: var(--callout); border-radius: 10px; padding: 14px 18px 14px 14px; margin: 6px 0; }
.callout-icon { font-size: 20px; line-height: 30px; flex: none; }
.callout-body { min-width: 0; flex: 1; }
.columns { display: flex; gap: 32px; margin: 2px 0; }
.column { min-width: 0; }
.column .media img.fit { object-fit: cover; object-position: center 35%; }
.pairs { margin: 6px 0; }
.pair { display: grid; grid-template-columns: var(--pair-a, 38%) minmax(0, 1fr); gap: 4px 32px; align-items: baseline; padding: 4px 0; }
.pair dt, .pair dd { margin: 0; min-width: 0; }
.pair dd { color: var(--fg-soft); }
.media { margin: 6px 0; }
.media img, .media video { display: block; width: 100%; border-radius: 3px; }
.media a { display: block; cursor: zoom-in; }
.media video { background: #000; }
.media figcaption { font-size: 14px; color: var(--fg-soft); padding: 6px 2px; }
.embed { position: relative; aspect-ratio: 16 / 9; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 3px; }
.toggle { margin: 2px 0; border-radius: 4px; }
.toggle > summary { cursor: pointer; padding: 3px 0; list-style: none; display: flex; gap: 6px; align-items: baseline; }
.toggle > summary::-webkit-details-marker { display: none; }
.toggle > summary::before { content: "▶"; font-size: .6em; width: 1.6em; text-align: center; flex: none; color: var(--fg-soft); transition: transform .15s; transform-origin: center; position: relative; top: -.15em; }
.toggle[open] > summary::before { transform: rotate(90deg); }
.toggle > summary:hover { background: var(--hover); }
.toggle-body { padding-left: 1.6em; }
.toggle-h1 > summary { font-size: 1.5em; font-weight: 600; margin-top: 1em; }
.toggle-h2 > summary { font-size: 1.2em; font-weight: 600; margin-top: .8em; }
.toggle-h3 > summary { font-size: 1.0625em; font-weight: 600; margin-top: .6em; }
.page-link::after { content: " →"; color: var(--fg-soft); }
.toggle.red_bg > summary { background: var(--red-bg); } .toggle.orange_bg > summary { background: var(--orange-bg); }
.toggle.yellow_bg > summary { background: var(--yellow-bg); } .toggle.green_bg > summary { background: var(--green-bg); }
.toggle.blue_bg > summary { background: var(--blue-bg); } .toggle.purple_bg > summary { background: var(--purple-bg); }
.bookmark { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px; margin: 6px 0; text-decoration: none; }
.bookmark:hover { background: var(--hover); }
.bm-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-desc { font-size: 12px; color: var(--fg-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-url { font-size: 12px; color: var(--fg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention, .page-link { font-weight: 500; }
.table-wrap { overflow-x: auto; margin: 6px 0; }
table { border-collapse: collapse; font-size: 14px; }
td { border: 1px solid var(--line-strong); padding: 7px 9px; vertical-align: top; min-width: 120px; }

/* ---- writings index ---- */
.w-lede { color: var(--fg-soft); font-size: 17px; }
.home-links { margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.chip { font-size: 14px; text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.chip:hover { background: var(--hover); }
.w-group { margin-top: 48px; scroll-margin-top: 56px; }
.w-group-title { font-size: 1.5em; font-weight: 600; margin: 0 0 2px; color: var(--blue); }
.w-blurb { color: var(--fg-soft); font-style: italic; margin: 0 0 10px !important; }
.w-year { font-size: 13px; font-weight: 600; color: var(--fg-faint); letter-spacing: .04em; margin: 22px 0 2px; }
.w-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.w-list li { padding: 0; border-top: 1px solid var(--line); }
.w-list a { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 13px 8px; text-decoration: none; border-radius: 4px; }
.w-list a:hover { background: var(--hover); }
.w-meta { font-size: 13px; color: var(--fg-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-title { display: block; font-weight: 600; font-size: 17px; }
.w-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--fg-soft); font-size: 14.5px; margin-top: 2px; }
.w-side { font-size: 13px; color: var(--fg-faint); white-space: nowrap; }
.drawer-close { display: none; }
.t-list { list-style: none; margin: 4px 0 12px; padding: 0; border-bottom: 1px solid var(--line); }
.t-list li { border-top: 1px solid var(--line); padding: 0; }
.t-list a { display: block; padding: 14px 8px; text-decoration: none; border-radius: 4px; }
.t-list a:hover { background: var(--hover); }
.t-list .w-meta { display: block; margin-bottom: 4px; }
.w-more { display: inline-flex; align-items: center; min-height: 36px; margin: 12px 0 4px; padding: 6px 14px; font: inherit; font-size: 14px; color: var(--fg); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.w-more:hover { background: var(--hover); }
.w-more[aria-expanded="false"]::after { content: "↓"; margin-left: 6px; color: var(--fg-faint); }
.t-list + .w-more { margin-top: 0; }
.t-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; font-size: 15.5px; line-height: 1.6; }
.w-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 12px; }

/* ---- essay ---- */
.essay .page-head { max-width: 680px; padding-top: 56px; }
.essay-kicker { font-size: 14px; color: var(--fg-soft); margin: 0 0 6px; }
.essay-kicker a { color: var(--blue); text-decoration: none; }
.prose { max-width: 680px; font: 19px/1.75 var(--serif); padding-top: 18px; padding-bottom: 40px; }
.prose p { margin: 0 0 1.15em; padding: 0; }
.prose ul, .prose ol { margin-bottom: 1.15em; }
.originals { max-width: 680px; border-top: 1px solid var(--line-strong); padding-top: 22px; }
.originals h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint); margin: 0 0 12px; font-weight: 600; }
.essay-nav { max-width: 680px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; padding-bottom: 96px; }
.essay-nav:has(+ .essay-back) { padding-bottom: 8px; }
.essay-nav a { border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px; text-decoration: none; font-weight: 500; }
.essay-nav a:hover { background: var(--hover); }
.essay-nav a span { display: block; font-size: 12px; color: var(--fg-faint); font-weight: 400; margin-bottom: 2px; }
.essay-nav .next { text-align: right; }
.essay-back { max-width: 680px; margin: 0 auto; padding: 0 24px 96px; font-size: 15px; }
.essay-back a { display: inline-block; padding: 8px 0; color: var(--fg-soft); text-decoration: none; }
.essay-back a:hover { color: var(--fg); }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .side-collapse { display: none; }
  .nav > li:first-child > a { padding-right: 10px; }
  /* Closed drawer is hidden (not just moved), so its links leave the tab order and its shadow doesn't leak. */
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; width: min(300px, 84vw); padding-top: 12px; font-size: 15px; }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .nav a { min-height: 42px; padding: 8px 12px; }
  .nav-sub a { min-height: 36px; padding: 6px 12px; font-size: 14px; }
  .profiles a { min-height: 36px; padding: 6px 13px; font-size: 14px; }
  .main { margin-left: 0; }
  .topbar { height: 52px; padding: 0 12px; }
  .menu-btn { display: inline-flex; }
  .drawer-close { display: inline-flex; flex: none; align-self: flex-end; width: 40px; height: 40px; margin: -4px 0 4px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--fg-soft); cursor: pointer; align-items: center; justify-content: center; }
  .drawer-close:hover { background: var(--hover); color: var(--fg); }
  .nh, .w-group, .home-builds, .playground section { scroll-margin-top: 64px; }
}
@media (max-width: 640px) {
  .columns { flex-direction: column; gap: 0; }
  .column { flex: 1 1 auto !important; }
  /* Stacked columns: a tall portrait photo shouldn't take over the whole screen. */
  .column .media img { max-height: min(42vh, 340px); object-fit: cover; object-position: center 30%; }
  .pair { grid-template-columns: 1fr; gap: 0; padding: 6px 0; }
  .pair dd { font-size: 15px; }
  .page-title { font-size: 32px; }
  .page-head, .page-intro, .content, .originals, .essay-nav { padding-left: 18px; padding-right: 18px; }
  .w-list a { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "meta side" "main main"; row-gap: 4px; column-gap: 10px; padding: 14px 4px; }
  .w-meta { grid-area: meta; }
  .w-side { grid-area: side; justify-self: end; }
  .w-main { grid-area: main; }
  .toggle-body, .indent { padding-left: .9em; }
  .page-title { font-size: 30px; }
  /* Keep in-page headings clearly below the 30px page title on phones. */
  .nh1 { font-size: 1.5em; } .nh2 { font-size: 1.3em; } .nh3 { font-size: 1.15em; }
  .toggle-h1 > summary { font-size: 1.3em; } .toggle-h2 > summary { font-size: 1.15em; }
  .prose { font-size: 18px; }
  .crumbs { display: none; }
  .crumbs-m { display: block; }
  .essay-nav { grid-template-columns: 1fr; }
  .essay-nav > span:empty { display: none; }
  .essay-nav .next { text-align: left; }
  .essay-back { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- additions ---- */
.indent { padding-left: 1.6em; }
pre { background: var(--callout); border-radius: 6px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; color: inherit; padding: 0; }
.nav-kids { list-style: none; margin: 0; padding: 0; }
.nav a.nav-child { padding-left: 26px; font-weight: 400; }
.nav-label { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.page.full .page-head, .page.full .content { max-width: 1100px; }
.callout .callout-body > :first-child { margin-top: 0; }
.nav-gap { height: 6px; }
/* Database previews: the newest few items, with a link to the whole collection in Notion. */
.db-card { border: 1px solid var(--line-strong); border-radius: 8px; margin: 8px 0 14px; overflow: hidden; }
.db-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.db-head:hover { background: var(--hover); }
.db-name { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-all { font-size: 13px; color: var(--fg-soft); white-space: nowrap; }
.db-rows { list-style: none; margin: 0; padding: 0; }
.db-rows li + li { border-top: 1px solid var(--line); }
.db-rows a { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 14px; text-decoration: none; font-size: 14.5px; color: var(--fg); }
.db-rows a:hover { background: var(--hover); }
.db-icon { width: 20px; flex: none; text-align: center; color: var(--fg-faint); line-height: 1.45; }
.db-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.db-title { font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.db-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--fg-soft); }
.db-tag { background: var(--tag-bg); border-radius: 4px; padding: 1px 6px; color: var(--fg); }
.db-dot { color: var(--fg-faint); }
.db-meta time { font-variant-numeric: tabular-nums; }
.db-sum { font-size: 13.5px; color: var(--fg-soft); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ⌘K search */
.search-btn { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--fg-soft); font: inherit; font-size: 13px; cursor: pointer; }
.search-btn:hover { background: var(--hover); color: var(--fg); }
.search-btn kbd { font: inherit; font-size: 11.5px; color: var(--fg-faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.search-dlg { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: hidden; display: none; flex-direction: column; }
.search-dlg[open] { display: flex; }
.search-dlg::backdrop { background: rgba(15, 15, 15, .35); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--fg-faint); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 17px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-esc { flex: none; font: inherit; font-size: 12px; color: var(--fg-soft); background: var(--tag-bg); border: 0; border-radius: 5px; padding: 3px 7px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.search-results a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.search-results [aria-selected="true"] a, .search-results a:hover { background: var(--hover); }
.sr-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-kind { font-size: 12px; color: var(--fg-faint); white-space: nowrap; align-self: center; }
.sr-x { grid-column: 1 / -1; font-size: 13px; color: var(--fg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-empty { padding: 18px 12px; color: var(--fg-soft); }
.search-hint { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-faint); }
@media (max-width: 900px) {
  .search-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; margin-right: -6px; }
  .search-btn .search-label, .search-btn kbd { display: none; }
  .search-dlg { margin-top: 12px; max-height: calc(100vh - 24px); }
  .search-hint { display: none; }
}
/* Bookshelf */
.shelf-wrap { border: 1px solid var(--line-strong); border-radius: 10px; margin: 10px 0 18px; padding: 12px 14px 4px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-head .db-all { text-decoration: none; }
.shelf-head .db-all:hover { text-decoration: underline; }
.shelf-count { font-weight: 400; color: var(--fg-faint); margin-left: 6px; font-size: 13px; }
.shelf-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 10px 0 14px; }
.shelf-filters, .shelf-sort { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 10px; font: inherit; font-size: 13px; color: var(--fg-soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.chip-btn span { color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.chip-btn i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.chip-btn:hover { background: var(--hover); color: var(--fg); }
.chip-btn[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip-btn[aria-pressed="true"] span { color: inherit; opacity: .7; }
.shelf { --k: 1; --row: calc(204px * var(--k)); list-style: none; margin: 0; padding: 0 4px; display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 3px; row-gap: 10px;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) - 2px), var(--line-strong) calc(var(--row) - 2px) var(--row), transparent var(--row) calc(var(--row) + 10px)); }
[hidden] { display: none !important; }
.spine-slot { height: var(--row); display: flex; align-items: flex-end; padding-bottom: 2px; }
.spine { height: calc(var(--h) * var(--k)); position: relative; display: flex; align-items: center; justify-content: center; border-radius: 3px 3px 1px 1px; background: var(--c); color: #fff; text-decoration: none; box-shadow: inset -3px 0 0 rgba(0, 0, 0, .18), inset 2px 0 0 rgba(255, 255, 255, .12); transition: transform .15s ease; }
.spine::before, .spine::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(255, 255, 255, .28); }
.spine::before { top: 10px; } .spine::after { bottom: 12px; }
.spine.paused { opacity: .62; }
.spine:hover, .spine:focus-visible { transform: translateY(-8px); }
.spine-title { writing-mode: vertical-rl; font-size: 12px; font-weight: 600; letter-spacing: .02em; line-height: 1.1; max-height: calc(100% - 44px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spine-star { position: absolute; bottom: 17px; font-size: 10px; color: #f3d27a; }
.ribbon { position: absolute; top: -2px; right: 5px; width: 7px; height: 20px; background: #e2574c; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.spine-card { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; padding: 8px 10px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 12.5px; line-height: 1.4; display: none; flex-direction: column; gap: 2px; z-index: 5; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.spine-card span { opacity: .75; }
.spine:hover .spine-card, .spine:focus-visible .spine-card { display: flex; }
.shelf-status { margin: 6px 0 6px; font-size: 12.5px; color: var(--fg-faint); min-height: 1.2em; }
.spine-audio { position: absolute; top: 15px; font-size: 10px; line-height: 1; opacity: .8; }
.spine.from-hl, .spine.from-audio, .spine.from-notes { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 82%, #000), var(--c) 22%, var(--c)); }
/* Home: a small shelf in the Reading column. */
.shelf-mini { margin: 8px 0 0; padding: 12px 10px 0; border-radius: 10px; background: color-mix(in srgb, var(--fg) 4%, var(--bg)); }
.shelf.mini { --k: .56; column-gap: 2px; row-gap: 6px; padding: 0; justify-content: center; border-bottom: 3px solid color-mix(in srgb, var(--fg) 22%, var(--bg)); }
.shelf.mini .spine-slot { padding-bottom: 0; }
.shelf.mini .spine { width: calc(var(--w, 32px) * .62) !important; }
.shelf.mini .spine::before { top: 6px; } .shelf.mini .spine::after { bottom: 7px; }
.shelf.mini .spine-title { font-size: 8.5px; max-height: calc(100% - 24px); }
.shelf.mini .spine-star, .shelf.mini .spine-audio, .shelf.mini .ribbon { display: none; }
.shelf.mini .spine:hover, .shelf.mini .spine:focus-visible { transform: translateY(-4px); }
.shelf.mini .spine-card { max-width: 180px; }
.shelf-mini figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px 10px; font-size: 13px; color: var(--fg-soft); }
.shelf-mini figcaption a { color: var(--fg); font-weight: 550; }
@media (max-width: 900px) { .shelf { --k: .84; } .spine-title { font-size: 11px; } .shelf-controls { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .spine { transition: none; } }
/* Interactive Alignment Pyramid */
.pyramid { margin: 8px 0 32px; padding: 20px 22px 18px; border: 1px solid var(--line-strong); border-radius: 12px; }
.pyr-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin: 0 0 18px; padding: 0; font-size: 15px; color: var(--fg); }
.pyr-head span { font-size: 13px; color: var(--fg-faint); }
.pyr-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pyr-left { display: flex; flex-direction: column; gap: 14px; }
.pyr-stack { position: relative; width: 100%; max-width: 440px; aspect-ratio: 2 / 1.7320508; margin: 0 auto; }
.pyr-tier { position: absolute; left: 0; right: 0; border: 0; padding: 0 0 min(10px, 2.4%); cursor: pointer; font: inherit; color: var(--fg); background: color-mix(in srgb, var(--fg) calc(7% + var(--n) * 3%), var(--bg)); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; transition: color .15s ease, background-color .15s ease; }
.pyr-tier:hover { background: color-mix(in srgb, var(--fg) calc(14% + var(--n) * 3%), var(--bg)); }
.pyr-tier[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.pyr-tier:focus-visible { outline: none; }
.pyr-tier:focus-visible .pyr-name { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.pyr-name { font-size: 15.5px; font-weight: 650; line-height: 1.2; }
.pyr-tq { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; opacity: .62; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* The feedback loop round the triangle (an SVG in the same units as the stack). */
.pyr-dia { --loop: #b7791f; position: relative; width: 100%; max-width: 520px; margin: 0 auto; }
.pyr-dia .pyr-stack { position: absolute; left: var(--gx); top: 0; width: var(--gw); height: var(--gh); max-width: none; aspect-ratio: auto; margin: 0; }
.pyr-loopsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pl-l, .pl-a { fill: none; stroke: var(--loop); stroke-width: .55; opacity: .7; }
.pl-dash { stroke-dasharray: 1.4 1.1; }
.pl-hd, .pl-j { fill: var(--loop); }
.pl-t { font-size: 3.5px; font-weight: 600; letter-spacing: .02em; fill: var(--loop); opacity: .85; }
.pl-box { fill: var(--bg); stroke: var(--loop); stroke-width: .6; }
.pl-bt { font-size: 3.9px; font-weight: 650; text-anchor: middle; fill: var(--fg); }
.pl-pulse { fill: none; stroke: var(--loop); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 8 200; stroke-dashoffset: 8; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pl-down { animation: pl-run-short var(--cycle) linear infinite; }
  .pl-up { animation: pl-run var(--cycle) linear var(--start) infinite; }
  .pl-a { animation: pl-flash var(--cycle) ease-out infinite; }
  .pl-t { animation: pl-tflash var(--cycle) ease-out infinite; }
  .pl-t:not([style]) { animation: none; }
  .pl-box { animation: pl-box var(--cycle) ease-out .7s infinite; }
}
@keyframes pl-run-short { 0% { stroke-dashoffset: 8; opacity: 1; } 11% { stroke-dashoffset: -100; opacity: 1; } 11.1%, 100% { opacity: 0; } }
@keyframes pl-run { 0% { stroke-dashoffset: 8; opacity: 1; } 48% { stroke-dashoffset: -100; opacity: 1; } 48.1%, 100% { opacity: 0; } }
@keyframes pl-flash { 0% { opacity: 1; stroke-width: 1; } 14%, 100% { opacity: .7; stroke-width: .55; } }
@keyframes pl-tflash { 0% { opacity: 1; } 14%, 100% { opacity: .85; } }
@keyframes pl-box { 0% { stroke-width: 1.1; fill: color-mix(in srgb, var(--loop) 14%, var(--bg)); } 16%, 100% { stroke-width: .6; fill: var(--bg); } }
@media (prefers-color-scheme: dark) { .pyr-dia { --loop: #e2a74c; } }
.pyr-panels { min-height: 340px; }
.pyr-panel { padding: 2px 0 0; }
.pyr-anchor { position: relative; top: -80px; display: block; }
.pyr-q { margin: 0 !important; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.pyr-title { margin: 2px 0 2px !important; padding: 0 !important; font-size: 22px; line-height: 1.25; }
.pyr-d { margin: 0 0 14px !important; color: var(--fg-soft); font-size: 15px; }
.pyr-chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pyr-chips li { margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--tag-bg); font-size: 14px; }
.pyr-links, .pyr-rows { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.pyr-links li, .pyr-rows > li { margin: 0; border-bottom: 1px solid var(--line); }
.pyr-links a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; font-size: 15px; text-decoration: none; }
.pyr-links a span { color: var(--fg-faint); }
.pyr-links a:hover { background: var(--hover); }
.pyr-rows summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 2px; cursor: pointer; border-radius: 4px; }
.pyr-rows summary::-webkit-details-marker { display: none; }
.pyr-rows summary:hover { background: var(--hover); }
.pyr-emo { flex: none; width: 1.5em; text-align: center; font-size: 17px; }
.pyr-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pyr-row-t b { font-weight: 600; font-size: 15px; }
.pyr-row-t span { font-size: 13px; color: var(--fg-faint); }
.pyr-n { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-faint); }
.pyr-n::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.pyr-rows details[open] .pyr-n::after { transform: rotate(-135deg) translate(-1px, -1px); }
.pyr-row-body { padding: 0 2px 10px calc(1.5em * 17 / 15 + 12px); font-size: 14px; color: var(--fg-soft); }
.pyr-row-body ol, .pyr-row-body ul { margin: 0; padding-left: 1.2em; }
.pyr-row-body li { margin: 2px 0; }
.pyr-row-body p { margin: 0 0 4px; }
.pyr-more { font-size: 14px; color: var(--fg-soft); }
@media (max-width: 900px) { .pyr-grid { grid-template-columns: 1fr; gap: 20px; } .pyramid { padding: 16px 14px 14px; } .pyr-panels { min-height: 0; } .pyr-head { margin-bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .pyr-tier, .pyr-n::after { transition: none; } }
/* Travel map */
.travel { margin: 6px 0 12px; }
.tv-thumb { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--blue) 7%, var(--bg)); overflow: hidden; cursor: zoom-in; }
.tv-thumb img { display: block; width: 100%; height: auto; }
.tv-over { position: absolute; inset: 0; width: 100%; height: 100%; }
.tv-v { fill: color-mix(in srgb, var(--blue) 62%, var(--bg)); stroke: var(--bg); stroke-width: .7; }
.tv-pin { fill: var(--blue); stroke: var(--bg); stroke-width: 4; }
.tv-pin.has-story { fill: #e8833a; }
.tv-open { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--fg); font-size: 12.5px; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); transition: transform .15s ease; }
.tv-thumb:hover .tv-open { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .16); }
.tv-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 10px 0 6px; font-size: 13.5px; color: var(--fg-soft); }
.tv-stats b { color: var(--fg); font-weight: 650; margin-right: 3px; }
.tv-groups { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tv-groups li { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 0; border-bottom: 1px solid var(--line); }
.tv-cont { flex: none; width: 104px; white-space: nowrap; font-size: 13px; color: var(--fg-soft); }
.tv-cont small { margin-left: 6px; font-size: 12px; color: var(--fg-faint); }
.tv-fl { display: flex; flex-wrap: wrap; gap: 0; min-width: 0; }
.tv-fl button { position: relative; width: 25px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; font-size: 17px; line-height: 1; cursor: pointer; }
.tv-fl button:hover { background: var(--hover); }
.tv-groups li.tv-st { align-items: flex-start; padding: 8px 0; }
.tv-st .tv-cont { padding-top: 1px; }
.tv-st ul { margin: 0; padding: 0; list-style: none; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.tv-st ul li { display: block; margin: 0 0 3px; padding: 0; border: 0; }
.tv-st ul li:last-child { margin-bottom: 0; }
/* full-screen explorer */
.tv-dlg { width: min(1120px, calc(100vw - 32px)); height: min(720px, calc(100vh - 32px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: 0 24px 80px rgba(0, 0, 0, .28); overflow: hidden; }
.tv-dlg[open] { display: flex; flex-direction: column; }
.tv-dlg::backdrop { background: rgba(15, 15, 15, .45); }
.tv-dlg-head { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.tv-dlg-head h2 { margin: 0; padding: 0; font-size: 17px; font-weight: 650; }
.tv-dlg-head p { margin: 0; flex: 1; font-size: 13px; color: var(--fg-faint); }
.tv-x { align-self: center; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--fg-soft); cursor: pointer; }
.tv-x:hover { background: var(--hover); color: var(--fg); }
.tv-dlg-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 272px; }
.tv-stage { position: relative; min-height: 0; background: color-mix(in srgb, var(--blue) 7%, var(--bg)); overflow: hidden; }
.tv-big { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tv-base path { fill: #e6e3dc; stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; }
@media (prefers-color-scheme: dark) { .tv-base path { fill: #3a3936; } }
.tv-big .tv-v { stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .2s; }
.tv-big .tv-v:hover { fill: color-mix(in srgb, var(--blue) 80%, var(--bg)); }
.tv-big .tv-v.on { fill: var(--blue); }
.tv-big .tv-pin { stroke-width: 2.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.tv-big .tv-pin.on { stroke: var(--fg); stroke-width: 3; }
.tv-ctrl { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.tv-ctrl button { pointer-events: auto; height: 34px; min-width: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tv-ctrl button:hover { background: color-mix(in srgb, var(--fg) 5%, var(--bg)); }
.tv-nav { display: flex; gap: 6px; }
.tv-nav button { padding: 0; font-size: 20px; line-height: 1; }
.tv-card { position: absolute; left: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.tv-card-k { margin: 0 !important; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.tv-card h3 { margin: 2px 0 4px !important; padding: 0 !important; font-size: 18px; line-height: 1.3; }
.tv-card ul { margin: 6px 0 0; padding-left: 1.1em; font-size: 14px; }
.tv-card li { margin: 3px 0; }
.tv-card-t { margin: 0 !important; font-size: 14px; line-height: 1.5; }
.tv-card-t + ul { margin-top: 8px; }
.tv-card-none { margin: 0 !important; font-size: 13.5px; color: var(--fg-soft); }
.tv-list { overflow-y: auto; border-left: 1px solid var(--line); padding: 6px 8px 14px; }
.tv-list h3 { margin: 12px 8px 4px !important; padding: 0 !important; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.tv-list h3 small { margin-left: 4px; font-size: inherit; letter-spacing: 0; }
.tv-list ul { list-style: none; margin: 0; padding: 0; }
.tv-list li { margin: 0; }
.tv-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--fg-soft); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tv-list button:hover { background: var(--hover); color: var(--fg); }
.tv-list button.on { background: var(--fg); color: var(--bg); }
.tv-f { font-size: 18px; line-height: 1; }
.tv-n { flex: 1; min-width: 0; }
.tv-sc { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e8833a; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) {
  .tv-dlg { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .tv-dlg-head p { display: none; }
  .tv-dlg-head h2 { flex: 1; }
  .tv-dlg-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 52%) minmax(0, 1fr); }
  .tv-list { border-left: 0; border-top: 1px solid var(--line); }
  .tv-card { position: static; width: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
  .tv-stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
  .tv-big { position: relative; inset: auto; height: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tv-v, .tv-pin, .tv-open { transition: none; } }

/* ---------- astack (static/astack, worn inside the site shell) ---------- */
.astack { --muted: var(--fg-soft); --accent: var(--blue); }
.astack .as-sub { margin: -4px 0 20px; color: var(--fg-soft); }
.astack .as-sub a { color: var(--fg-soft); }
.astack a { text-decoration: none; }
.astack code { font: 12px/1.4 var(--mono); color: var(--fg-faint); }
.astack .search { width: 100%; height: 40px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; }
.astack .search::placeholder { color: var(--fg-faint); }
.astack .search:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.astack .empty { display: none; color: var(--fg-soft); padding: 24px 0; }
.astack section { margin-top: 44px; }
.astack h2 { font-size: 22px; font-weight: 650; letter-spacing: -.005em; color: var(--fg); margin: 0 0 6px; padding: 0; text-transform: none; }
.astack h3 { font-size: 15px; font-weight: 600; margin: 24px 0 4px; }
.astack .count { color: var(--fg-faint); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.astack .lede { color: var(--fg-soft); margin: 0 0 14px; max-width: 60ch; }
.astack ul { list-style: none; margin: 0; padding: 0; }
.astack li { margin: 0; }
.astack .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.astack .card { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); transition: background-color .15s, border-color .15s; }
.astack .card:hover { background: var(--hover); }
.astack .card-main { display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 10px; flex: 1; color: var(--fg); }
.astack .card-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.astack .arrow { color: var(--fg-faint); }
.astack .card-desc { color: var(--fg-soft); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.astack .card-host { font-size: 12.5px; color: var(--accent); overflow-wrap: anywhere; }
.astack .card-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.astack .date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.astack .foot-link { margin-left: auto; color: var(--fg-soft); }
.astack .foot-link:hover { color: var(--fg); text-decoration: underline; }
.astack .tag { background: var(--tag-bg); color: var(--fg-soft); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; }
.astack .muted { color: var(--fg-soft); }
.astack .rows { border-top: 1px solid var(--line); }
.astack .row { border-bottom: 1px solid var(--line); }
.astack .row a, .astack .row-btn, .astack .row-static { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; width: calc(100% + 16px); padding: 10px 8px; margin: 0 -8px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; text-align: left; }
.astack .row a:hover, .astack .row-btn:hover { background: var(--hover); }
.astack .row-btn { cursor: copy; }
.astack .row-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.astack .row-btn .row-code::after { content: " ⧉"; opacity: .55; }
.astack .row-btn.copied .row-code::after { content: " ✓"; opacity: 1; color: var(--accent); }
.astack .row-title { font-weight: 600; font-size: 15px; }
.astack .row-desc { color: var(--fg-soft); font-size: 14px; }
.astack .row-side { display: inline-flex; align-items: baseline; gap: 8px; }
.astack details summary { cursor: pointer; color: var(--fg-soft); padding: 6px 0; }
.astack details summary:hover { color: var(--fg); }
.astack table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.astack td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.astack td a { font-weight: 600; color: var(--fg); } .astack td a:hover { text-decoration: underline; }
.astack td.num { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; padding-right: 0; }
.astack td.desc { max-width: 300px; }
.astack footer { margin-top: 48px; color: var(--fg-faint); font-size: 13px; }
.astack-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60; max-width: calc(100vw - 32px); }
.astack-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .astack .row a, .astack .row-btn, .astack .row-static { grid-template-columns: 1fr; gap: 2px; }
  .astack .row-code, .astack .row-side .tag { display: none; }
  .astack td.desc, .astack td:nth-child(3) { display: none; }
}
.astack .row-side .row-link { display: inline; width: auto; padding: 0; margin: 0; border-radius: 0; color: var(--fg-soft); font-size: 13.5px; background: none; }
.astack .row-side .row-link:hover { color: var(--fg); text-decoration: underline; background: none; }

/* ---------- Buy me a boba ---------- */
.boba-zh { display: block; margin-top: 2px; font-size: .55em; font-weight: 600; color: var(--fg-soft); }
.boba .boba-intro { font-size: 17px; line-height: 1.6; color: var(--fg); margin: 0 0 22px; }
.boba .boba-intro span { color: var(--fg-soft); font-size: 16px; }
.boba-cups { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.boba-cups li { margin: 0; }
.boba-card { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; padding: 18px 10px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: color-mix(in srgb, #c8a27a 7%, var(--bg)); color: var(--fg); text-decoration: none; text-align: center; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.boba-card:hover { transform: translateY(-3px); background: color-mix(in srgb, #c8a27a 15%, var(--bg)); border-color: color-mix(in srgb, #9c6a43 45%, var(--line-strong)); }
.boba-cup { width: 58px; height: 68px; overflow: visible; }
.boba-card:hover .boba-cup { animation: boba-wiggle .5s ease; }
.bc-straw { stroke: #e46f6f; stroke-width: 5; stroke-linecap: round; fill: none; }
.bc-lid { fill: color-mix(in srgb, var(--fg) 10%, var(--bg)); stroke: color-mix(in srgb, var(--fg) 35%, transparent); stroke-width: 1.5; }
.bc-cup { fill: color-mix(in srgb, var(--fg) 4%, var(--bg)); stroke: color-mix(in srgb, var(--fg) 35%, transparent); stroke-width: 1.5; }
.bc-tea { fill: var(--tea); }
.bc-pearls { fill: #2d1d14; }
.bc-shine { stroke: rgba(255, 255, 255, .45); stroke-width: 2.5; stroke-linecap: round; }
.boba-name { display: flex; flex-direction: column; font-weight: 650; font-size: 15px; line-height: 1.3; }
.boba-name small, .boba-price small { font-weight: 400; font-size: 12.5px; color: var(--fg-soft); }
.boba-price { display: flex; flex-direction: column; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.boba-go { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border-radius: 10px; background: var(--fg); color: var(--bg); font-weight: 650; text-decoration: none; transition: opacity .15s; }
.boba-go:hover { opacity: .88; }
.boba .boba-fine { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--fg-faint); text-align: center; }
.boba .boba-h { margin: 40px 0 8px; font-size: 18px; }
.boba .boba-h span { color: var(--fg-soft); font-weight: 500; font-size: 15px; margin-left: 6px; }
.boba-where { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.boba-where li { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.boba-where li span { color: var(--fg-soft); text-align: right; }
@keyframes boba-wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 65% { transform: rotate(4deg); } }
@media (max-width: 560px) {
  .boba-cups { gap: 8px; }
  .boba-card { padding: 14px 6px 12px; }
  .boba-cup { width: 46px; height: 54px; }
  .boba-price { font-size: 16px; }
  .boba-where li { flex-direction: column; gap: 0; }
  .boba-where li span { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .boba-card, .boba-card:hover .boba-cup { transition: none; animation: none; transform: none; } }

/* ---- Playground (sites and apps) and the home page's "Recent builds" strip ----
   Each card is one link (the title's ::after covers the card); "Code" sits above that layer. The screenshot is
   the hero. Grid is 6 columns: a wide feature card, two large, then threes, so it reads curated, not tiled. */
:root { --spring: cubic-bezier(.2, .8, .25, 1); }
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, .034, .128 4.9%, .418 11.3%, .706 18.3%, .881 25%, .988 32.6%, 1.027 40.4%, 1.036 46.8%, 1.026 56%, 1.007 70.5%, .999 85%, 1); }
}
.playground a, .home-builds a { text-decoration: none; }
.playground .content, .home-builds { container-type: inline-size; }
.pg-lede { color: var(--fg-soft); font-size: 17px; margin: 0; max-width: 60ch; text-wrap: pretty; }
.pg-cross { margin: 6px 0 0; font-size: 15px; }
/* The screening room, first thing on the Playground: a picture of the room and a way in; the list stays below. */
.pg-room { position: relative; display: block; margin: 22px 0 6px; border-radius: 14px; overflow: hidden; background: #0d0c0b; color: #f3ede2; text-decoration: none; aspect-ratio: 16 / 8; box-shadow: 0 18px 40px -24px rgba(20, 14, 8, .55); isolation: isolate; }
.pg-room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform .8s cubic-bezier(.2, .8, .25, 1); z-index: -1; }
.pg-room::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(13, 12, 11, .86) 0%, rgba(13, 12, 11, .55) 38%, rgba(13, 12, 11, 0) 70%); }
.pg-room:hover img { transform: scale(1.025); }
.pg-room-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 360px; height: 100%; justify-content: flex-end; padding: 26px 28px; }
.pg-room-kicker { font: 700 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #e7b866; }
.pg-room-title { font: 700 30px/1.08 Caveat, "Kaiti TC", cursive; color: #f3ede2; text-wrap: balance; }
.pg-room-sub { font-size: 14.5px; line-height: 1.45; color: rgba(243, 237, 226, .74); }
.pg-room-cta { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 18px; border-radius: 999px; background: #f4ecdc; color: #1c1a17; font: 600 14.5px var(--sans); }
.pg-room:hover .pg-room-cta { background: #fff; }
.pg-room:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (max-width: 640px) {
  .pg-room { aspect-ratio: 4 / 5; }
  .pg-room img { object-position: 30% 50%; }
  .pg-room::after { background: linear-gradient(0deg, rgba(13, 12, 11, .9) 0%, rgba(13, 12, 11, .6) 45%, rgba(13, 12, 11, 0) 75%); }
  .pg-room-text { padding: 20px; max-width: none; }
  .pg-room-title { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .pg-room img { transition: none; } }
.pg-cross a, .hb-head a { color: var(--blue); }
.pg-cross a:hover, .hb-head a:hover { text-decoration: underline; }
.pg-h { font-size: 22px; font-weight: 650; margin: 44px 0 16px; }
.pg-count { color: var(--fg-faint); font-size: 14px; font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.pg-sub { color: var(--fg-soft); margin: -8px 0 12px; font-size: 15px; }
.pg-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 22px; }
.pg-card { position: relative; grid-column: span 2; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--bg);
  transition: transform .55s var(--spring), box-shadow .35s ease, border-color .2s ease; }
.pg-large { grid-column: span 3; }
.pg-feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.pg-card:hover, .pg-card:focus-within { transform: translateY(-3px); border-color: rgba(55, 53, 47, .24); box-shadow: 0 18px 40px -18px rgba(25, 23, 17, .32), 0 2px 6px -2px rgba(25, 23, 17, .08); }
.pg-shot { position: relative; aspect-ratio: 16 / 10; background: var(--callout); border-bottom: 1px solid var(--line); overflow: hidden; }
.pg-feature .pg-shot { border-bottom: 0; border-right: 1px solid var(--line); }
.pg-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--spring); }
.pg-card:hover .pg-shot img, .pg-card:focus-within .pg-shot img { transform: scale(1.035); }
.pg-noshot { display: grid; place-items: center; height: 100%; color: var(--fg-faint); font-size: 14px; }
.pg-body { display: flex; flex-direction: column; padding: 16px 18px 16px; flex: 1; min-width: 0; }
.pg-feature .pg-body { justify-content: center; padding: 32px 34px; }
.pg-card .pg-meta { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; letter-spacing: .01em; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.pg-title { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.005em; word-break: keep-all; overflow-wrap: anywhere; }
.pg-large .pg-title { font-size: 19px; }
.pg-feature .pg-title { font-size: 30px; line-height: 1.15; letter-spacing: -.015em; }
.pg-link { color: var(--fg); }
.pg-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pg-link:focus-visible { outline: none; }
.pg-link:focus-visible::after { box-shadow: inset 0 0 0 2px var(--focus); border-radius: 14px; }
@supports selector(:has(*)) {
  .pg-link:focus-visible::after { box-shadow: none; }
  .pg-card:has(.pg-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
}
.pg-card .pg-blurb { margin: 6px 0 0; color: var(--fg-soft); font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }
.pg-card.pg-feature .pg-blurb { font-size: 16.5px; line-height: 1.55; margin-top: 10px; }
.pg-card .pg-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 42px; margin: auto 0 0; padding-top: 16px; font-size: 13px; }
.pg-card.pg-feature .pg-foot { margin-top: 0; padding-top: 22px; }
.pg-host { display: inline-flex; align-items: baseline; gap: 4px; color: var(--fg-faint); white-space: nowrap; transition: color .2s; }
.pg-arrow { display: inline-block; transition: transform .5s var(--spring); }
.pg-card:hover .pg-host, .pg-card:focus-within .pg-host { color: var(--fg-soft); }
.pg-card:hover .pg-arrow, .pg-card:focus-within .pg-arrow { transform: translate(2px, -2px); }
.pg-code::before { content: ""; position: absolute; inset: -9px -6px; }
.pg-code { position: relative; z-index: 2; margin-left: auto; flex: none; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--fg-soft); font-size: 12.5px; line-height: 18px; background: var(--bg); transition: background-color .15s, color .15s; }
.pg-code:hover { background: var(--hover); color: var(--fg); }
.pg-repos { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pg-repos li { border-bottom: 1px solid var(--line); }
.pg-repos a { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 9px 8px; margin: 0 -8px; border-radius: 6px; font-size: 14px; color: var(--fg); }
.pg-repos a:hover { background: var(--hover); }
.pg-rname { font-weight: 600; overflow-wrap: anywhere; }
.pg-repos a.no-desc { grid-template-columns: minmax(0, 1fr) auto; }
.pg-rdesc { color: var(--fg-soft); }
.pg-rmeta { color: var(--fg-faint); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@container (max-width: 939px) {
  .pg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .pg-card, .pg-large { grid-column: span 1; }
  .pg-feature { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .pg-feature .pg-shot { border-right: 0; border-bottom: 1px solid var(--line); }
  .pg-feature .pg-body { padding: 18px 20px 18px; }
  .pg-feature .pg-title { font-size: 24px; }
  /* An odd card out at the end lies across both columns instead of leaving half a row empty. */
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) .pg-shot { border-bottom: 0; border-right: 1px solid var(--line); }
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) .pg-body { justify-content: center; padding: 22px 24px; }
}
@container (max-width: 700px) { .pg-repos a { grid-template-columns: 1fr; gap: 2px; } }
@container (max-width: 520px) {
  .pg-cards { grid-template-columns: 1fr; }
  .pg-card .pg-body, .pg-card.pg-feature .pg-body { padding: 16px 18px; }
  .pg-title, .pg-large .pg-title { font-size: 19px; }
  .pg-feature .pg-title { font-size: 22px; }
  .pg-card.pg-feature .pg-blurb { font-size: 15px; }
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) { display: flex; }
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) .pg-shot { border-right: 0; border-bottom: 1px solid var(--line); }
  .pg-cards:has(> .pg-feature) > .pg-card:not(.pg-feature):last-child:nth-child(even) .pg-body { padding: 16px 18px; }
}
/* Home: the screening-room banner, shorter than the Playground's hero, above the cards. */
.hb-room { margin: 0 0 14px; aspect-ratio: 16 / 5.2; }
.hb-room img { object-position: 50% 45%; }
.hb-room .pg-room-text { padding: 18px 22px; gap: 4px; max-width: 320px; }
.hb-room .pg-room-title { font-size: 26px; }
.hb-room .pg-room-cta { margin-top: 6px; min-height: 36px; font-size: 14px; }
@media (max-width: 640px) {
  .hb-room { aspect-ratio: 16 / 10; }
  .hb-room .pg-room-text { padding: 16px; }
  .hb-room .pg-room-title { font-size: 23px; }
}
/* Home: three compact cards; on a phone, a row you swipe. */
.home-builds { margin: 40px 0 8px; scroll-margin-top: 72px; }
.playground section { scroll-margin-top: 72px; }
.hb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hb-head h2 { margin: 0; font-size: 1.875em; font-weight: 600; line-height: 1.3; }
.hb-head a { font-size: 15px; font-weight: 500; }
.hb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hb-cards .pg-card { grid-column: auto; border-radius: 12px; }
.hb-cards .pg-body { padding: 12px 14px 14px; }
.hb-cards .pg-card .pg-meta { margin-bottom: 3px; font-size: 12px; }
.hb-cards .pg-title { font-size: 15.5px; }
.hb-cards .pg-card .pg-blurb { font-size: 13.5px; line-height: 1.45; margin-top: 4px; }
.hb-cards .pg-card .pg-foot { min-height: 0; padding-top: 10px; font-size: 12.5px; }
@media (max-width: 640px) {
  .hb-head h2 { font-size: 1.5em; }
  .hb-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -18px; padding: 4px 18px 14px; scroll-padding: 0 18px; scrollbar-width: none; }
  .hb-cards::-webkit-scrollbar { display: none; }
  .hb-cards .pg-card { flex: 0 0 76%; scroll-snap-align: start; }
  .hb-cards .pg-card:hover { transform: none; }
}
@media (prefers-color-scheme: dark) {
  .pg-card:hover, .pg-card:focus-within { border-color: rgba(255, 255, 255, .22); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-card, .pg-shot img, .pg-arrow { transition: none; }
  .pg-card:hover, .pg-card:focus-within, .pg-card:hover .pg-shot img, .pg-card:focus-within .pg-shot img, .pg-card:hover .pg-arrow, .pg-card:focus-within .pg-arrow { transform: none; }
}
@media (max-width: 900px) { .home-builds, .playground section { scroll-margin-top: 64px; } }
.astack .as-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: -12px 0 22px; font-size: 15px; }
.astack .as-links a { color: var(--blue); }
.astack .as-links a:hover { text-decoration: underline; }
.pg-card p { padding: 0; min-height: 0; }
/* ---------- Project case studies (astack/<slug>/) ---------- */
.case .case-lead { font-size: 18px; line-height: 1.6; color: var(--fg); margin: 0 0 20px; }
.case-meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-meta div { padding: 12px 14px 12px 0; }
.case-meta div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.case-meta dt { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-faint); }
.case-meta dd { margin: 3px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--fg); }
.case-shot { --w: min(1040px, calc(100vw - var(--sidebar-w) - 64px)); width: var(--w); margin: 10px 0 34px calc((100% - var(--w)) / 2); }
@media (max-width: 900px) { .case-shot { --w: calc(100vw - 32px); } }
.case-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 15, 15, .04), 0 8px 28px rgba(15, 15, 15, .07); }
.case-shot figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--fg-soft); text-align: center; }
.case h2 { scroll-margin-top: 64px; }
.case-steps { padding-left: 1.4em; }
.case-steps li { margin: 0 0 8px; padding-left: 2px; }
.case-cards { list-style: none; margin: 6px 0 30px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.case-cards li { margin: 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px; }
.case-cards h3 { margin: 0 0 4px; font-size: 15.5px; line-height: 1.35; }
.case-cards p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--fg-soft); }
.case kbd { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--hover); color: var(--fg); }
.case .case-note { font-size: 13.5px; color: var(--fg-faint); }
.case .case-back { margin-top: 28px; font-size: 14.5px; }
@media (max-width: 700px) {
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-meta div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .case-meta div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case-cards { grid-template-columns: 1fr; }
  .case-shot img { border-radius: 8px; }
}
.case-private { font-size: 11.5px; padding: 1px 6px; border-radius: 4px; background: var(--tag-bg); color: var(--fg-soft); white-space: nowrap; }

/* ---- Writings: "Letters to myself" (src/letters.js) ----
   Two piles of envelopes sitting on the page itself (no panel), Prologue and Chapter 1 side by side, with one
   card-catalog row across both. Envelopes are drawn at 360×225 and scaled to the pile (--k), so nothing
   reflows. Paper and ink are flat colours plus a faint fibre noise; handwriting is Caveat. */
.letters { --desk: #f3f0e8; --paper: #fcfaf4; --paper-2: #f4efe3; --ink: #2d3a5a; --pm: rgba(45, 58, 90, .5); --red: #b2412b; --stamp-p: #46668a; --stamp-c: #a9553a;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --hand: Caveat, "Kaiti TC", "BiauKai", "STKaiti", "Bradley Hand", "Segoe Print", cursive; }
@media (prefers-color-scheme: dark) {
  .letters { --desk: #1e1d1a; --paper: #2c2a26; --paper-2: #34312c; --ink: #c8d3ee; --pm: rgba(200, 211, 238, .45); --red: #e07a62; --stamp-p: #5f7fa3; --stamp-c: #b8664a; }
}
.lt-face { position: absolute; inset: 0; border-radius: 7px; background: var(--paper) var(--noise); border: 1px solid rgba(90, 70, 40, .13); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 1px rgba(40, 30, 10, .05), 0 12px 26px -16px rgba(40, 30, 10, .45); transition: transform .62s var(--spring), box-shadow .3s; overflow: hidden; }
.lt-env.is-top:not(.is-opening):hover .lt-front { box-shadow: 0 1px 1px rgba(40, 30, 10, .05), 0 22px 40px -18px rgba(40, 30, 10, .5); transform: translateY(-8px) rotate(-1deg); }
.lt-back { transform: rotateY(180deg); background-color: var(--paper-2); }
.lt-env.is-opening .lt-front { transform: rotateY(-180deg); }
.lt-env.is-opening .lt-back { transform: rotateY(0); }
.lt-flap { position: absolute; inset: 0 0 auto; height: 56%; background: var(--paper) var(--noise); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .5s var(--spring) .18s; filter: drop-shadow(0 1px 0 rgba(90, 70, 40, .18)); z-index: 2; }
.lt-back::before, .lt-back::after { content: ""; position: absolute; bottom: 0; width: 60%; height: 64%; background: linear-gradient(var(--paper-2), var(--paper-2)); border-top: 1px solid rgba(90, 70, 40, .12); z-index: 3; }
.lt-back::before { left: 0; clip-path: polygon(0 100%, 0 0, 100% 100%); }
.lt-back::after { right: 0; clip-path: polygon(100% 100%, 100% 0, 0 100%); }
.lt-sheet-peek { position: absolute; left: 9%; right: 9%; top: 14%; height: 80%; background: #fffdf8; border-radius: 3px; box-shadow: 0 1px 3px rgba(40, 30, 10, .15); transition: transform .55s var(--spring) .32s; z-index: 1; }
.lt-env.is-opening .lt-flap { transform: rotateX(180deg); z-index: 0; }
.lt-env.is-closing .lt-sheet-peek { transition-delay: 0s; }
.lt-env.is-closing .lt-flap { transition-delay: .12s; }
.lt-env.is-closing .lt-face { transition-delay: .24s; }
.lt-env.is-opening .lt-sheet-peek { transform: translateY(-46%); }
.lt-from { position: absolute; left: 22px; top: 18px; font-size: 11.5px; letter-spacing: .02em; color: var(--fg-faint); }
.lt-stamp { position: absolute; right: 16px; top: 14px; width: 50px; height: 62px; padding: 4px; background: #fdfbf5; transform: rotate(2deg); filter: drop-shadow(0 .5px .5px rgba(60, 45, 20, .25));
  -webkit-mask: radial-gradient(circle, #0000 2px, #000 2.2px) -3.5px -3.5px / 7px 7px round, linear-gradient(#000 0 0) content-box; mask: radial-gradient(circle, #0000 2px, #000 2.2px) -3.5px -3.5px / 7px 7px round, linear-gradient(#000 0 0) content-box; }
.lt-stamp-in { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; background: var(--stamp-c); color: #fbf6ea; box-shadow: inset 0 0 0 2px rgba(255, 250, 235, .35); }
.lt-stamp.lt-p .lt-stamp-in { background: var(--stamp-p); }
.lt-stamp b { font: 600 20px/1 var(--serif); }
.lt-stamp small { margin-top: 4px; font-size: 7px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.lt-postmark { position: absolute; right: 60px; top: 8px; width: 80px; height: 80px; overflow: visible; transform: rotate(-14deg); pointer-events: none; }
.lt-postmark circle, .lt-postmark .lt-wave { fill: none; stroke: var(--pm); stroke-width: 1.4; }
.lt-postmark text { font: 600 10px var(--sans); fill: var(--pm); }
.lt-postmark .lt-pm-top { font-size: 8.5px; letter-spacing: 1px; }
.lt-postmark .lt-pm-big { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.lt-place { flex: none; padding: 3px 8px; white-space: nowrap; border: 1.5px solid var(--red); border-radius: 3px; color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .1em; line-height: 1.35; text-transform: uppercase; transform: rotate(-5deg); opacity: .82; }
.lt-first { position: absolute; left: 24px; right: 30px; top: 92px; font: 600 23px/1.18 var(--hand); color: var(--ink); text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lt-bottom { position: absolute; left: 22px; right: 16px; bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lt-title { min-width: 0; font-size: 14px; font-weight: 650; color: var(--fg); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lt-btn { min-height: 38px; min-width: 40px; padding: 0 14px; border: 1px solid rgba(90, 70, 40, .2); border-radius: 999px; background: var(--paper); color: var(--fg); font: 500 14px var(--sans); cursor: pointer; transition: background-color .15s, transform .4s var(--spring); }
.lt-btn:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
.lt-btn:disabled { opacity: .4; cursor: default; }
.lt-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lt-random { padding: 0 18px; }
.lt-backdrop { position: absolute; inset: 0; background: rgba(243, 240, 232, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lt-label { position: absolute; left: 22px; right: 26px; top: 84px; padding: 8px 12px 10px; background: #fff; border-radius: 2px; transform: rotate(-.6deg); box-shadow: 0 1px 2px rgba(40, 30, 10, .12), 0 0 0 1px rgba(90, 70, 40, .06); }
.lt-label-src { display: block; margin-bottom: 3px; font: 600 9.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }
.lt-first.lt-typed { position: static; font: 15px/1.45 "American Typewriter", "Courier Prime", "Courier New", var(--mono); color: #2e2c28; -webkit-line-clamp: 2; }
.lt-stamp.lt-o .lt-stamp-in { background: #6b7a4b; }
.p-index { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.p-index li { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.p-date { color: var(--fg-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.p-title { color: var(--fg); font-weight: 500; text-decoration: none; }
.p-title:hover { text-decoration: underline; }
.p-src { display: flex; gap: 10px; font-size: 13px; }
.p-src a { color: var(--fg-faint); text-decoration: none; }
.p-src a:hover { color: var(--fg); text-decoration: underline; }

.lt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.lt-head > div { flex: 1 1 360px; }
.lt-head .w-blurb { max-width: 56ch; margin-bottom: 0; }
.lt-random { flex: none; margin-bottom: 2px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--fg-soft); font: 500 14px var(--sans); cursor: pointer; transition: background-color .15s, color .15s; }
.lt-random:hover { background: var(--hover); color: var(--fg); }
.lt-random:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* The desk is the page: no background, border or padding of its own. One pile in focus in the middle;
   the other small on its side of the timeline (Prologue left, Chapter 1 right), one click from the middle. */
.lt-desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px) minmax(0, 1fr); align-items: center; column-gap: 20px; margin-top: 22px; overflow-x: clip; overflow-clip-margin: 18px; } /* a letter put away never widens the page */
.lt-pile { container-type: inline-size; position: relative; grid-row: 1; min-width: 0; scroll-margin-top: 72px; }
.lt-pile.is-focus { --ew: min(360px, calc(100cqw - 22px)); grid-column: 2; z-index: 1; }
.lt-pile.is-side { --ew: min(148px, calc(100cqw - 10px)); align-self: center; }
.lt-pile[data-side="left"] { grid-column: 1; }
.lt-pile[data-side="right"] { grid-column: 3; }
.lt-tab { margin: 0 0 14px; padding: 0; font-size: 13px; color: var(--fg-faint); font-variant-numeric: tabular-nums; text-align: center; }
.lt-tab span { font: 600 21px/1 var(--hand); color: var(--ink); margin-right: 4px; }
.lt-tab em { font-style: normal; }
.lt-pile.is-focus .lt-tab em::before { content: " · "; }
.lt-pile.is-side .lt-tab em { display: block; }
.lt-pile.is-side .lt-tab { margin-bottom: 8px; font-size: 12px; line-height: 1.35; transition: color .2s; }
.lt-pile.is-side .lt-tab span { display: block; margin: 0 0 3px; font-size: 18px; color: var(--fg-soft); transition: color .2s; }
.lt-stack { position: relative; z-index: 0; isolation: isolate; height: calc(var(--ew) / 1.6 + 22px); touch-action: pan-y; }
.lt-pile.is-side .lt-stack { pointer-events: none; transition: transform .35s var(--spring); }
.lt-pile.is-side:hover .lt-stack { transform: translateY(-3px); }
.lt-pile.is-side:hover .lt-tab, .lt-pile.is-side:hover .lt-tab span { color: var(--fg); }
.lt-pick { position: absolute; inset: -8px; z-index: 2; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.lt-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.lt-env { position: absolute; left: calc(50% - var(--ew) / 2); top: 2px; width: var(--ew); aspect-ratio: 1.6; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent; touch-action: pan-y; perspective: 1400px; }
.lt-scale { position: absolute; left: 0; top: 0; width: 360px; height: 225px; transform: scale(var(--k, 1)); transform-origin: 0 0; }
.lt-env.is-top { cursor: grab; }
.lt-env.is-top:active { cursor: grabbing; }
.lt-env:focus-visible { outline: none; }
.lt-env:focus-visible .lt-front { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.lt-pile.is-side .lt-env.is-top .lt-front { box-shadow: 0 1px 1px rgba(40, 30, 10, .05), 0 8px 20px -16px rgba(40, 30, 10, .4); }
/* Under the pile in focus: one letter back, where you are, one letter on. */
.lt-controls { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.lt-step { flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--fg); font: 400 18px/1 var(--sans); cursor: pointer; transition: background-color .15s, opacity .15s; }
.lt-step:hover:not(:disabled) { background: var(--hover); }
.lt-step:disabled { opacity: .3; cursor: default; }
.lt-step:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lt-now { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 260px; min-width: 0; text-align: center; font-size: 13px; color: var(--fg-soft); font-variant-numeric: tabular-nums; }
.lt-now b { font-size: 14px; font-weight: 600; color: var(--fg); }
.lt-now span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The timeline under the pile: one mark per letter, oldest to newest. Press or drag along it to jump. */
.lt-catalog { grid-column: 1 / -1; grid-row: 3; position: relative; margin: 16px 0 0; padding: 6px 2px 0; border-radius: 8px; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; }
.lt-catalog:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.lt-edges { display: flex; align-items: flex-end; justify-content: space-between; height: 28px; border-bottom: 1px solid var(--line-strong); }
.lt-edge { flex: 0 0 2px; height: 10px; border-radius: 1px 1px 0 0; background: rgba(90, 70, 40, .3); transition: height .45s var(--spring), background-color .2s; }
.lt-edge.era-start { margin-left: 14px; }
.lt-edge.is-n2 { height: 14px; }
.lt-edge.is-n1 { height: 19px; }
.lt-edge.is-top { height: 22px; background: rgba(45, 58, 90, .45); flex-basis: 3px; }
.lt-edge.is-cur { height: 28px; background: var(--ink); flex-basis: 3px; }
.lt-catalog:hover .lt-edge:not(.is-cur):not(.is-top) { background-color: rgba(90, 70, 40, .45); }
.lt-years { position: relative; height: 18px; margin-top: 5px; }
.lt-years span { position: absolute; top: 0; font-size: 12px; color: var(--fg-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Pile / List */
.lt-tools { display: flex; flex: none; align-items: center; gap: 10px; margin-bottom: 2px; }
.lt-tools .lt-random { margin-bottom: 0; }
.lt-view { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 999px; }
.lt-view button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--fg-soft); font: 500 14px var(--sans); cursor: pointer; transition: background-color .15s, color .15s; }
.lt-view button:hover { color: var(--fg); }
.lt-view button[aria-pressed="true"] { background: var(--hover); color: var(--fg); }
.lt-view button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.lt-list { margin-top: 8px; }
.w-sub-span { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
::view-transition-group(*) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2, .8, .25, 1); }
/* The open letter: the page itself (same markup and type as /writings/<slug>), opening out of the envelope. */
.lt-reader { --hand: Caveat, "Kaiti TC", "BiauKai", "STKaiti", "Bradley Hand", "Segoe Print", cursive; --ink: #2d3a5a;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
.lt-reader[hidden] { display: none; }
.lt-reader.is-closing { pointer-events: none; }
.lt-reader:focus { outline: none; }
.lt-r-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px 0 14px; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color .2s; }
.lt-reader.is-scrolled .lt-r-bar { border-bottom-color: var(--line); }
.lt-r-back { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--fg-soft); font: 500 14px var(--sans); cursor: pointer; }
.lt-r-back:hover { background: var(--hover); color: var(--fg); }
.lt-r-crumb { min-width: 0; flex: 1; font-size: 14px; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.lt-reader.is-scrolled .lt-r-crumb { opacity: 1; }
.lt-r-nav { display: flex; gap: 2px; margin-left: auto; }
.lt-r-btn { width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--fg-soft); font: 400 17px/1 var(--sans); cursor: pointer; }
.lt-r-btn:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
.lt-r-btn:disabled { opacity: .3; cursor: default; }
.lt-r-back:focus-visible, .lt-r-btn:focus-visible, .lt-r-turns a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* A little paper at the top: the letter moment, before the plain page. */
.lt-r-paper { position: absolute; top: 0; left: 0; right: 0; height: 260px; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(247, 242, 230, .9), rgba(247, 242, 230, 0)), var(--noise); -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.lt-r-page { position: relative; z-index: 1; }
.lt-r-page .page-head { padding-top: 40px; }
.lt-r-hand { margin: 0 0 14px; font: 600 24px/1.1 var(--hand); color: var(--ink); }
.lt-r-hand span { font-size: 19px; color: var(--fg-faint); }
.lt-r-text h3 { margin: 1.6em 0 .5em; font: 600 1.2em/1.35 var(--serif); }
.lt-r-text h4 { margin: 1.4em 0 .4em; font: 600 1em/1.4 var(--serif); }
.lt-r-text blockquote { margin: 1.2em 0; padding-left: 1em; border-left: 3px solid var(--line-strong); color: var(--fg-soft); }
.lt-r-text ul, .lt-r-text ol { padding-left: 1.3em; }
.lt-r-text img { display: block; max-width: 100%; height: auto; margin: 1.2em auto; border-radius: 4px; }
.lt-r-text figure { margin: 1.4em 0; }
.lt-r-text figcaption { margin-top: -.5em; font: 13.5px/1.5 var(--sans); color: var(--fg-faint); text-align: center; }
.lt-r-text a { color: var(--blue); }
.lt-r-sign, .lt-r-also { max-width: 680px; margin: 0 auto; padding: 0 24px; }
.lt-r-sign { text-align: right; font: 600 24px/1 var(--hand); color: var(--ink); }
.lt-r-also { font-size: 15px; color: var(--fg-soft); }
.lt-r-also a { color: var(--blue); }
.lt-r-turns a { color: var(--fg); }
.lt-loading { display: grid; gap: 14px; padding-top: 6px; }
.lt-loading span { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--hover), var(--line-strong), var(--hover)) 0 0 / 200% 100%; animation: lt-shimmer 1.2s linear infinite; }
.lt-loading span:nth-child(2) { width: 92%; } .lt-loading span:nth-child(3) { width: 70%; }
@keyframes lt-shimmer { to { background-position: -200% 0; } }
html.lt-reading { overflow: hidden; }
@media (prefers-color-scheme: dark) {
  .lt-reader { --ink: #c8d3ee; }
  .lt-r-paper { background: linear-gradient(to bottom, rgba(52, 49, 44, .7), rgba(52, 49, 44, 0)); }
  .lt-label { background: #34312c; }
  .lt-first.lt-typed { color: rgba(255, 255, 255, .84); }
}
@media (max-width: 640px) {
  /* The other pile shrinks to a small stack in the corner, beside the name of the one in focus. */
  .lt-desk { grid-template-columns: minmax(0, 1fr); position: relative; margin-top: 16px; }
  .lt-pile.is-focus { --ew: min(360px, calc(100cqw - 8px)); grid-column: 1; }
  .lt-pile.is-focus .lt-tab { min-height: 72px; padding-right: 160px; text-align: left; }
  .lt-pile.is-focus .lt-tab span { display: block; margin-bottom: 3px; }
  .lt-pile.is-side { --ew: 60px; position: absolute; top: 0; right: 0; width: 156px; display: flex; align-items: flex-start; gap: 10px; }
  .lt-pile.is-side .lt-stack { flex: 0 0 66px; height: 62px; }
  .lt-pile.is-side .lt-tab { flex: 1; margin: 0; text-align: right; }
  .lt-pile.is-side .lt-tab span { font-size: 17px; }
  .lt-controls { gap: 10px; }
  .lt-step { width: 44px; height: 44px; }
  .lt-now { width: auto; flex: 1; }
  .lt-view button { min-height: 38px; }
  .lt-edge.era-start { margin-left: 8px; }
  .lt-catalog { margin-top: 12px; }
  .lt-r-bar { padding: 0 6px 0 8px; }
  .lt-r-btn { width: 44px; height: 44px; }
  .lt-r-back { height: 44px; }
  .lt-r-page .page-head { padding-top: 24px; }
  .lt-r-sign, .lt-r-also { padding: 0 18px; }
  .p-index li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .p-date { grid-column: 1 / -1; }
}
@media (pointer: coarse), (max-width: 640px) { .lt-random { min-height: 44px; padding: 0 16px; } }
@media (prefers-reduced-motion: reduce) {
  .lt-face, .lt-flap, .lt-sheet-peek, .lt-r-crumb, .lt-pile.is-side .lt-stack, .lt-edge { transition: none; }
  .lt-loading span { animation: none; }
  .lt-env.is-top:not(.is-opening):hover .lt-front { transform: none; }
}

.w-sub { margin-top: 18px; }
.w-sub-title { margin: 0 0 6px; font-size: 16px; font-weight: 650; color: var(--fg); }
/* The home page's Vibecode Playground toggle: the same compact cards, inside the toggle. */
.hb-in { margin: 10px 0 14px; }
.hb-in .hb-head { margin-bottom: 12px; }
.hb-in .hb-head p { margin: 0; padding: 0; color: var(--fg-soft); font-size: 15px; }
@media (max-width: 640px) { .hb-in .hb-cards { margin-left: calc(-.9em - 18px); padding-left: calc(.9em + 18px); scroll-padding-left: calc(.9em + 18px); } }
/* Playground: older work, moved from the home page. Kept to a readable width on the full-width page. */
.pg-earlier { max-width: 900px; }
.pg-earlier .nh3 { margin-top: 1.6em; }
.playground .pg-earlier a { color: var(--blue); }
/* Image viewer (site.js): full screen, click anywhere to close. */
.lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; cursor: zoom-out; }
.lb[open] { display: flex; align-items: center; justify-content: center; }
.lb::backdrop { background: rgba(12, 12, 12, .88); }
.lb-fig { margin: 0; padding: 56px 20px 24px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-fig img { display: block; max-width: min(100%, 1600px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.lb-fig figcaption { color: rgba(255, 255, 255, .8); font-size: 14px; text-align: center; max-width: 70ch; }
.lb-x { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.lb-x:hover { background: rgba(255, 255, 255, .24); }
.lb-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-open { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .lb[open] .lb-fig { animation: lb-in .18s ease-out; } }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
.case-try { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 22px; }
.case-try a { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--fg); color: var(--bg); font-weight: 650; font-size: 15px; text-decoration: none; transition: opacity .15s; }
.case-try a:hover { opacity: .88; }
.case-try span { color: var(--fg-soft); font-size: 14px; }

/* GIFs play as silent looping videos; keep tall phone recordings from filling the screen */
video.gifv { display: block; width: auto; max-width: 100%; height: auto; max-height: min(640px, 72vh); margin: 0 auto; }
@media (max-width: 720px) { video.gifv { max-height: 60vh; } }
