@charset "UTF-8";
.page-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 2rem;
  column-gap: 2rem;
  align-items: flex-start;
}

.index-main {
  display: block;
}

/* Shared listing-page layout for home, pagination and tags */
body[data-page-type=home] .index-main,
body[data-page-type=pagination] .index-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: auto;
  width: 100%;
  padding: 1rem 0;
  box-sizing: border-box;
  overflow: visible;
}

body[data-page-type=home] .index-center-wrapper,
body[data-page-type=pagination] .index-center-wrapper {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem 1.5rem;
  margin-bottom: 1rem !important;
}

body[data-page-type=home] .post-grid-wrapper,
body[data-page-type=pagination] .post-grid-wrapper {
  padding: 0;
}

body[data-page-type=home] .post-grid,
body[data-page-type=pagination] .post-grid {
  width: min(100%, 1200px);
  max-width: 1200px;
  row-gap: 3.5rem;
}

.main-content {
  grid-column: 1;
  max-width: 90rem;
  width: 100%;
  padding-left: 26px;
  padding-right: 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  justify-self: start;
}

body[data-page-type=home] .main-content,
body[data-page-type=pagination] .main-content {
  padding-inline: 0;
}

.site-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  padding: 0 1rem;
}

/* ===== RESPONSIVE GRID LAYOUT ===== */
/* The base 3-column grid (content | TOC | right-gutter) handles all sizes.
  Blog content keeps its left edge aligned with the separator while preserving the right gutter. */
@media (max-width: 768px) {
  .main-content {
    max-width: 100%;
  }
}
@media (max-width: 600px) {
  .main-content {
    max-width: 100%;
  }
}
/* Small mobile: 480px and below */
@media (max-width: 480px) {
  .post-grid {
    row-gap: 1.5rem;
    margin: 0.5rem auto;
  }
  .post-grid > .post-card {
    flex: 0 0 100%;
  }
}
/* Ultra small: 360px and below */
@media (max-width: 360px) {
  .post-grid {
    perspective: none;
  }
}
/* ===== CARD WIGGLE ANIMATION ===== */
@keyframes cardWiggle {
  0% {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  }
  25% {
    filter: drop-shadow(1px 2px 8px rgba(0, 0, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  }
  75% {
    filter: drop-shadow(-1px 2px 8px rgba(0, 0, 0, 0.3));
  }
  100% {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  }
}
.main-inner {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Add perspective for 3D effect */
.post-grid {
  perspective: 1200px;
}

/* Pagination button row spacing */
.nav-button-row {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.index-center-wrapper {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 0 1.5rem;
}

.pinned-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  margin-top: auto;
}

.post-grid-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
}

.post-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  row-gap: 3.5rem;
  width: min(100%, 1200px);
  max-width: 1200px;
  margin: 0 auto;
}

/* Fixed-width cards; justify-content: center on grid centers incomplete rows */
.post-grid > .post-card {
  flex: 0 0 calc((100% - 4rem) / 3);
  min-width: 0;
  box-sizing: border-box;
}

/* Keep listing pages top-aligned instead of vertically centered */
body[data-page-type=home] > main:has(.post-grid-wrapper),
body[data-page-type=pagination] > main:has(.post-grid-wrapper) {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
}

body[data-page-type=home] > main:has(.post-grid-wrapper) .post-grid-wrapper,
body[data-page-type=pagination] > main:has(.post-grid-wrapper) .post-grid-wrapper {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

body[data-page-type=home] > main:has(.post-grid-wrapper) .nav-button-row,
body[data-page-type=pagination] > main:has(.post-grid-wrapper) .nav-button-row {
  margin-top: 1rem;
  width: 100%;
}

.index-main .post-grid {
  margin: 0 auto;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.4s cubic-bezier(0.33, 1, 0.68, 1), color 0.3s;
  padding: 1rem;
  height: 380px;
  overflow: hidden;
  z-index: 1;
  border: none;
  transform-origin: center center;
}

.post-card > a {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
  min-height: 0;
}

.post-card:hover {
  box-shadow: -16px 18px 40px rgba(255, 111, 145, 0.4), 0 22px 44px rgba(255, 240, 215, 0.18), 16px 18px 40px rgba(255, 165, 80, 0.4), 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* --- Holographic foil: blazing rainbow + diffraction grain --- */
.post-card::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 2;
  opacity: calc(var(--holo-intensity, 0) * 1);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'><g fill='white'><circle cx='32' cy='42' r='1.2' opacity='0.9'/><circle cx='118' cy='28' r='0.9' opacity='0.8'/><circle cx='195' cy='55' r='1.4' opacity='1'/><circle cx='248' cy='38' r='1.1' opacity='0.9'/><circle cx='62' cy='95' r='1.3' opacity='0.85'/><circle cx='155' cy='108' r='0.9' opacity='0.8'/><circle cx='225' cy='125' r='1.4' opacity='0.95'/><circle cx='42' cy='162' r='1.1' opacity='0.85'/><circle cx='128' cy='178' r='1.3' opacity='0.9'/><circle cx='205' cy='195' r='0.9' opacity='0.8'/><circle cx='78' cy='225' r='1.4' opacity='1'/><circle cx='168' cy='248' r='1.1' opacity='0.9'/><circle cx='245' cy='235' r='1.3' opacity='0.95'/><circle cx='15' cy='145' r='1.0' opacity='0.85'/><circle cx='95' cy='200' r='1.2' opacity='0.9'/><circle cx='175' cy='145' r='0.8' opacity='0.75'/><circle cx='265' cy='170' r='1.3' opacity='0.95'/></g></svg>"), linear-gradient(calc((var(--mx, 0.5) - 0.5) * 60deg + 180deg), hsl(185, 100%, 60%) 0%, hsl(220, 100%, 65%) 18%, hsl(270, 100%, 68%) 36%, hsl(315, 100%, 65%) 54%, hsl(10, 100%, 62%) 72%, hsl(45, 100%, 65%) 88%, hsl(185, 100%, 60%) 100%), linear-gradient(calc((var(--mx, 0.5) - 0.5) * 60deg + 90deg), hsl(200, 100%, 62%) 0%, hsl(255, 100%, 66%) 20%, hsl(310, 100%, 65%) 40%, hsl(355, 100%, 63%) 60%, hsl(50, 100%, 66%) 80%, hsl(140, 100%, 62%) 100%);
  background-size: 220px 220px, 130% 130%, 130% 130%;
  background-position: calc(var(--mx, 0.5) * 60px) calc(var(--my, 0.5) * 60px), calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%), calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%);
  background-blend-mode: overlay, screen, hard-light;
  filter: saturate(3) brightness(1.6) contrast(1.15);
  mix-blend-mode: screen;
  transition: opacity 0.35s ease;
}

/* --- Specular highlight + sweeping shine ----- */
.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 4;
  opacity: calc(var(--holo-intensity, 0) * 1);
  --shine-pos: -60%;
  background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 8%, transparent 22%), radial-gradient(ellipse 80% 80% at var(--pointer-x, 50%) var(--pointer-y, 50%), transparent 4%, hsla(185, 100%, 75%, 0.5) 12%, hsla(265, 100%, 78%, 0.48) 20%, hsla(325, 100%, 78%, 0.48) 28%, hsla(15, 100%, 75%, 0.48) 36%, hsla(55, 100%, 78%, 0.4) 44%, transparent 58%), linear-gradient(115deg, transparent 0%, transparent 34%, rgba(255, 255, 255, 0.35) 44%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0.35) 56%, transparent 66%, transparent 100%);
  background-size: 100% 100%, 100% 100%, 220% 220%;
  background-position: center, center, var(--shine-pos) center;
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
}

