/* ================================================================
   Aurora — content layer
   Post page, article typography, TOC, archive, taxonomy, about,
   search and overlays
   ================================================================ */

/* ---------------------------------------------------------------
   12. Post header & layout
   --------------------------------------------------------------- */
.post-hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(44px, 5vw, 64px)) 0 clamp(26px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}

.post-hero-inner {
  /* match the 800 + 48 + 280 article grid, so the header lines up with body copy */
  max-width: 1128px;
}

.post-hero-inner > * {
  max-width: 840px;
  margin-top: 0;
}

.post-hero-inner--single {
  max-width: 840px;
}

.post-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-category {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}

.post-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 11px;
  font-weight: 600;
}

[data-theme="dark"] .post-locked {
  color: #fbbf24;
}

.post-locked .icon {
  width: 12px;
  height: 12px;
}

.post-title {
  margin-top: 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.post-lead {
  max-width: 780px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(14.5px, 1.2vw, 16px);
  line-height: 1.8;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.post-author-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.post-author-mini img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-author-mini:hover {
  color: var(--accent);
}

.meta-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.post-meta-item .icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.post-meta-item--muted {
  color: var(--muted-2);
}

.post-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 800px) minmax(232px, 280px);
  justify-content: center;
  align-items: start;
  gap: clamp(32px, 3.5vw, 48px);
  padding-top: clamp(40px, 5vw, 58px);
  padding-bottom: clamp(48px, 7vw, 90px);
}

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

