/* =========================================================
   P0taTo blog engine
   A small, hand written dark theme.
   ========================================================= */

:root {
  --bg: #08080b;
  --bg-soft: #0b0b10;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-solid: #121218;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ececf2;
  --text-soft: #c3c3cf;
  --muted: #8b8b9b;
  --faint: #5f5f70;
  --accent: #f5c451;
  --accent-2: #ef9a63;
  --accent-soft: rgba(245, 196, 81, 0.12);
  --violet: #8b7cf6;
  --green: #6ee7a8;
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

body::selection,
body *::selection {
  background: rgba(245, 196, 81, 0.9);
  color: #17130a;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
figure,
blockquote,
pre {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent);
  color: #17130a;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #08080b;
}

::-webkit-scrollbar-thumb {
  background: #262631;
  border: 2px solid #08080b;
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a48;
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---------- backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--bg);
}

/* ---------- layout ---------- */

.shell {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 28px;
}

.shell--narrow {
  max-width: 860px;
}

.shell--archive {
  max-width: 940px;
}

.site-main {
  position: relative;
  z-index: 1;
  min-height: 60vh;
  view-transition-name: page;
}

.site-main:focus {
  outline: none;
}

/* ---------- home ---------- */

.home {
  padding-bottom: 48px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: calc(var(--header-h) + 44px) 0 30px;
  border-bottom: 1px solid var(--line);
}

.profile__avatar {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  transition: transform 0.5s var(--ease);
}

.profile__avatar::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(245, 196, 81, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.profile__avatar:hover {
  transform: scale(1.03);
}

.profile__avatar img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
}

.profile__info {
  min-width: 0;
}

.profile__name {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.045em;
}

.profile__tagline {
  margin-top: 8px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  font-style: italic;
}

.profile__links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.profile__links .social-link {
  width: 32px;
  height: 32px;
}

.profile__links .social-link svg {
  width: 15px;
  height: 15px;
}

.profile__stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.profile__stats a {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  transition: color 0.3s ease;
}

.profile__stats strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.profile__stats span {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.profile__stats a:hover strong,
.profile__stats a:hover span {
  color: var(--accent);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  align-items: start;
  gap: 42px;
  padding-top: 36px;
}

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

.home-section {
  margin-bottom: 46px;
}

.home-section .section-head {
  margin-bottom: 16px;
  padding-top: 0;
  padding-bottom: 10px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.home-section .section-head h2 {
  font-size: 1.2rem;
}

.home-posts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-posts .post-card {
  padding: 26px 28px;
  border-radius: 18px;
}

.home-posts .post-card__title {
  margin-top: 16px;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
}

.home-posts .post-card__excerpt {
  margin-top: 10px;
  font-size: 13.5px;
}

.home-posts .post-card__foot {
  margin-top: 20px;
}

.home-side {
  position: sticky;
  top: 98px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.side-card__title {
  margin-bottom: 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-list {
  display: flex;
  flex-direction: column;
}

.side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 12px;
  transition: color 0.25s ease, padding 0.3s var(--ease);
}

.side-row:last-child {
  border-bottom: 0;
}

.side-row:hover {
  padding-left: 3px;
  color: var(--accent);
}

.side-row__count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.side-year {
  margin: 8px 0 1px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.side-year:first-child {
  margin-top: 0;
}

.home .comments {
  margin-top: 10px;
}


/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  padding: 18px 0;
  transition: padding 0.45s var(--ease), background 0.45s ease, border-color 0.45s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  padding: 10px 0;
  background: rgba(8, 8, 11, 0.72);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--text);
  transition: color 0.3s ease;
}

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

.brand__dot {
  width: 6px;
  height: 6px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 3.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 46%, 100% { opacity: 1; transform: scale(1); }
  50%, 54% { opacity: 0.35; transform: scale(0.72); }
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.nav__indicator {
  position: absolute;
  top: 4px;
  left: 0;
  z-index: 0;
  width: 0;
  height: calc(100% - 8px);
  border: 1px solid rgba(245, 196, 81, 0.16);
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.11);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.34s var(--spring),
    width 0.34s var(--spring),
    height 0.34s var(--spring),
    top 0.34s var(--spring),
    opacity 0.2s ease;
}

.nav__indicator.is-ready {
  opacity: 1;
}

.site-header.is-scrolled .nav {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.nav__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.3s ease, transform 0.3s var(--ease);
}

.nav__link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.nav__link.is-active {
  color: var(--accent);
}

.nav__link.is-active .nav__icon {
  transform: scale(1.08);
}

.nav__icon {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  opacity: 0.9;
  transition: transform 0.3s var(--spring);
}

.nav__icon svg {
  width: 15px;
  height: 15px;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.nav-toggle:hover {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.35);
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle__close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__close {
  display: block;
}

/* ---------- mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  padding: calc(var(--header-h) + 28px) 28px 36px;
  background: rgba(8, 8, 11, 0.98);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.5s var(--ease);
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  margin: auto;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(16px);
  transition: color 0.3s ease, transform 0.35s var(--ease);
}

.mobile-menu.is-open .mobile-menu__link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(80ms + var(--i) * 55ms);
}

.mobile-menu__link:hover {
  color: var(--accent);
}

.mobile-menu__link svg {
  width: 22px;
  height: 22px;
  color: var(--faint);
  transition: color 0.3s ease, transform 0.35s var(--ease);
}

.mobile-menu__link:hover svg {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.mobile-menu__foot {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 36px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease), background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  color: #17130a;
  background: var(--accent);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background: #f8d477;
}

.btn--ghost {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
}

.btn--small {
  padding: 8px 15px;
  font-size: 12px;
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: 92px 0;
  scroll-margin-top: 92px;
}

.section--latest {
  padding-top: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-head__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head__index {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.section-head__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.section-head__icon svg {
  width: 18px;
  height: 18px;
}

.section-head h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-head__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.3s ease;
}

.section-head__more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.35s var(--ease);
}

.section-head__more:hover {
  color: var(--accent);
}

.section-head__more:hover svg {
  transform: translateX(4px);
}

/* ---------- post card ---------- */

.post-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.55s var(--ease), border-color 0.45s ease;
}

.post-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.post-card:focus-within {
  border-color: rgba(245, 196, 81, 0.45);
}

.post-card__overlay:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 196, 81, 0.22);
}