@property --shine-pos {
  syntax: "<percentage>";
  inherits: false;
  initial-value: -60%;
}
@keyframes holoShineSweep {
  0% {
    --shine-pos: -60%;
  }
  55% {
    --shine-pos: 160%;
  }
  100% {
    --shine-pos: 160%;
  }
}
.post-card:hover::after,
.post-card:focus-within::after {
  animation: holoShineSweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.post-card:hover,
.post-card:focus-within {
  box-shadow: -20px 20px 50px rgba(255, 60, 180, 0.75), 0 0 30px rgba(180, 100, 255, 0.6), 20px 20px 50px rgba(255, 140, 40, 0.75), 0 30px 60px rgba(255, 220, 120, 0.35), 0 0 80px rgba(100, 220, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.4);
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
  z-index: 3;
}

/* Darken text when holo foil lightens the card */
.post-card:hover .post-content h2,
.post-card:focus-within .post-content h2,
.post-card:hover .post-content p,
.post-card:focus-within .post-content p,
.post-card:hover .post-date,
.post-card:focus-within .post-date {
  color: var(--color-bg-secondary) !important;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: sparkle-fade 1.5s forwards;
  filter: drop-shadow(0 0 4px #fff);
  mix-blend-mode: screen;
  z-index: 6;
}

@keyframes sparkle-fade {
  0% {
    opacity: 1;
    transform: scale(0.8);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}
/* --- Reflective + holographic thumbnail effect --- */
.post-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0;
  position: relative;
  z-index: 3;
}

.post-thumb-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  flex-shrink: 0;
}

/* Holographic foil on thumbnail — same gradient system as card ::before */
.post-thumb-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 14px;
  opacity: calc(var(--holo-intensity, 0) * 1);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'><g fill='white'><circle cx='32' cy='42' r='1.2' opacity='0.9'/><circle cx='118' cy='28' r='0.9' opacity='0.8'/><circle cx='195' cy='55' r='1.4' opacity='1'/><circle cx='248' cy='38' r='1.1' opacity='0.9'/><circle cx='62' cy='95' r='1.3' opacity='0.85'/><circle cx='155' cy='108' r='0.9' opacity='0.8'/><circle cx='225' cy='125' r='1.4' opacity='0.95'/><circle cx='42' cy='162' r='1.1' opacity='0.85'/><circle cx='128' cy='178' r='1.3' opacity='0.9'/><circle cx='205' cy='195' r='0.9' opacity='0.8'/><circle cx='78' cy='225' r='1.4' opacity='1'/><circle cx='168' cy='248' r='1.1' opacity='0.9'/><circle cx='245' cy='235' r='1.3' opacity='0.95'/></g></svg>"), linear-gradient(calc((var(--mx, 0.5) - 0.5) * 60deg + 180deg), hsl(185, 100%, 60%) 0%, hsl(220, 100%, 65%) 18%, hsl(270, 100%, 68%) 36%, hsl(315, 100%, 65%) 54%, hsl(10, 100%, 62%) 72%, hsl(45, 100%, 65%) 88%, hsl(185, 100%, 60%) 100%), linear-gradient(calc((var(--mx, 0.5) - 0.5) * 60deg + 90deg), hsl(200, 100%, 62%) 0%, hsl(255, 100%, 66%) 20%, hsl(310, 100%, 65%) 40%, hsl(355, 100%, 63%) 60%, hsl(50, 100%, 66%) 80%, hsl(140, 100%, 62%) 100%);
  background-size: 220px 220px, 130% 130%, 130% 130%;
  background-position: calc(var(--mx, 0.5) * 60px) calc(var(--my, 0.5) * 60px), calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%), calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%);
  background-blend-mode: overlay, screen, hard-light;
  filter: saturate(3) brightness(1.6) contrast(1.15);
  mix-blend-mode: screen;
  z-index: 4;
  transition: opacity 0.35s ease;
}

/* Specular highlight on thumbnail — mirrors card ::after */
.post-thumb-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 14px;
  opacity: calc(var(--holo-intensity, 0) * 1);
  background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.45) 10%, transparent 25%), radial-gradient(ellipse 80% 80% at var(--pointer-x, 50%) var(--pointer-y, 50%), transparent 4%, hsla(185, 100%, 75%, 0.5) 12%, hsla(265, 100%, 78%, 0.48) 20%, hsla(325, 100%, 78%, 0.48) 28%, hsla(15, 100%, 75%, 0.48) 36%, transparent 55%);
  mix-blend-mode: screen;
  z-index: 5;
  transition: opacity 0.35s ease;
}

/* --- Keep content above effects --- */
.post-card > * {
  position: relative;
  z-index: 5;
}

.post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--color-text-primary);
  padding: 0;
}

.post-content h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-content p {
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
}

.post-excerpt {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  transform: translateY(12px) scale(0.985);
  transition: max-height 0s, opacity 0s, margin-top 0s, transform 0s;
}

.post-card:hover .post-excerpt,
.post-card:focus-within .post-excerpt {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
  transform: translateY(0) scale(1);
  transition: max-height 0.95s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), margin-top 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  pointer-events: auto;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-meta .badge {
  pointer-events: auto;
}

.post-date {
  font-size: 0.75rem;
  color: var(--color-text-primary);
}

.post-tags {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
}

