/* ================================================================
   Blog — content left, sidebar right
   ================================================================ */

:root {
  --brand: #fff;
  --brand-dim: #d4d4d8;
}
.dark {
  color-scheme: dark;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: linear-gradient(45deg, #171717 20%, #0e0e10 60%);
  background-attachment: fixed;
}

body {
  font-family: "Inter", "Inter Fallback", ui-sans-serif, system-ui,
    -apple-system, sans-serif;
  color: #a1a1aa;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.8;
  height: 100vh;
}

/* ---- Page frame lines ---- */
/*body::before, body::after {
  content: ""; position: fixed; top: 0; bottom: 0; width: 1px;
  background: #26262a; pointer-events: none; z-index: 100;
}*/
body::before {
  left: calc((100vw - 1248px) / 2);
}
body::after {
  right: calc((100vw - 1248px) / 2);
}
@media (max-width: 1300px) {
  body::before {
    left: 32px;
  }
  body::after {
    right: 32px;
  }
}
@media (max-width: 768px) {
  body::before {
    left: 16px;
  }
  body::after {
    right: 16px;
  }
}

/* ---- Layout ---- */
.blog-layout {
  display: flex;
  max-width: 1248px;
  margin: 0 auto;
  min-height: 100vh;
  border-right: 1px solid #26262a;
  border-left: 1px solid #26262a;
}
.blog-main {
  flex: 1;
  min-width: 0;
  padding: 96px 15px 0 15px;
  border-right: 1px solid #26262a;
}
.blog-sidebar {
  width: 180px;
  flex-shrink: 0;
  padding: 0 42px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Mobile menu button & drawer ---- */
.blog-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 130;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  color: #e4e4e7;
  cursor: pointer;
  transition: border-color 0.15s;
}
.blog-menu-btn:hover {
  border-color: #3f3f46;
}
.blog-menu-btn svg {
  display: block;
}
.blog-menu-btn .icon-close {
  display: none;
}
body.menu-open .blog-menu-btn .icon-open {
  display: none;
}
body.menu-open .blog-menu-btn .icon-close {
  display: block;
}
body.menu-open {
  overflow: hidden;
}
.blog-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 110;
}


@media (max-width: 500px) {
  .blog-layout {
    flex-direction: column;
  }
  .blog-main {
    border-right: none;
    padding: 32px 0 0 0;
  }
  .blog-menu-btn {
    display: flex;
  }
  .blog-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(300px, 85vw);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px 28px;
    background: #101012;
    border-left: 1px solid #26262a;
    z-index: 120;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    order: 0;
  }
  .blog-sidebar.open {
    transform: translateX(0);
  }
  .blog-sidebar-nav {
    display: flex;
  }
  .blog-menu-overlay {
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.28s ease, visibility 0.28s;
  }
  .blog-menu-overlay.open {
    visibility: visible;
    opacity: 1;
  }
}
@media (max-width: 768px) {
  .blog-layout {
    padding: 0 16px;
  }
}