.post-card__body {
  position: relative;
  pointer-events: none;
}

.post-card__tags {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: auto;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.post-card__cat {
  color: var(--accent);
}

.post-card__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

.post-card__read {
  margin-left: auto;
  color: var(--faint);
}

.post-card__title {
  max-width: 18em;
  margin-top: 22px;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.035em;
  transition: color 0.35s ease;
}

.post-card:hover .post-card__title {
  color: #fff7e4;
}

.post-card__excerpt {
  max-width: 52em;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
}

.post-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease);
}

.chip:hover {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.32);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.post-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--text-soft);
  font-size: 12.5px;
}

.post-card__more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.35s var(--ease);
}

.post-card:hover .post-card__more {
  color: var(--accent);
}

.post-card:hover .post-card__more svg {
  transform: translateX(5px);
}

/* ---------- ideas ---------- */

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.shell--ideas {
  max-width: 980px;
  padding-bottom: 86px;
}

.idea-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.022);
  transition: transform 0.45s var(--ease), border-color 0.35s ease, background 0.35s ease;
}

.idea-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}
}

.idea-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.idea-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.idea-card__head time {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
}

.idea-card__date {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.idea-card__time {
  color: var(--faint);
  font-size: 10px;
}

.idea-card__text {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.idea-card__text p {
  margin: 0;
}

.idea-card__media {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.idea-image {
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e0e14;
  cursor: zoom-in;
}

.idea-image img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s ease;
}

.idea-image:hover img {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.shell--ideas .idea-image img {
  max-height: 380px;
}

/* ---------- page hero ---------- */

.page-hero {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 54px) 28px 28px;
  text-align: center;
}

.page-hero__title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.05em;
  color: var(--text);
}

.page-hero__meta {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 24px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-hero__count {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
}

/* ---------- post ---------- */

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 2px;
  pointer-events: none;
  background: transparent;
}

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

.post-hero {
  padding: calc(var(--header-h) + 86px) 0 40px;
}

.post-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-hero__category {
  color: var(--accent);
  transition: color 0.3s ease;
}

.post-hero__category:hover {
  color: #ffe6a1;
}

.post-hero__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

.post-hero__title {
  max-width: 15em;
  margin-top: 22px;
  font-size: clamp(2.35rem, 5.4vw, 4.15rem);
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -0.045em;
  color: var(--text);
}

.post-hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.post-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-hero__extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--faint);
  font-size: 11px;
}