.badge {
  background-color: var(--color-bg-muted);
  color: var(--color-text-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.inline-badge {
  background-color: var(--color-bg-muted);
  color: var(--color-text-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-decoration: none;
  /* Smooth transition setup */
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}

.inline-badge:hover {
  background-color: var(--color-bg-muted);
  color: var(--color-text-primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

/* Tag pill: on hover — restore original rainbow gradient and glow */
.post-card:hover .badge,
.post-card:focus-within .badge {
  background: linear-gradient(135deg, #ffb86c, #6fcfff, #b86cff, #ff6f91);
  color: #000;
  background-size: 300% 300%;
  animation: badge-glow 3s ease infinite;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
  transition: background 0.4s ease-in-out;
}

/* Tag pill: re-hover for brighter glow */
.post-card:hover .badge:hover,
.post-card:focus-within .badge:hover {
  color: #fff;
  background: linear-gradient(135deg, #fff1bc, #a5eaff, #dab6ff, #ffb6c9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3), 0 0 32px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px) scale(1.06);
}

@keyframes badge-glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* ── Filter bar ── */
.post-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.5rem;
  padding: 0.5rem 2rem 1.6rem;
  width: 100%;
  max-width: min(100%, 1200px);
  margin: 0 auto;
  justify-content: center;
  box-sizing: border-box;
}

/* sticker-style tag chips: lowercase mono, soft border, slight tilt for charm */
.post-filter-pill {
  margin-bottom: 2rem;
  appearance: none;
  border: 1px dashed color-mix(in srgb, var(--color-text-muted) 38%, transparent);
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.35rem 0.95rem 0.4rem;
  border-radius: 6px;
  font-family: "Maple Mono", "JetBrainsMonoNerd", monospace;
  font-size: 0.78rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  transform: rotate(var(--pill-tilt, 0deg));
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.22s ease;
}

/* gentle alternating tilt so the bar feels collected, not stamped */
.post-filter-pill:nth-child(3n+1) {
  --pill-tilt: -1.2deg;
}

.post-filter-pill:nth-child(3n+2) {
  --pill-tilt: 0.8deg;
}

.post-filter-pill:nth-child(3n+3) {
  --pill-tilt: -0.4deg;
}

.post-filter-pill::before {
  content: "#";
  margin-right: 0.1em;
  color: color-mix(in srgb, var(--color-light-purple, #c1b6f0) 70%, transparent);
  font-weight: 600;
}

.post-filter-pill:hover {
  color: var(--color-light-yellow);
  border-color: color-mix(in srgb, var(--color-light-yellow) 55%, transparent);
  background: color-mix(in srgb, var(--color-light-yellow) 7%, transparent);
  transform: rotate(0deg) translateY(-2px);
}

.post-filter-pill.is-active {
  color: var(--color-bg-primary);
  background: var(--color-light-yellow);
  border-style: solid;
  border-color: var(--color-light-yellow);
  font-weight: 700;
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--color-light-yellow) 32%, transparent);
}

.post-filter-pill.is-active::before {
  color: color-mix(in srgb, var(--color-bg-primary) 65%, var(--color-purple));
}

/* Tag-tinted active pills */
.post-filter-pill.is-active[data-filter=maldev] {
  background: var(--color-red);
  border-color: var(--color-red);
  box-shadow: 0 3px 12px rgba(253, 94, 58, 0.4);
}

.post-filter-pill.is-active[data-filter=physics] {
  background: var(--color-blue);
  border-color: var(--color-blue);
  box-shadow: 0 3px 12px rgba(62, 143, 176, 0.4);
}

.post-filter-pill.is-active[data-filter=math] {
  background: var(--color-purple);
  border-color: var(--color-purple);
  box-shadow: 0 3px 12px rgba(196, 167, 231, 0.4);
}

.post-filter-pill.is-active[data-filter=uoft] {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  box-shadow: 0 3px 12px rgba(234, 157, 52, 0.4);
}

.post-filter-pill.is-active[data-filter=intro] {
  background: var(--color-green);
  border-color: var(--color-green);
  box-shadow: 0 3px 12px rgba(55, 217, 158, 0.4);
}

.post-filter-pill.is-active[data-filter=windows] {
  background: var(--color-light-blue);
  border-color: var(--color-light-blue);
  box-shadow: 0 3px 12px rgba(156, 207, 216, 0.4);
  color: var(--color-bg-secondary);
}

/* Hidden card (filtered out) */
.post-card--hidden {
  display: none;
}

.post-grid__empty {
  width: 100%;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* ============================================
   ENHANCED RESPONSIVE POST GRID & ANIMATIONS
   ============================================ */
.post-grid {
  animation: gridSlideIn 0.6s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes gridSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Stagger animation for post cards */
.post-card {
  animation: cardFadeIn 0.5s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.post-card:nth-child(1) {
  animation-delay: 0.05s;
}

.post-card:nth-child(2) {
  animation-delay: 0.1s;
}

.post-card:nth-child(3) {
  animation-delay: 0.15s;
}

/* Enhanced mobile pagination */
@media (max-width: 768px) {
  .nav-button-row,
  .pinned-row {
    gap: 0.75rem;
  }
  .post-grid > .post-card {
    flex: 0 0 calc((100% - 2rem) / 2);
  }
}
@media (max-width: 600px) {
  .nav-button-row {
    margin-top: 1.5rem;
  }
  .post-grid {
    gap: 1rem;
  }
  .post-grid > .post-card {
    flex: 0 0 100%;
  }
  .post-card {
    height: auto;
    min-height: 280px;
    padding: 0.9rem;
  }
}
@media (max-width: 480px) {
  .nav-button-row,
  .pinned-row {
    gap: 0.5rem;
  }
  .post-card {
    padding: 0.75rem;
    border-radius: 14px;
  }
  .post-meta {
    font-size: 0.7rem;
  }
}
/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 600px) {
  .post-grid {
    row-gap: 2rem;
  }
  .post-card {
    min-height: auto;
  }
}
/* Listing pages opt into this via JS when content exceeds viewport height. */
body[data-page-type=home].listing-fit,
body[data-page-type=pagination].listing-fit {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-page-type=home].listing-fit > main,
body[data-page-type=pagination].listing-fit > main {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body[data-page-type=home].listing-fit .index-main,
body[data-page-type=pagination].listing-fit .index-main {
  transform-origin: top center;
  will-change: transform;
}

body[data-page-type=home].listing-fit .index-center-wrapper,
body[data-page-type=pagination].listing-fit .index-center-wrapper {
  align-items: center;
}

/* self host your fonts, otherwise it can take a while to load, especially if the font is big */
body {
  font-family: "Maple Mono", "JetBrainsMonoNerd", "Kosugi Maru", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: "liga" 1, "calt" 1;
}

/* Self-hosted Maple Mono faces (weights and italics available in assets/fonts/) */
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-ThinItalic.ttf") format("truetype");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-ExtraLightItalic.ttf") format("truetype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-SemiBoldItalic.ttf") format("truetype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("../fonts/MapleMono-NF-CN-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
/* Let interactive text inherit the site font instead of falling back to system-ui */
button,
input,
select,
textarea,
summary,
details,
.collapse-box,
.collapse-box summary,
.math-block,
.math-content,
.math-label {
  font-family: inherit;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: "liga" 1, "calt" 1;
}

/* 
========================
Color Scheme Variables
========================
*/
/* 
========================
Root Theme Variables
========================
*/
:root {
  color-scheme: dark;
  /* Backgrounds */
  --color-bg-primary: #362b31;
  --color-bg-secondary: #2C2328;
  --color-bg-muted: #4a3e44;
  /* Text */
  --color-text-primary: #fdfbd4;
  --color-text-muted: #beae94;
  /* Core Accents */
  --color-red: #fd5e3a;
  --color-yellow: #ea9d34;
  --color-green: #37d99e;
  --color-blue: #3e8fb0;
  --color-pink: #ea9a97;
  --color-purple: #c4a7e7;
  /* Soft Variants */
  --color-light-red: #c85a50;
  --color-light-yellow: #ecd28b;
  --color-light-green: #8ca589;
  --color-light-blue: #9ccfd8;
  --color-light-pink: #ebbcba;
  --color-light-purple: #CCCCFF;
  --color-note: #CCCCFF;
  /* Semantic Roles */
  --color-accent: #c85a50;
  --color-muted: var(--color-bg-muted);
  --color-soft: var(--color-text-muted);
  --color-fg-muted: var(--color-text-muted);
  /* Typography */
  --font-primary: 'Maple Mono', 'JetBrainsMonoNerd', 'Kosugi Maru', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-secondary: 'Maple Mono', 'JetBrainsMonoNerd', 'Kosugi Maru', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Media viewer frame ----------------------------------------------------- */
.media-frame {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px;
  display: block;
  max-width: 100%;
  box-shadow: 0 6px 24px rgba(2, 2, 2, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: transform 200ms var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)), box-shadow 200ms;
}

.media-frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 36px rgba(2, 2, 2, 0.7);
}

.media-frame .media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.media-frame img, .media-frame video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.media-frame .media-caption {
  margin-top: 8px;
  color: var(--color-fg-muted);
  font-size: 0.95rem;
}

.media-frame .media-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--color-text-primary);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
}

/* play overlay */
.media-frame .media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0.98;
}

.media-frame .media-play svg {
  width: 34px;
  height: 34px;
  fill: var(--color-accent, var(--color-light-red));
}

/* fullscreen overlay */
.media-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 8, 0.78);
}

.media-viewer-overlay.open {
  display: flex;
}

.media-viewer-overlay .viewer-inner {
  width: min(1200px, 94%);
  max-height: 92%;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bg-secondary), rgba(10, 8, 10, 0.9));
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.media-viewer-overlay .viewer-media {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-overlay img, .media-viewer-overlay video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.media-viewer-overlay .viewer-caption {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.media-viewer-overlay .viewer-close {
  position: absolute;
  right: 20px;
  top: 18px;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .media-frame {
    padding: 10px;
    border-radius: 10px;
  }
  .media-frame .media-play {
    width: 60px;
    height: 60px;
  }
  .media-frame .media-play svg {
    width: 26px;
    height: 26px;
  }
}
/* ── Continue reading toast ── */
.reading-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10050;
  background: var(--color-bg-muted);
  border: 1px solid color-mix(in srgb, var(--color-text-muted) 28%, transparent);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 300px;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
  pointer-events: none;
}

.reading-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.reading-toast__text {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.reading-toast__text em {
  color: var(--color-text-primary);
  font-style: normal;
  font-weight: 600;
}

.reading-toast__actions {
  display: flex;
  gap: 0.5rem;
}

.reading-toast__btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.reading-toast__btn:active {
  transform: scale(0.94);
}

.reading-toast__btn--yes {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  font-weight: 600;
}

.reading-toast__btn--yes:hover {
  background: var(--color-light-red);
}

.reading-toast__btn--no {
  background: color-mix(in srgb, var(--color-bg-secondary) 80%, transparent);
  color: var(--color-text-muted);
}

.reading-toast__btn--no:hover {
  color: var(--color-text-primary);
}

@media (max-width: 600px) {
  .reading-toast {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}
/* ── Footnote hover tooltip ── */
.fn-tooltip {
  position: absolute;
  z-index: 10100;
  max-width: 280px;
  padding: 0.55rem 0.8rem;
  background: var(--color-bg-muted);
  color: var(--color-text-primary);
  border: 1px solid color-mix(in srgb, var(--color-text-muted) 30%, transparent);
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.fn-tooltip--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Highlight the footnote anchor on hover */
sup a[href^="#fn"] {
  transition: color 0.15s;
}

sup a[href^="#fn"]:hover,
sup a[href^="#fn"]:focus {
  color: var(--color-light-yellow);
  text-decoration: underline;
  outline: none;
}

.section-separator {
  border: none;
  border-top: 2px solid var(--color-muted);
  width: calc(100% - 100px);
  margin: 2rem auto;
  opacity: 0.5;
}

/* ── Animated underline for body-text links ── */
main p a:not(.badge):not(.button):not(.math-label):not(.annotated-text):not(.file-card):not([class]),
main li a:not(.badge):not(.button):not(.file-card):not([class]),
main blockquote a:not(.badge):not(.button) {
  text-decoration: none;
  background-image: linear-gradient(color-mix(in srgb, var(--color-light-yellow) 65%, transparent), color-mix(in srgb, var(--color-light-yellow) 65%, transparent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.28s ease;
}

main p a:not(.badge):not(.button):not(.math-label):not(.annotated-text):not(.file-card):not([class]):hover,
main li a:not(.badge):not(.button):not(.file-card):not([class]):hover,
main blockquote a:not(.badge):not(.button):hover {
  background-size: 100% 1.5px;
}

html {
  scroll-behavior: smooth;
  /* Slight global scale-down: 15px base instead of the 16px default
     gives ~6% more horizontal room everywhere without touching individual
     px-sized components. Helps the docked TOC + content fit on standard
     laptop widths (1366–1680). */
  font-size: 15px;
}

body {
  overflow-x: hidden;
  overflow-y: scroll;
  color: var(--color-text-primary);
  line-height: 1.6;
  background-color: var(--color-bg-primary);
  font-family: "Maple Mono", "JetBrainsMonoNerd", normal;
  font-size: 1rem;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
}

.mobile-warning-modal[hidden] {
  display: none;
}

.mobile-warning-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mobile-warning-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 8, 10, 0.72);
  backdrop-filter: blur(6px);
}

.mobile-warning-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(34rem, 100vw - 2rem);
  border-radius: 24px;
  border: 2px solid var(--color-bg-muted);
  background: linear-gradient(145deg, color-mix(in srgb, var(--color-bg-secondary) 96%, black), color-mix(in srgb, var(--color-bg-primary) 92%, black));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
}

.mobile-warning-modal__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--color-yellow) 14%, transparent);
  color: var(--color-light-yellow);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.mobile-warning-modal__content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.15;
}

.mobile-warning-modal__content p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.mobile-warning-modal__button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--color-yellow);
  color: #221b1f;
  font: inherit;
  font-weight: 700;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.mobile-warning-modal__button:hover,
.mobile-warning-modal__button:focus {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

body.mobile-warning-modal-open {
  overflow: hidden;
}

a, button, [role=button], input[type=submit], input[type=button], .btn, .post-card, .toc-list a, .inline-badge {
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
}

::selection {
  background-color: rgba(234, 157, 52, 0.35);
  color: var(--color-text-primary);
}

.button {
  display: inline-block;
  padding: 0.5em 1em;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0.375rem;
  border: 2px solid var(--color-bg-muted);
  background-color: transparent;
  color: var(--color-accent);
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
  touch-action: manipulation;
}

.button:hover,
.button:focus {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
}

a {
  color: var(--color-yellow);
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
}

a:hover,
a:focus {
  color: var(--color-light-yellow);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-light-yellow);
  outline-offset: 2px;
}

.alert::before,
.info::before,
.success::before {
  display: inline-block;
}

a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after {
  content: " [↗]";
  font-size: 0.85em;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon):hover::after {
  opacity: 1;
}

/* Hide external-link arrows for heading links site-wide */
h1 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
h2 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
h3 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
h4 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
h5 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
h6 a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after {
  content: "" !important;
  opacity: 0 !important;
  display: none !important;
}

body[data-hide-external-links=true] a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after,
body[data-hide-external-links=true] blockquote a[href^=http]:not([href*="https://www.crow.rip"]):not(.button):not(.no-external-icon)::after {
  content: "" !important;
  opacity: 0 !important;
  display: none !important;
}

main {
  margin: 1.5rem;
  padding: 0;
}

.go-back-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

a:hover {
  cursor: url("/assets/cursors/hand.png") 0 0, auto !important;
}

.post-card,
.post-card * {
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
}

.post-card a,
.post-card a * {
  cursor: url("/assets/cursors/hand.png") 0 0, auto !important;
}

.anchor-heading {
  opacity: 0;
  text-decoration: none;
  font-size: 0.85em;
  color: var(--color-soft);
  transition: opacity 0.2s ease;
}

.heading-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-soft);
  opacity: 0;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  vertical-align: middle;
}

