/* ByteGuard theme — dark-navy + cyan editorial
   Translated from ByteGuard Redesign.html (React prototype)
*/

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ── tokens ────────────────────────────────────────────────────────────── */
:root {
  --bg: #0b1526;
  --bg2: #0f1e35;
  --bg3: #162440;
  --cyan: #00e5d1;
  --cyan2: rgba(0, 229, 209, 0.12);
  --cyan3: rgba(0, 229, 209, 0.07);
  --border: rgba(0, 229, 209, 0.10);
  --border2: rgba(0, 229, 209, 0.25);
  --text: #dce8f5;
  --muted: #7a93ad;
  --muted2: #8aa4be;
  --fh: 'Inter', system-ui, sans-serif;
  --fb: 'Inter', system-ui, sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 10px;
  --container: 1160px;
  --narrow: 860px;
}

/* ── utilities ─────────────────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 28px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* honor users who request reduced motion (vestibular / vertigo) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .starthere-card:hover { transform: none; }
  .starthere-card:hover .starthere-go { transform: none; }
  .cur { animation: none; }
}

/* skip link — first focusable element, jumps over nav for keyboard users */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--cyan); color: #08111f;
  padding: 10px 16px; font-weight: 700;
  z-index: 9999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; outline: 2px solid #08111f; outline-offset: -4px; }

/* global keyboard-focus ring — only shows for keyboard, never mouse */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 3px;
}

/* blinking cursor after headings */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cur {
  display: inline-block;
  width: 9px;
  height: 0.9em;
  background: var(--cyan);
  vertical-align: middle;
  margin-left: 5px;
  animation: blink 1.1s step-end infinite;
}

/* ── image placeholder (fallback when no feature_image) ───────────────── */
.iph {
  width: 100%;
  height: 100%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.iph::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 7px, rgba(0, 229, 209, 0.025) 7px, rgba(0, 229, 209, 0.025) 14px);
}
.iph span {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
  z-index: 1;
  line-height: 1.9;
  position: relative;
}

