.blog-site {
  --blog-bg: #09090b; --blog-panel: #121216; --blog-line: #29292f;
  --blog-text: #f5f4f8; --blog-muted: #b2afb9; --blog-accent: #c8bcff;
  background: var(--blog-bg); color: var(--blog-text);
}
.blog-site .top { background: rgba(9,9,11,.87); }
.blog-site .top.is-scrolled { background: rgba(9,9,11,.76); }
.blog-container { width: min(1176px, calc(100% - 56px)); margin-inline: auto; padding: clamp(112px, 11vw, 155px) 0 84px; }
.blog-heading { padding-bottom: 32px; margin-bottom: 35px; border-bottom: 1px solid var(--blog-line); }
.blog-heading h1 { margin: 0; font-size: clamp(2.2rem, 4.7vw, 3.3rem); line-height: 1.15; letter-spacing: -.045em; }
.blog-heading p { margin: 12px 0 0; color: var(--blog-muted); }
.blog-search {
  display: flex; align-items: center; gap: 10px; width: min(100%, 506px); margin-top: 26px;
  min-height: 56px; padding: 7px 12px 7px 15px; border: 1px solid var(--blog-line);
  border-radius: 13px; background: var(--blog-panel);
}
.blog-search input {
  flex: 1; min-width: 0; width: 100%; min-height: 40px; padding: 0;
  color: var(--blog-text); color-scheme: dark; background: transparent; border: 0; font: inherit;
}
.blog-search input::placeholder { color: var(--blog-muted); }
.blog-search button {
  flex: none; min-height: 38px; padding: 6px 12px; border: 1px solid #3b3b46; border-radius: 8px;
  background: #1b1b21; color: var(--blog-text); font: inherit; font-size: .85rem; cursor: pointer;
}
.blog-search button:hover { border-color: #807395; }
.blog-card { min-width: 0; border: 1px solid var(--blog-line); border-radius: 18px; background: var(--blog-panel); overflow: hidden; }
.blog-card[hidden], .blog-empty[hidden] { display: none; }
.blog-card-link { display: grid; grid-template-rows: auto 1fr; height: 100%; color: inherit; text-decoration: none; }
.blog-card-link:hover, .blog-card-link:visited { color: inherit; }
.blog-cover, .blog-reading-cover { overflow: hidden; background: #191820; }
.blog-cover { aspect-ratio: 16 / 9; }
.blog-cover img, .blog-reading-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { display: flex; flex-direction: column; padding: 21px; }
.blog-card-label { margin-bottom: 11px; }
.blog-category {
  display: inline-block; padding: 4px 9px; border-radius: 6px; background: #252135;
  color: var(--blog-accent); font-size: .77rem; font-weight: 650; line-height: 1.55;
}
.blog-card h2 { margin: 0; font-size: 1.22rem; line-height: 1.38; overflow-wrap: anywhere; }
.blog-card-body > p {
  margin: 9px 0 21px; color: var(--blog-muted); font-size: .92rem; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; color: var(--blog-muted); font-size: .79rem; }
.blog-card .blog-meta { margin-top: auto; }
.blog-meta .blog-arrow { margin-left: auto; font-size: 1.15rem; color: var(--blog-accent); }
.blog-section, .blog-archive { margin-top: 42px; }
.blog-section[hidden] { display: none; }
.blog-section-title { margin: 0 0 18px; font-size: 1.3rem; scroll-margin-top: 96px; }
.blog-section-count, .blog-filter-count { color: var(--blog-muted); font-size: .85em; font-weight: 400; }
.blog-filters button[aria-pressed="true"] .blog-filter-count { color: inherit; }
.blog-related > h2 { margin: 0; font-size: 1.48rem; }
.blog-crumb { display: flex; gap: 10px; margin-top: 48px; color: var(--blog-muted); font-size: .85rem; }
.blog-crumb a { color: inherit; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-filters button, .blog-empty button {
  min-height: 40px; padding: 6px 13px; border: 1px solid var(--blog-line); border-radius: 999px;
  background: #121216; color: var(--blog-muted); font: inherit; font-size: .88rem; cursor: pointer;
}
.blog-filters button[aria-pressed="true"] { background: #eae5ff; color: #171321; border-color: #eae5ff; font-weight: 700; }
.blog-empty { text-align: center; padding: 38px 16px; border: 1px dashed var(--blog-line); border-radius: 16px; color: var(--blog-muted); }
.blog-empty h3 { margin: 0 0 8px; color: var(--blog-text); }
.blog-empty p { margin: 0 0 16px; }
.blog-card:focus-within { outline: 2px solid var(--blog-accent); outline-offset: 3px; }
.blog-site :is(a, button, input):focus-visible { outline: 2px solid var(--blog-accent); outline-offset: 3px; }
/* The search field and its button read as a single control. */
.blog-search:focus-within {
  border-color: #8e7dbf;
  box-shadow: 0 0 0 2px rgba(200, 188, 255, .16);
}
.blog-site .blog-search input:focus-visible { outline: none; }
.blog-site .blog-search button:focus-visible { outline-offset: -3px; }
@media (forced-colors: active) {
  .blog-search:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
}
.blog-card-link:active { opacity: .8; }
.blog-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.blog-footer { border-top: 1px solid var(--blog-line); padding: 24px 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px; font-size: .87rem; }
.blog-footer a, .blog-back { color: var(--blog-muted); text-decoration: none; }
.blog-footer a:hover, .blog-back:hover, .blog-toc a:hover { color: var(--blog-accent); }
.blog-detail { max-width: 840px; }
.blog-back { display: inline-block; margin-bottom: 26px; }
.blog-reading > header h1 { margin: 14px 0 10px; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.14; letter-spacing: -.038em; }
.blog-deck { margin: 0 0 15px; color: var(--blog-muted); line-height: 1.7; }
.blog-reading-cover { aspect-ratio: 16 / 7; margin-top: 26px; border-radius: 18px; }
.blog-toc { border: 1px solid var(--blog-line); border-radius: 14px; margin: 34px 0; padding: 18px 22px; background: var(--blog-panel); }
.blog-toc p { margin: 0; font-weight: 700; }
.blog-toc ol { margin: .6rem 0 0; padding-inline-start: 1.3rem; }
.blog-toc a { color: var(--blog-muted); line-height: 1.9; text-underline-offset: .2em; }
.blog-prose { max-width: 43rem; }
.blog-prose section { scroll-margin-top: 100px; margin-bottom: 28px; }
.blog-prose h2 { margin: 0 0 9px; font-size: 1.36rem; }
.blog-prose p { margin: 0; color: #d4d1db; font-size: 1.02rem; line-height: 1.9; }
.blog-related { margin-top: 42px; border-top: 1px solid var(--blog-line); padding-top: 25px; }
.blog-related > h2 { margin-bottom: 14px; }
.blog-related .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (prefers-reduced-motion: no-preference) {
  .blog-card { transition: transform .18s ease, border-color .18s ease; }
  .blog-cover img { transition: transform .24s ease; }
  .blog-grid.is-refreshing .blog-card:not([hidden]) { animation: blog-appear .18s ease both; }
  @keyframes blog-appear { from { opacity: .55; } to { opacity: 1; } }
}
@media (hover: hover) {
  .blog-card:hover { border-color: #807395; }
  @media (prefers-reduced-motion: no-preference) {
    .blog-card:hover { transform: translateY(-3px); }
    .blog-card:hover img { transform: scale(1.035); }
  }
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .blog-container { width: calc(100% - 32px); padding-top: 111px; padding-bottom: 58px; }
  .blog-heading { padding-bottom: 22px; margin-bottom: 22px; }
  .blog-search { margin-top: 20px; }
  .blog-grid, .blog-related .blog-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-section, .blog-archive { margin-top: 30px; }
}