.heading-copy-btn:hover,
.heading-copy-btn:focus-visible {
  color: var(--color-light-yellow);
  transform: translateY(-1px);
}

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

h1:hover .heading-copy-btn,
h2:hover .heading-copy-btn,
h3:hover .heading-copy-btn,
h4:hover .heading-copy-btn,
h5:hover .heading-copy-btn,
h6:hover .heading-copy-btn,
h1:focus-within .heading-copy-btn,
h2:focus-within .heading-copy-btn,
h3:focus-within .heading-copy-btn,
h4:focus-within .heading-copy-btn,
h5:focus-within .heading-copy-btn,
h6:focus-within .heading-copy-btn {
  opacity: 1;
}

h1,
h2,
h3,
h4 {
  scroll-margin-top: 6rem;
}

.error-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  text-align: center;
}

.error-illustration {
  max-width: 50vw;
  width: 100%;
}

.error-illustration img {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.error-illustration p {
  font-size: 0.9rem;
  color: var(--color-soft);
  margin: 0;
}

/* ========================
   Rounded Tables
   ======================== */
table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--color-bg-muted);
  width: auto;
  min-width: 50%;
}

th {
  background: var(--color-bg-muted);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.55rem 1rem;
}

tr:not(:last-child) td {
  border-bottom: 2px solid var(--color-bg-muted);
}

tr:nth-child(even) td {
  background: color-mix(in srgb, var(--color-bg-muted) 30%, transparent);
}

mark {
  background-color: var(--color-text-primary);
  color: var(--color-bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 0.4em;
  font-weight: 500;
}

kbd {
  display: inline-block;
  vertical-align: -0.1em;
  background-color: var(--color-bg-secondary);
  color: var(--color-light-purple);
  padding: 0.1em 0.4em;
  border-radius: 0.4em;
  font-size: 0.9em;
  font-weight: 500;
  line-height: 1.4;
  border: 2px solid var(--color-muted);
  font-family: "Maple Mono", "JetBrainsMonoNerd", monospace;
  box-shadow: inset 0 -2px 0 var(--color-muted);
  white-space: nowrap;
  margin: 0 0.1em;
}

.blog-meta-row {
  margin: 1.5rem 0 0.2rem 0;
  color: var(--color-text-primary);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.blog-meta-core {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.blog-meta-core > * {
  margin: 0;
}

.blog-meta-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-bg-secondary) 82%, transparent);
  border: 2px solid var(--color-bg-muted);
  color: var(--color-text-primary);
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.blog-meta-pill i {
  color: var(--color-light-yellow);
}

.blog-share-btn {
  appearance: none;
  border: 2px solid var(--color-bg-muted);
  padding: 0.45rem 0.75rem;
  min-height: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  vertical-align: middle;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: inherit;
}

.blog-share-btn i {
  line-height: 1;
}

.blog-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-divider {
  border: none;
  border-top: 2px solid var(--color-bg-muted);
  margin: 0.5em 0 2em 0;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: color-mix(in srgb, var(--color-bg-muted) 55%, transparent);
  z-index: 10001;
  pointer-events: none;
}

.reading-progress__bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-light-yellow), var(--color-light-red));
  box-shadow: 0 0 12px rgba(236, 210, 139, 0.4);
  transition: width 0.1s linear;
  pointer-events: none;
}

.reading-progress__markers {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 10002;
}

/* --- Chapter markers: clean dots that sit on the bar --- */
/* Typed custom property so calc() can multiply it as a real number
   (without @property, the var is a string token and the swell calc
   silently fails) */
@property --proximity {
  syntax: "<number>";
  inherits: true; /* so ::after can read the marker's value for opacity */
  initial-value: 0;
}
/* --- EQ-style chapter markers: dots that swell into vertical peaks
   as the cursor nears (like an FL Studio EQ band) --- */
.reading-progress__marker {
  --proximity: 0;
  position: absolute;
  top: 0; /* anchored to the top of the bar, peaks hang downward */
  /* swell: height + width both driven by cursor proximity */
  width: calc(6px + var(--proximity) * 3px);
  height: calc(6px + var(--proximity) * 26px);
  /* Neutralize the global 44px coarse-pointer touch-target rule */
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  border-radius: 999px; /* capsule — a dot when short, a peak when tall */
  background: color-mix(in srgb, var(--color-bg-primary) 65%, var(--color-text-muted));
  border: 1.5px solid color-mix(in srgb, var(--color-text-muted) 50%, transparent);
  cursor: pointer;
  padding: 0;
  margin: 0;
  transform: translateX(-50%);
  transform-origin: top center;
  transition: height 0.15s cubic-bezier(0.34, 1.45, 0.64, 1), width 0.15s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: markerFadeIn 0.4s ease-out both;
  z-index: 1;
}

/* Cursor approaching from the top edge — glow ramps up */
.reading-progress__marker.is-near {
  box-shadow: 0 0 10px rgba(236, 210, 139, 0.4);
  z-index: 4;
}

/* Passed: warm accent fill, blends into the progress bar */
.reading-progress__marker.is-passed {
  background: var(--color-light-yellow);
  border-color: color-mix(in srgb, var(--color-light-yellow) 75%, #fff);
  box-shadow: 0 0 6px rgba(236, 210, 139, 0.55);
}

/* Current chapter: always a visible little peak, swells further on proximity */
.reading-progress__marker.is-current {
  height: calc(13px + var(--proximity) * 22px);
  width: calc(8px + var(--proximity) * 3px);
  background: var(--color-light-red);
  border-color: #fff7e6;
  z-index: 6;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-light-red) 22%, transparent), 0 0 14px rgba(255, 111, 145, 0.6);
  animation: markerCurrentPulse 2.4s ease-in-out infinite;
}

/* Hover / focus: full peak, regardless of proximity */
.reading-progress__marker:hover,
.reading-progress__marker:focus-visible {
  height: 36px;
  width: 11px;
  background: var(--color-light-yellow);
  border-color: #fff7e6;
  box-shadow: 0 0 18px rgba(236, 210, 139, 0.75), 0 2px 10px rgba(0, 0, 0, 0.45);
  animation: none; /* freeze the current-pulse while hovered */
  z-index: 9;
}