.post-hero__views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
}

.post-hero__views svg {
  width: 13px;
  height: 13px;
}

.post-hero__updated {
  font-family: var(--mono);
}

.mobile-toc {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.mobile-toc summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  color: var(--text-soft);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}

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

.mobile-toc summary svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.mobile-toc summary svg:last-child {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}

.mobile-toc[open] summary svg:last-child {
  transform: rotate(180deg);
}

.mobile-toc nav {
  display: flex;
  flex-direction: column;
  padding: 0 16px 14px;
}

.mobile-toc .toc__link {
  padding: 7px 0;
  border: 0;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px;
  align-items: start;
  gap: clamp(36px, 6vw, 74px);
  max-width: 1060px;
  padding-top: 42px;
  padding-bottom: 110px;
}

.post-main {
  min-width: 0;
  max-width: 760px;
}

.post-hero .shell--narrow,
.post-layout {
  max-width: 1060px;
}

.post-hero .shell--narrow {
  max-width: 900px;
}

/* ---------- prose ---------- */

.prose {
  color: #d2d2dd;
  font-size: 16.5px;
  line-height: 1.95;
  overflow-wrap: break-word;
}

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

.prose p {
  margin: 1.25em 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  color: #f1f1f6;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.025em;
  scroll-margin-top: 110px;
}

.prose h1 {
  margin: 2.2em 0 0.85em;
  font-size: 1.75rem;
}

.prose h2 {
  margin: 2.35em 0 0.8em;
  font-size: 1.55rem;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  margin-right: 11px;
  margin-bottom: 0.35em;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: middle;
}

.prose h3 {
  margin: 2em 0 0.7em;
  font-size: 1.25rem;
}

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

