/* blog.css — shared styles for blog category + article pages.
   Loaded AFTER styles.css to extend the same design tokens. */

/* override: blog pages have no canvas — use a soft star backdrop */
body.blog-page {
  background:
    radial-gradient(ellipse at 50% -10%, oklch(20% 0.04 235 / 0.6), transparent 60%),
    radial-gradient(ellipse at 80% 100%, oklch(18% 0.05 245 / 0.4), transparent 50%),
    #000;
  cursor: auto;
}
body.blog-page .cursor, body.blog-page .cursor-trail { display: none; }

/* static star field via inline svg + dot grid */
.starfield {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6), transparent 100%),
    radial-gradient(1px 1px at 80% 70%, rgba(180,200,255,0.5), transparent 100%),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.4), transparent 100%),
    radial-gradient(2px 2px at 30% 80%, rgba(125,211,252,0.7), transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1px 1px at 10% 60%, rgba(255,255,255,0.4), transparent 100%),
    radial-gradient(1px 1px at 90% 40%, rgba(180,200,255,0.5), transparent 100%);
  background-size: 1200px 800px, 1400px 900px, 1000px 700px, 1600px 1100px, 1300px 900px, 1100px 800px, 1500px 1000px;
  opacity: 0.5;
  animation: starShift 60s linear infinite;
}
@keyframes starShift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: -1200px 0, 1400px 0, -1000px 0, 1600px 0, -1300px 0, 1100px 0, -1500px 0; }
}

/* override topnav so it doesn't depend on body.ready */
body.blog-page .topnav { opacity: 1; pointer-events: auto; }

main.blog-main {
  position: relative;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto;
  padding: 140px var(--pad) 80px;
}

/* ===== CATEGORY (blog list) PAGE ===== */
.blog-hero {
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: end;
}
.blog-hero h1 {
  font-size: clamp(40px, 6vw, 92px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.blog-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, #fff, oklch(82% 0.13 220), oklch(55% 0.18 245));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.blog-hero p { color: var(--muted); font-size: 17px; max-width: 44ch; }

.blog-meta-row {
  display: flex; gap: 20px;
  font-size: 10px; letter-spacing: 0.22em; color: var(--dim);
  text-transform: uppercase;
  margin-top: 24px;
}
.blog-meta-row .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--core); align-self: center;
  box-shadow: 0 0 6px var(--core);
}