.reading-progress__marker:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-light-yellow) 75%, #fff);
  outline-offset: 3px;
}

/* Quick vertical pop when a marker is freshly passed (an EQ "blip") */
.reading-progress__marker.dancing {
  animation: markerBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Whole-page-complete celebration — gentle, not gaudy */
.reading-progress__marker.party-mode {
  background: var(--color-light-green);
  border-color: #fff7e6;
  box-shadow: 0 0 10px rgba(39, 201, 109, 0.55);
  animation: markerPartyGlow 1.6s ease-in-out infinite;
}

/* --- Chapter name: only visible on direct hover --- */
.reading-progress__marker::after {
  content: attr(data-heading);
  position: absolute;
  left: 50%;
  top: 42px;
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  pointer-events: none;
  white-space: nowrap;
  max-width: min(70vw, 380px);
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--color-light-yellow) 28%, var(--color-bg-muted));
  background: color-mix(in srgb, var(--color-bg-secondary) 97%, black);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.reading-progress__marker:hover::after,
.reading-progress__marker:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes markerFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.2);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
}
@keyframes markerCurrentPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-light-red) 20%, transparent), 0 0 12px rgba(255, 111, 145, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-light-red) 14%, transparent), 0 0 20px rgba(255, 111, 145, 0.75);
  }
}
@keyframes markerBounce {
  0% {
    transform: translateX(-50%) scaleY(1);
  }
  40% {
    transform: translateX(-50%) scaleY(2.4);
  }
  100% {
    transform: translateX(-50%) scaleY(1);
  }
}
@keyframes markerPartyGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(39, 201, 109, 0.45);
  }
  50% {
    box-shadow: 0 0 18px rgba(39, 201, 109, 0.85);
  }
}
.reading-progress__bar.is-complete {
  background: linear-gradient(90deg, #27c96d 0%, #7fffb0 50%, #27c96d 100%);
  box-shadow: 0 0 10px rgba(39, 201, 109, 0.55), 0 0 24px rgba(127, 255, 176, 0.35), 0 0 42px rgba(39, 201, 109, 0.2);
  animation: progressFinishPulse 1.2s ease-in-out infinite, progressShimmer 1.1s linear infinite;
  background-size: 200% 100%;
}

@keyframes progressFinishPulse {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 10px rgba(39, 201, 109, 0.45), 0 0 22px rgba(127, 255, 176, 0.25), 0 0 36px rgba(39, 201, 109, 0.14);
  }
  50% {
    filter: brightness(1.18);
    box-shadow: 0 0 14px rgba(39, 201, 109, 0.75), 0 0 30px rgba(127, 255, 176, 0.5), 0 0 52px rgba(39, 201, 109, 0.28);
  }
}
@keyframes progressShimmer {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 200% 50%;
  }
}
body[data-page-type=blog] .main-content {
  font-size: 1.04rem;
}

body[data-page-type=blog] .main-content > :first-child {
  margin-top: 0;
}

.blog-hero {
  --hero-x: 0px;
  --hero-y: 0px;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  min-height: 18rem;
  margin: 0 0 2rem;
  padding: 1.25rem;
  border-radius: 24px;
  background: rgba(18, 12, 16, 0.14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  transform: translateZ(0);
}

.blog-hero__image-frame {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blog-hero:hover {
  transform: scale(1.01);
}

.blog-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18) translate3d(var(--hero-x), var(--hero-y), 0);
  transform-origin: center center;
  filter: saturate(0.98) contrast(1.03);
  transition: transform 160ms linear, filter 220ms ease;
  pointer-events: none;
  min-width: 0;
}

.blog-hero__panel {
  display: inline-block;
  padding: 2rem;
  border-radius: 16px;
  background: rgba(18, 12, 16, 0.7);
  backdrop-filter: blur(10px);
  border: 2px solid var(--color-bg-muted);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.blog-hero__panel--meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  overflow: visible;
}

.blog-hero h1 {
  margin: 0;
  display: block;
  color: var(--color-text-primary);
  font-size: clamp(1.65rem, 2.5vw, 2.5rem);
  line-height: 1.08;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.blog-hero .blog-meta-row {
  margin-top: 1rem;
  padding: 0;
  width: fit-content;
  max-width: 100%;
  color: var(--color-text-primary);
}

.blog-hero__tags {
  margin: 0;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  position: relative;
}

.blog-hero__tags > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, pointer;
}

.blog-hero__tags > summary::-webkit-details-marker {
  display: none;
}

.blog-hero__tags-summary {
  width: fit-content;
  padding: 0;
  outline: none;
}

.blog-hero__tags-summary-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-bg-secondary) 84%, transparent);
  border: 2px solid var(--color-bg-muted);
  color: var(--color-text-primary);
  font-size: 0.82rem;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.blog-hero__tags[open] .blog-hero__tags-summary-pill {
  border-color: color-mix(in srgb, var(--color-yellow) 48%, transparent);
}

.blog-hero__tags-summary-pill i {
  color: var(--color-light-yellow);
}

.blog-hero__tags-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 30;
  min-width: 220px;
  max-width: 360px;
  width: max-content;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--color-bg-secondary) 96%, black);
  border: 2px solid var(--color-bg-muted);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.blog-hero__tags[open] > summary:focus-visible {
  outline: 2px solid var(--color-light-yellow);
  outline-offset: 3px;
  border-radius: 14px;
}

.blog-hero__tags .blog-tag-row {
  margin-top: 0;
  width: 100%;
  gap: 0.55rem;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

.blog-hero__panel--meta {
  align-items: flex-start;
}

.blog-hero__tags-panel .inline-badge {
  background: color-mix(in srgb, var(--color-bg-muted) 80%, transparent);
}

.blog-hero + .anchor-heading,
.blog-hero + .blog-divider {
  display: none;
}

/* =====================================================
   Related Posts Section
   ===================================================== */
.related-posts {
  position: relative;
  margin-top: 2rem;
  padding: 0;
  border-radius: 22px;
  border: 2px solid var(--color-bg-muted);
  background: var(--color-bg-secondary);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.related-posts__header {
  padding: 1.75rem 1.75rem 0;
}

.search-page {
  display: grid;
  gap: 1rem;
  max-width: 68rem;
  margin: 0 auto;
}

body[data-page-type=search] > main {
  margin: 0;
  padding: 1rem 1.25rem 0.75rem;
  /* Reserve enough vertical space for header + nav-row + footer + margins
     (~21rem at the 15px base font-size) so the footer always lands
     inside the viewport on a standard laptop. */
  min-height: calc(100vh - 21rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

body[data-page-type=search] .search-page {
  width: min(100%, 68rem);
  margin: auto;
}

body[data-page-type=search] .search-page__results {
  width: 100%;
}

.search-page__hero {
  position: relative;
  overflow: hidden;
  padding: 1rem 1.1rem 0.95rem;
  border-radius: 22px;
  border: 2px solid var(--color-bg-muted);
  background: var(--color-bg-secondary);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18);
}

.search-page__hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-page__hero-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--color-bg-primary);
  background: linear-gradient(145deg, var(--color-light-yellow), var(--color-light-pink));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
  font-size: 1.3rem;
}

.search-page__eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.search-page__hero h1 {
  margin: 0;
}

.search-page__hero p {
  margin: 0.65rem 0 0;
  color: var(--color-text-muted);
  max-width: 60ch;
}

.search-page__bar {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 18px;
  border: 2px solid var(--color-bg-muted);
  background: var(--color-bg-secondary);
}

.search-page__bar label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-page__input {
  width: 100%;
  border: 2px solid var(--color-bg-muted);
  border-radius: 16px;
  padding: 0.9rem 3.5rem 0.9rem 1rem;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font: inherit;
}

.search-page__input:focus {
  outline: 2px solid var(--color-light-yellow);
  outline-offset: 2px;
}

.search-shortcut-hint {
  position: absolute;
  right: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-bg-muted);
  border-radius: 5px;
  padding: 2px 7px;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.search-input-wrapper:focus-within .search-shortcut-hint {
  opacity: 0;
}

.search-page__status {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.search-page__results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.search-result-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 18px;
  border: 2px solid var(--color-bg-muted);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.search-result-card:hover,
.search-result-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-light-yellow);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.search-result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.search-result-card__tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.search-result-card__tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--color-bg-muted);
  border: 2px solid var(--color-bg-muted);
  color: var(--color-text-primary);
  text-transform: none;
  letter-spacing: 0;
}

.search-result-card__tag-chip i {
  color: var(--color-light-yellow);
}