/* ---- Sidebar items ---- */
.blog-sidebar-logo {
  display: flex;
  text-decoration: none;
  margin-bottom: 15px;
  padding-left: 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.blog-sidebar-logo:hover {
  opacity: 1;
}
.blog-sidebar-logo-img {
  height: 50px;
  width: auto;
  position: relative;
  left: -4px;
}
.blog-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blog-sidebar-nav a {
  display: block;
  text-decoration: none;
  color: #52525b;
  font-size: 14px;
  font-weight: 450;
  padding: 7px 0;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.blog-sidebar-cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #000;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 9px 0;
  background: #fff;
  transition: background 0.15s;
  text-align: center;
}
.blog-sidebar-cta:hover {
  background: #e4e4e7;
}

/* ---- Hero ---- */
.blog-hero {
  position: relative;
  padding-bottom: 50px;
  padding-left: 30px;
}
.blog-hero-bg {
  position: absolute;
  left: -15px;
  top: -96px;
  width: calc(100% + 30px);
  height: calc(100% + 96px);
  pointer-events: none;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
@media (max-width: 500px) {
  .blog-hero-bg {
    top: -32px;
    height: calc(100% + 32px);
  }
}
.blog-hero h1,
.blog-hero p {
  position: relative;
  z-index: 1;
}
.blog-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fafafa;
  margin-bottom: 20px;
}
.blog-hero p {
  color: #71717a;
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 500px;
}
.blog-hero::after {
  content: "";
  display: block;
  margin-top: 64px;
  width: 100%;
  height: 0px;
  background: #1c1c20;
  position: relative;
  z-index: 1;
}

/* ---- Article header ---- */
.blog-article-header {
  padding-bottom: 64px;
}
.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #71717a;
  text-decoration: none;
  font-size: 0.8125rem;
  margin-bottom: 32px;
  font-weight: 500;
  transition: color 0.2s;
}
.blog-back:hover {
  color: #d4d4d8;
}
.blog-back svg {
  transition: transform 0.2s;
}
.blog-back:hover svg {
  transform: translateX(-2px);
}
.blog-article-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #fafafa;
  margin-bottom: 24px;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: #71717a;
}
.blog-meta-dot {
  color: #3f3f46;
}
.blog-tags {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.blog-tag {
  padding: 5px 12px;
  font-size: 0.675rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: filter 0.2s;
}
.blog-tag:hover {
  filter: brightness(1.2);
}

/* ---- List ---- */
.blog-posts {
  padding-bottom: 120px;
}
.blog-part {
  margin-bottom: 72px;
}
.blog-part:last-child {
  margin-bottom: 0;
}
.blog-part-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 24px 0 20px;
  border-top: 1px solid #1c1c20;
}
.blog-part-count {
  font-weight: 400;
  color: #3f3f46;
  letter-spacing: 0.06em;
  margin-left: 6px;
}
.blog-row {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid #121215;
  transition: border-color 0.25s;
}
.blog-row:hover {
  border-color: #1c1c20;
}
.blog-row-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
  min-width: 0;
}
.blog-row-num {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  color: #3f3f46;
  font-weight: 500;
  padding-top: 2px;
  flex-shrink: 0;
}
.blog-row-text {
  flex: 1;
  min-width: 0;
}
.blog-row-text h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}
.blog-row-text h3 a {
  color: #e4e4e7;
  text-decoration: none;
  transition: color 0.15s;
}
.blog-row-text h3 a:hover {
  color: #fff;
}
.blog-row-text p {
  font-size: 0.875rem;
  color: #71717a;
  line-height: 1.6;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}
.blog-row-time {
  font-size: 0.75rem;
  color: #3f3f46;
  white-space: nowrap;
  font-weight: 500;
}
.blog-row-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.15s;
}
.blog-row-link:hover {
  background: #e4e4e7;
}
.blog-row-link svg {
  transition: transform 0.15s;
}
.blog-row-link:hover svg {
  transform: translateX(2px);
}

/* ---- Article body ---- */