.heading-anchor {
  display: inline-flex;
  margin-left: 9px;
  color: var(--faint);
  opacity: 0;
  vertical-align: middle;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.heading-anchor svg {
  width: 0.62em;
  height: 0.62em;
}

.prose h1:hover .heading-anchor,
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(245, 196, 81, 0.32);
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

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

.prose strong {
  color: #ffffff;
  font-weight: 650;
}

.prose em {
  color: #e6e6ef;
}

.prose mark {
  padding: 0 0.18em;
  border-radius: 3px;
  color: #1a170d;
  background: rgba(245, 196, 81, 0.78);
}

.prose hr {
  height: 1px;
  margin: 3.2em 0;
  border: 0;
  background: var(--line-strong);
}

.prose blockquote {
  margin: 2em 0;
  padding: 18px 22px;
  border-left: 2px solid var(--accent);
  border-radius: 0 14px 14px 0;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
}

.prose blockquote p {
  margin: 0;
}

.prose ul,
.prose ol {
  margin: 1.2em 0;
  padding-left: 1.55em;
}

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

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

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

.prose img {
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.prose code {
  padding: 0.15em 0.42em;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  color: #ffd98a;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.86em;
}

.prose .code-block code {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}

.prose .table-wrap {
  margin: 1.8em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

.prose th,
.prose td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

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

.prose tbody tr {
  transition: background 0.25s ease;
}

.prose tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.math-display {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 1.6em 0;
  padding: 10px 2px;
  scrollbar-width: thin;
}

.katex {
  font-size: 1.04em;
}

.katex-display {
  margin: 0;
}

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 2em 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #050507;
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- code ---------- */

.code-block {
  position: relative;
  margin: 1.7em 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b0b10;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 12px 7px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.code-lang {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  transition: color 0.25s ease, background 0.25s ease;
}

.code-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.code-copy svg {
  width: 13px;
  height: 13px;
}

.code-copy-icon,
.code-copy-check {
  display: inline-flex;
}

.code-copy-check {
  display: none;
  color: var(--green);
}

.code-copy[data-copied="true"] .code-copy-icon {
  display: none;
}

.code-copy[data-copied="true"] .code-copy-check {
  display: inline-flex;
}

.code-copy[data-copied="true"] {
  color: var(--green);
}

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-block pre code {
  display: block;
  color: #d7d7e2;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.8;
  tab-size: 4;
}

.hljs-comment,
.hljs-quote {
  color: #63637a;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
  color: #c792ea;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #a5e075;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-variable,
.hljs-template-variable {
  color: #f78c6c;
}

.hljs-title,
.hljs-title.class_,
.hljs-title.function_,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
  color: #82aaff;
}

.hljs-params,
.hljs-property {
  color: #d7d7e2;
}

.hljs-built_in,
.hljs-type,
.hljs-attr,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-meta {
  color: #ffcb6b;
}

.hljs-tag {
  color: #f07178;
}

.hljs-deletion {
  color: #f07178;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

/* ---------- toc ---------- */

.toc {
  position: sticky;
  top: 112px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.toc__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toc__title svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.toc__nav {
  display: flex;
  flex-direction: column;
}

.toc__link {
  position: relative;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  transition: color 0.25s ease, transform 0.25s var(--ease);
}

.toc__link:hover {
  color: var(--text);
  transform: translateX(2px);
}

.toc__link--h3 {
  padding-left: 12px;
  font-size: 11.5px;
  color: var(--faint);
}

.toc__link.is-active {
  color: var(--accent);
}

.toc__link.is-active::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 50%;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}

/* ---------- post end + comments ---------- */

.post-end {
  margin-top: 72px;
  padding: 44px 0 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.post-end__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border: 1px solid rgba(245, 196, 81, 0.2);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}

.post-end__mark svg {
  width: 18px;
  height: 18px;
}

.post-end__thanks {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.post-end__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}

.post-end__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.comments {
  margin-top: 76px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 100px;
}

.comments__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}

.comments__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.comments__icon svg {
  width: 20px;
  height: 20px;
}

.comments__title h2 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.giscus-shell {
  min-height: 170px;
}

.giscus-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 170px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--faint);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.giscus-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---------- archives ---------- */

.archive {
  padding-top: 10px;
}

.archive-year {
  margin-bottom: 54px;
}

.archive-year__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.archive-year__head h2 {
  font-size: clamp(2.1rem, 4.8vw, 3.1rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text);
}

.archive-year__head span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
}

.archive-month {
  margin-bottom: 26px;
  padding-left: 2px;
}

.archive-month__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.archive-month__name {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.archive-month__count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.archive-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 16px;
  padding: 17px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.35s ease, padding 0.35s var(--ease);
}

.archive-row:hover {
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.022);
}

.archive-row__date {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.archive-row__title {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 14.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.archive-row:hover .archive-row__title {
  color: var(--accent);
}

.archive-row__tags {
  overflow: hidden;
  max-width: 220px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row__arrow {
  display: grid;
  place-items: center;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.35s var(--ease), color 0.3s ease;
}

.archive-row__arrow svg {
  width: 16px;
  height: 16px;
}

.archive-row:hover .archive-row__arrow {
  color: var(--accent);
  opacity: 1;
  transform: translateX(0);
}

.archive-categories {
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.archive-categories__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.archive-categories__title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.archive-categories__list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.category-pill:hover {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.3);
  background: var(--accent-soft);
}

.category-pill__count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- tags / categories ---------- */

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  padding-bottom: 90px;
}

.tag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
  transition: transform 0.45s var(--ease), border-color 0.35s ease, background 0.35s ease;
}

.tag-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 196, 81, 0.25);
  background: rgba(255, 255, 255, 0.035);
}

.tag-card__hash {
  position: absolute;
  right: 16px;
  top: 6px;
  color: rgba(255, 255, 255, 0.045);
  font-family: var(--mono);
  font-size: 5.4rem;
  font-weight: 700;
  line-height: 1;
  transition: color 0.35s ease, transform 0.45s var(--ease);
}

.tag-card:hover .tag-card__hash {
  color: rgba(245, 196, 81, 0.12);
  transform: translateY(-2px) rotate(-4deg);
}

.tag-card__name {
  position: relative;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tag-card__count {
  position: relative;
  margin-top: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

.tag-card__bar {
  position: relative;
  display: block;
  width: 100%;
  height: 2px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.tag-card__bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.3s ease;
}

.back-link svg {
  width: 15px;
  height: 15px;
  transform: rotate(180deg);
  transition: transform 0.35s var(--ease);
}

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

.back-link:hover svg {
  transform: rotate(180deg) translateX(3px);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 90px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding-bottom: 90px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.022);
  transition: transform 0.45s var(--ease), border-color 0.35s ease, background 0.35s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 124, 246, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.category-card__name {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.category-card__count {
  margin-top: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

.category-card__arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease);
}

.category-card__arrow svg {
  width: 16px;
  height: 16px;
}

.category-card:hover .category-card__arrow {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.3);
  transform: translate(3px, -3px);
}

/* ---------- 404 ---------- */

.notfound {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--header-h) + 60px) 0 80px;
}