.search-result-card__match {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.search-result-card__match-chip {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.search-result-card p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-card__excerpt-label {
  color: var(--color-text-primary);
  font-weight: 700;
}

.search-highlight {
  padding: 0 0.18em;
  border-radius: 0.2em;
  background: color-mix(in srgb, var(--color-light-yellow) 30%, transparent);
  color: var(--color-text-primary);
}

.search-result-card__kw-match {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  color: var(--color-text-muted);
}
.search-result-card__kw-match i {
  font-size: 0.64rem;
  opacity: 0.55;
  flex-shrink: 0;
}
.search-result-card__kw-match mark.search-highlight {
  font-size: 0.73rem;
}

.search-nav-highlight {
  background: color-mix(in srgb, var(--color-light-yellow) 38%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.search-nav-highlight.is-flashing {
  animation: searchNavFlash 0.55s ease-in-out 4;
}

@keyframes searchNavFlash {
  0%, 100% {
    background: color-mix(in srgb, var(--color-light-yellow) 40%, transparent);
    box-shadow: none;
  }
  50% {
    background: color-mix(in srgb, var(--color-light-yellow) 75%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-light-yellow) 28%, transparent);
  }
}
.search-result-card__link {
  margin-top: auto;
  color: var(--color-yellow);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
}

.search-result-card__arrow {
  display: inline-block;
  transform: rotate(90deg);
  transform-origin: center;
}

.search-result-card:hover .search-result-card__arrow,
.search-result-card:focus-visible .search-result-card__arrow {
  animation: searchArrowDrift 0.95s ease-in-out infinite;
}

@keyframes searchArrowDrift {
  0%, 100% {
    transform: translate(0, 0) rotate(90deg);
  }
  50% {
    transform: translate(0.24rem, -0.08rem) rotate(90deg);
  }
}
@media (max-width: 900px) {
  .search-page__results {
    grid-template-columns: 1fr;
  }
}
.related-posts h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-posts h2 i {
  color: var(--color-light-yellow);
}

.related-posts__lede {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.5rem 1.75rem 1.75rem;
  gap: 1rem;
}

.related-posts__card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 2px solid var(--color-bg-muted);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  text-decoration: none;
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  cursor: url("/assets/cursors/slapping cat_32-48-64.ani") 16 16, auto;
}

.related-posts__card:hover,
.related-posts__card:focus-visible {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--color-light-yellow) 60%, transparent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), 0 0 0 1px color-mix(in srgb, var(--color-light-yellow) 30%, transparent);
  cursor: url("/assets/cursors/hand.png") 0 0, auto;
}

.related-posts__thumb-wrap {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: var(--color-bg-muted);
  flex-shrink: 0;
}

.related-posts__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-posts__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem 1rem;
  flex: 1;
}

.related-posts__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.related-posts__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.related-posts__pill i {
  color: var(--color-text-muted);
  font-size: 0.8em;
}

.related-posts__pill--accent {
  background: color-mix(in srgb, var(--color-light-yellow) 18%, var(--color-bg-muted));
  color: var(--color-light-yellow);
}

.related-posts__pill--accent i {
  color: var(--color-light-yellow);
}

.related-posts__card h3 {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.related-posts__card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-posts__link {
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--color-yellow);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  transition: gap 180ms ease;
}

.related-posts__arrow {
  font-size: 0.8em;
  transition: transform 200ms ease;
}

.related-posts__card:hover .related-posts__arrow,
.related-posts__card:focus-visible .related-posts__arrow {
  transform: translateX(4px);
}

@media (max-width: 900px) {
  .related-posts__grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .blog-hero {
    flex-direction: column;
    align-items: flex-start;
    min-height: 16rem;
  }
  .blog-hero__image {
    transform: scale(1.18) translate3d(var(--hero-x), var(--hero-y), 0);
  }
  .blog-hero__tags {
    width: 100%;
  }
  .blog-hero__content {
    max-width: 100%;
  }
}
@media (max-width: 768px) {
  .blog-hero {
    padding: 1rem;
    border-radius: 18px;
  }
  .blog-hero h1 {
    font-size: 1.65rem;
    line-height: 1.1;
  }
  .blog-hero .blog-meta-row {
    padding: 0.65rem 0.8rem;
  }
  .blog-hero .blog-meta-pill {
    font-size: 0.78rem;
  }
}
/* Hero abstract: subtle fade/slide in on hover of the hero */
.hero-abstract {
  margin: 0;
  color: rgba(241, 226, 204, 0.92);
  font-size: 1rem;
  max-width: 60ch;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  clip-path: inset(0 0 100% 0);
  transition: max-height 340ms cubic-bezier(0.2, 0.8, 0.2, 1), margin-top 260ms ease, opacity 240ms ease, transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), clip-path 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.blog-hero:hover .hero-abstract,
.blog-hero:focus-within .hero-abstract {
  margin-top: 0.7rem;
  max-height: 7rem;
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-abstract,
  .blog-hero:hover .hero-abstract,
  .blog-hero:focus-within .hero-abstract {
    transition: none;
    transform: none;
    opacity: 1;
    max-height: none;
    margin-top: 0.7rem;
    clip-path: inset(0 0 0 0);
  }
}
/* Fix: ensure adjacent inline links have visual spacing (addresses comma spacing issues) */
.main-content a + a,
.main-content a + span a {
  margin-left: 0.35rem;
}

.main-content li a + a {
  margin-left: 0.45rem;
}

/* Changelog page styles: left-aligned headings, icon, expandable details */
.changelog {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  text-align: left;
}

.changelog > h2,
.changelog > h3,
.changelog > h4 {
  text-align: left;
}

.changelog details {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem 1.1rem;
  border: 2px solid var(--color-bg-muted);
  border-left: 2px solid var(--color-bg-muted);
  border-radius: 12px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--color-yellow) 10%, transparent), color-mix(in srgb, var(--color-green) 8%, transparent)), color-mix(in srgb, var(--color-bg-secondary) 28%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.changelog details:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--color-yellow) 52%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.changelog details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  color: var(--color-yellow);
  padding: 0;
}

.changelog details summary::before {
  content: "✦";
  margin-right: 0.4rem;
  font-size: 0.95rem;
  color: var(--color-green);
}

.changelog details summary small {
  font-weight: 500;
  color: color-mix(in srgb, var(--color-text-muted) 88%, var(--color-text-primary));
  margin-left: auto;
}

.changelog details[open] summary {
  color: var(--color-light-yellow);
}

.changelog details .body {
  margin-top: 0.8rem;
  color: color-mix(in srgb, var(--color-text-primary) 94%, transparent);
}