/* ---- Prose ---- */
.prose {
  max-width: none;
  color: #a1a1aa;
  font-size: 1rem;
  line-height: 1.88;
}
.prose > * + * {
  margin-top: 1.4em;
}
.prose > *:first-child {
  margin-top: 0;
}
.prose p {
  margin: 1.4em 0;
  line-height: 1.88;
}
.prose a {
  color: #d4d4d8;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid #3f3f46;
  transition: border-color 0.2s, color 0.2s;
}
.prose a:hover {
  color: #fafafa;
  border-bottom-color: #71717a;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: #f4f4f5;
  font-weight: 600;
  line-height: 1.3;
  scroll-margin-top: 80px;
}
.prose h1 {
  font-size: 1.75rem;
  margin: 2em 0 0.5em;
  letter-spacing: -0.03em;
}
.prose h2 {
  font-size: 1.25rem;
  margin: 2.2em 0 0.5em;
  letter-spacing: -0.02em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid #1c1c20;
}
.prose h3 {
  font-size: 1.1rem;
  margin: 1.6em 0 0.4em;
}
.prose h4 {
  font-size: 0.95rem;
  margin: 1.4em 0 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
}
.prose strong {
  color: #e4e4e7;
  font-weight: 600;
}
.prose em {
  font-style: italic;
  color: #d4d4d8;
}
.prose code {
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", ui-monospace, monospace;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.prose pre {
  background: #0a0a0c;
  color: #d4d4d8;
  padding: 24px 28px;
  border-radius: 6px;
  border: 1px solid #1c1c20;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.75;
  margin: 1.8em 0;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  font-weight: 400;
}
.prose blockquote {
  border-left: 2px solid #2a2a2e;
  padding: 18px 24px;
  margin: 1.8em 0;
  color: #a1a1aa;
}
.prose blockquote p:first-child {
  margin-top: 0;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin: 1.3em 0;
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin: 0.4em 0;
  line-height: 1.8;
}
.prose ul > li::marker,
.prose ol > li::marker {
  color: #3f3f46;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
.prose thead {
  border-bottom: 2px solid #1c1c20;
}
.prose th {
  color: #e4e4e7;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid #0f0f12;
}
.prose hr {
  border: none;
  border-top: 1px solid #1c1c20;
  margin: 2.5em 0;
}
.prose img {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 10px 0;
}

/* ---- Footer ---- */
.blog-footer {
  display: none;
  border-top: 1px solid #1c1c20;
  padding: 56px 0 48px;
  max-width: 1248px;
  margin: 0 auto;
}
.blog-footer-inner {
  padding: 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (max-width: 768px) {
  .blog-footer-inner {
    padding: 0 32px;
  }
}
.blog-footer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 44px;
}
.blog-footer-socials a {
  color: #3f3f46;
  transition: color 0.2s;
  display: flex;
}
.blog-footer-socials a:hover {
  color: #a1a1aa;
}
.blog-footer-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  color: #3f3f46;
}
@media (min-width: 768px) {
  .blog-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}
.blog-footer-secured {
  display: flex;
  align-items: center;
  gap: 6px;
}
.blog-footer-polkadot {
  font-weight: 600;
  color: #71717a;
}
.blog-footer-legal {
  display: flex;
  gap: 24px;
  height: 0;
}
.blog-footer-legal a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.blog-footer-legal a:hover {
  color: #a1a1aa;
}
.blog-footer-copy {
  color: #3f3f46;
}
.blog-rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3f3f46;
  text-decoration: none;
  font-size: 0.8rem;
  margin-top: 32px;
  transition: color 0.2s;
  font-weight: 500;
}
.blog-rss-link:hover {
  color: #a1a1aa;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .blog-hero {
    padding-bottom: 48px;
  }
  .blog-hero h1 {
    font-size: 1.7rem;
  }
  .blog-hero::after {
    margin-top: 40px;
  }
  .blog-article-header {
    padding-bottom: 40px;
  }
  .blog-article-header h1 {
    font-size: 1.4rem;
  }
  .blog-row {
    flex-direction: column;
    gap: 14px;
    padding: 20px 0;
  }
  .blog-row-meta {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }
  .blog-footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .blog-footer-legal {
    gap: 16px;
  }
  .prose {
    font-size: 0.95rem;
  }
  .prose h1 {
    font-size: 1.3rem;
  }
  .prose h2 {
    font-size: 1.1rem;
  }
  .prose pre {
    padding: 16px;
    font-size: 0.78rem;
  }
}

/* ---- Prev / Next navigation ---- */
.blog-prev-next {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 24px 60px;
}
.blog-prev,
.blog-next {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  max-width: 45%;
  transition: opacity 0.2s;
}
.blog-prev {
  align-items: flex-start;
  text-align: left;
}
.blog-next {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}
.blog-prev:hover,
.blog-next:hover {
  opacity: 0.7;
}
.blog-pn-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.blog-pn-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #a1a1aa;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .blog-prev-next {
    flex-direction: column;
    gap: 20px;
    padding: 32px 20px 48px;
  }
  .blog-next {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
  }
  .blog-prev,
  .blog-next {
    max-width: 100%;
  }
}
.blog-sidebar-nav a.active {
  color: #e4e4e7;
}
