/* ================================================
   AiGAP Blog — shared styles
   Used by: aigap-blog, aigap-blog-post, aigap-blog-category,
            aigap-blog-tag, aigap-blog-author, aigap-blog-search
   ================================================ */

:root {
  --paper:    #e3e4e5;
  --paper-2:  #cdced0;
  --paper-3:  #ededee;
  --paper-4:  #f7f7f8;
  --ink:      #0f1115;
  --ink-soft: #3a3d44;
  --ink-mute: #7a7d83;
  --red:      #e51f36;
  --red-deep: #9c0e21;
  --red-soft: rgba(229, 31, 54, 0.08);
  --green:    #2d7a4f;
  --gold:     #b8893a;
  --line:        rgba(15, 17, 21, 0.10);
  --line-strong: rgba(15, 17, 21, 0.20);
  --bezier:   cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--paper-3); }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ===== ATMOSPHERE ===== */
.atmosphere { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.atmo-orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.10; }
.atmo-orb.o1 { width: 520px; height: 520px; background: radial-gradient(circle, var(--red), transparent 70%); top: -180px; left: -180px; }
.atmo-orb.o2 { width: 600px; height: 600px; background: radial-gradient(circle, var(--gold), transparent 70%); bottom: -200px; right: -120px; opacity: 0.08; }
.grid-texture {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 17, 21, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 17, 21, 0.018) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 70%);
}
.paper-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.4; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='3' seed='3'/><feColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.07 0 0 0 0 0.08 0 0 0 0.07 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
.layer { position: relative; z-index: 1; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 100; width: calc(100% - 32px); max-width: 1200px;
  background: rgba(237, 237, 238, 0.85);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line-strong); border-radius: 100px;
  padding: 10px 14px 10px 22px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px -6px rgba(15, 17, 21, 0.06);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.nav-brand .mark { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.nav-brand .mark.combined { width: 110px; height: auto; max-height: 36px; display: block; }
@media (max-width: 600px) { .nav-brand .mark.combined { width: 90px; } }
.footer-brand .nav-brand .mark.combined { width: 130px; max-height: 42px; }
.nav-brand .name { font-family: 'Fraunces', serif; font-weight: 900; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.nav-brand .name .ai { color: var(--red); }
.nav-brand .name .gap { color: var(--ink); }
.nav-brand .name .dot { color: var(--red); font-style: italic; font-weight: 400; font-size: 0.7em; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 13.5px;
  font-weight: 500; padding: 8px 14px; border-radius: 100px; transition: all 0.18s;
}
.nav-links a:hover, .nav-links a.current { color: var(--red); background: rgba(229,31,54,0.06); }
.nav-cta { display: flex; gap: 8px; align-items: center; }
.nav-cta a {
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 9px 16px; border-radius: 100px; transition: all 0.18s;
}
.nav-cta .ghost { color: var(--ink-soft); }
.nav-cta .ghost:hover { color: var(--red); }
.nav-cta .primary { background: var(--red); color: var(--paper-3); font-weight: 600; }
.nav-cta .primary:hover { background: var(--ink); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ===== EYEBROW ===== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--red); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--red); }

/* ===== BLOG HEADER (used on list, category, tag, author, search) ===== */
.blog-header {
  padding: 130px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.blog-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 18px;
  max-width: 900px;
}
.blog-header h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--red);
}
.blog-header p.lede {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 21px;
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.5;
}
.blog-header .crumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.blog-header .crumb a { color: var(--ink-mute); text-decoration: none; transition: color 0.15s; }
.blog-header .crumb a:hover { color: var(--red); }
.blog-header .crumb span.sep { color: var(--ink-mute); opacity: 0.5; }

/* ===== SEARCH BAR ===== */
.blog-search {
  max-width: 1200px;
  margin: 28px auto 0;
  padding: 0 24px;
  position: relative;
}
.blog-search input {
  width: 100%;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 16px 24px 16px 52px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: all 0.18s;
}
.blog-search input::placeholder { color: var(--ink-mute); }
.blog-search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(15,17,21,0.06); }
.blog-search .search-icon {
  position: absolute;
  left: 44px; top: 50%; transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
  font-size: 18px;
}