.changelog .chg-heading {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.changelog .chg-heading--added {
  color: var(--color-green);
}

.changelog .chg-heading--changed {
  color: var(--color-yellow);
}

.changelog .chg-heading--technical {
  color: var(--color-blue);
}

body[data-page-type=blog] .main-content p,
body[data-page-type=blog] .main-content li {
  letter-spacing: 0.01em;
  line-height: 1.85;
}

body[data-page-type=blog] .main-content img {
  border-radius: 12px;
}

body[data-page-type=blog] .main-content h4,
body[data-page-type=blog] .main-content h5,
body[data-page-type=blog] .main-content h6 {
  position: relative;
}

body[data-page-type=blog] .main-content h4::after,
body[data-page-type=blog] .main-content h5::after,
body[data-page-type=blog] .main-content h6::after {
  content: "";
  display: block;
  margin-top: 0.35rem;
  width: 2.2rem;
  border-top: 2px solid var(--color-bg-muted);
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 12, 16, 0.48);
  backdrop-filter: blur(3px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox.is-closing {
  opacity: 0;
  pointer-events: none;
}

.image-lightbox__frame {
  width: min(92vw, 1200px);
  max-height: 92vh;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 220ms ease;
}

.image-lightbox.is-open .image-lightbox__frame {
  transform: scale(1);
  opacity: 1;
}

.image-lightbox__image {
  display: block;
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  cursor: zoom-out;
}

body[data-page-type=blog] .main-content img {
  cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* =========================
   Minimal Scrollbar
   ========================= */
/* Base Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background-color: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-muted);
  border-radius: 4px;
  border: none;
  transition: background-color 0.2s ease-in-out;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}

/* 🧽 Hides top/bottom scrollbar arrows (those "nubs") */
::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

/* Firefox support */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-muted) transparent;
}

/* ================
   Responsive Styles
   ================ */
@media (max-width: 1200px) {
  .box,
  .file-card,
  blockquote {
    width: 70%;
    max-width: 70%;
  }
  table {
    width: 70%;
  }
}
@media (max-width: 900px) {
  main {
    margin: 1rem;
  }
  .box,
  .file-card,
  blockquote {
    width: 90%;
    max-width: 90%;
  }
  table {
    width: 100%;
  }
  iframe,
  video,
  audio,
  object,
  embed {
    width: 100%;
    min-width: 0;
  }
  .blog-hero {
    min-height: 20rem;
    padding: 1.25rem;
    border-radius: 20px;
  }
  .blog-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }
}
@media (max-width: 600px) {
  .blog-hero {
    min-height: 16rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 18px;
  }
  .blog-hero__tags {
    width: auto;
    max-width: 100%;
  }
  .blog-hero__content {
    max-width: 100%;
  }
}
@media (max-width: 600px) {
  .box {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 1rem;
  }
  .file-card {
    width: 100%;
    max-width: 100%;
    padding: 1em;
  }
  blockquote {
    max-width: 95vw;
    width: 100%;
    font-size: 0.95rem;
    padding: 1.5em 1.5em;
  }
  table {
    width: 100%;
    font-size: 0.9rem;
  }
  .button {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75em 1em;
    font-size: 1rem;
  }
  figure {
    margin: 1.2rem 0;
  }
  figcaption {
    font-size: 0.75rem;
  }
  .collapse-box {
    width: 100%;
    padding: 0 1rem;
  }
  .highlight {
    max-width: 100%;
    font-size: 0.9rem;
  }
  .box i {
    font-size: 1.2em;
  }
  .file-card__icon {
    font-size: 2em;
  }
}
@media (max-width: 480px) {
  .button {
    display: block;
    width: 100%;
    text-align: center;
  }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
@media (max-width: 400px) {
  body {
    font-size: 0.9rem;
  }
  .button {
    font-size: 0.9rem;
    padding: 0.6em 1em;
  }
  blockquote {
    font-size: 0.9rem;
  }
}
@media (max-width: 500px) {
  .anchor-heading {
    font-size: 0.7em;
  }
}
/* Custom Styles for Markdown Checkboxes (Task Lists) */
.task-list-item {
  list-style-type: none;
  /* Removes the default bullet point */
  margin-left: -2em;
  /* Adjusted to push the checkbox further left and sit flush */
  display: flex;
  /* Use flexbox for horizontal alignment */
  align-items: flex-start;
  /* Align checkbox and text at the top */
  margin-bottom: 0.5em;
  /* Add space between each task item */
}

.task-list-item input[type=checkbox] {
  /* Hide default browser checkbox and create custom one */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1.3em;
  /* Size of the custom checkbox square */
  height: 1.3em;
  border: 2px solid var(--color-bg-muted);
  /* Changed: Border color for unchecked state is now muted background */
  border-radius: 4px;
  /* Slightly rounded corners */
  margin-top: 0.2em;
  /* Adjust vertical position to align with text */
  margin-right: 0.6em;
  /* Space between checkbox and text */
  cursor: pointer;
  background-color: var(--color-bg-muted);
  /* Changed: Background for unchecked is now muted background */
  flex-shrink: 0;
  /* Prevent checkbox from shrinking on smaller screens */
  display: grid;
  /* Use grid for easy centering of custom checkmark */
  place-content: center;
  /* Center the custom checkmark */
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  /* Smooth transitions for interactions */
}

/* Custom checkmark for the checked state */
.task-list-item input[type=checkbox]::before {
  content: "";
  width: 0.7em;
  height: 0.7em;
  transform: scale(0);
  /* Hidden by default */
  transition: transform 0.2s ease-in-out;
  /* Use a clever clip-path for the checkmark shape */
  box-shadow: inset 1em 1em var(--color-light-yellow);
  /* Changed: Checkmark color is now light yellow */
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 60%);
}

.task-list-item input[type=checkbox]:checked {
  background-color: var(--color-bg-muted);
  /* Changed: Background when checked is now light yellow */
  border-color: var(--color-light-yellow);
  /* Changed: Border color when checked is now light yellow */
}

.task-list-item input[type=checkbox]:checked::before {
  transform: scale(1);
  /* Show checkmark when checked */
}

/* Hover effect for unchecked checkboxes */
.task-list-item input[type=checkbox]:not(:checked):hover {
  border-color: var(--color-light-blue);
  /* Slightly change border on hover (kept this as is) */
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-light-yellow) 40%, transparent);
  /* Subtle shadow (kept this as is) */
}

/* Style for disabled checkboxes (common in Markdown task lists) */
.task-list-item input[type=checkbox]:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  /* Make disabled checkboxes slightly faded */
}

.task-list-item input[type=checkbox]:disabled:checked {
  border-color: var(--color-text-primary);
  /* Muted border for disabled checked (kept as is, but considers the swap) */
}

.task-list-item input[type=checkbox]:disabled::before {
  box-shadow: inset 1em 1em var(--color-text-primary);
  /* Muted checkmark for disabled (kept as is, but considers the swap) */
}

/* Ensure that if the text is also clickable, the cursor indicates it */
.task-list-item label {
  cursor: pointer;
}

@keyframes tabActivePulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 214, 102, 0);
  }
  100% {
    box-shadow: 0 0 8px rgba(255, 214, 102, 0.35);
  }
}
/* Animation for content fading in and sliding up */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
ol li::marker,
ul li::marker {
  color: var(--color-text-muted);
}

/* ============================================
   ENHANCED MOBILE RESPONSIVE & POLISH
   ============================================ */
/* Blog metadata stack on mobile */
@media (max-width: 768px) {
  .blog-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .blog-meta-row > * {
    width: 100%;
  }
  .blog-tag-row {
    width: 100%;
  }
}
/* Reading progress bar mobile: hide markers on small screens */
@media (max-width: 600px) {
  .reading-progress__markers {
    display: none;
  }
}
@media (max-width: 600px) {
  main {
    margin: 0.75rem;
  }
  .error-wrapper {
    min-height: 60vh;
    padding: 1rem;
  }
  .error-illustration {
    max-width: 90vw;
  }
  .anchor-heading {
    font-size: 0.75em;
  }
}
/* Ultra-small mobile screens: 360px and below */
@media (max-width: 360px) {
  main {
    margin: 0.5rem;
  }
  h1,
  h2,
  h3,
  h4 {
    scroll-margin-top: 4rem;
  }
  p {
    line-height: 1.5;
  }
  .button {
    font-size: 0.85rem;
    padding: 0.55em 0.9em;
  }
}
@media (max-width: 1024px) {
  .mobile-warning-modal {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }
}
@media (max-width: 600px) {
  .mobile-warning-modal__dialog {
    width: min(100%, 34rem);
    grid-template-columns: 1fr;
  }
  .mobile-warning-modal__icon {
    width: 2.5rem;
    height: 2.5rem;
  }
}
/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
  header {
    min-height: 40px;
  }
  main {
    margin: 0.5rem;
  }
  .blog-meta-row {
    flex-direction: row;
    gap: 0.5rem;
    margin: 0.5rem 0;
  }
  h1 {
    margin: 0.75rem 0;
    font-size: 1.5rem;
  }
}
/* Touch-friendly spacing for interactive elements.
   NOTE: bare `a` and `button` are intentionally NOT given a 44px min size —
   doing so balloons every tag badge, filter pill, nav icon, and progress
   marker into a giant blob. Real link/button tap-targets on this site
   (nav pills, post cards, bottom nav, pagination) already carry generous
   padding. Only genuine form controls + the .button class get the min size. */
@media (hover: none) and (pointer: coarse) {
  .button,
  input,
  textarea,
  select {
    min-height: 44px;
    min-width: 44px;
  }
  .toc-list a {
    padding: 0.4em 0.25em;
  }
  .pagination a,
  .pagination span.page {
    padding: 0.6rem 0.9rem;
  }
}
/* Add subtle hover lift animation for non-touch devices */
@media (hover: hover) and (pointer: fine) {
  a,
  .button,
  .toc-list a:not(.active > a),
  .pagination a {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  }
  a:hover,
  .button:hover {
    transform: translateY(-2px);
  }
}
/* Focus visibility improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 2px solid var(--color-light-yellow);
    outline-offset: 3px;
    animation: focusRing 0.2s ease-in;
  }
}
/* High contrast mode support */
@media (prefers-contrast: more) {
  body {
    background-color: #2a2227;
  }
  a {
    color: #ffd966;
  }
  kbd {
    border: 2px solid var(--color-bg-muted);
  }
}
/* Reduced data mode - lighter animations */
@media (prefers-reduced-data: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */
@keyframes focusRing {
  from {
    outline-offset: 0px;
  }
  to {
    outline-offset: 3px;
  }
}
/* ============================================
   KNOWLEDGE GRAPH (canvas, tags page)
   ============================================ */
.knowledge-graph-mount {
  width: 100%;
  max-width: 1100px;
  margin: 0.5rem auto 2rem;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-bg-secondary);
  border: 1px solid color-mix(in srgb, var(--color-bg-muted) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(253, 251, 212, 0.04), 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.tag-list-section {
  max-width: 1100px;
  margin: 1.5rem auto 0;
}

.knowledge-graph-mount::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(ellipse at 30% 40%, color-mix(in srgb, var(--color-purple) 6%, transparent) 0%, transparent 70%), radial-gradient(ellipse at 70% 60%, color-mix(in srgb, var(--color-blue) 5%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.knowledge-graph__canvas {
  display: block;
  width: 100%;
  position: relative;
  z-index: 1;
}

.knowledge-graph__hint {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.65rem;
  color: color-mix(in srgb, var(--color-text-muted) 50%, transparent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
  font-family: var(--font-primary);
}

.tag-list-section__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-bg-muted) 60%, transparent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-list li {
  margin: 0;
}

.tag-list .badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: color-mix(in srgb, var(--color-bg-muted) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-bg-muted) 90%, transparent);
  border-radius: 9999px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.2s ease;
}

.tag-list .badge:hover {
  background: color-mix(in srgb, var(--color-accent) 18%, var(--color-bg-muted));
  color: var(--color-text-primary);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.tag-list .badge[href*=maldev]:hover {
  background: color-mix(in srgb, var(--color-red) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-red) 40%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-red) 22%, transparent);
}

.tag-list .badge[href*=physics]:hover {
  background: color-mix(in srgb, var(--color-blue) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-blue) 40%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-blue) 22%, transparent);
}

