/* LevenST blog — site stylesheet.
   Warm paper, ink and a single vermilion accent. The home page borrows a visual novel's text window;
   its ▼ "next" marker is the site's one recurring ornament.
   Sections: tokens · base · header & footer · page furniture · dialogue · lists · pages · post · prose ·
             code · math & extras · search · overlays · responsive · motion & print */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f6f4ee;
  --bg-raised: #fbfaf6;
  --bg-soft: #efece4;
  --bg-hover: #ebe7dd;
  --fg: #1d1b17;
  --fg-body: #35322b;
  --muted: #6f695f;
  --faint: #9a9386;
  --line: #e3ded3;
  --line-strong: #d1cbbd;
  --accent: #b33a22;
  --accent-hover: #922d18;
  --accent-soft: rgb(179 58 34 / 0.07);
  --accent-line: rgb(179 58 34 / 0.32);
  --selection: rgb(179 58 34 / 0.16);
  --ok: #3d7a38;
  --ok-soft: rgb(61 122 56 / 0.1);
  --ok-fg: #2f6a2b;
  --mark: rgb(230 168 50 / 0.32);
  --header-bg: rgb(246 244 238 / 0.88);
  --code-bg: #f0ece3;
  --code-border: #e4dfd3;
  --code-fg: #2b2823;
  --code-inline-bg: rgb(29 27 23 / 0.065);
  --code-inline-fg: #3a352d;
  --hl-comment: #8e8779;
  --hl-keyword: #a3361f;
  --hl-string: #4d7526;
  --hl-number: #2c5d9a;
  --hl-function: #6c45a3;
  --hl-type: #8a5a0c;
  --hl-tag: #1d6676;
  --hl-attr: #8a5a0c;
  --hl-var: #8a5a0c;
  --hl-builtin: #2c5d9a;
  --hl-del: #8c2414;
  --hl-del-bg: rgb(179 58 34 / 0.1);
  --hl-ins: #2f6b3a;
  --hl-ins-bg: rgb(61 122 56 / 0.12);
  --vn-bg: #1f1d19;
  --vn-fg: #f2ede2;
  --vn-frame: rgb(242 237 226 / 0.14);
  --vn-name-bg: #b33a22;
  --vn-name-fg: #fff7ef;
  --vn-next: #ef8a6b;
  --vn-dim: rgb(242 237 226 / 0.76);
  --vn-faint: rgb(242 237 226 / 0.5);
  --vn-hover: rgb(242 237 226 / 0.07);
  --vn-shadow: 0 24px 48px -26px rgb(29 27 23 / 0.6);
  --shadow-sm: 0 1px 2px rgb(29 27 23 / 0.05);
  --shadow-md: 0 1px 2px rgb(29 27 23 / 0.05), 0 12px 30px -10px rgb(29 27 23 / 0.16);
  --shadow-lg: 0 32px 80px -20px rgb(29 27 23 / 0.36), 0 0 0 1px rgb(29 27 23 / 0.06);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC",
    "Source Han Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Cascadia Mono", Menlo, Consolas,
    "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
  --w-content: 680px;
  --w-page: 680px;
  --header-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #131210;
  --bg-raised: #1a1916;
  --bg-soft: #1d1b18;
  --bg-hover: #25231f;
  --fg: #ede8dd;
  --fg-body: #d2ccc0;
  --muted: #9d968a;
  --faint: #736c61;
  --line: #2a2723;
  --line-strong: #3a3630;
  --accent: #ee8466;
  --accent-hover: #f5a185;
  --accent-soft: rgb(238 132 102 / 0.09);
  --accent-line: rgb(238 132 102 / 0.38);
  --selection: rgb(238 132 102 / 0.26);
  --ok: #7dbf77;
  --ok-soft: rgb(125 191 119 / 0.12);
  --ok-fg: #94d18e;
  --mark: rgb(230 168 50 / 0.26);
  --header-bg: rgb(19 18 16 / 0.86);
  --code-bg: #191815;
  --code-border: #292622;
  --code-fg: #e4ded2;
  --code-inline-bg: rgb(237 232 221 / 0.08);
  --code-inline-fg: #e4ded2;
  --hl-comment: #857e72;
  --hl-keyword: #f08f72;
  --hl-string: #a9c97f;
  --hl-number: #8db5e6;
  --hl-function: #c8a4ee;
  --hl-type: #e2b46a;
  --hl-tag: #7fc6d2;
  --hl-attr: #e2b46a;
  --hl-var: #e2b46a;
  --hl-builtin: #8db5e6;
  --hl-del: #ffc4b4;
  --hl-del-bg: rgb(238 132 102 / 0.16);
  --hl-ins: #c4ecbd;
  --hl-ins-bg: rgb(125 191 119 / 0.16);
  --vn-bg: #1f1d1a;
  --vn-fg: #ede8dd;
  --vn-frame: rgb(237 232 221 / 0.11);
  --vn-name-bg: #b5432b;
  --vn-name-fg: #fff4ec;
  --vn-next: #ee8466;
  --vn-dim: rgb(237 232 221 / 0.74);
  --vn-faint: rgb(237 232 221 / 0.48);
  --vn-hover: rgb(237 232 221 / 0.06);
  --vn-shadow: 0 0 0 1px #2f2c27, 0 24px 48px -26px rgb(0 0 0 / 0.9);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -8px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 32px 80px -16px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.06);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --bg-raised: #1a1916;
    --bg-soft: #1d1b18;
    --bg-hover: #25231f;
    --fg: #ede8dd;
    --fg-body: #d2ccc0;
    --muted: #9d968a;
    --faint: #736c61;
    --line: #2a2723;
    --line-strong: #3a3630;
    --accent: #ee8466;
    --accent-hover: #f5a185;
    --accent-soft: rgb(238 132 102 / 0.09);
    --accent-line: rgb(238 132 102 / 0.38);
    --selection: rgb(238 132 102 / 0.26);
    --ok: #7dbf77;
    --ok-soft: rgb(125 191 119 / 0.12);
    --ok-fg: #94d18e;
    --mark: rgb(230 168 50 / 0.26);
    --header-bg: rgb(19 18 16 / 0.86);
    --code-bg: #191815;
    --code-border: #292622;
    --code-fg: #e4ded2;
    --code-inline-bg: rgb(237 232 221 / 0.08);
    --code-inline-fg: #e4ded2;
    --hl-comment: #857e72;
    --hl-keyword: #f08f72;
    --hl-string: #a9c97f;
    --hl-number: #8db5e6;
    --hl-function: #c8a4ee;
    --hl-type: #e2b46a;
    --hl-tag: #7fc6d2;
    --hl-attr: #e2b46a;
    --hl-var: #e2b46a;
    --hl-builtin: #8db5e6;
    --hl-del: #ffc4b4;
    --hl-del-bg: rgb(238 132 102 / 0.16);
    --hl-ins: #c4ecbd;
    --hl-ins-bg: rgb(125 191 119 / 0.16);
    --vn-bg: #1f1d1a;
    --vn-fg: #ede8dd;
    --vn-frame: rgb(237 232 221 / 0.11);
    --vn-name-bg: #b5432b;
    --vn-name-fg: #fff4ec;
    --vn-next: #ee8466;
    --vn-dim: rgb(237 232 221 / 0.74);
    --vn-faint: rgb(237 232 221 / 0.48);
    --vn-hover: rgb(237 232 221 / 0.06);
    --vn-shadow: 0 0 0 1px #2f2c27, 0 24px 48px -26px rgb(0 0 0 / 0.9);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -8px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 32px 80px -16px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.06);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 var(--font-sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--selection);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.icon {
  flex-shrink: 0;
  vertical-align: -0.15em;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-raised);
  color: var(--muted);
  font: 500 11px/1.4 var(--font-mono);
  text-align: center;
}