/* ===== FEATURED HERO ===== */
.featured-row {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
}
@media (max-width: 880px) {
  .featured-row { grid-template-columns: 1fr; }
}
.featured-main {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  transition: transform 0.3s var(--bezier), box-shadow 0.3s var(--bezier);
}
.featured-main:hover { transform: translateY(-4px); box-shadow: 0 24px 60px -20px rgba(15,17,21,0.20); }
.featured-main .cover {
  height: 360px;
  position: relative;
  overflow: hidden;
}
.featured-main .cover::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.18), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.65' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
.featured-main .cover-label,
.post-card-cover .cover-label {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.95);
  background: rgba(15,17,21,0.4);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.18);
}
.featured-main .body { padding: 30px 32px 36px; }
.featured-main .meta {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.featured-main h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
}
.featured-main p.excerpt {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 580px;
}
.featured-main .author-row {
  display: flex; align-items: center; gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.featured-side { display: flex; flex-direction: column; gap: 16px; }
.featured-side .post-card { display: flex; gap: 14px; padding: 16px; }
.featured-side .post-card-cover { width: 110px; min-width: 110px; height: 110px; border-radius: 10px; }
.featured-side .post-card-body { padding: 0; }
.featured-side .post-card-title { font-size: 17px; line-height: 1.2; }
.featured-side .post-card-excerpt { display: none; }
.featured-side .post-card-cover .cover-label { font-size: 8px; padding: 4px 8px; top: 10px; left: 10px; }
.featured-side .post-card-footer { font-size: 10.5px; padding-top: 10px; }

/* ===== AUTHOR MINI / AVATAR ===== */
.author-mini {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
}
.avatar-mini {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.featured-main .avatar-mini { width: 36px; height: 36px; font-size: 12px; }
.author-mini .author-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.featured-main .author-mini .author-name { font-size: 14px; }

/* ===== MAIN BLOG GRID + SIDEBAR ===== */
.blog-main {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
}
@media (max-width: 980px) {
  .blog-main { grid-template-columns: 1fr; gap: 60px; }
}

/* Section title */
.section-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-bar h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-bar .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}

/* Card grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 720px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s var(--bezier);
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 18px 40px -16px rgba(15,17,21,0.18);
}
.post-card-cover {
  height: 180px;
  position: relative;
  overflow: hidden;
}
.post-card-cover::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.16), transparent 60%);
}
.post-card-body { padding: 22px 22px 20px; }
.post-card-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.post-card-meta .dot { opacity: 0.5; }
.post-card-meta .readtime { color: var(--ink-soft); }
.cat-pill {
  background: rgba(229, 31, 54, 0.08);
  color: var(--cc, var(--red));
  border: 1px solid rgba(229, 31, 54, 0.18);
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.post-card-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}
.post-card:hover .post-card-title { color: var(--red); }
.post-card-excerpt {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-bottom: 18px;
}
.post-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-mute);
}
.post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.side-card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 24px;
}
.side-card h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s;
}
.cat-list a:hover, .cat-list a.active { background: rgba(229,31,54,0.06); color: var(--red); }
.cat-list a .n { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-mute); font-weight: 700; }
.cat-list a:hover .n, .cat-list a.active .n { color: var(--red); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.tag-cloud a:hover, .tag-cloud a.active { border-color: var(--red); color: var(--red); background: rgba(229,31,54,0.04); }
.tag-cloud a::before { content: "#"; opacity: 0.5; margin-right: 1px; }

.popular-list { display: flex; flex-direction: column; gap: 14px; }
.popular-list a {
  display: flex; gap: 10px; text-decoration: none; color: inherit;
  align-items: flex-start;
}
.popular-list .num {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--red);
  letter-spacing: -0.02em;
  font-style: italic;
  width: 32px; flex-shrink: 0;
}
.popular-list .meta {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.popular-list .meta-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-top: 5px;
}
.popular-list a:hover .meta { color: var(--red); }

/* Newsletter sidebar */
.side-newsletter {
  background: var(--ink);
  color: var(--paper-3);
  border: 1px solid var(--ink);
}
.side-newsletter h4 { color: rgba(237,237,238,0.55); border-color: rgba(237,237,238,0.12); }
.side-newsletter h5 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--paper-3);
}
.side-newsletter p { font-size: 13px; color: rgba(237,237,238,0.7); margin-bottom: 16px; line-height: 1.5; }
.side-newsletter form { display: flex; flex-direction: column; gap: 10px; }
.side-newsletter input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--paper-3);
  outline: none;
}
.side-newsletter input::placeholder { color: rgba(237,237,238,0.4); }
.side-newsletter input:focus { border-color: var(--red); }
.side-newsletter button {
  background: var(--red);
  color: var(--paper-3);
  border: 0;
  padding: 11px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.side-newsletter button:hover { background: var(--red-deep); }

/* ===== AUTHOR PAGE HEADER ===== */
.author-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 130px 24px 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) { .author-hero { grid-template-columns: 1fr; } }
.author-hero .avatar-large {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  border: 4px solid var(--paper-3);
  box-shadow: 0 16px 40px -10px rgba(15,17,21,0.25);
}
.author-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -0.03em;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 8px;
}
.author-hero .author-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--red);
  margin-bottom: 20px;
}
.author-hero p.bio {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.author-hero .author-social {
  display: flex; gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
}
.author-hero .author-social a {
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  transition: all 0.15s;
}
.author-hero .author-social a:hover { color: var(--red); border-color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper-3);
}
.empty-state .icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.empty-state p { color: var(--ink-mute); font-size: 14.5px; }

