@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(assets/inter-latin.woff2) format('woff2'); }

/* ---------- tokens ---------- */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a; --fg: #fafafa; --muted: #a1a1a1; --faint: #6b6b6b; --line: rgba(255, 255, 255, 0.1); --hover: rgba(255, 255, 255, 0.05);
  --card: #111111;
  --card-solid: #141414; --rim: rgba(255, 255, 255, 0.09); --rim-top: rgba(255, 255, 255, 0.16);
  --glass: rgba(22, 22, 24, 0.55); --glass-line: rgba(255, 255, 255, 0.14); --glare: rgba(255, 255, 255, 0.09);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.8); --code-bg: rgba(255, 255, 255, 0.04);
  --accent: #60a5fa; --green: #4ade80; --blue: #60a5fa; --amber: #fbbf24; --purple: #c084fc; --rose: #fb7185; --red: #f87171;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f4; --fg: #0a0a0a; --muted: #6b6b6b; --faint: #a3a3a3; --line: rgba(0, 0, 0, 0.09); --hover: rgba(0, 0, 0, 0.035);
  --card: #ffffff;
  --card-solid: #ffffff; --rim: rgba(0, 0, 0, 0.07); --rim-top: rgba(255, 255, 255, 1);
  --glass: rgba(250, 250, 249, 0.62); --glass-line: rgba(255, 255, 255, 0.9); --glare: rgba(255, 255, 255, 0.6);
  --shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.25); --code-bg: rgba(0, 0, 0, 0.035);
  --accent: #2563eb; --green: #16a34a; --blue: #2563eb; --amber: #d97706; --purple: #9333ea; --rose: #e11d48; --red: #dc2626;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; transition: background 0.3s; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; font: 400 15px/1.6 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.icon { display: inline-flex; width: 1em; height: 1em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.wrap { width: min(1024px, 100%); margin: 0 auto; padding: 0 24px; }