.post-cover {
  margin-bottom: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

.post-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------------------------------------------------------------
   13. Article typography
   --------------------------------------------------------------- */
.prose {
  color: var(--text-soft);
  font-size: 1.015rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

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

.prose > h1:first-child,
.prose > hr:first-child {
  display: none;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 26px);
  color: var(--text);
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 2.4em 0 0.8em;
  font-size: clamp(1.32rem, 2.1vw, 1.5rem);
  line-height: 1.4;
  font-weight: 600;
}

.prose h3 {
  margin: 2em 0 0.65em;
  font-size: 1.18rem;
  line-height: 1.45;
  font-weight: 600;
}

.prose h4 {
  margin: 1.7em 0 0.6em;
  font-size: 1.06rem;
}

.prose h5,
.prose h6 {
  margin: 1.5em 0 0.5em;
  font-size: 0.98rem;
}

.prose p {
  margin: 1.15em 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 32%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.prose a:hover {
  color: var(--accent-2);
  text-decoration-color: currentColor;
}

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

.prose em {
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 1.15em 0;
  padding-left: 1.5em;
}

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

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

.prose li > ul,
.prose li > ol {
  margin: 0.4em 0;
}

.prose blockquote {
  position: relative;
  margin: 1.9em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 0.96em;
}

.prose blockquote p {
  margin: 0.5em 0;
}

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

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

.prose hr {
  height: 0;
  margin: 3em 0;
  border-top: 1px solid var(--line);
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.5em auto;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.prose img:hover {
  opacity: 0.94;
}

.prose figure img {
  margin-bottom: 8px;
}

.prose figcaption {
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.prose iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.prose iframe[src*="youtube"],
.prose iframe[src*="youtu.be"],
.prose iframe[src*="vimeo"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.4em 0;
  box-shadow: var(--shadow-sm);
}

.prose video {
  width: 100%;
  border-radius: var(--radius-sm);
}

.table-wrap {
  margin: 1.7em 0;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
}

.table-wrap table {
  margin: 0;
}

.prose table {
  width: 100%;
  margin: 1.7em 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.65;
}

.prose thead {
  background: var(--surface-3);
}

.prose th {
  padding: 11px 14px;
  color: var(--text);
  font-weight: 650;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

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

.prose tbody tr {
  transition: background-color 0.2s;
}

.prose tbody tr:hover {
  background: var(--accent-softer);
}

/* Markdown tables used as image + caption blocks */
.prose table:has(img) {
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.prose table:has(img) thead {
  background: transparent;
}

.prose table:has(img) th {
  padding: 4px 8px 10px;
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.prose table:has(img) td {
  padding: 0 8px 20px;
  border-bottom: 0;
  text-align: center;
}

.prose table:has(img) tbody tr:hover {
  background: transparent;
}

.prose table:has(img) img {
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

/* Inline code */
.prose :not(pre) > code {
  padding: 0.18em 0.42em;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  font-family: var(--font-mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* Highlighted code blocks */
.prose figure.highlight {
  position: relative;
  margin: 1.8em 0;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.prose figure.highlight table {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: visible;
  background: transparent;
  font-size: 0.84rem;
}

.prose figure.highlight td {
  padding: 0;
  border: 0;
  vertical-align: top;
}

.prose figure.highlight .code {
  padding: 17px 20px;
  width: auto;
}

.prose figure.highlight pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.75;
  overflow-x: auto;
  scrollbar-width: thin;
}

.prose figure.highlight code {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

.prose figure.highlight .line {
  display: inline;
}

/* Generic pre blocks that are not highlighted by Hexo */
.prose pre:not(.highlight pre):not(.mermaid) {
  margin: 1.8em 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.75;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

.prose pre.mermaid {
  margin: 1.8em 0;
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  overflow-x: auto;
}

.prose pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Code toolbar injected by JS */
.code-toolbar {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.55;
  transition: opacity 0.2s;
}

figure.highlight:hover .code-toolbar,
figure.highlight:focus-within .code-toolbar {
  opacity: 1;
}

.code-lang {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  color: #8fa0bd;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  transition: background-color 0.2s, color 0.2s;
}

.code-copy:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #fff;
}

.code-copy .icon {
  width: 14px;
  height: 14px;
}

.code-copy.is-copied {
  color: #4ade80;
}

/* Task list */
.prose input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--accent);
}

/* Share row */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.share-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

.share-btn .icon {
  width: 15px;
  height: 15px;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-softer);
  transform: none;
}

.share-btn--icon {
  width: 35px;
  padding: 0;
  justify-content: center;
}

/* Previous / next */
.post-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.post-pagination-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 17px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.18s, background-color 0.18s;
}

.post-pagination-item:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.post-pagination-item.is-empty {
  visibility: hidden;
}

.post-pagination-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.post-pagination-label .icon {
  width: 13px;
  height: 13px;
}

.post-pagination-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.post-pagination-item:hover strong {
  color: var(--accent);
}

.post-pagination-item--next {
  text-align: right;
}

.post-pagination-item--next .post-pagination-label {
  justify-content: flex-end;
}

/* Related */
.related-posts {
  margin-top: 52px;
}

.related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.related-head h2 {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.related-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.comments {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.comments-title {
  margin-bottom: 18px;
  font-size: 1.2rem;
}

/* ---------------------------------------------------------------
   14. Table of contents
   --------------------------------------------------------------- */
.toc-card {
  padding: 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 10px;
}

.toc-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.toc-head .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.toc-percent {
  color: var(--muted-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.toc-progress {
  height: 1px;
  margin-bottom: 12px;
  background: var(--line);
  overflow: hidden;
}

.toc-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s linear;
}

.toc-nav {
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.toc-nav::-webkit-scrollbar {
  width: 4px;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 0;
}

.toc-link {
  position: relative;
  display: block;
  padding: 5px 0 5px 11px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  transition: color 0.16s, border-color 0.16s;
}

.toc-link:hover {
  color: var(--text);
}

.toc-link.is-active {
  color: var(--text);
  border-left-color: var(--accent);
}

.toc-link--h3 {
  padding-left: 25px;
  font-size: 11.5px;
}

.toc-link--h4 {
  padding-left: 36px;
  font-size: 11px;
}

.toc-empty {
  color: var(--muted-2);
  font-size: 11.5px;
}

.toc-card .toc-empty {
  display: none;
}

.toc-card.is-empty {
  display: none;
}

/* Floating TOC */
.toc-fab {
  position: fixed;
  right: 22px;
  bottom: 74px;
  z-index: 91;
  display: none;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.toc-fab .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.toc-drawer {
  position: fixed;
  inset: 0;
  z-index: 160;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.toc-drawer.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  padding: 22px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
}

.toc-drawer.is-open .drawer-panel {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-nav--mobile {
  max-height: none;
}

.toc-nav--mobile .toc-link {
  font-size: 13px;
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  height: 2.5px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.year-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 2px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: color 0.16s;
}

.year-chip span {
  margin-left: 6px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.year-chip:hover {
  color: var(--text);
}

.year-chip.is-active {
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
}

.year-chip.is-active span {
  color: var(--muted);
}

.timeline-year {
  margin-bottom: 44px;
}

.timeline-year-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-year-head h2 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.timeline-year-head span {
  color: var(--muted-2);
  font-size: 12px;
}

.timeline-list {
  position: relative;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 58px 18px minmax(0, 1fr) 32px;
  align-items: start;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date {
  padding-top: 2px;
  color: var(--muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-dot {
  position: relative;
  width: 5px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 50%;
  background: var(--line-strong);
  z-index: 1;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(58px + 12px + 9px - 0.5px);
  width: 1px;
  background: var(--line);
}

.timeline-item:first-child::before {
  top: 22px;
}

.timeline-item:last-child::before {
  bottom: calc(100% - 22px);
}

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

.timeline-body h3 {
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.timeline-body h3 a {
  transition: color 0.2s;
}

.timeline-item:hover .timeline-body h3 a {
  color: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-meta .icon {
  width: 12px;
  height: 12px;
}

.timeline-cat {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.timeline-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--muted-2);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s, color 0.2s, background-color 0.2s;
}

.timeline-arrow .icon {
  width: 14px;
  height: 14px;
}

.timeline-item:hover .timeline-arrow {
  opacity: 1;
  transform: none;
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------------------------------------------------------------
   16. Categories page
   --------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 18px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  overflow: hidden;
}

.category-card:hover .category-card h2 {
  color: var(--accent);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.category-card-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted-2);
  border: 0;
}

.category-card-icon .icon {
  width: 17px;
  height: 17px;
}

.category-card-count {
  color: var(--muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.category-card h2 {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.16s;
}

.category-card-bar {
  display: none;
}

.category-card-posts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.category-card-posts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.category-card-posts li > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-posts time {
  flex: none;
  color: var(--muted-2);
  font-size: 11.5px;
}

.category-card-arrow {
  display: none;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: border-color 0.18s;
}

.tag-filter:focus-within {
  border-color: var(--accent);
  box-shadow: none;
}

.tag-filter .icon {
  width: 16px;
  height: 16px;
}

.tag-filter input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.tag-filter input::placeholder {
  color: var(--muted-2);
}

.tag-toolbar-count {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
}

.tag-cloud-large {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: calc(0.35em * var(--tag-scale, 1)) 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: calc(0.85rem * var(--tag-scale, 1));
  line-height: 1.3;
  transition: color 0.16s;
}

.tag-pill-hash {
  color: var(--accent);
  opacity: 0.85;
  font-weight: 500;
}

.tag-pill-count {
  margin-left: 5px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 0.62em;
  font-variant-numeric: tabular-nums;
}

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

.tag-pill.is-hidden {
  display: none;
}

.tag-empty {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* ---------------------------------------------------------------
   18. About page
   --------------------------------------------------------------- */
.section.about-section {
  padding-top: calc(var(--header-h) + clamp(46px, 6vw, 72px));
}

.about-layout {
  max-width: 900px;
  margin-inline: auto;
}

.about-content {
  min-width: 0;
  padding-top: 4px;
}

.about-content > h1:first-child {
  display: block;
}

.about-content h1 {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.about-content h1 + .about-lead {
  margin-top: 0;
}

.about-lead {
  color: var(--text-soft);
  font-size: 1.04em;
}

.about-projects-table table {
  font-size: 0.86rem;
}

.about-projects-table th:last-child,
.about-projects-table th:nth-last-child(2),
.about-projects-table td:last-child,
.about-projects-table td:nth-last-child(2) {
  white-space: nowrap;
}

.about-projects-table td:first-child {
  min-width: 132px;
}

.about-colophon {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12.5px;
}

.page-prose {
  padding-top: 4px;
}

/* ---------------------------------------------------------------
   19. 404
   --------------------------------------------------------------- */
.notfound {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 80vh;
  padding: calc(var(--header-h) + 48px) 0 96px;
}

.notfound-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.notfound-code {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

.notfound-inner h1 {
  margin-top: 14px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.notfound-inner > p {
  max-width: 440px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.notfound-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
}

.notfound-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.16s;
}

.notfound-links a .icon {
  width: 13px;
  height: 13px;
}

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

/* ---------------------------------------------------------------
   20. Search overlay
   --------------------------------------------------------------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 20px 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 18, 0.44);
}

.search-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  min-height: 300px;
  max-height: 78vh;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.2s var(--ease);
}

.search-modal.is-open .search-panel {
  transform: none;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-prompt {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
}

.search-input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

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

.search-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  flex: none;
  transition: background-color 0.2s, color 0.2s;
}

.search-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.search-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.search-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.search-keys span {
  margin-right: 8px;
}

.search-keys kbd {
  height: 18px;
  min-width: 18px;
  font-size: 9.5px;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border-left: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s;
}

.search-result + .search-result {
  margin-top: 2px;
}

.search-result:hover,
.search-result.is-active {
  background: var(--accent-softer);
  border-left-color: var(--accent);
}

.search-result-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}

.search-result.is-active .search-result-icon,
.search-result:hover .search-result-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-result-icon .icon {
  width: 17px;
  height: 17px;
}

.search-result-body {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.search-result-title time {
  margin-left: auto;
  flex: none;
  color: var(--muted-2);
  font-size: 12px;
}

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

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 12px;
}

.search-result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.search-result-meta .icon {
  width: 11px;
  height: 11px;
}

.search-result mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 24px;
  text-align: center;
}

.search-panel.is-empty .search-results {
  display: none;
}

.search-panel.is-empty .search-empty {
  flex: 1;
}

.search-empty-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
}

.search-empty-icon .icon {
  width: 22px;
  height: 22px;
}

.search-empty-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.search-empty-text {
  color: var(--muted);
  font-size: 11.5px;
}

.search-suggest {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.search-suggest-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-suggest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.16s, border-color 0.16s, background-color 0.16s;
}

.search-tag span {
  color: var(--muted-2);
  font-size: 9px;
}

.search-tag:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-softer);
}

.search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-foot-meta {
  letter-spacing: 0.04em;
}

.search-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}

.search-brand .icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

/* ---------------------------------------------------------------
   21. Toast & lightbox
   --------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 300;
  padding: 9px 15px;
  border-radius: var(--radius-xs);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.3s var(--ease);
  white-space: nowrap;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(5, 8, 15, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  max-width: min(1200px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background-color 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---------------------------------------------------------------
   22. Animations
   --------------------------------------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.86);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(36px, 26px, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-24px, 44px, 0) scale(0.96);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 0;
    transform: translateY(7px);
  }
  100% {
    opacity: 0;
  }
}

/* Third-party player (APlayer / Meting) in dark mode */
[data-theme="dark"] .aplayer {
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
}

/* Encrypted post form */
#hexo-blog-encrypt .hbe-content {
  padding: 30px 0 20px;
}

#hexo-blog-encrypt .hbe-input {
  display: block;
  width: min(440px, 100%);
  margin: 0 auto;
}

#hexo-blog-encrypt .hbe-input-field-default {
  float: none;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  opacity: 1;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#hexo-blog-encrypt .hbe-input-field-default:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-softer);
  outline: none;
}

#hexo-blog-encrypt .hbe-input-field-default::placeholder {
  color: var(--muted);
}

#hexo-blog-encrypt .hbe-input-label {
  display: none;
}

/* Encrypted hint */
.encrypt-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11.5px;
}

.encrypt-hint .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* APlayer shell */
.prose .aplayer {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Player fallback */
.aplayer.is-unavailable {
  width: 100% !important;
  max-width: 560px;
  margin: 0 auto;
  background: transparent !important;
  box-shadow: none !important;
}

.player-fallback {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  text-align: left;
}

.player-fallback-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.player-fallback-icon .icon {
  width: 20px;
  height: 20px;
}

.player-fallback-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-fallback-copy strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}

.player-fallback-copy span span {
  color: var(--muted);
  font-size: 11px;
}

.player-fallback > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}

.player-fallback > a .icon {
  width: 12px;
  height: 12px;
}

.player-fallback > a:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}

/* ---------------------------------------------------------------
   Extended Markdown: task lists,
footnotes,
definition lists,
abbreviations {
  padding-left: 0.4em;
  list-style: none;
}

.prose dl {
  margin: 1.5em 0;
}

.prose dt {
  margin-top: 1em;
  color: var(--text);
  font-weight: 650;
}

.prose dd {
  margin-left: 1.2em;
  color: var(--muted);
}

.prose abbr[title] {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.prose ins {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
}

.prose mark {
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-3) 20%, transparent);
  color: var(--text);
}

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

/* markdown-it-container blocks (::: note, ::: tip ...) */
.prose .note,
.prose .tip,
.prose .warning {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-softer);
}

.prose .tip {
  border-left-color: #10b981;
  background: color-mix(in srgb, #10b981 7%, transparent);
}

.prose .warning {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}

.prose .note > :first-child,
.prose .tip > :first-child,
.prose .warning > :first-child {
  margin-top: 0;
}

.prose .note > :last-child,
.prose .tip > :last-child,
.prose .warning > :last-child {
  margin-bottom: 0;
}

/* GFM alerts (> [!NOTE]) transformed by theme.js */
.prose .admonition {
  position: relative;
  margin: 1.6em 0;
  padding: 18px 20px 18px 22px;
  border: 1px solid color-mix(in srgb, var(--admonition-color) 22%, transparent);
  border-left: 3px solid var(--admonition-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--admonition-color) 7%, transparent);
}

.prose .admonition p {
  margin: 0.55em 0;
}

.prose .admonition p:first-of-type {
  margin-top: 0;
}

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

.admonition-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--admonition-color);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admonition-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--admonition-color);
  box-shadow: none;
}

.prose .admonition--note {
  --admonition-color: #3b82f6;
}

.prose .admonition--tip {
  --admonition-color: #10b981;
}

.prose .admonition--important {
  --admonition-color: #8b5cf6;
}

.prose .admonition--warning {
  --admonition-color: #f59e0b;
}

.prose .admonition--caution {
  --admonition-color: #ef4444;
}

/* Hexo highlight.js token classes (markdown-it output) */
.prose figure.highlight .comment,
.prose figure.highlight .quote {
  color: #64748b;
  font-style: italic;
}

.prose figure.highlight .keyword,
.prose figure.highlight .selector-tag,
.prose figure.highlight .literal,
.prose figure.highlight .type {
  color: #c084fc;
}

.prose figure.highlight .string,
.prose figure.highlight .regexp,
.prose figure.highlight .attribute,
.prose figure.highlight .attr {
  color: #86efac;
}

.prose figure.highlight .number,
.prose figure.highlight .symbol,
.prose figure.highlight .bullet,
.prose figure.highlight .link {
  color: #fbbf24;
}

.prose figure.highlight .title,
.prose figure.highlight .section,
.prose figure.highlight .name,
.prose figure.highlight .selector-class {
  color: #7dd3fc;
}

.prose figure.highlight .variable,
.prose figure.highlight .params {
  color: #fca5a5;
}

.prose figure.highlight .built_in,
.prose figure.highlight .meta,
.prose figure.highlight .tag {
  color: #67e8f9;
}

.prose figure.highlight .emphasis {
  font-style: italic;
}

.prose figure.highlight .strong {
  font-weight: 700;
}

.prose figure.highlight .code {
  color: inherit;
}

/* Code block fullscreen viewer */
.code-expand,
.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  transition: background-color 0.2s, color 0.2s;
}

.code-expand:hover,
.code-copy:hover {
  background: rgba(148, 163, 184, 0.24);
  color: #fff;
}

.code-expand .icon,
.code-copy .icon {
  width: 14px;
  height: 14px;
}

.prose figure.highlight .code pre {
  white-space: pre;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.code-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 260;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.code-fullscreen.is-open {
  opacity: 1;
  visibility: visible;
}

.code-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.code-fullscreen-panel {
  position: absolute;
  inset: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.3s var(--ease);
}

.code-fullscreen.is-open .code-fullscreen-panel {
  transform: none;
}

.code-fullscreen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  height: 54px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.code-fullscreen-lang {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.code-fullscreen-actions .icon-btn {
  color: var(--text-soft);
}

.code-fullscreen-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--code-bg);
}

.code-fullscreen-body .prose {
  min-height: 100%;
  max-width: none;
}

.code-fullscreen-body .prose figure.highlight {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--code-bg);
}

.code-fullscreen-body .prose figure.highlight table {
  margin: 0;
  table-layout: fixed;
  width: 100%;
}

.code-fullscreen-body .prose figure.highlight .code {
  padding: 22px 24px;
}

.code-fullscreen-body .prose figure.highlight pre {
  max-width: 100%;
  max-height: none;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.75;
}

@media (max-width: 640px) {
  .code-fullscreen-panel {
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .code-fullscreen-head {
    height: 52px;
    padding-top: env(safe-area-inset-top);
    height: calc(52px + env(safe-area-inset-top));
  }

  .code-fullscreen-body .prose figure.highlight .code {
    padding: 16px;
  }
}

.post-layout--single {
  grid-template-columns: minmax(0, 840px);
}

/* ------------------------------------------------------------------
   Music and video library pages
   ------------------------------------------------------------------ */
.media-intro {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 26px;
  padding: 0 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  overflow: hidden;
}

.media-intro-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
}

.media-intro-mark .icon {
  width: 20px;
  height: 20px;
}

.media-intro-copy {
  min-width: 0;
  max-width: 62ch;
}

.media-kicker {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
}

.media-intro-copy h1,
.media-intro-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.media-intro-copy > p:not(.media-kicker) {
  margin: 8px 0 14px;
  text-wrap: balance;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.media-meta > span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-strong);
}

.media-meta span {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 11.5px;
}

.media-badge {
  position: static;
  white-space: nowrap;
  color: var(--muted-2);
  font-size: 11.5px;
}

.music-player .aplayer {
  margin: 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.media-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.media-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.video-section {
  margin-top: 28px;
}

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

.video-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: baseline;
  margin-bottom: 14px;
}

.video-section-index {
  display: none;
}

.video-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.video-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.video-count {
  padding-top: 3px;
  color: var(--muted-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
  transition: border-color 0.18s;
}

.video-card:hover {
  border-color: var(--accent);
  box-shadow: none;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.video-card figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.video-tag {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}

@media (max-width: 760px) {
  .media-intro {
    gap: 13px;
    padding: 18px;
  }

  .media-intro-mark {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-xs);
  }

  .media-intro-mark .icon {
    width: 21px;
    height: 21px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-section-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .video-count {
    grid-column: auto;
  }
}

/* ------------------------------------------------------------------
   Project index page (/projects/)
   ------------------------------------------------------------------ */
.page-prose .project-hero {
  margin: 0 0 26px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.page-prose .project-hero h1,
.page-prose .project-hero h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.page-prose .project-hero p {
  max-width: 62ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.page-prose .project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
  margin: 0;
}

.page-prose a.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 44px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.page-prose a.project-card:hover {
  border-color: var(--accent);
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.page-prose .project-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.page-prose .project-dom {
  color: var(--accent);
}

.page-prose .project-name {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.page-prose .project-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-prose .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.page-prose .project-tags > span {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.page-prose .project-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  transition: color 0.2s var(--ease);
}

.page-prose .project-arrow .icon {
  width: 14px;
  height: 14px;
}

.page-prose a.project-card:hover .project-arrow {
  color: var(--accent);
}

.page-prose .project-note {
  margin: 22px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .page-prose .project-grid {
    grid-template-columns: 1fr;
  }

  .page-prose a.project-card {
    padding: 14px 40px 16px 16px;
  }
}

/* ------------------------------------------------------------------
   Music player (/music/)
   ------------------------------------------------------------------ */
.page-prose .player {
  margin: 26px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  overflow: hidden;
}

.page-prose .player-stage {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px 14px;
}

.page-prose .player-art {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease);
}

.page-prose .player-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.page-prose .player-cover {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: cover;
  cursor: default;
}

.page-prose .player-cover:hover {
  opacity: 1;
}

.page-prose .player[data-playing="true"] .player-art {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent),
    0 10px 26px -14px color-mix(in srgb, var(--accent) 55%, transparent);
}

.page-prose .player-meta {
  min-width: 0;
}

.page-prose .player-now {
  margin: 0;
  color: var(--muted-2);
  transition: color 0.2s var(--ease);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-prose .player-now.is-playing {
  color: var(--accent);
}

.page-prose .player-title {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-prose .player-artist {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.page-prose .player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-prose .player .ctl {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.page-prose .player .ctl:hover {
  background: var(--surface-2);
  color: var(--text);
}

.page-prose .player .ctl:active {
  transform: scale(0.94);
}

.page-prose .player .ctl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-prose .player .ctl .icon {
  width: 18px;
  height: 18px;
}

.page-prose .player .ctl-play {
  width: 52px;
  height: 52px;
  margin: 0 4px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}

.page-prose .player .ctl-play:hover {
  background: var(--accent-2);
  color: var(--on-accent);
}

.page-prose .player .ctl-play .icon {
  width: 20px;
  height: 20px;
}

.page-prose .player .ctl-play .icon-pause {
  display: none;
}

.page-prose .player[data-playing="true"] .ctl-play .icon-play {
  display: none;
}

.page-prose .player[data-playing="true"] .ctl-play .icon-pause {
  display: block;
}

.page-prose .player .ctl-sm {
  width: 34px;
  height: 34px;
  color: var(--muted-2);
}

.page-prose .player .ctl-sm .icon {
  width: 15px;
  height: 15px;
}

.page-prose .player .ctl[aria-pressed="true"] {
  color: var(--accent);
}

.page-prose .player .ctl-repeat[data-mode="one"]::after {
  content: "1";
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.page-prose .player .ctl-vol .icon-mute {
  display: none;
}

.page-prose .player[data-muted="true"] .ctl-vol .icon-vol {
  display: none;
}

.page-prose .player[data-muted="true"] .ctl-vol .icon-mute {
  display: block;
}

.page-prose .player-progress {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 0 20px 6px;
}

.page-prose .player-time {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.page-prose .player-time[data-duration] {
  text-align: right;
}

.page-prose .player .range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.page-prose .player .range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--fill, 0%),
    var(--line-strong) var(--fill, 0%) 100%
  );
  transition: background 0.1s linear;
}

.page-prose .player .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s var(--ease);
}

.page-prose .player .range:hover::-webkit-slider-thumb,
.page-prose .player .range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.15);
}

.page-prose .player .range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}

.page-prose .player .range::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.page-prose .player .range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.page-prose .player .range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

.page-prose .player-sub {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 6px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.page-prose .player-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-prose .player-count {
  margin: 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.page-prose .player-vol {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.page-prose .player-vol .range {
  width: 84px;
  height: 16px;
}

.page-prose .player-list-wrap {
  background: var(--surface);
}

.page-prose .player-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 6px;
}

.page-prose .player-list-title {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-prose .player-list-hint {
  color: var(--muted-2);
  font-size: 10.5px;
}

.page-prose .player-list {
  /* 8 full rows (8 x 40px) plus the list padding: never cut a row in half */
  max-height: 332px;
  margin: 0;
  padding: 2px 10px 10px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.page-prose .player-list::-webkit-scrollbar {
  width: 8px;
}

.page-prose .player-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--line-strong);
  background-clip: content-box;
}

.page-prose .player-list li {
  margin: 0;
  padding: 0;
}

.page-prose .player-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 18px 42px;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.page-prose .player-row:hover {
  background: var(--surface-2);
  color: var(--text);
}

.page-prose .player-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.page-prose .player-row[aria-current="true"] {
  background: var(--accent-softer);
  color: var(--text);
  font-weight: 600;
}

.page-prose .player-row-index {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
}

.page-prose .player-row[aria-current="true"] .player-row-index {
  color: var(--accent);
}

.page-prose .player-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-prose .player-row-duration {
  grid-column: 4;
  grid-row: 1;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.page-prose .player-row-eq {
  display: none;
  grid-column: 3;
  grid-row: 1;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.page-prose .player-row-eq span {
  display: block;
  width: 2px;
  height: 100%;
  border-radius: 1px;
  background: var(--accent);
  transform-origin: bottom;
  animation: player-eq 0.9s ease-in-out infinite alternate;
}

.page-prose .player-row-eq span:nth-child(2) {
  animation-delay: -0.3s;
}

.page-prose .player-row-eq span:nth-child(3) {
  animation-delay: -0.6s;
}

@keyframes player-eq {
  from { transform: scaleY(0.25); }
  to { transform: scaleY(1); }
}

.page-prose .player[data-playing="true"] .player-row[aria-current="true"] .player-row-eq {
  display: flex;
}

.page-prose .player[data-playing="true"] .player-row[aria-current="true"] .player-row-duration {
  display: none;
}

@media (max-width: 760px) {
  .page-prose .player-stage {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 16px 12px;
  }

  .page-prose .player-art {
    width: 76px;
    height: 76px;
  }

  .page-prose .player-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 2px;
  }

  .page-prose .player-progress {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding: 0 16px 4px;
  }

  .page-prose .player-sub {
    padding: 4px 16px 10px;
  }

  .page-prose .player-vol .range {
    width: 64px;
  }

  .page-prose .player-list-head {
    padding: 10px 16px 4px;
  }

  .page-prose .player-list-hint {
    display: none;
  }

  .page-prose .player-list {
    /* 7 whole rows on small screens */
    max-height: 290px;
    padding: 2px 8px 8px;
  }
}

@media (max-width: 480px) {
  .page-prose .player-vol {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-prose .player-row-eq span {
    animation: none;
    transform: scaleY(0.6);
  }

  .page-prose .player .ctl,
  .page-prose .player .range::-webkit-slider-thumb {
    transition: none;
  }
}