.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;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: min(100% - 40px, var(--w-content));
  margin-inline: auto;
}

.empty {
  margin: 24px 0;
  color: var(--muted);
}

/* The ▼ that a visual novel shows when a line is finished. */
.brand-mark,
.post-end,
.vn-next {
  display: inline-block;
  flex-shrink: 0;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ------------------------------------------------------------------ header & footer */
.site-header {
  position: relative;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100% - 40px, var(--w-content));
  height: var(--header-h);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: var(--fg);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 11px;
  height: 9px;
  margin-top: 1px;
}

.brand:hover .brand-mark {
  animation: mark-bob 0.5s ease-in-out infinite alternate;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: -8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.theme-moon {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: none;
}

:root[data-theme="dark"] .theme-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-moon {
    display: block;
  }
}

.site-footer {
  margin-top: 120px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: min(100% - 40px, var(--w-content));
  margin-inline: auto;
  padding: 24px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
}

.footer-sign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.footer-sign .brand-mark {
  width: 8px;
  height: 7px;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ page furniture */
.page {
  padding-top: 28px;
}

.page-header {
  margin: 20px 0 48px;
}

.page-kicker {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.page-kicker a {
  color: var(--accent);
}

.page-kicker a:hover {
  color: var(--accent-hover);
}

.page-title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(28px, 2.2vw + 19px, 36px);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.page-title .hash {
  margin-right: 2px;
  color: var(--faint);
  font-weight: 500;
}

.page-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15.5px;
}

.page-desc a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.page-desc a:hover {
  text-decoration-color: currentColor;
}

/* A small label followed by a hairline, with an optional count at the end. */
.rule-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.rule-title::after {
  content: "";
  flex: 1;
  order: 1;
  height: 1px;
  background: var(--line);
}

.rule-title .rule-count {
  order: 2;
  color: var(--faint);
  font: 500 12.5px/1.6 var(--font-mono);
  letter-spacing: 0;
}

.rule-title a.rule-count:hover {
  color: var(--accent);
}

.rule-year > span:first-child {
  color: var(--fg);
  font: 600 15px/1.6 var(--font-mono);
  letter-spacing: 0.02em;
}

.more-link {
  margin: 16px 0 0;
  font-size: 14px;
}

.more-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.more-link a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ dialogue (home, 404) */
.page-home,
.page-404 {
  padding-top: 40px;
}

.vn {
  margin-bottom: 88px;
}

/* A page that is only a dialogue box (an empty home, 404) holds it mid-screen, like a title screen. */
.page-solo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 10vh;
}