/* ===== POST PAGE — single article ===== */
.article-cover {
  width: 100%;
  height: clamp(280px, 40vh, 480px);
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.article-cover::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.16), transparent 60%),
    linear-gradient(to bottom, transparent 50%, rgba(15,17,21,0.55) 100%);
}
.article-cover .cover-label {
  position: absolute;
  top: 30px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: rgba(255,255,255,0.95);
  background: rgba(15,17,21,0.4);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.18);
}

.article-shell {
  max-width: 1200px;
  margin: -80px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 5;
}
.article-meta-card {
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 30px 36px;
  max-width: 820px;
  margin: 0 auto 40px;
  box-shadow: 0 20px 50px -16px rgba(15,17,21,0.25);
}
.article-meta-card .crumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-mute); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.article-meta-card .crumb a { color: var(--ink-mute); text-decoration: none; }
.article-meta-card .crumb a:hover { color: var(--red); }
.article-meta-card .crumb .sep { opacity: 0.5; }
.article-meta-card h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 18px;
}
.article-meta-card h1 em { font-style: italic; color: var(--red); }
.article-meta-card .excerpt {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 24px;
}
.article-meta-card .meta-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.article-meta-card .meta-row .author-mini .avatar-mini { width: 40px; height: 40px; font-size: 13px; }
.article-meta-card .meta-row .author-mini .author-name { font-size: 15px; font-weight: 600; }
.article-meta-card .meta-row .author-mini .author-role-mini {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  display: block; margin-top: 2px;
}
.article-meta-card .meta-extras {
  display: flex; gap: 14px; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-mute);
}

/* article body + TOC layout */
.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 200px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .article-share-rail { display: none; }
}
@media (max-width: 880px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { order: 2; }
}