.notfound__inner {
  text-align: center;
}

.notfound__code {
  display: flex;
  justify-content: center;
  gap: 0.02em;
  font-family: var(--mono);
  font-size: clamp(6rem, 22vw, 13rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.notfound__code span {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  animation: floatCode 5s ease-in-out infinite;
}

.notfound__code span:nth-child(2) {
  animation-delay: 0.5s;
}

.notfound__code span:nth-child(3) {
  animation-delay: 1s;
}

.notfound__zero {
  color: var(--accent) !important;
  -webkit-text-stroke: 0 !important;
}

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

.notfound__title {
  margin-top: 26px;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  letter-spacing: -0.03em;
}

.notfound__desc {
  max-width: 30em;
  margin: 14px auto 28px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 52px 0 34px;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 32px;
}

.footer__copy {
  color: var(--text-soft);
  font-size: 12px;
}

.footer__copy a {
  color: var(--text);
  transition: color 0.3s ease;
}

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

.footer__stats {
  display: flex;
  align-items: center;
  gap: 22px;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.stat__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.stat__dot--soft {
  background: var(--accent);
}

.stat__value {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.footer__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 11px;
  transition: color 0.3s ease;
}

.footer__link svg {
  width: 14px;
  height: 14px;
}

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

/* ---------- to top ---------- */

.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(13, 13, 18, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease), color 0.3s ease, border-color 0.3s ease;
}

.to-top svg {
  width: 17px;
  height: 17px;
}

.to-top__label {
  display: none;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.35);
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 40px;
  border: 0;
  background: transparent;
}

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

.lightbox::backdrop {
  background: rgba(4, 4, 7, 0.86);
}

.lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 86vh;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  animation: lightboxIn 0.45s var(--ease);
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: absolute;
  top: 26px;
  right: 26px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  background: rgba(13, 13, 18, 0.8);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
}

.lightbox__close:hover {
  color: var(--accent);
  border-color: rgba(245, 196, 81, 0.35);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 130;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 18, 24, 0.92);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

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