.tag-list .badge[href*=math]:hover {
  background: color-mix(in srgb, var(--color-purple) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-purple) 40%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-purple) 22%, transparent);
}

.tag-list .badge[href*=uoft]:hover {
  background: color-mix(in srgb, var(--color-yellow) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-yellow) 40%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-yellow) 22%, transparent);
}

.tag-list .badge[href*=intro]:hover {
  background: color-mix(in srgb, var(--color-green) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-green) 40%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-green) 22%, transparent);
}

.tag-list .badge[href*=windows]:hover {
  background: color-mix(in srgb, var(--color-light-blue) 18%, var(--color-bg-muted));
  border-color: color-mix(in srgb, var(--color-light-blue) 40%, transparent);
}

/* =============================================================
   RESPONSIVE OVERHAUL — tablet & mobile reading/viewing fixes
   (late cascade — these win over earlier rules)
   ============================================================= */
/* --- Tablet (≤ 900px) --- */
@media (max-width: 900px) {
  main {
    margin: 1rem;
  }
  body[data-page-type=blog] .main-content {
    font-size: 1rem;
  }
  .blog-hero {
    min-height: 14rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  .blog-hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.15;
  }
  .blog-meta-pill,
  .blog-share-btn {
    font-size: 0.78rem;
    padding: 0.38rem 0.65rem;
  }
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem;
  }
  .related-posts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* --- Phone (≤ 600px) --- */
@media (max-width: 600px) {
  body {
    line-height: 1.55;
  }
  main {
    margin: 0.75rem;
  }
  /* Typography scaling — content body */
  body[data-page-type=blog] .main-content {
    font-size: 0.97rem;
  }
  body[data-page-type=blog] .main-content h1 {
    font-size: 1.55rem;
    line-height: 1.18;
  }
  body[data-page-type=blog] .main-content h2 {
    font-size: 1.3rem;
    line-height: 1.22;
    margin-top: 1.6rem;
  }
  body[data-page-type=blog] .main-content h3 {
    font-size: 1.1rem;
    line-height: 1.25;
    margin-top: 1.3rem;
  }
  body[data-page-type=blog] .main-content h4 {
    font-size: 1rem;
    line-height: 1.3;
  }
  body[data-page-type=blog] .main-content p,
  body[data-page-type=blog] .main-content li {
    line-height: 1.7;
    letter-spacing: 0;
  }
  /* Blog hero compact mode */
  .blog-hero {
    min-height: auto;
    padding: 0.85rem;
    margin-bottom: 1rem;
    border-radius: 16px;
  }
  .blog-hero__image {
    transform: scale(1.1);
    filter: saturate(0.95) brightness(0.85);
  }
  .blog-hero__panel {
    padding: 1rem;
    border-radius: 12px;
  }
  .blog-hero h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.7rem);
    line-height: 1.15;
  }
  .blog-hero .blog-meta-row {
    margin-top: 0.55rem;
    gap: 0.45rem;
  }
  .blog-meta-pill,
  .blog-share-btn {
    font-size: 0.72rem;
    padding: 0.32rem 0.55rem;
    gap: 0.3rem;
  }
  .blog-meta-pill i,
  .blog-share-btn i {
    font-size: 0.8em;
  }
  .hero-abstract {
    font-size: 0.88rem;
    max-height: none;
    opacity: 1;
    margin-top: 0.5rem;
    transform: none;
    clip-path: none;
  }
  /* Single-column post grid on phone */
  .post-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }
  .post-card {
    height: auto !important;
    min-height: 0;
  }
  .post-thumb {
    height: 160px !important;
  }
  .post-content {
    gap: 0.35rem;
  }
  .post-content h2 {
    font-size: 1.05rem;
    line-height: 1.25;
  }
  .post-content p {
    font-size: 0.82rem;
  }
  .post-meta {
    font-size: 0.7rem;
  }
  .post-date {
    font-size: 0.72rem;
  }
  /* Filter bar on home page — wrap nicely */
  .post-filter-bar {
    gap: 0.4rem;
    padding: 0.5rem 0;
  }
  .post-filter-pill {
    font-size: 0.72rem;
    padding: 0.32rem 0.65rem;
  }
  /* Search page */
  .search-page__results {
    grid-template-columns: 1fr;
  }
  .search-page__hero {
    padding: 0.85rem;
  }
  .search-page__hero-icon {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1rem;
  }
  .search-page__hero h1 {
    font-size: 1.3rem;
  }
  /* Related posts — single column */
  .related-posts__grid {
    grid-template-columns: 1fr;
    padding: 0.4rem 1rem 1rem;
  }
  .related-posts__header {
    padding: 1rem 1rem 0;
  }
  /* Knowledge graph + tag list */
  .knowledge-graph-mount {
    border-radius: 14px;
    margin: 0.4rem auto 1.4rem;
  }
  .tag-list-section {
    margin: 1rem auto 0;
  }
  .tag-list {
    gap: 0.45rem;
  }
  .tag-list .badge {
    padding: 0.32rem 0.75rem;
    font-size: 0.72rem;
  }
  /* Reading progress markers hidden on phone (already in code) */
  .reading-progress {
    height: 3px;
  }
  /* Site footer / nav button spacing */
  .nav-button-row {
    margin: 0.75rem 0;
  }
}
/* --- Small phone (≤ 400px) --- */
@media (max-width: 400px) {
  main {
    margin: 0.5rem;
  }
  body[data-page-type=blog] .main-content h1 {
    font-size: 1.4rem;
  }
  body[data-page-type=blog] .main-content h2 {
    font-size: 1.18rem;
  }
  body[data-page-type=blog] .main-content h3 {
    font-size: 1.02rem;
  }
  .blog-hero {
    padding: 0.7rem;
    border-radius: 14px;
  }
  .blog-hero__panel {
    padding: 0.85rem;
  }
  .post-thumb {
    height: 140px !important;
  }
}
/* =============================================================
   GLOBAL IMAGE / OVERFLOW SAFETY (mobile + tablet)
   ============================================================= */
@media (max-width: 900px) {
  main img,
  main figure img,
  main .imgp,
  main video,
  main iframe {
    max-width: 100% !important;
    width: auto;
    height: auto;
    box-sizing: border-box;
  }
  main figure {
    margin: 1.25rem 0;
    max-width: 100%;
  }
  /* Inline width attribute overrides — neutralize on small screens */
  main img[width] {
    width: auto !important;
    max-width: 100% !important;
  }
  /* Anything that tries to overflow horizontally — cap it */
  body main > * {
    max-width: 100%;
  }
  /* Pre / code blocks scroll instead of overflow */
  main pre {
    max-width: 100%;
    overflow-x: auto;
  }
}
/* =============================================================
   FOLLOW-UP FIXES — blockquote/callout width, bottom-nav peek
   ============================================================= */
/* Make blockquotes + callouts + file-cards FULL width on tablet & phone
   so they match the math, paragraphs, and definitions */
@media (max-width: 1200px) {
  .box,
  .file-card,
  blockquote {
    width: 100% !important;
    max-width: 100% !important;
  }
}
@media (max-width: 900px) {
  .box,
  .file-card,
  blockquote {
    width: 100% !important;
    max-width: 100% !important;
  }
}
@media (max-width: 600px) {
  .box,
  .file-card,
  blockquote {
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* Fix phone-view bottom-nav peek:
   - Body padding must fully clear the nav (nav ≈ 84px tall) so no content hides
   - Nav must be fully opaque so nothing bleeds through it
   - Nav's own padding-bottom (in header.css) extends its background into the
     iOS safe-area / home-indicator zone — no separate ::after needed */
@media (max-width: 600px) {
  body {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mobile-bottom-nav {
    background: var(--color-bg-secondary) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.5);
    border-top: 1px solid color-mix(in srgb, var(--color-bg-muted) 80%, transparent);
  }
}

/*# sourceMappingURL=style.css.map */