/* Category filter pills */
.cat-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
}
.cat-bar .pill {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  background: rgba(0,0,0,0.5);
  transition: all .25s;
  cursor: pointer;
}
.cat-bar .pill:hover {
  color: #fff;
  border-color: var(--muted);
}
.cat-bar .pill.active {
  background: oklch(82% 0.13 220 / 0.12);
  border-color: var(--core);
  color: #fff;
  box-shadow: inset 0 0 16px oklch(82% 0.13 220 / 0.18);
}
.cat-bar .count {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

/* Featured / hero post */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 56px;
  background: rgba(0,0,0,0.4);
  transition: all .3s;
  text-decoration: none;
}
.featured-post:hover {
  border-color: var(--core);
  box-shadow: 0 0 32px oklch(82% 0.13 220 / 0.15);
}
.featured-post .visual {
  background:
    linear-gradient(135deg, oklch(82% 0.13 220 / 0.55), oklch(55% 0.18 245 / 0.35)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 6px, transparent 6px 12px);
  min-height: 360px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.featured-post .visual .glyph {
  font-size: 72px; font-weight: 300;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.1em;
  text-shadow: 0 0 30px oklch(82% 0.13 220 / 0.5);
}
.featured-post .visual::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(0,0,0,0.4) 100%);
}
.featured-post .body {
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 24px;
}
.featured-post .badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.28em; color: var(--core);
  text-transform: uppercase;
  width: max-content;
}
.featured-post .badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--core); box-shadow: 0 0 8px var(--core);
}
.featured-post h2 {
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #fff;
  text-wrap: balance;
}
.featured-post .excerpt {
  color: var(--muted); font-size: 15px; line-height: 1.5;
}
.featured-post .meta {
  display: flex; gap: 18px;
  font-size: 11px; letter-spacing: 0.18em; color: var(--dim);
  text-transform: uppercase;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.featured-post .arrow-link {
  color: var(--core);
  letter-spacing: 0.22em;
  font-size: 11px;
  text-transform: uppercase;
}

/* Article grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 56px;
}
.article-card {
  background: rgba(0,0,0,0.55);
  padding: 28px 26px 30px;
  display: flex; flex-direction: column;
  gap: 16px;
  text-decoration: none;
  transition: all .3s;
  position: relative;
  min-height: 320px;
}
.article-card:hover {
  background: oklch(15% 0.02 230 / 0.7);
}
.article-card:hover h3 { color: oklch(82% 0.13 220); }
.article-card .tag {
  font-size: 9px; letter-spacing: 0.28em; color: var(--core);
  text-transform: uppercase;
}
.article-card h3 {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
  transition: color .25s;
  text-wrap: balance;
}
.article-card .ex {
  font-size: 13px; color: var(--muted);
  line-height: 1.45;
  flex: 1;
}
.article-card .foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.article-card .foot .read { color: var(--muted); }
.article-card .visual {
  height: 120px;
  margin: -28px -26px 0;
  background:
    linear-gradient(135deg, oklch(82% 0.13 220 / 0.35), oklch(55% 0.18 245 / 0.2)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 6px, transparent 6px 12px);
  display: flex; align-items: flex-end; padding: 14px;
  position: relative;
  overflow: hidden;
}
.article-card .visual::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--core), transparent);
}
.article-card .visual .num {
  font-size: 11px; letter-spacing: 0.32em; color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.article-card.amber .tag { color: var(--amber); }
.article-card.amber .visual {
  background:
    linear-gradient(135deg, oklch(78% 0.17 60 / 0.3), oklch(62% 0.22 25 / 0.18)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 6px, transparent 6px 12px);
}
.article-card.amber .visual::before { background: linear-gradient(90deg, transparent, var(--amber), transparent); }

/* Pagination */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.pagination a, .pagination .pages { color: inherit; }
.pagination a { transition: color .2s; }
.pagination a:hover { color: #fff; }
.pagination .pages span {
  margin: 0 6px;
  font-variant-numeric: tabular-nums;
}
.pagination .pages .now { color: var(--core); }

/* ===== ARTICLE (single post) PAGE ===== */
.article-hero {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
  max-width: 880px;
}
.breadcrumbs {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 28px;
  display: flex; gap: 14px;
}
.breadcrumbs a { color: var(--muted); transition: color .2s; }
.breadcrumbs a:hover { color: #fff; }
.breadcrumbs .sep { color: var(--line); }
.article-hero h1 {
  font-size: clamp(32px, 4.8vw, 64px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-bottom: 24px;
}
.article-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, #fff, oklch(82% 0.13 220));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.article-hero .lede {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 32px;
  text-wrap: pretty;
}
.article-hero .meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: 0.22em; color: var(--dim);
  text-transform: uppercase;
}
.article-hero .meta .author { color: #fff; }
.article-hero .meta .tag { color: var(--core); }

.article-cover {
  height: 380px;
  margin-bottom: 64px;
  background:
    linear-gradient(135deg, oklch(82% 0.13 220 / 0.5), oklch(55% 0.18 245 / 0.32)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 8px, transparent 8px 16px);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  overflow: hidden;
}
.article-cover .num {
  font-size: 96px; font-weight: 300; color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  text-shadow: 0 0 40px oklch(82% 0.13 220 / 0.6);
}
.article-cover::after {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--core), transparent);
}

/* Article body — prose */
.article-body {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.65;
  color: oklch(85% 0.01 230);
}
.article-body > * + * { margin-top: 24px; }
.article-body h2 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: #fff;
  margin-top: 48px;
  margin-bottom: 4px;
  text-wrap: balance;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  margin-top: 36px;
}
.article-body p { text-wrap: pretty; }
.article-body strong { color: #fff; font-weight: 500; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-bottom: 10px; }
.article-body li::marker { color: var(--core); }
.article-body a {
  color: oklch(82% 0.13 220);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: oklch(82% 0.13 220 / 0.4);
  transition: color .2s;
}
.article-body a:hover { color: #fff; }
.article-body blockquote {
  border-left: 2px solid var(--core);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-size: 19px;
  color: #fff;
  line-height: 1.45;
  font-weight: 300;
  letter-spacing: -0.005em;
}
.article-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: oklch(82% 0.13 220 / 0.12);
  padding: 2px 6px;
  font-size: 14px;
  border-radius: 2px;
  color: oklch(82% 0.13 220);
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.article-body th, .article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.article-body th {
  color: #fff; font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.22em;
  border-bottom: 1px solid var(--core);
}
.article-body td:first-child { color: var(--muted); }

.tldr {
  border: 1px solid var(--core);
  background: oklch(82% 0.13 220 / 0.08);
  padding: 20px 24px;
  margin: 32px 0;
  font-size: 15px;
  color: oklch(90% 0.02 220);
  position: relative;
}
.tldr::before {
  content: "TL;DR";
  position: absolute;
  top: -8px; left: 16px;
  background: #000;
  padding: 0 8px;
  font-size: 10px; letter-spacing: 0.32em;
  color: var(--core);
}

/* Article foot — author + share + next */
.article-foot {
  max-width: 760px;
  padding-top: 48px;
  margin-top: 64px;
  border-top: 1px solid var(--line);
}
.author-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
}
.author-card .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(82% 0.13 220), oklch(55% 0.18 245));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 500;
  color: #fff;
  box-shadow: 0 0 18px oklch(82% 0.13 220 / 0.35);
}
.author-card .who {
  display: flex; flex-direction: column; gap: 4px;
}
.author-card .who .name { color: #fff; font-size: 15px; font-weight: 500; }
.author-card .who .role { color: var(--dim); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.author-card .share {
  display: flex; gap: 10px;
  font-size: 10px; letter-spacing: 0.22em; color: var(--muted);
  text-transform: uppercase;
}
.author-card .share a { padding: 8px 12px; border: 1px solid var(--line); transition: all .2s; }
.author-card .share a:hover { color: #fff; border-color: var(--core); }

/* Related articles */
.related {
  max-width: 1280px;
  margin: 80px auto 0;
  padding: 0 var(--pad);
}
.related-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--dim);
}
.related-head h3 { color: #fff; font-size: 13px; letter-spacing: 0.32em; font-weight: 500; }
.related-head a { color: var(--core); }

/* Article CTA inset */
.article-cta {
  max-width: 760px;
  margin: 64px 0;
  padding: 36px 32px;
  border: 1px solid var(--core);
  background:
    linear-gradient(135deg, oklch(82% 0.13 220 / 0.10), oklch(55% 0.18 245 / 0.06)),
    rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}
.article-cta::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--core), transparent);
}
.article-cta .ct {
  font-size: 18px;
  color: #fff;
  font-weight: 400;
  letter-spacing: -0.005em;
  max-width: 36ch;
}
.article-cta .ct strong { color: oklch(82% 0.13 220); font-weight: 500; }
.article-cta button {
  flex-shrink: 0;
  padding: 16px 28px;
  border: 1px solid var(--core);
  background: oklch(82% 0.13 220 / 0.12);
  color: #fff;
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
}
.article-cta button:hover {
  background: oklch(82% 0.13 220 / 0.25);
  border-color: #fff;
  box-shadow: 0 0 24px oklch(82% 0.13 220 / 0.4);
}

@media (max-width: 900px) {
  .blog-hero { grid-template-columns: 1fr; gap: 28px; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .visual { border-right: 0; border-bottom: 1px solid var(--line); min-height: 240px; }
  .featured-post .body { padding: 28px 24px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-cta { flex-direction: column; align-items: flex-start; }
  main.blog-main { padding-top: 110px; }
}