.page-solo .vn {
  margin-bottom: 0;
}

.vn-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.14em;
}

.vn-caption::before,
.vn-caption::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.vn-caption span {
  max-width: 80%;
  text-align: center;
}

.vn-window {
  position: relative;
  padding: 36px 36px 34px;
  border-radius: 14px;
  background: var(--vn-bg);
  color: var(--vn-fg);
  box-shadow: var(--vn-shadow);
  outline: 1px solid var(--vn-frame);
  outline-offset: -7px;
}

.vn-name {
  position: absolute;
  top: 0;
  left: 26px;
  margin: 0;
  padding: 4px 16px;
  border-radius: 7px;
  background: var(--vn-name-bg);
  color: var(--vn-name-fg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.1em;
  transform: translateY(-50%);
}

.vn-line {
  margin: 0;
  font-size: 17px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  text-wrap: pretty;
}

.vn-line + .vn-line {
  margin-top: 0.25em;
}

.vn-rest {
  visibility: hidden;
}

.vn-next {
  position: absolute;
  right: 26px;
  bottom: 20px;
  width: 12px;
  height: 10px;
  background: var(--vn-next);
  animation: mark-bob 0.8s ease-in-out infinite alternate;
}

.vn.is-typing .vn-window {
  cursor: pointer;
}

.vn.is-typing .vn-next {
  opacity: 0;
  animation: none;
}

.vn-choices {
  display: grid;
  gap: 2px;
  margin: 22px -12px 0;
  padding: 0;
  list-style: none;
}

.vn-choices::before {
  content: "";
  height: 1px;
  margin: 0 12px 12px;
  background: var(--vn-frame);
}

.vn-choice {
  position: relative;
  display: block;
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--vn-dim);
  font-size: 15.5px;
  line-height: 1.6;
  text-align: left;
  transition: color 0.15s, background-color 0.15s;
}