.label { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- glass ---------- */
/* Card: a pane with a lit top edge. .shine adds a specular highlight that follows the pointer. */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
a.card, button.card { transition: border-color 0.25s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
a.card:hover, button.card:hover { border-color: color-mix(in srgb, var(--fg) 22%, transparent); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 18px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.pill.frost { color: #fff; background: rgba(0, 0, 0, 0.55); border-color: transparent; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-shipped { color: var(--green); }
.st-in-progress, .st-active { color: var(--blue); }
.st-paused { color: var(--amber); }
/* AI disclosure: monochrome so it reads the same in every theme. Generated is solid, assisted is outlined. */
.pill.ai { gap: 4px; font-weight: 500; color: var(--fg); border-color: color-mix(in srgb, var(--fg) 35%, transparent); }
.pill.ai-generated { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ai-note { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--muted); border: 1px solid var(--line); }
.ai-note b { color: var(--fg); font-weight: 600; white-space: nowrap; }
.ai-note .icon { flex: none; color: var(--fg); transform: translateY(1px); }
.ai-note.ai-generated { background: var(--hover); border-color: color-mix(in srgb, var(--fg) 35%, transparent); }
.tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--hover); border: 1px solid var(--line); color: color-mix(in srgb, var(--fg) 80%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: all 0.2s; }
.chips button:hover { color: var(--fg); border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.chips button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chips button span { opacity: 0.55; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-head { position: relative; z-index: 30; }
.slim { position: fixed; top: 0; left: 0; right: 0; z-index: 31; border-bottom: 1px solid var(--line); transform: translateY(-100%); transition: transform 0.25s ease;
  background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.slim.on { transform: none; }
.slim .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.slim .me { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.slim .me img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-top: 22px; padding-bottom: 14px; }
.who-mini { display: flex; flex-direction: column; gap: 4px; }
.who-mini a { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.who-mini img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.who-mini small { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.who-text { font-size: 14px; line-height: 1.35; }
.who-text span { display: block; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav nav { display: flex; gap: 20px; }
.nav nav a { font-size: 14px; letter-spacing: 0.02em; color: var(--muted); transition: color 0.2s; }
.nav nav a:hover { color: var(--fg); }
.nav nav a[aria-current] { color: var(--fg); font-weight: 500; text-decoration: underline; text-underline-offset: 5px; }
.theme { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.theme:hover { color: var(--fg); }
/* Menu: phones only. A sheet of the site's pages as rows, each with its colour. */
.menu-btn { display: none; }
.mn-me { display: flex; align-items: center; gap: 12px; margin: 8px 16px 14px; padding: 12px 16px; border-radius: 14px; background: var(--bg); }
.mn-me img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mn-me > span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.mn-me b { font-size: 16px; font-weight: 600; }
.mn-me small { font-size: 12px; color: var(--muted); }
.mn-me > .icon, .mn-row > .icon { color: var(--faint); font-size: 18px; }
.mn-me[aria-current] > .icon, .mn-row[aria-current] > .icon { color: var(--fg); }
.mn-list { overflow: hidden; }
.mn-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 16px; font-size: 15px; font-weight: 500; }
.mn-row + .mn-row { border-top: 1px solid var(--line); }
.mn-row > span:not(.mn-badge) { flex: 1; }
a.mn-row:active { background: var(--hover); }
.mn-badge { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; font-size: 18px;
  color: var(--type, var(--fg)); background: color-mix(in srgb, var(--type, var(--fg)) 16%, transparent); }
.mn-switch { position: relative; width: 50px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background 0.2s; }
.mn-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mn-switch[aria-checked="true"] { background: var(--accent); }
.mn-switch[aria-checked="true"]::after { transform: translateX(20px); }
.site-head.home .who-mini { display: none; }
.site-head:not(.home) .who-text { display: none; }

/* Home intro: photo and name */
.intro { padding-top: 18px; }
.namerow { display: flex; align-items: stretch; gap: 22px; }
.avatar { position: relative; width: 224px; height: 224px; flex: none; border-radius: 8px; overflow: hidden; cursor: grab; transform: perspective(600px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.avatar::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.06), transparent 65%); }
.avatar:hover::after { opacity: 1; }
.name { display: flex; flex-direction: column; justify-content: center; }
.intro h1 { margin: 0; font-size: clamp(56px, 10.5vw, 96px); line-height: 0.98; font-weight: 700; letter-spacing: -0.03em; text-transform: uppercase; }
.bio { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.intro { margin-bottom: 40px; }

/* Tabs */
.tabs { display: flex; gap: 24px; margin: 36px 0 40px; border-bottom: 1px solid var(--line); }
.tabs button, .tabs a { padding: 0 0 10px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs [aria-current] { color: var(--fg); font-weight: 500; border-color: var(--fg); }
.block { margin-bottom: 48px; }
.block > .label { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--faint); }
.block { margin-bottom: 40px; }

main { flex: 1; padding-bottom: 72px; }
html.in-room main { padding-bottom: 0; }
.room { --room-top: 40px; }
html.lb-open .slim { visibility: hidden; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 44px 0 36px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(44px, 7vw, 64px); line-height: 1; letter-spacing: -0.04em; font-weight: 700; }
.page-head p { margin: 14px 0 0; max-width: 460px; color: var(--muted); }
.stats { display: flex; gap: 6px; padding: 6px; border-radius: 14px; }
.stats div { padding: 8px 14px; border-radius: 10px; min-width: 76px; }
.stats div + div { border-left: 1px solid var(--line); border-radius: 0; }
.stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid.square > * { aspect-ratio: 1; }
.tile { display: flex; flex-direction: column; min-height: 100%; transform: perspective(700px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); }
.tile:hover { z-index: 2; }

/* Project tile */
.t-project { padding: 16px; gap: 8px; }
.t-project .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.t-project h3 { margin: 4px 0 0; font-size: 15.5px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.t-project .desc { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.t-project .created { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.t-project .latest { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); min-width: 0; }
.t-project .latest b { color: color-mix(in srgb, var(--fg) 85%, transparent); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-project .when { margin-left: auto; white-space: nowrap; }
.t-project .row-end { display: flex; align-items: center; gap: 8px; }
.t-project .pin { color: var(--muted); font-size: 14px; display: inline-flex; }
.t-project .ext { display: flex; gap: 8px; color: var(--muted); font-size: 14px; }
.t-project .ext a:hover { color: var(--fg); }
.k-software { --kind: var(--purple); } .k-music { --kind: var(--green); } .k-portfolio { --kind: var(--blue); }
.k-fitness { --kind: var(--amber); } .k-creative { --kind: var(--rose); } .k-other { --kind: var(--muted); }

/* Album tile */
.t-album { padding: 0; overflow: hidden; }
.t-album .photos { position: absolute; inset: 0; }
.t-album .photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease, transform 6s ease; }
.t-album .photos img.on { opacity: 1; }
.t-album:hover .photos img.on { transform: scale(1.05); }
.t-album .count { position: absolute; top: 10px; right: 10px; }
.t-album .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); }
.t-album .cap b { display: block; font-size: 15px; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; opacity: 0.8; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }

/* Blog tile: the project tile with a cover image */
.t-blog { padding: 16px; gap: 8px; }
.t-blog .media { aspect-ratio: 16 / 9; margin-bottom: 4px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--hover); }
.t-blog .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-blog .row { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.t-blog h3 { margin: 4px 0 0; font-size: 15.5px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.t-blog .desc { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.t-blog .latest { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.t-blog .latest b { color: color-mix(in srgb, var(--fg) 85%, transparent); font-weight: 400; }
.t-blog .when { margin-left: auto; white-space: nowrap; }

/* ---------- feed ---------- */
.fd-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--type, var(--faint)); flex: none; }
.ty-post { --type: color-mix(in srgb, var(--fg) 30%, transparent); } .ty-project { --type: var(--purple); } .ty-blog { --type: var(--blue); }
.ty-roomlog { --type: var(--amber); } .ty-review { --type: var(--rose); } .ty-album { --type: var(--green); }
.fd-chips { position: sticky; top: 0; z-index: 6; display: flex; gap: 6px; height: 52px; align-items: center; margin: 0 -24px; padding: 0 24px; background: var(--bg); transition: top 0.25s ease; }
html.slim-on .fd-chips { top: 52px; }
.fd-chips button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid transparent; background: none; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.fd-chips button:hover { color: var(--fg); }
.fd-chips button[aria-pressed="true"] { color: var(--fg); background: var(--hover); border-color: var(--line); }
.fd .rv-head { top: 52px; padding-top: 12px; }
html.slim-on .fd .rv-head { top: 104px; }
.rv .rv-sub { display: block; }
.rv-sub .fd-dot { margin-right: 6px; vertical-align: 1px; }
.fd-trail { flex: none; min-width: 44px; text-align: right; font-size: 13px; color: var(--faint); }
a.rv { color: inherit; }
.fd-post .rv-av img { border-radius: 9px; }
.fd-thought { font-size: 15px; color: var(--fg); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fd-post.open .fd-thought { -webkit-line-clamp: unset; display: block; }
.fd-url { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.fd-url:hover { color: var(--fg); }

/* Activity preview and page */
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.block-head .label { margin: 0; color: var(--faint); }
.see-all { font-size: 13px; color: var(--muted); }
.see-all:hover { color: var(--fg); }
.fd > .rv-search { width: 100%; max-width: 360px; margin-bottom: 4px; }

/* At a glance */
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gl { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-width: 0; transition: background 0.2s; }
.gl:hover { background: color-mix(in srgb, var(--card) 85%, var(--fg)); }
.gl-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.gl b { margin-top: 6px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-stat { margin-left: auto; color: var(--faint); white-space: nowrap; }
.gl-cap { font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sheet extras */
.sh-entry { padding: 14px 16px; }
.sh-entry + .sh-entry { border-top: 1px solid var(--line); }
.sh-entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sh-entry-top span { flex: none; font-size: 12px; color: var(--faint); }
.sh-entry b { font-weight: 600; } .sh-entry p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.sh-btn { display: flex; align-items: center; justify-content: center; height: 44px; margin: 12px 16px 0; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500; }
.sh-btn:hover { opacity: 0.9; }

/* ---------- reviews ---------- */
.rv-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.rv-search { display: flex; align-items: center; gap: 8px; width: 220px; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--faint); }
.rv-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 13px; color: var(--fg); }
.rv-search input::placeholder { color: var(--faint); }
.rv-search .icon { font-size: 16px; }
.rv-tools .chips button { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.rv-sort { position: relative; display: inline-flex; align-items: center; margin-left: auto; color: var(--muted); }
.rv-sort select { appearance: none; border: 0; background: none; padding: 6px 22px 6px 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.rv-sort select option { background: var(--card); color: var(--fg); }
.rv-sort .icon { position: absolute; right: 4px; pointer-events: none; font-size: 13px; }
.rv-group + .rv-group { margin-top: 8px; }
.rv-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: baseline; padding: 20px 4px 8px; background: var(--bg); font-size: 13px; transition: top 0.25s ease; }
html.slim-on .rv-head { top: 52px; }
/* Sticky bars carry no background. Once stuck, they sit on one sheet of glass with the slim header (.bar-glass). */
.fd-chips, .rv-head { --glass: 1; background: none; }
.bar-glass { position: fixed; top: 0; left: 0; right: 0; z-index: 4; pointer-events: none; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html.glass-on .slim { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent; }
.rv-head b { font-weight: 600; }
.rv-head span { color: var(--faint); font-variant-numeric: tabular-nums; }
.rv-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px; }
.rv { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.rv:hover { background: var(--hover); }
.rv:active { background: color-mix(in srgb, var(--fg) 10%, transparent); }
.rv:focus-visible { outline: 2px solid color-mix(in srgb, var(--fg) 40%, transparent); outline-offset: -2px; }
.rv-av { position: relative; flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--hover); border: 1px solid var(--line); }
.rv-av img { width: 40px; height: 40px; object-fit: cover; object-position: top; border-radius: 9px; }
.rv-av b { font-size: 15px; font-weight: 600; color: var(--muted); }
.rv-av.big { width: 64px; height: 64px; border-radius: 16px; } .rv-av.big img { width: 64px; height: 64px; } .rv-av.big b { font-size: 24px; }
.src-letterboxd { --s: var(--green); } .src-google { --s: var(--blue); } .src-myanimelist { --s: color-mix(in srgb, var(--blue) 70%, transparent); }
.rv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-line1 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.rv-title { font-size: 15px; font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-meta { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--faint); }
.rv-meta .icon { font-size: 12px; }
.rv-source { margin-right: 4px; }
.rv-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-body { color: var(--faint); }
.rv-score { flex: none; min-width: 44px; text-align: right; font-size: 15px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.rv-score small { font-size: 12px; font-weight: 400; color: var(--faint); }
.rv-score.top { color: var(--green); }

/* Detail sheet */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s; }
.modal.on { opacity: 1; }
.sheet { position: relative; width: min(440px, 100%); max-height: calc(100svh - 48px); overflow: auto; padding-bottom: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  transform: translateY(8px); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.on .sheet { transform: none; }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--hover); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
html.modal-open { overflow: hidden; }
.sh-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; text-align: center; }
.sh-poster { width: 96px; height: 144px; object-fit: cover; border-radius: 12px; }
.sh-score { margin-top: 10px; } .sh-score .rv-score { min-width: 0; font-size: 40px; letter-spacing: -0.02em; } .sh-score small { font-size: 16px; }
.sh-top h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sh-top p { margin: 0; font-size: 13px; color: var(--muted); }
.sh-card { margin: 0 16px 10px; border-radius: 14px; background: var(--bg); }
.sh-body { padding: 16px; font-size: 15px; line-height: 1.6; white-space: pre-line; }
.sh-kv, .sh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; font-size: 14px; }
.sh-kv + .sh-kv, .sh-row + .sh-row { border-top: 1px solid var(--line); }
.sh-kv span:first-child { color: var(--muted); }
.sh-kv span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.rv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s); }
.sh-row { justify-content: flex-start; }
.sh-row img, .sh-thumb { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: var(--hover); }
.sh-row > span:not(.icon) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.sh-row small { font-size: 11px; color: var(--muted); }
.sh-row .icon { color: var(--faint); }
.sh-row:hover { background: var(--hover); }
.sh-links { overflow: hidden; }

/* ---------- albums ---------- */
.al-list { display: flex; flex-direction: column; gap: 14px; }
.al-row { display: block; padding: 12px; }
.al-row .strip { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.al-row .strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; transition: filter 0.3s; }
.al-row:hover .strip img { filter: brightness(1.06); }
.al-row .count { position: absolute; top: 10px; right: 10px; }
.al-row .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 4px 4px; }
.al-row h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.02em; }
.al-row .meta { color: var(--muted); opacity: 1; font-size: 13px; }
.al-row .go { color: var(--muted); font-size: 18px; transition: transform 0.3s, color 0.3s; }
.al-row:hover .go { transform: translateX(4px); color: var(--fg); }
.al-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.al-photos button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.al-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.al-photos button:hover img { transform: scale(1.03); }
.al-photos button:first-child { grid-column: span 2; grid-row: span 2; }
.al-photos button:first-child img { height: 100%; aspect-ratio: auto; }
.lb-links { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.lb-links a { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2); }

/* ---------- articles ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 24px; font-size: 13px; color: var(--muted); }
.crumb:hover { color: var(--fg); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 48px; }
.post-layout .cover { width: 100%; border-radius: 14px; border: 1px solid var(--rim); margin-bottom: 24px; display: block; }
.post-layout h1 { margin: 12px 0 14px; font-size: clamp(32px, 4.5vw, 40px); line-height: 1.12; letter-spacing: -0.03em; }
.lede { margin: 0; font-size: 15px; color: var(--muted); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose { color: color-mix(in srgb, var(--fg) 82%, transparent); }
.prose h2, .prose h3 { color: var(--fg); scroll-margin-top: 90px; }
.toc { position: sticky; top: 96px; align-self: start; }
.toc .label { margin-bottom: 14px; display: block; }
.toc a { display: block; padding: 5px 0 5px 12px; font-size: 12.5px; color: var(--faint); border-left: 1px solid var(--line); cursor: pointer; }
.toc a.on { color: var(--fg); border-color: var(--fg); }
.foot-links { margin-top: 48px; }

/* Project detail */
.proj { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 48px; margin-top: 28px; }
.proj aside { position: sticky; top: 96px; align-self: start; }
.proj aside h2 { margin: 0 0 8px; font-size: 15px; }
.proj aside .pills { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 16px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.proj aside nav { display: flex; flex-direction: column; gap: 2px; }
.proj aside nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; color: var(--muted); }
.proj aside nav a:hover { color: var(--fg); background: var(--hover); }
.proj aside nav a[aria-current] { color: var(--fg); background: var(--hover); }
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.proj-head h1 { margin: 0; font-size: clamp(32px, 4.5vw, 40px); line-height: 1.1; letter-spacing: -0.03em; }
.btns { display: flex; gap: 8px; flex: none; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; font-size: 13px; border: 1px solid var(--line); color: var(--muted); }
.btn:hover { color: var(--fg); background: var(--hover); }
.btn.solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.proj .lede { margin-top: 12px; max-width: 620px; }
.proj .tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.proj .dates { margin-top: 14px; font-size: 12.5px; color: var(--faint); display: flex; gap: 10px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--fg); }
.timeline .top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.timeline b { display: block; font-weight: 600; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.status-filter { display: flex; gap: 4px; }
.status-filter button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 0; border-radius: 6px; background: none; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.status-filter button b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.status-filter button:hover { background: var(--hover); }
.status-filter button[aria-pressed="true"] { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.status-filter .dot { color: inherit; }
.status-filter .st-in-progress .dot { background: var(--blue); } .status-filter .st-shipped .dot { background: var(--green); }
.status-filter .st-paused .dot { background: var(--amber); } .status-filter .st-archived .dot { background: var(--faint); }
.status-filter button[class] { color: var(--muted); }
.read-total { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.read-total b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
/* Projects page groups */
.group { margin-top: 40px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.group-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.group-head span { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid.auto > * { min-height: 300px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 22px 0; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.site-foot nav { display: flex; gap: 16px; }
.site-foot a:hover { color: var(--fg); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 900px) {
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Contents become a sticky row of section pills above the article. */
  .post-layout { display: flex; flex-direction: column; gap: 0; }
  .toc { order: -1; align-self: stretch; top: 0; z-index: 6; display: flex; gap: 6px; height: 52px; align-items: center; margin: 0 -24px 8px; padding: 0 24px;
    --glass: 1; background: none; overflow-x: auto; scrollbar-width: none; transition: top 0.25s ease; }
  html.slim-on .toc { top: 52px; }
  .toc .label { display: none; }
  .toc a { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .toc a.on { color: var(--fg); background: var(--hover); border-color: var(--line); }
  .post-layout .prose h2 { scroll-margin-top: 120px; }
  .proj { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .proj aside { position: static; }
  .proj aside nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .proj aside nav a { flex: none; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .slim .wrap { gap: 12px; }
  .toc { margin: 0 -16px 8px; padding: 0 16px; }
  .fd-chips { margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .fd .rv-body { display: none; }
  .fd .rv-title { white-space: nowrap; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gl b { font-size: 16px; }
  .gl-label { flex-wrap: wrap; }
  /* One card at a time, centred, its neighbours just showing at the edges. */
  .grid.pins { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 24px; scroll-padding: 0 24px; }
  .grid.pins > * { flex: 0 0 calc(100vw - 48px); min-width: 0; scroll-snap-align: center; aspect-ratio: auto; min-height: 300px; }
    .rv-search { width: 100%; order: -1; }
  .rv-source { display: none; }
  .rv-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; }
  .rv-sort { margin-left: 0; }
  /* Bottom sheets run 80px past the screen's edge, so browser toolbars and rounding never leave a gap below them. */
  .modal { place-items: end stretch; padding: 0; bottom: -80px; }
  .sheet { width: 100%; max-height: calc(92dvh + 80px); border-radius: 20px 20px 0 0; border-bottom: 0; transform: translateY(40px); padding-top: 14px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .sheet::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line); }
  .al-row .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding: 0 16px; }
  .bar { align-items: center; gap: 12px; padding-top: 16px; }
  .nav { gap: 8px; }
  .nav nav { display: none; }
  .menu-btn { display: grid; }
  .nav .theme:not(.menu-btn) { display: none; }
  .avatar { width: 108px; height: 108px; }
  .bio { margin-top: 8px; }
  .intro h1 { font-size: 9vw; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid.square > * { aspect-ratio: 4 / 3.4; }
  .al-photos { grid-template-columns: repeat(2, 1fr); }
  .proj-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01s !important; } }
.mn-row.ty-post { --type: var(--muted); }
/* The menu closes by swipe, backdrop or a row; it needs no close button. */
.sheet:has(.mn-me) .x { display: none; }