.article-toc {
  position: sticky; top: 96px; align-self: start;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.article-toc h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.article-toc ol { list-style: none; padding: 0; }
.article-toc ol li { margin-bottom: 4px; }
.article-toc ol li a {
  display: block;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 12px 7px 14px;
  border-left: 2px solid var(--line);
  transition: all 0.15s;
}
.article-toc ol li a:hover, .article-toc ol li a.active {
  color: var(--red);
  border-left-color: var(--red);
  background: rgba(229,31,54,0.04);
}

.article-share-rail {
  position: sticky; top: 96px; align-self: start;
  display: flex; flex-direction: column; gap: 8px;
}
.article-share-rail h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.article-share-rail a, .article-share-rail button {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.article-share-rail a:hover, .article-share-rail button:hover {
  border-color: var(--red); color: var(--red);
}
.article-share-rail .share-icon {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 12px;
}

/* ===== ARTICLE BODY (prose) ===== */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
}
.article-body .lede {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.article-body p { margin-bottom: 1.4em; }
.article-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 1.8em 0 0.6em;
  color: var(--ink);
  scroll-margin-top: 100px;
}
.article-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 1.6em 0 0.5em;
  color: var(--ink);
}
.article-body em { font-style: italic; }
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.article-body a:hover { color: var(--red-deep); }
.article-body ul, .article-body ol {
  margin: 0 0 1.4em 1.6em;
}
.article-body li { margin-bottom: 0.5em; }
.article-body blockquote {
  border-left: 3px solid var(--red);
  padding: 4px 0 4px 24px;
  margin: 1.4em 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.article-body code {
  background: rgba(15,17,21,0.06);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--ink);
}
.article-body pre {
  background: var(--ink);
  color: #d4d4d4;
  padding: 22px 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px -12px rgba(15,17,21,0.30);
}
.article-body pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
/* very lightweight syntax tints */
.article-body pre .lang-bash,
.article-body pre code.lang-bash { color: #a0e9b5; }
.article-body pre .lang-json,
.article-body pre code.lang-json { color: #f4d4a3; }

/* ===== TAGS LIST AT BOTTOM OF POST ===== */
.article-tags {
  max-width: 720px;
  margin: 40px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.article-tags h6 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-mute); margin-bottom: 12px;
}

/* ===== AUTHOR BIO BLOCK (under article body) ===== */
.author-bio-card {
  max-width: 720px;
  margin: 50px auto 0;
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 600px) { .author-bio-card { grid-template-columns: 1fr; text-align: center; } }
.author-bio-card .avatar-med {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px; font-weight: 700;
  color: #fff;
  border: 3px solid var(--paper);
}
@media (max-width: 600px) { .author-bio-card .avatar-med { margin: 0 auto; } }
.author-bio-card .role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--red); margin-bottom: 4px;
}
.author-bio-card h4 {
  font-family: 'Fraunces', serif;
  font-size: 24px; font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.author-bio-card h4 a { color: var(--ink); text-decoration: none; }
.author-bio-card h4 a:hover { color: var(--red); }
.author-bio-card p { color: var(--ink-mute); font-size: 14.5px; line-height: 1.55; }

/* ===== RELATED POSTS ===== */
.related-strip {
  max-width: 1200px;
  margin: 80px auto 60px;
  padding: 0 24px;
}
.related-strip .section-bar { margin-bottom: 32px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 880px) { .related-grid { grid-template-columns: 1fr; } }

/* ===== NEWSLETTER STRIP (bottom of post) ===== */
.newsletter-strip {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.newsletter-card {
  background: var(--ink);
  color: var(--paper-3);
  border-radius: 22px;
  padding: 50px 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.newsletter-card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 30%, rgba(229,31,54,0.18), transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(184,137,58,0.10), transparent 60%);
  pointer-events: none;
}
.newsletter-card > * { position: relative; z-index: 1; }
@media (max-width: 760px) { .newsletter-card { grid-template-columns: 1fr; padding: 36px 28px; } }
.newsletter-card .eyebrow { color: rgba(255, 0.8, 0.8, 1); margin-bottom: 14px; }
.newsletter-card .eyebrow::before { background: var(--red); }
.newsletter-card h3 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin-bottom: 12px;
}
.newsletter-card h3 em { font-style: italic; color: var(--red); font-weight: 300; }
.newsletter-card p { font-size: 15.5px; color: rgba(237,237,238,0.7); max-width: 460px; line-height: 1.55; }
.newsletter-card form { display: flex; gap: 8px; min-width: 320px; }
.newsletter-card input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 100px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 14px;
  color: var(--paper-3);
  outline: none;
  min-width: 0;
}
.newsletter-card input::placeholder { color: rgba(237,237,238,0.45); }
.newsletter-card input:focus { border-color: var(--red); }
.newsletter-card button {
  background: var(--red);
  color: var(--paper-3);
  border: 0;
  padding: 14px 22px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.newsletter-card button:hover { background: var(--red-deep); }

/* ===== COMMENTS ===== */
.comments-section {
  max-width: 720px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.comments-section h3 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.comments-section .sub {
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 28px;
}
.comment-form {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 36px;
}
.comment-form textarea {
  width: 100%;
  min-height: 100px;
  background: transparent;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
}
.comment-form textarea::placeholder { color: var(--ink-mute); }
.comment-form .form-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.comment-form .form-row span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.comment-form button {
  background: var(--ink);
  color: var(--paper-3);
  border: 0;
  padding: 9px 18px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.comment-form button:hover { background: var(--red); }
.comment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.comment .avatar-mini { width: 40px; height: 40px; font-size: 12px; }
.comment .head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}
.comment .head b { font-weight: 600; }
.comment .head .when {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.comment .body { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.comment .reply {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 500;
  cursor: pointer;
}
.comment .reply:hover { color: var(--red); }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--line);
  padding: 60px 24px 40px;
  margin-top: 0;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto 50px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { color: var(--ink-soft); font-size: 14px; max-width: 320px; line-height: 1.5; margin-top: 14px; }
.footer-col h6 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
  transition: color 0.15s;
}
.footer-col a:hover, .footer-col a.current { color: var(--red); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) { .footer-bottom { flex-direction: column; gap: 10px; text-align: center; } }

/* ===== Hamburger + Lang switcher (responsive nav) ===== */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--paper-3); cursor: pointer;
  flex-direction: column; gap: 4px;
  align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.nav-burger span {
  width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: all 0.2s var(--bezier);
}
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-lang { position: relative; }
.nav-lang > summary {
  list-style: none; cursor: pointer;
  padding: 8px 12px; border-radius: 100px;
  border: 1px solid var(--line-strong); background: var(--paper-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-lang > summary::-webkit-details-marker { display: none; }
.nav-lang > summary::after {
  content: ""; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px); opacity: 0.5; margin-left: 2px;
}
.nav-lang[open] > summary { color: var(--ink); border-color: var(--ink); }
.nav-lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--paper-3); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 6px; min-width: 170px;
  box-shadow: 0 16px 40px -10px rgba(15,17,21,0.18);
  display: flex; flex-direction: column; gap: 1px;
  z-index: 120;
}
.nav-lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 13.5px;
  font-family: 'Instrument Sans', sans-serif; font-weight: 500;
}
.nav-lang-menu a:hover { background: rgba(229, 31, 54, 0.06); color: var(--red); }
.nav-lang-menu a .code {
  margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; color: var(--ink-mute); font-weight: 700;
}
.nav-lang-menu a.current { color: var(--red); background: rgba(229, 31, 54, 0.04); }

@media (max-width: 980px) {
  .nav-burger { display: inline-flex; }
  .nav-cta a.primary { padding: 8px 14px; font-size: 13px; }
  .nav-links {
    display: none;
    position: fixed; top: 76px; left: 16px; right: 16px;
    background: var(--paper-3); border: 1px solid var(--line-strong);
    border-radius: 18px; padding: 12px;
    flex-direction: column; gap: 2px;
    box-shadow: 0 24px 60px -12px rgba(15,17,21,0.25);
    z-index: 119;
  }
  body.nav-open .nav-links { display: flex !important; }
  body.nav-open .nav-links a {
    padding: 12px 14px !important; border-radius: 10px !important;
    font-size: 15px; width: 100%;
  }
}