/* ---------- reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--faint);
  font-size: 13px;
}

.empty-state svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

/* ---------- view transitions ---------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(page) {
  animation: pageOut 0.12s ease both;
}

::view-transition-new(page) {
  animation: pageIn 0.18s var(--ease) both;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

@keyframes pageOut {
  to { opacity: 0; transform: translateY(-6px); }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .hero__inner {
    gap: 40px;
  }

  .hero__title {
    font-size: clamp(4rem, 10vw, 7rem);
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 30px;
  }

  .post-layout {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 44px;
  }

  .archive-row {
    grid-template-columns: 84px minmax(0, 1fr) auto 20px;
  }
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header.is-scrolled .nav {
    border-color: transparent;
    background: transparent;
  }

  .profile {
    padding-top: calc(var(--header-h) + 30px);
  }

  .profile__stats {
    gap: 20px;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 28px;
  }

  .home-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .side-card:last-child {
    grid-column: 1 / -1;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 64px);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .hero__portrait {
    order: -1;
    justify-self: start;
    width: 168px;
  }

  .portrait__caption {
    display: none;
  }

  .hero__title {
    font-size: clamp(4rem, 16vw, 7rem);
  }

  .hero__foot {
    padding-top: 48px;
  }

  .post-layout {
    display: block;
    padding-top: 34px;
    padding-bottom: 80px;
  }

  .toc {
    display: none;
  }

  .mobile-toc {
    display: block;
  }

  .post-hero {
    padding-top: calc(var(--header-h) + 70px);
  }

  .post-hero .shell--narrow {
    max-width: 100%;
  }

  .footer__inner {
    grid-template-columns: 1fr auto;
  }

  .footer__stats {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (min-width: 901px) {
  .mobile-toc {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 68px;
  }

  .shell {
    padding-inline: 20px;
  }

  .site-header {
    padding: 12px 0;
  }

  .site-header__inner {
    gap: 12px;
  }

  .brand {
    font-size: 1.02rem;
  }

  .profile {
    flex-wrap: wrap;
    gap: 15px;
    padding-top: calc(var(--header-h) + 24px);
    padding-bottom: 22px;
  }

  .profile__avatar {
    width: 72px;
    height: 72px;
  }

  .profile__name {
    font-size: 2rem;
  }

  .profile__tagline {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .profile__links {
    margin-top: 10px;
  }

  .profile__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .profile__stats a {
    align-items: flex-start;
  }

  .profile__stats strong {
    font-size: 1.2rem;
  }

  .home {
    padding-bottom: 36px;
  }

  .home-section {
    margin-bottom: 34px;
  }

  .home-posts .post-card {
    padding: 22px;
    border-radius: 16px;
  }

  .home-side {
    grid-template-columns: 1fr;
  }

  .side-card:last-child {
    grid-column: auto;
  }

  .section {
    padding: 66px 0;
  }

  .section--latest {
    padding-top: 10px;
  }

  .post-card {
    border-radius: 20px;
  }

  .post-card__meta {
    gap: 8px;
    font-size: 9.5px;
  }

  .post-card__read {
    margin-left: 0;
  }

  .post-card__title {
    margin-top: 16px;
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .post-card__foot {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 22px;
  }

  .ideas-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .idea-card {
    padding: 16px;
    border-radius: 14px;
  }

  .shell--ideas {
    padding-bottom: 60px;
  }

  .page-hero {
    padding-top: calc(var(--header-h) + 56px);
    padding-bottom: 26px;
  }

  .post-hero {
    padding-top: calc(var(--header-h) + 52px);
    padding-bottom: 26px;
  }

  .post-hero__title {
    margin-top: 16px;
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .post-hero__foot {
    margin-top: 20px;
    padding-bottom: 20px;
  }

  .post-hero__extra {
    gap: 12px;
  }

  .prose {
    font-size: 15px;
    line-height: 1.88;
  }

  .prose p {
    margin: 1.05em 0;
  }

  .prose h2 {
    font-size: 1.36rem;
  }

  .prose h2::before {
    width: 12px;
    margin-right: 8px;
  }

  .prose h1 {
    font-size: 1.5rem;
  }

  .prose .table-wrap {
    overflow: visible;
  }

  .prose table,
  .prose tbody,
  .prose tr,
  .prose td {
    display: block;
    width: 100%;
  }

  .prose thead {
    display: none;
  }

  .prose tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

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

  .prose td {
    padding: 6px 14px;
    border: 0;
    text-align: left !important;
  }

  .prose td + td {
    margin-top: 4px;
  }

  .prose td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .prose p .katex,
  .prose li .katex,
  .prose td .katex {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: middle;
    scrollbar-width: none;
  }

  .prose p .katex::-webkit-scrollbar,
  .prose li .katex::-webkit-scrollbar,
  .prose td .katex::-webkit-scrollbar {
    display: none;
  }

  .prose .katex--wide {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: middle;
  }

  .math-display {
    margin: 1.1em 0;
    padding: 6px 0;
  }

  .code-block pre {
    padding: 14px 16px;
  }

  .code-block pre code {
    font-size: 12.5px;
  }

  .post-end {
    margin-top: 54px;
  }

  .comments {
    margin-top: 56px;
  }

  .archive-row {
    grid-template-columns: 74px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 14px 4px;
  }

  .archive-row__tags {
    display: none;
  }

  .archive-year {
    margin-bottom: 40px;
  }

  .tag-grid,
  .category-grid {
    grid-template-columns: 1fr;
    padding-bottom: 66px;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer__stats {
    grid-column: auto;
    grid-row: auto;
  }

  .footer__right {
    justify-content: space-between;
  }

  .to-top {
    right: 18px;
    bottom: 18px;
  }

  .lightbox {
    padding: 18px;
  }

  .lightbox__close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 420px) {
  .hero__stats {
    gap: 22px;
  }

  .hero-stat {
    gap: 6px;
  }

  .hero-stat__num {
    font-size: 1.2rem;
  }

  .hero-stat__label {
    font-size: 10px;
  }

  .mobile-menu {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .hero__letter {
    opacity: 1;
    transform: none;
  }
}