.vn-choice::before {
  content: "";
  position: absolute;
  top: calc(7px + 0.8em);
  left: 13px;
  width: 8px;
  height: 10px;
  margin-top: -5px;
  background: var(--vn-next);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.vn-choice:hover,
.vn-choice:focus-visible {
  background: var(--vn-hover);
  color: var(--vn-fg);
}

.vn-choice:focus-visible {
  outline: 2px solid var(--vn-next);
  outline-offset: -2px;
}

.vn-choice:hover::before,
.vn-choice:focus-visible::before {
  opacity: 1;
  transform: none;
}

.vn-choice-note {
  display: inline-block;
  color: var(--vn-faint);
  transition: color 0.15s;
}

.vn-choice:hover .vn-choice-note,
.vn-choice:focus-visible .vn-choice-note {
  color: var(--vn-dim);
}

.vn.is-typing .vn-choices {
  visibility: hidden;
}

.vn.is-revealed .vn-choices > * {
  animation: choice-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.vn.is-revealed .vn-choices > :nth-child(2) {
  animation-delay: 0.06s;
}

.vn.is-revealed .vn-choices > :nth-child(3) {
  animation-delay: 0.12s;
}

.vn.is-revealed .vn-choices > :nth-child(4) {
  animation-delay: 0.18s;
}

.vn.is-revealed .vn-choices > :nth-child(n + 5) {
  animation-delay: 0.24s;
}

.home-section + .home-section {
  margin-top: 76px;
}

.home-section .rule-title {
  margin-bottom: 4px;
}

/* ------------------------------------------------------------------ lists */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list > li + li {
  border-top: 1px solid var(--line);
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 20px;
  padding: 18px 0 19px;
}

.post-row::before {
  content: "";
  position: absolute;
  top: 27px;
  left: -24px;
  width: 8px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.post-row:hover::before {
  opacity: 1;
  transform: none;
}

.post-row-date {
  color: var(--faint);
  font: 13px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-row-title {
  display: block;
  min-width: 0;
}

.post-row-main {
  display: block;
  color: var(--fg);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
  transition: color 0.15s;
}

.post-row-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.post-row-cat {
  color: var(--faint);
  font-size: 13px;
  white-space: nowrap;
}

.post-row:hover .post-row-main {
  color: var(--accent);
}

/* Archive rows show only month.day, so the date column can be narrower. */
@media (min-width: 601px) {
  .post-list.is-short .post-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
}

.project {
  padding: 18px 0 0;
}

.project + .project {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.project-list .project:first-child {
  padding-top: 0;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.project-name {
  margin: 0;
  color: var(--fg);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.project-name a {
  transition: color 0.15s;
}

.project-name a:hover {
  color: var(--accent);
}

.project-badge {
  color: var(--faint);
  font: 500 12.5px/1.4 var(--font-mono);
  letter-spacing: 0.04em;
}

.project-desc {
  margin: 10px 0 0;
  color: var(--fg-body);
  font-size: 15.5px;
  line-height: 1.85;
  text-wrap: pretty;
}

.project-stack {
  margin: 12px 0 0;
  color: var(--faint);
  font: 12.5px/1.7 var(--font-mono);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  transition: color 0.15s;
}

.project-links a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ pages */
.year-group + .year-group {
  margin-top: 52px;
}

.term-section + .term-section {
  margin-top: 60px;
}

.cat-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.cat-list li + li {
  border-top: 1px solid var(--line);
}

.cat-row {
  display: grid;
  grid-template-columns: 9em 4.5em minmax(0, 1fr);
  align-items: baseline;
  gap: 0 16px;
  padding: 15px 0;
}

.cat-name {
  color: var(--fg);
  font-size: 16.5px;
  font-weight: 650;
  transition: color 0.15s;
}

.cat-count {
  color: var(--faint);
  font: 13px/1 var(--font-mono);
}

.cat-latest {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-row:hover .cat-name {
  color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.tag-cloud a {
  color: var(--fg-body);
  font-size: 15px;
  transition: color 0.15s;
}

.tag-cloud a:hover {
  color: var(--accent);
}

.tag-count {
  position: relative;
  top: -0.55em;
  margin-left: 3px;
  color: var(--faint);
  font: 11px/1 var(--font-mono);
}

.about-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.about-section {
  margin-top: 60px;
}

.facts {
  margin: 8px 0 0;
}

.facts > div {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
}

.facts > div + div {
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 14px;
}

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font: 14px/1.7 var(--font-mono);
}

.facts a {
  color: var(--fg);
  transition: color 0.15s;
}

.facts a:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  opacity: 0.88;
}

.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--fg);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  opacity: 1;
}

/* ------------------------------------------------------------------ post */
.page-post {
  padding-top: 32px;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.post > * {
  width: min(100% - 40px, var(--w-content));
  margin-inline: auto;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.post-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.post-kicker a:hover {
  color: var(--accent-hover);
}

.post-title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(28px, 2.6vw + 17px, 40px);
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.post-subtitle {
  display: block;
  margin-top: 0.45em;
  color: var(--muted);
  font-size: max(0.5em, 17px);
  font-weight: 450;
  line-height: 1.65;
  letter-spacing: 0;
  text-wrap: pretty;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 22px 0 0;
  color: var(--faint);
  font: 13px/1.6 var(--font-mono);
}

.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-family: var(--font-sans);
}

.edit-link:hover {
  color: var(--accent-hover);
}

.toc {
  margin-bottom: 40px;
}

.toc details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
}

.toc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc-count {
  color: var(--faint);
  font: 400 12px/1 var(--font-mono);
}

.toc-chevron {
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.2s;
}

.toc details[open] .toc-chevron {
  transform: rotate(180deg);
}

.toc ol {
  margin: 0;
  padding: 6px 16px 12px;
  border-top: 1px solid var(--line);
  list-style: none;
}

.toc li a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.15s, border-color 0.15s;
}

.toc .toc-h3 a {
  padding-left: 1.2em;
  font-size: 13.5px;
}

.toc li a:hover {
  color: var(--fg);
}

.toc li a.is-active {
  color: var(--accent);
}

.toc-top {
  display: none;
}

.post-body {
  min-width: 0;
}

.post-end {
  display: block;
  width: 12px;
  height: 10px;
  margin: 64px auto 48px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.tag-list a {
  color: var(--muted);
  transition: color 0.15s;
}

.tag-list a:hover {
  color: var(--accent);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.post-nav-link.is-next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.post-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.post-nav-title {
  color: var(--fg);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  transition: color 0.15s;
}

.post-nav-link:hover .post-nav-title {
  color: var(--accent);
}

.related {
  margin-top: 48px;
}

.related ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.related li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.related li + li {
  border-top: 1px solid var(--line);
}

.related a {
  color: var(--fg-body);
  font-size: 15px;
  transition: color 0.15s;
}

.related a:hover {
  color: var(--accent);
}

.related time {
  flex-shrink: 0;
  color: var(--faint);
  font: 12.5px/1 var(--font-mono);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 44px 0 0;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.15s;
}

.text-btn:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ prose */
.prose {
  color: var(--fg-body);
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

.prose :is(h1, h2, h3, h4, h5, h6) {
  position: relative;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.45;
  scroll-margin-top: 24px;
  text-wrap: balance;
}

.prose h1 {
  margin: 2em 0 0.8em;
  font-size: 1.6em;
}

.prose h2 {
  margin: 2.3em 0 0.85em;
  font-size: 1.4em;
  letter-spacing: -0.005em;
}

.prose h3 {
  margin: 1.9em 0 0.7em;
  font-size: 1.16em;
}

.prose :is(h4, h5, h6) {
  margin: 1.6em 0 0.6em;
  font-size: 1em;
}

.prose .h-anchor {
  position: absolute;
  left: -1.05em;
  width: 1em;
  color: var(--faint);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.prose :is(h2, h3, h4):hover .h-anchor {
  opacity: 1;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  transition: text-decoration-color 0.15s;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong {
  color: var(--fg);
  font-weight: 650;
}

.prose :is(ul, ol) {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

.prose li {
  margin: 0.3em 0;
  padding-left: 0.2em;
}

.prose li::marker {
  color: var(--faint);
}

.prose ol > li::marker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose li > :is(ul, ol) {
  margin: 0.3em 0 0.4em;
}

.prose li > p {
  margin: 0 0 0.5em;
}

.prose .contains-task-list {
  padding-left: 0.4em;
  list-style: none;
}

.prose .task-list-item-checkbox {
  margin: 0 0.5em 0 0;
  vertical-align: -0.1em;
  accent-color: var(--accent);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 3px solid var(--accent-line);
  color: var(--muted);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose hr {
  height: 4px;
  margin: 3.2em 0;
  border: 0;
  overflow: visible;
}

.prose hr::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: -20px 0 var(--faint), 20px 0 var(--faint);
}

.prose hr + :is(h2, h3) {
  margin-top: 0;
}

.prose :not(pre) > code {
  padding: 0.14em 0.38em;
  border-radius: 5px;
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.prose a code {
  color: inherit;
}

.prose kbd {
  font-size: 0.76em;
}

.prose mark {
  padding: 0 0.1em;
  border-radius: 3px;
  background: var(--mark);
  color: inherit;
}

.prose del {
  color: var(--muted);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: 8px;
}

.prose img.is-zoomable {
  cursor: zoom-in;
}

.prose .figure {
  margin: 1.8em 0;
}

.prose .figure img {
  margin: 0 auto;
}

.prose .figure figcaption {
  margin-top: 0.7em;
  color: var(--muted);
  font-size: 0.84em;
  text-align: center;
}

.prose video {
  display: block;
  max-width: 100%;
  margin: 1.6em auto;
  border-radius: 8px;
}

.prose .table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.6;
}

.prose :is(th, td) {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-soft);
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose dl {
  margin: 0 0 1.1em;
}

.prose dt {
  color: var(--fg);
  font-weight: 650;
}

.prose dd {
  margin: 0.2em 0 0.8em 1.4em;
}

.prose .footnote-ref a {
  padding: 0 0.1em;
  font-family: var(--font-mono);
  font-size: 0.78em;
  text-decoration: none;
}

.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88em;
}

.prose .footnotes p {
  margin: 0;
}

.prose .footnote-backref {
  text-decoration: none;
}

.prose .dead-link {
  color: var(--fg-body);
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 0.24em;
  cursor: help;
}

/* ------------------------------------------------------------------ code */
.prose .code {
  position: relative;
  margin: 1.7em 0;
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: 12px;
  background: var(--code-bg);
}

.prose .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--code-border);
  color: var(--faint);
  font: 12px/1 var(--font-mono);
}

.code-lang {
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  font: 12px/1 var(--font-sans);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.code-copy:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.code-copy.is-done {
  color: var(--ok);
}

.prose pre {
  margin: 0;
  padding: 16px 20px 18px;
  overflow-x: auto;
  color: var(--code-fg);
  font: 13.5px/1.72 var(--font-mono);
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  white-space: pre;
}

.hl .c,
.hl .ch,
.hl .cm,
.hl .c1,
.hl .cs,
.hl .cpf {
  color: var(--hl-comment);
  font-style: italic;
}

.hl .k,
.hl .kc,
.hl .kd,
.hl .kn,
.hl .kp,
.hl .kr,
.hl .ow,
.hl .cp {
  color: var(--hl-keyword);
}

.hl .kt,
.hl .nc,
.hl .nn,
.hl .ne {
  color: var(--hl-type);
}

.hl .s,
.hl .sa,
.hl .sb,
.hl .sc,
.hl .dl,
.hl .sd,
.hl .s2,
.hl .sh,
.hl .sx,
.hl .s1,
.hl .ss,
.hl .sr {
  color: var(--hl-string);
}

.hl .se,
.hl .si,
.hl .m,
.hl .mb,
.hl .mf,
.hl .mh,
.hl .mi,
.hl .mo,
.hl .il,
.hl .no {
  color: var(--hl-number);
}

.hl .nf,
.hl .fm,
.hl .nd {
  color: var(--hl-function);
}

.hl .nb,
.hl .bp {
  color: var(--hl-builtin);
}

.hl .nt {
  color: var(--hl-tag);
}

.hl .na {
  color: var(--hl-attr);
}

.hl .nv,
.hl .vc,
.hl .vg,
.hl .vi,
.hl .vm {
  color: var(--hl-var);
}

.hl .gd {
  background: var(--hl-del-bg);
  color: var(--hl-del);
}

.hl .gi {
  background: var(--hl-ins-bg);
  color: var(--hl-ins);
}

.hl .gh,
.hl .gu {
  color: var(--hl-function);
  font-weight: 600;
}

.hl .gp {
  color: var(--hl-comment);
  user-select: none;
}

.hl .ge {
  font-style: italic;
}

.hl .gs {
  font-weight: 600;
}

/* ------------------------------------------------------------------ math & extras */
.prose .math-display {
  display: block;
  margin: 1.5em 0;
  padding: 0.3em 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.prose .math:not(.is-rendered) {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose .katex {
  font-size: 1.1em;
}

.prose .katex-display {
  margin: 0;
}

.prose .callout {
  --c: var(--accent);
  margin: 1.6em 0;
  padding: 14px 18px 14px 16px;
  border-left: 3px solid var(--c);
  border-radius: 4px 10px 10px 4px;
  background: color-mix(in srgb, var(--c) 7%, transparent);
}

.prose .callout-note {
  --c: #3b6ea8;
}

.prose .callout-tip {
  --c: #3d7a38;
}

.prose .callout-important {
  --c: #7a4fb0;
}

.prose .callout-warning {
  --c: #a86b12;
}

.prose .callout-caution {
  --c: #b33a22;
}

:root[data-theme="dark"] .prose .callout-note {
  --c: #82aee0;
}

:root[data-theme="dark"] .prose .callout-tip {
  --c: #84c47e;
}

:root[data-theme="dark"] .prose .callout-important {
  --c: #b99ae6;
}

:root[data-theme="dark"] .prose .callout-warning {
  --c: #e0a84f;
}

:root[data-theme="dark"] .prose .callout-caution {
  --c: #ee8466;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose .callout-note {
    --c: #82aee0;
  }
  :root:not([data-theme="light"]) .prose .callout-tip {
    --c: #84c47e;
  }
  :root:not([data-theme="light"]) .prose .callout-important {
    --c: #b99ae6;
  }
  :root:not([data-theme="light"]) .prose .callout-warning {
    --c: #e0a84f;
  }
  :root:not([data-theme="light"]) .prose .callout-caution {
    --c: #ee8466;
  }
}

.prose .callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--c);
  font-size: 0.9em;
  font-weight: 650;
}

.prose .callout > p:not(.callout-title) {
  margin-bottom: 0.6em;
}

.prose .callout > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ search */
.search-dialog {
  width: min(620px, 100vw - 24px);
  max-width: none;
  max-height: min(640px, 100vh - 48px);
  margin: 9vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}

.search-dialog::backdrop {
  background: rgb(29 27 23 / 0.38);
}

.search-dialog[open] {
  display: flex;
  animation: pop-in 0.16s ease-out;
}

.search-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.search-field {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--fg);
  font-size: 16.5px;
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--faint);
}

.search-close:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.search-results {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-label {
  margin: 6px 12px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.search-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
}

.search-item[aria-selected="true"] {
  background: var(--bg-hover);
}

.search-item-title {
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.search-item[aria-selected="true"] .search-item-title {
  color: var(--accent);
}

.search-item-meta {
  margin-top: 2px;
  color: var(--faint);
  font: 12px/1.5 var(--font-mono);
}

.search-item-snippet {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-item mark {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--mark);
  color: inherit;
}

.search-empty {
  padding: 28px 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.search-foot {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.search-foot kbd {
  margin-right: 3px;
}

.search-foot-tip {
  margin-left: auto;
}

/* ------------------------------------------------------------------ overlays */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgb(19 18 16 / 0.88);
}

.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ responsive */
@media (min-width: 1180px) {
  .post {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--w-content) minmax(0, 1fr);
    column-gap: 56px;
  }
  .post > * {
    grid-column: 2;
    width: auto;
    margin-inline: 0;
  }
  .post > .toc {
    position: sticky;
    top: 40px;
    grid-column: 3;
    grid-row: 2 / span 2;
    align-self: start;
    width: min(100%, 240px);
    max-height: calc(100vh - 80px);
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .toc details {
    border: 0;
    border-radius: 0;
    background: none;
  }
  .toc summary {
    padding: 0 0 12px;
    color: var(--muted);
    font-size: 12.5px;
    letter-spacing: 0.08em;
    pointer-events: none;
  }
  .toc-chevron {
    display: none;
  }
  .toc ol {
    padding: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .toc li a {
    margin-left: -1px;
    padding: 5px 0 5px 14px;
    border-left: 1px solid transparent;
    font-size: 13px;
  }
  .toc .toc-h3 a {
    padding-left: 26px;
    font-size: 12.5px;
  }
  .toc li a.is-active {
    border-left-color: var(--accent);
    color: var(--fg);
  }
  .toc-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 0 14px;
    color: var(--faint);
    font-size: 12.5px;
  }
  .toc-top:hover {
    color: var(--accent);
  }
}

@media (max-width: 760px) {
  .post-row::before {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "nav nav";
    gap: 2px 0;
    height: auto;
    padding: 14px 0 4px;
  }
  .brand {
    grid-area: brand;
  }
  .header-actions {
    grid-area: actions;
  }
  .site-nav {
    grid-area: nav;
    gap: 26px;
  }
  .page,
  .page-post {
    padding-top: 20px;
  }
  .page-home,
  .page-404 {
    padding-top: 32px;
  }
  .page-header {
    margin-bottom: 36px;
  }
  .vn {
    margin-bottom: 72px;
  }
  .vn-caption {
    margin-bottom: 30px;
  }
  .vn-window {
    padding: 32px 22px 30px;
    border-radius: 12px;
    outline-offset: -6px;
  }
  .vn-name {
    left: 18px;
  }
  .vn-line {
    font-size: 16px;
    line-height: 1.9;
  }
  .vn-next {
    right: 18px;
    bottom: 16px;
  }
  .vn-choices {
    margin-inline: -8px;
  }
  .vn-choices::before {
    margin-inline: 8px;
  }
  .vn-choice {
    padding-left: 28px;
    font-size: 15px;
  }
  .vn-choice::before {
    left: 9px;
  }
  .post-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "date cat" "title title";
    row-gap: 9px;
    column-gap: 0;
    padding: 16px 0 17px;
  }
  .post-row-date {
    grid-area: date;
  }
  .post-row-cat {
    grid-area: cat;
    justify-self: start;
  }
  .post-row-cat::before {
    content: "·";
    margin: 0 8px;
  }
  .post-row-title {
    grid-area: title;
  }
  .post-row-main {
    font-size: 16.5px;
  }
  .cat-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 16px;
  }
  .cat-latest {
    grid-column: 1 / -1;
    text-align: left;
  }
  .post-header {
    margin-bottom: 32px;
    padding-bottom: 26px;
  }
  .prose {
    font-size: 16.5px;
    line-height: 1.82;
  }
  .prose .code {
    margin-inline: -20px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .prose pre {
    padding-inline: 20px;
    font-size: 13px;
  }
  .prose .h-anchor {
    display: none;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav-link.is-next {
    grid-column: 1;
  }
  .search-dialog {
    margin-top: 12px;
    max-height: calc(100vh - 24px);
  }
}

@media (hover: none) {
  .search-foot {
    display: none;
  }
}

/* ------------------------------------------------------------------ motion & print */
@keyframes mark-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(3px);
  }
}

@keyframes choice-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
}

/* transition: none rather than a tiny duration: transition-property defaults to "all", so a global
   duration would turn every style change into an animation and delay what scripts measure. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .post-actions,
  .post-nav,
  .related,
  .reading-progress,
  .code-copy,
  .search-dialog,
  .vn-choices {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .prose a {
    color: inherit;
  }
}