/* ── chip (monospace bracketed category tag) ──────────────────────────── */
.chip {
  font-family: var(--fm);
  font-size: 10.5px;
  color: var(--cyan);
  border: 1px solid var(--border2);
  padding: 2px 9px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: inline-block;
  white-space: nowrap;
}

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav {
  background: rgba(11, 21, 38, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 300;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.nav-brand { display: flex; align-items: center; gap: 9px; }
.nav-brand-name {
  font-family: var(--fh);
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links a { color: var(--muted); transition: color 0.18s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-search {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.18s;
}
.nav-search:hover { color: var(--cyan); }
.nav-subscribe {
  background: var(--cyan);
  color: #0b1526;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  transition: opacity 0.18s;
}
.nav-subscribe:hover { opacity: 0.85; }
.nav-toggle {
  display: none;
  color: var(--text);
  font-size: 22px;
  padding: 0 4px;
}

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(175deg, #0e1f3a 0%, var(--bg) 70%);
}
.strapline {
  text-align: center;
  padding-top: 18px;
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px 28px;
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 20px;
  align-items: stretch;
}

/* featured post (left 58%) */
.featured {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
}
.featured:hover { border-color: var(--border2); box-shadow: 0 0 24px rgba(0, 229, 209, 0.07); }
.featured-image-wrap {
  height: 190px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.featured-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(15, 30, 53, 0.9) 100%);
  pointer-events: none;
}
.featured-chip { position: absolute; bottom: 12px; left: 16px; z-index: 2; }
.featured-body {
  padding: 16px 20px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.featured-title {
  font-family: var(--fh);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.22;
  color: var(--text);
}
.featured-excerpt {
  font-size: 13.5px;
  color: var(--muted2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.author-row { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b1526;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar--sm { width: 20px; height: 20px; font-size: 10px; background: var(--cyan2); border: 1px solid var(--border2); color: var(--cyan); }
.avatar--md { width: 32px; height: 32px; font-size: 13px; }
.avatar--lg { width: 50px; height: 50px; font-size: 18px; }
.author-name { font-size: 12.5px; color: var(--muted2); }
.meta-mono { font-size: 12px; color: var(--muted); font-family: var(--fm); }
.read-link {
  font-size: 12.5px;
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* newsletter card (right 42%) */
.newsletter {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nl-head { display: flex; align-items: center; gap: 10px; }
.nl-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--cyan2);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nl-title { font-family: var(--fh); font-size: 1rem; font-weight: 700; line-height: 1.2; }
.nl-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nl-body { font-size: 13px; color: var(--muted2); line-height: 1.6; }
.nl-fineprint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.nl-fineprint a { color: var(--muted2); text-decoration: underline; text-decoration-color: var(--border); }
.nl-fineprint a:hover { color: var(--cyan); }
.nl-form { display: flex; flex-direction: column; gap: 7px; }
.nl-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 13px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.nl-input:focus { border-color: var(--cyan); }
.nl-submit {
  background: var(--cyan);
  color: #0b1526;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px;
  border-radius: 7px;
  transition: opacity 0.18s;
  width: 100%;
  font-family: inherit;
}
.nl-submit:hover { opacity: 0.82; }
.nl-socials {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.nl-socials a { transition: color 0.18s; }
.nl-socials a:hover { color: var(--cyan); }
.nl-success {
  background: var(--cyan3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
}
.nl-success-tick { font-size: 1.4rem; color: var(--cyan); }

/* ── start here ───────────────────────────────────────────────────────── */
.starthere {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(circle at 0% 0%, rgba(0,229,209,0.07) 0%, transparent 35%),
    linear-gradient(180deg, rgba(0,229,209,0.03) 0%, transparent 100%);
  padding: 20px 0 18px;
}
.starthere-inner { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.starthere-label {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.starthere-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.starthere-head {
  font-size: 0.95rem; font-weight: 600;
  margin: 0; color: var(--muted2, var(--text));
  letter-spacing: -0.005em;
}
.starthere-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.starthere-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(15,30,53,0.7) 0%, rgba(11,21,38,0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.starthere-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,229,209,0.08) 100%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.starthere-card:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.starthere-card:hover::before { opacity: 1; }
.starthere-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.starthere-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--cyan);
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}
.starthere-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.starthere-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.starthere-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.starthere-go {
  font-size: 1.15rem;
  color: var(--cyan);
  line-height: 1;
  flex-shrink: 0;
  transition: transform .18s ease;
}
.starthere-card:hover .starthere-go { transform: translateX(3px); }
@media (max-width: 800px) {
  .starthere-grid { grid-template-columns: 1fr; gap: 8px; }
  .starthere { padding: 16px 0 14px; }
  .starthere-card { padding: 11px 14px; gap: 12px; }
  .starthere-num { font-size: 1.3rem; }
  .starthere-title { font-size: 0.92rem; }
}

/* ── category strip ───────────────────────────────────────────────────── */
.catstrip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.catstrip::-webkit-scrollbar { display: none; }
.catstrip-inner {
  display: flex;
  gap: 7px;
  padding: 11px 28px;
  min-width: max-content;
  max-width: var(--container);
  margin: 0 auto;
}
.catstrip a, .catstrip button {
  font-family: var(--fm);
  font-size: 11.5px;
  padding: 5px 15px;
  border-radius: 18px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted2);
  white-space: nowrap;
  transition: all 0.18s;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: inline-block;
}
.catstrip a:hover, .catstrip button:hover { color: var(--text); border-color: var(--cyan); }
.catstrip .active {
  background: var(--cyan);
  color: #0b1526;
  border-color: var(--cyan);
}

/* ── latest posts grid ────────────────────────────────────────────────── */
.latest {
  max-width: var(--container);
  margin: 0 auto;
  padding: 30px 28px;
}
.latest-head {
  font-family: var(--fh);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  color: var(--text);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ── post card ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--border2); box-shadow: 0 0 18px rgba(0, 229, 209, 0.07); }
.card-image-wrap {
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.card-image-wrap img, .card-image-wrap .iph {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-image-wrap img,
.card:hover .card-image-wrap .iph { transform: scale(1.04); }
.card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.card-title {
  font-family: var(--fh);
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text);
}
.card-excerpt {
  font-size: 12.5px;
  color: var(--muted2);
  line-height: 1.58;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-meta .avatar { margin-left: auto; }

/* ── series band ──────────────────────────────────────────────────────── */
.series {
  background: #070f1e;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 0;
}
.series h2 {
  font-family: var(--fh);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  color: var(--text);
}
.series-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.series-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.series-card:hover { border-color: var(--border2); }
.series-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.series-card-head h3 { font-family: var(--fh); font-size: 0.95rem; font-weight: 600; color: var(--text); }
.series-badge {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--cyan);
  background: var(--cyan2);
  border: 1px solid var(--border2);
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
}
.series-desc { font-size: 12.5px; color: var(--muted2); line-height: 1.55; margin-bottom: 12px; }
.series-bar { height: 2px; background: var(--bg3); border-radius: 1px; overflow: hidden; }
.series-bar > div { height: 100%; background: var(--cyan); border-radius: 1px; }
.series-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--fm);
}

/* ── footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: #060f1c;
  border-top: 1px solid var(--border);
  padding: 44px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer-about-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}
.footer-about-head span {
  font-family: var(--fm);
  font-size: 12px;
  color: var(--cyan);
}
.footer-author { display: flex; gap: 10px; }
.footer-author p {
  font-size: 12.5px;
  color: var(--muted2);
  line-height: 1.65;
}
.footer-author strong { color: var(--text); font-weight: 600; }
.footer-heading {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-list { display: flex; flex-direction: column; gap: 7px; }
.footer-list a {
  font-size: 12.5px;
  color: var(--muted2);
  transition: color 0.18s;
}
.footer-list a:hover { color: var(--cyan); }
.footer-nl-blurb { font-size: 12.5px; color: var(--muted2); line-height: 1.6; margin-bottom: 10px; }
.footer-nl-form { display: flex; flex-direction: column; gap: 7px; }
.footer-nl-form input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.footer-nl-form input:focus { border-color: var(--cyan); }
.footer-nl-form button {
  background: var(--cyan);
  color: #0b1526;
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px;
  border-radius: 6px;
  font-family: inherit;
}
.footer-nl-form button:hover { opacity: 0.85; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom span { font-size: 12px; color: var(--muted); }
.footer-build {
  font-family: var(--fm);
  font-size: 10.5px;
  color: var(--muted);
  opacity: 0.5;
}
.footer-legal { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.footer-legal a { transition: color 0.18s; }
.footer-legal a:hover { color: var(--text); }

/* ── post page: full-bleed hero + sticky TOC ─────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--cyan);
  z-index: 400;
  width: 0%;
  box-shadow: 0 0 6px rgba(0, 229, 209, 0.6);
  transition: width 0.08s linear;
}
.post-hero {
  position: relative;
  height: 380px;
  overflow: hidden;
}
.post-hero img, .post-hero .iph {
  width: 100%; height: 100%; object-fit: cover;
}
.post-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11,21,38,0.15) 0%, rgba(11,21,38,0.55) 45%, #0b1526 100%);
  pointer-events: none;
}
.post-back {
  position: absolute;
  top: 16px;
  left: 24px;
  font-family: var(--fm);
  font-size: 11.5px;
  color: rgba(220, 232, 245, 0.75);
  background: rgba(11, 21, 38, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 229, 209, 0.18);
  padding: 5px 13px;
  border-radius: 18px;
  transition: color 0.18s;
  text-decoration: none;
  z-index: 2;
}
.post-back:hover { color: var(--cyan); }
.post-hero-title-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 0 32px 28px;
  z-index: 2;
}
.post-hero-title {
  font-family: var(--fh);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.17;
  color: #fff;
  margin: 10px 0 12px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: rgba(220, 232, 245, 0.9);
  flex-wrap: wrap;
}
.post-hero-meta .avatar { width: 24px; height: 24px; font-size: 10.5px; }
.post-hero-meta .dot { color: rgba(220, 232, 245, 0.4); }
.post-hero-meta .mono { font-family: var(--fm); font-size: 11.5px; color: rgba(220, 232, 245, 0.55); }

.post-body {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 28px 0;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 44px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 66px;
}
.toc-label {
  font-family: var(--fm);
  font-size: 9.5px;
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0.8;
}
.toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.toc a {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 5px;
  border-left: 2px solid rgba(255, 255, 255, 0.05);
  transition: all 0.16s;
  line-height: 1.3;
  text-decoration: none;
}
.toc a:hover { color: var(--muted2); }
.toc a.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: var(--cyan3);
}
.toc-progress {
  margin-top: 16px;
  height: 2px;
  background: var(--bg3);
  border-radius: 1px;
  overflow: hidden;
}
.toc-progress > div { height: 100%; background: var(--cyan); border-radius: 1px; transition: width 0.1s; }
.toc-pct {
  margin-top: 5px;
  font-family: var(--fm);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.5;
}

.article { min-width: 0; padding-bottom: 80px; }
.article .lede {
  font-size: 1.05rem;
  color: var(--muted2);
  line-height: 1.78;
  margin-bottom: 32px;
  border-left: 3px solid var(--cyan);
  padding-left: 16px;
  font-style: italic;
}
.article h2 {
  font-family: var(--fh);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 26px 0 12px;
  color: var(--text);
  scroll-margin-top: 70px;
}
.article h2::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 0.9em;
  background: var(--cyan);
  vertical-align: middle;
  margin-left: 5px;
  animation: blink 1.1s step-end infinite;
}
.article h3 {
  font-family: var(--fh);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 22px 0 10px;
  color: var(--text);
  scroll-margin-top: 70px;
}
.article p { color: var(--muted2); line-height: 1.85; margin-bottom: 14px; }
.article a { color: var(--cyan); text-decoration: underline; text-decoration-color: var(--border2); transition: text-decoration-color 0.18s; }
.article a:hover { text-decoration-color: var(--cyan); }
.article ul, .article ol { color: var(--muted2); line-height: 2; padding-left: 22px; margin-bottom: 14px; }
.article li { margin-bottom: 4px; }
.article blockquote {
  border-left: 3px solid var(--cyan);
  padding: 4px 16px;
  color: var(--muted2);
  font-style: italic;
  margin: 18px 0;
}
.article code {
  font-family: var(--fm);
  font-size: 12px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--cyan);
}
.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}
.article img { border-radius: 8px; margin: 18px 0; }
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
}
.article th, .article td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  color: var(--muted2);
}
.article th { background: var(--bg2); color: var(--text); font-weight: 600; }

/* terminal-chrome code blocks */
.article pre {
  position: relative;
  background: #050d18;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 22px 0;
  padding: 38px 16px 16px;
  overflow-x: auto;
  font-family: var(--fm);
  font-size: 12.5px;
  line-height: 1.75;
  color: #b8d4f0;
}
.article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.article pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: #0b1829;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.article pre::after {
  content: '';
  position: absolute;
  top: 10px; left: 13px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #28c940;
}

/* author box */
.author-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 20px 22px;
  margin-top: 36px;
  display: flex;
  gap: 16px;
}
.author-box-name { font-family: var(--fh); font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; color: var(--text); }
.author-box-bio { font-size: 12.5px; color: var(--muted2); line-height: 1.65; margin-bottom: 10px; }
.author-box-links { display: flex; gap: 10px; flex-wrap: wrap; }
.author-box-links a {
  font-family: var(--fm);
  font-size: 11.5px;
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 5px;
  color: var(--muted2);
  transition: all 0.18s;
  text-decoration: none;
}
.author-box-links a:first-child { color: var(--cyan); border-color: var(--border2); }
.author-box-links a:hover { color: var(--cyan); border-color: var(--border2); }

/* related posts */
.related { margin-top: 36px; }
.related h3,
.comments h3 {
  font-family: var(--fh);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.comments { margin-top: 40px; padding-top: 32px; border-top: 1px solid rgba(0,229,209,0.08); }
.comments-note { font-size: 12.5px; color: var(--muted2); line-height: 1.6; margin: 0 0 18px; }
.comments-note a { color: var(--cyan); text-decoration: none; }
.comments-note a:hover { text-decoration: underline; }
.comments-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(0,229,209,0.10);
  border-radius: 10px;
  padding: 18px 20px;
}
.giscus, .giscus-frame { width: 100%; }
.giscus-frame { border: 0; color-scheme: dark; }
@media (max-width: 640px) {
  .comments-box { padding: 14px; }
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.related-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.related-card:hover { border-color: var(--border2); }
.related-card-image { height: 88px; }
.related-card-image img, .related-card-image .iph { width: 100%; height: 100%; object-fit: cover; }
.related-card-body { padding: 10px 12px; }
.related-card-title {
  font-family: var(--fh);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 5px;
  line-height: 1.32;
  color: var(--text);
}

/* ── Koenig editor card widths ────────────────────────────────────────── */
.article .kg-width-wide { max-width: 1040px; margin-left: calc(50% - 520px); margin-right: calc(50% - 520px); }
.article .kg-width-full { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.article .kg-width-wide img, .article .kg-width-full img { width: 100%; height: auto; border-radius: 8px; }
.article .kg-image { max-width: 100%; height: auto; }
.article figure { margin: 18px 0; }
.article figure figcaption { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; font-family: var(--fm); }
.article .kg-bookmark-card {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  margin: 18px 0;
}
.article .kg-bookmark-content { padding: 16px 20px; flex: 1; min-width: 0; }
.article .kg-bookmark-title { font-family: var(--fh); font-weight: 700; color: var(--text); font-size: 0.95rem; margin-bottom: 6px; }
.article .kg-bookmark-description { font-size: 12.5px; color: var(--muted2); line-height: 1.55; }
.article .kg-callout-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  display: flex;
  gap: 10px;
}
.article .kg-callout-text { color: var(--muted2); }
.article .kg-toggle-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
}
.article .kg-header-card { padding: 28px 0; }
.article .kg-header-card-heading { font-family: var(--fh); }

@media (max-width: 1100px) {
  .article .kg-width-wide { max-width: 100%; margin-left: 0; margin-right: 0; }
}

/* ── pagination ───────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 28px 40px;
  font-family: var(--fm);
  font-size: 12px;
}
.pagination a, .pagination span {
  color: var(--muted2);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.18s;
}
.pagination a:hover { color: var(--cyan); border-color: var(--border2); }
.pagination .current { color: var(--cyan); border-color: var(--cyan); background: var(--cyan3); }

/* ── error page ───────────────────────────────────────────────────────── */
.error-wrap {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 80px 28px;
  text-align: center;
}
.error-wrap h1 {
  font-family: var(--fh);
  font-size: 3rem;
  color: var(--cyan);
  margin-bottom: 12px;
}
.error-wrap p { color: var(--muted2); margin-bottom: 24px; }

/* ── tag/author archive pages ─────────────────────────────────────────── */
.archive-head {
  padding: 40px 28px 20px;
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}
.archive-head h1 {
  font-family: var(--fh);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 8px;
}
.archive-head p { color: var(--muted2); font-size: 14px; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .post-body { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; display: none; }
  .series-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .newsletter { display: none; }
  .hero-featured { margin-bottom: 0; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg2);
    flex-direction: column;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .featured-title { font-size: 1.3rem; }
  .post-hero { height: 280px; }
  .post-hero-title-wrap { padding: 0 20px 20px; }
  .post-body { padding: 24px 20px 0; }
  .article pre { font-size: 11.5px; }
  .catstrip-inner { padding: 11px 20px; }
  .container, .narrow { padding: 0 20px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ── page head (pages without feature image) ─────────────────────────── */
.page-head {
  padding: 72px 0 28px;
  border-bottom: 1px solid rgba(0, 229, 209, 0.08);
  background: linear-gradient(180deg, rgba(0,229,209,0.04) 0%, transparent 100%);
}
.page-head-inner {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 0 32px;
}
.page-back {
  display: inline-block;
  font-family: var(--fm);
  font-size: 11.5px;
  color: rgba(220, 232, 245, 0.6);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.18s;
}
.page-back:hover { color: var(--cyan); }
.page-title {
  font-family: var(--fh);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
@media (max-width: 640px) {
  .page-head { padding: 48px 0 22px; }
  .page-head-inner { padding: 0 20px; }
}

/* ── series part cards ───────────────────────────────────────────────── */
.series-parts {
  display: grid;
  gap: 14px;
  margin: 24px 0 32px;
}
.series-part {
  position: relative;
  display: block;
  padding: 20px 22px 20px 68px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(0, 229, 209, 0.12);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.series-part:hover {
  border-color: rgba(0, 229, 209, 0.35);
  background: rgba(0, 229, 209, 0.04);
  transform: translateY(-1px);
}
.series-part-num {
  position: absolute;
  left: 18px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 229, 209, 0.08);
  border: 1px solid rgba(0, 229, 209, 0.25);
  color: var(--cyan);
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.series-part-title {
  font-family: var(--fh);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--fg);
}
.series-part-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(220, 232, 245, 0.72);
  margin: 0;
}
.series-part-cta {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--fm);
  font-size: 11.5px;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.series-part.is-locked {
  opacity: 0.7;
  border-style: dashed;
}
.series-part.is-locked:hover {
  transform: none;
  background: rgba(255,255,255,0.025);
  border-color: rgba(0, 229, 209, 0.18);
}
.series-part-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-family: var(--fm);
  font-size: 10.5px;
  color: rgba(220, 232, 245, 0.75);
  background: rgba(220, 232, 245, 0.06);
  border: 1px solid rgba(220, 232, 245, 0.12);
  border-radius: 10px;
  vertical-align: middle;
}
@media (max-width: 640px) {
  .series-part { padding: 18px 18px 18px 60px; }
  .series-part-num { left: 14px; top: 18px; width: 32px; height: 32px; font-size: 12px; }
}
