/* ============================================================
   thenets.org — Glass UI
   Ported from claude.ai/design · glass-ui-design-system
   ============================================================ */

/* ── Design tokens (colors_and_type.css verbatim) ──────────── */
:root {
  /* Brand — cyan */
  --brand-300: #67e8f9;
  --brand-400: #22d3ee;
  --brand-500: #06b6d4;
  --brand-600: #0891b2;
  --brand2-500: #0ea5e9;
  --brand2-600: #0284c7;

  --brand-rgb:  6 182 212;
  --brand2-rgb: 14 165 233;

  /* Page background channels */
  --color-chat-main: #0d0d11;

  /* Glass surfaces */
  --glass-light:         rgba(255, 255, 255, 0.10);
  --glass-light-hover:   rgba(255, 255, 255, 0.16);
  --glass-light-active:  rgba(255, 255, 255, 0.22);
  --glass-border:        rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.32);

  /* Semantic accents */
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger:  #ef4444;
  --accent-info:    #06b6d4;

  /* Foreground */
  --fg-1: rgba(255, 255, 255, 0.92);
  --fg-2: rgba(255, 255, 255, 0.60);
  --fg-3: rgba(255, 255, 255, 0.35);

  /* Blur scale (numeric values — apply as blur(var(--blur-md))) */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --blur-xl: 40px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.18);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.22);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.28);
  --shadow-elevated: 0 20px 60px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.32);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 9999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography */
  --font-display: "DM Sans", "Inter", system-ui, sans-serif;
  --font-body:    "DM Sans", "Inter", system-ui, sans-serif;
  --font-sans:    var(--font-body);
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Base type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;

  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.55;
  --tracking-tight: -0.02em;

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --ease-glass: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:   cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout — used by the post template */
  --post-width: 720px;
  --post-font-size: 17px;
  --post-density: 1;
  --header-h: 56px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  background: #0a0a0f;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--fg-1);
  background: #0a0a0f;
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(34,211,238,0.08), transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(168,85,247,0.06), transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-300); text-decoration: none; }
a:hover { color: #a5f3fc; }

img { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(34,211,238,0.35); color: var(--fg-1); }

/* ── Reading progress bar ──────────────────────────────────── */
.progress-bar {
  position: fixed; left: 0; top: 0;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--brand-400), #a855f7);
  z-index: 60;
  pointer-events: none;
  transition: width 80ms linear;
}

/* ── Site nav ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 15, 0.80);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.site-logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-1);
  letter-spacing: -0.01em;
}
.site-logo a:hover { color: var(--brand-300); }

html.is-home .site-logo { transition: opacity 300ms var(--ease-out); }
html.is-home.at-top .site-logo { opacity: 0; pointer-events: none; }

.site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 24px;
  font-size: 13px;
}
.site-nav--drawer { display: none; }
.site-nav a {
  color: var(--fg-2);
  transition: color 150ms ease;
  padding: 4px 0;
}
.site-nav a:hover,
.site-nav a.active { color: var(--fg-1); }

.nav-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column; gap: 4px;
}
.nav-toggle span {
  width: 20px; height: 2px;
  background: var(--fg-2);
  border-radius: 2px;
}

/* Search trigger */
.search-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-2);
  transition: background 150ms ease, color 150ms ease;
}
.search-trigger:hover { background: rgba(255,255,255,0.06); color: var(--fg-1); }
.search-trigger svg { width: 14px; height: 14px; display: block; }

/* ── Main ──────────────────────────────────────────────────── */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
}
/* Post pages: the post-body-wrap handles its own width/padding (1100px grid).
   Let the wrap span full width of main and control its own layout. */
.site-main--post {
  max-width: none;
  padding: 0;
}

/* ════════════════════════════════════════════════════════════
   HOME / LIST — glass cards, mirroring post design vocabulary
   ════════════════════════════════════════════════════════════ */

/* Home hero */
.home-hero {
  position: relative;
  padding: 40px 32px;
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute; inset: -40%;
  background:
    radial-gradient(40% 40% at 20% 10%, rgba(34,211,238,0.18), transparent 60%),
    radial-gradient(35% 45% at 85% 20%, rgba(168,85,247,0.14), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.home-hero > * { position: relative; z-index: 1; }
.home-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--fg-1);
  text-wrap: balance;
}
.home-description {
  color: var(--fg-2);
  font-size: 1.05rem;
  margin: 0;
  max-width: 60ch;
}

/* Home hero logo: visually de-emphasized when rendered on home */
html.is-home .site-header { background: rgba(10,10,15,0.5); }

/* Section/list headers */
.list-header {
  margin-bottom: 32px;
  padding: 28px 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
}
.list-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--fg-1);
}
.tag-label {
  color: var(--brand-300);
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.05em;
}
.list-description { color: var(--fg-2); margin: 0; font-size: 14px; }
.no-posts { color: var(--fg-2); font-style: italic; }

/* Post grid (home/list/tag) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.post-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
}
/* Whole-card click target: the title link spans the entire card via ::before.
   Tag links sit above via z-index so they still route to tag pages. */
.post-card .post-card-title a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card .post-meta .tag,
.post-card .post-tags a {
  position: relative;
  z-index: 2;
}
.post-card:hover {
  border-color: rgba(34,211,238,0.3);
  transform: translateY(-2px);
  background: rgba(255,255,255,0.05);
}
.post-card:not(.has-image) { padding: 20px; gap: 10px; }
.post-card-image-link { display: block; }
.post-card.has-image .post-card-image-link { overflow: hidden; }
.post-card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  transition: transform 400ms var(--ease-out);
}
.post-card:hover .post-card-image { transform: scale(1.04); }
.post-card-body {
  padding: 18px 20px 22px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
}
.post-card-title a { color: var(--fg-1); }
.post-card-title a:hover { color: var(--brand-300); }
.post-excerpt {
  font-size: 14px;
  color: var(--fg-2);
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured grid */
.featured-section { margin-bottom: 40px; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}
.featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 250ms ease, transform 250ms ease;
}
.featured-card:hover {
  border-color: rgba(34,211,238,0.35);
  transform: translateY(-3px);
}
.featured-card-image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 1;
  transition: transform 500ms var(--ease-out);
}
.featured-card:hover .featured-card-image { transform: scale(1.05); }
.featured-card-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(10,10,16,0) 25%, rgba(10,10,16,0.92) 100%);
}
.featured-card-ribbon {
  position: absolute;
  top: 16px; left: 16px; z-index: 3;
  padding: 3px 10px;
  background: rgba(10,10,16,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(34,211,238,0.35);
  color: var(--brand-300);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  border-radius: var(--radius-pill);
}
.featured-card-content {
  position: relative; z-index: 3;
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  color: var(--fg-1);
}
.featured-card-content:hover { color: var(--fg-1); }
.featured-card-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-300);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.featured-card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
  color: var(--fg-1);
}
/* When the whole card is an <a>, strip the underline and inherit color. */
a.featured-card { text-decoration: none; color: inherit; }
a.featured-card:hover { color: inherit; }
.featured-card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
}
.featured-card-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card { min-height: 260px; }
}

/* Pagination */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 8px;
  margin-top: 48px;
  list-style: none; padding: 0;
}
.pagination li { list-style: none; }
.pagination a,
.pagination span,
.pagination .page-link {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--fg-2);
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.pagination a:hover,
.pagination .page-link:hover {
  border-color: rgba(34,211,238,0.3);
  color: var(--brand-300);
  background: rgba(255,255,255,0.05);
}
.pagination .active .page-link,
.pagination .active {
  border-color: rgba(34,211,238,0.4);
  color: var(--brand-300);
  background: rgba(34,211,238,0.08);
}
.pagination .disabled .page-link { opacity: 0.4; cursor: default; }
.pagination .page-link span { border: none; padding: 0; display: inline; background: none; }

/* ════════════════════════════════════════════════════════════
   ABOUT ME — dedicated rich layout (/about-me/)
   Ported from design preview/about-me.html
   ════════════════════════════════════════════════════════════ */
.site-main--about { max-width: none; padding: 0; }

/* Accent aliases used by this page */
:root {
  --me-accent: var(--brand-400);
  --me-accent2: #a855f7;
  --me-accent-soft: rgba(34, 211, 238, 0.15);
  --me-density: 1;
}

/* Starfield canvas */
#stars {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Layout wrap */
.about-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 28px 96px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
  position: relative;
  z-index: 1;
}
.about-main { min-width: 0; }

/* Sidebar section nav */
.sec-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  font-size: 13px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}
.sec-nav h6 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
}
.sec-nav ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid rgba(255,255,255,0.08); }
.sec-nav li { margin: 0; }
.sec-nav a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--fg-2);
  text-decoration: none;
  transition: color 150ms ease, border-color 200ms ease;
  border-bottom: none;
}
.sec-nav a:hover { color: var(--fg-1); }
.sec-nav a.active {
  color: var(--me-accent);
  border-left-color: var(--me-accent);
  font-weight: 500;
}

/* ── Hero ───────────────────────────────────────────────── */
.about-hero {
  position: relative;
  border-radius: 22px;
  padding: 44px 36px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
  isolation: isolate;
  margin-bottom: calc(56px * var(--me-density));
}
.about-hero .hero-bg {
  position: absolute; inset: -40%;
  background:
    radial-gradient(420px circle at var(--mx,30%) var(--my,40%), var(--me-accent-soft), transparent 55%),
    radial-gradient(600px circle at 85% 0%, color-mix(in srgb, var(--me-accent2) 18%, transparent), transparent 60%),
    radial-gradient(500px circle at 0% 100%, color-mix(in srgb, var(--me-accent) 14%, transparent), transparent 60%);
  z-index: -2;
  transition: background-position 400ms ease;
}
.about-hero .hero-grid {
  position: absolute; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse 60% 100% at 50% 50%, black 50%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 50%, black 50%, transparent 85%);
  opacity: 0.7;
}
.hero-inner {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 28px;
  align-items: center;
}
.about-hero .avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--me-accent), var(--me-accent2));
  padding: 2px;
  box-shadow: 0 10px 30px -10px rgba(34,211,238,0.5);
  flex-shrink: 0;
}
.about-hero .avatar .inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #0a0a0f;
  display: grid; place-items: center;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.about-hero .avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
  border: none;
  box-shadow: none;
  background: #0a0a0f;
}
.hero-text .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--me-accent);
  margin: 0 0 14px;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--me-accent) 35%, transparent);
  background: color-mix(in srgb, var(--me-accent) 8%, transparent);
  border-radius: var(--radius-pill);
  background-clip: padding-box;
  background: none;
  border: none;
  padding: 0;
}
.hero-text .eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }
.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--fg-1);
  text-wrap: balance;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.98) 0%,
    var(--me-accent) 55%,
    var(--me-accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-text .hero-tag {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 16px;
  text-wrap: pretty;
  max-width: 62ch;
}
.hero-text .location {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
.hero-text .location svg {
  width: 13px; height: 13px;
  vertical-align: -2px;
  margin-right: 4px;
}

/* ── Sections ───────────────────────────────────────────── */
.me-section {
  margin-bottom: calc(56px * var(--me-density));
  scroll-margin-top: 80px;
}
.me-section h2,
.me-section .sec-h {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin: 0 0 28px;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.me-section .sec-num {
  color: var(--me-accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.me-section .sec-label {
  color: var(--fg-2);
  flex-shrink: 0;
}
.me-section .sec-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.12) 35%,
    rgba(255, 255, 255, 0) 100%
  );
  margin-left: 4px;
}
.me-section .prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.7;
  color: rgba(255,255,255,0.86);
}
.me-section .prose p { margin: 0 0 18px; text-wrap: pretty; }
.me-section .prose strong { color: var(--fg-1); font-weight: 600; }
.me-section .prose em { color: #e0e7ff; font-style: italic; }
.me-section .prose a {
  color: var(--me-accent);
  border-bottom: 1px solid color-mix(in srgb, var(--me-accent) 35%, transparent);
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}
.me-section .prose a:hover { color: #a5f3fc; border-bottom-color: var(--me-accent); }

/* ── Now card ─────────────────────────────────────────── */
.now-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  border-left: 3px solid var(--me-accent);
}
.now-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--me-accent) 14%, transparent);
  color: var(--me-accent);
  display: grid; place-items: center;
}
.now-icon svg { width: 22px; height: 22px; }
.now-card h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 6px;
  color: var(--fg-1);
}
.now-card p {
  font-size: 14.5px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0;
}
.now-card strong { color: var(--fg-1); font-weight: 600; }

/* ── Timeline ─────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 14px; top: 16px; bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(34,211,238,0.4), rgba(168,85,247,0.3), transparent);
}
.tl-item {
  position: relative;
  padding: 16px 18px 16px 44px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: border-color 150ms ease, background 150ms ease;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 10px; top: 24px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--me-accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.tl-item.current::before {
  box-shadow: 0 0 0 3px rgba(34,211,238,0.25), 0 0 16px rgba(34,211,238,0.6);
  animation: pulse 2.5s ease-in-out infinite;
}
.tl-item:hover { border-color: rgba(34,211,238,0.25); }
.tl-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tl-meta .dur { opacity: 0.7; }
.tl-meta .now-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--me-accent);
  background: color-mix(in srgb, var(--me-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--me-accent) 35%, transparent);
}
.tl-role {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 3px;
}
.tl-company {
  font-size: 13.5px;
  color: var(--fg-2);
  margin: 0 0 8px;
}
.tl-company .co { font-weight: 600; color: var(--fg-1); }
.tl-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease;
  opacity: 0;
}
.tl-item.open .tl-body { max-height: 800px; opacity: 1; margin-top: 4px; }
.tl-body p { margin: 0 0 10px; }
.tl-body ul { padding-left: 18px; margin: 8px 0 0; }
.tl-body li { margin-bottom: 6px; }
.tl-body strong { color: var(--fg-1); font-weight: 600; }
.tl-toggle {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-pill);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.tl-toggle:hover { background: rgba(255,255,255,0.08); color: var(--fg-1); }
.tl-toggle svg { width: 12px; height: 12px; transition: transform 200ms ease; }
.tl-item.open .tl-toggle svg { transform: rotate(180deg); }
.tl-toggle .less { display: none; }
.tl-item.open .tl-toggle .more { display: none; }
.tl-item.open .tl-toggle .less { display: inline; }

/* ── Projects / portfolio ─────────────────────────────── */
.portfolio-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.portfolio-filter button {
  padding: 6px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms ease;
}
.portfolio-filter button:hover { color: var(--fg-1); border-color: rgba(255,255,255,0.18); }
.portfolio-filter button.active {
  background: color-mix(in srgb, var(--me-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--me-accent) 45%, transparent);
  color: var(--me-accent);
}
.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 200ms var(--ease-out), border-color 200ms ease, background 200ms ease;
}
.proj.hidden { display: none; }
.proj:hover {
  transform: translateY(-3px);
  border-color: rgba(34,211,238,0.35);
  background: rgba(255,255,255,0.04);
}
.proj .ext {
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(10,10,15,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  color: var(--fg-1);
  opacity: 0;
  transition: opacity 180ms ease;
}
.proj:hover .ext { opacity: 1; }
.proj .ext svg { width: 13px; height: 13px; }
.proj-cover {
  height: 140px;
  background-color: #1e1b4b;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: transform 400ms var(--ease-out);
}
.proj:hover .proj-cover { transform: scale(1.03); }

/* Fallback gradient palettes — used when no background-image is set */
.cov-a:not([style*="background-image"]) { background-image: linear-gradient(135deg, #0c1220, #1e3a8a 60%, #7c3aed); }
.cov-b:not([style*="background-image"]) { background-image: linear-gradient(135deg, #064e3b, #065f46 50%, #0891b2); }
.cov-c:not([style*="background-image"]) { background-image: linear-gradient(135deg, #7f1d1d, #991b1b 60%, #b45309); }
.cov-d:not([style*="background-image"]) { background-image: linear-gradient(135deg, #1e1b4b, #be185d 70%); }
.cov-e:not([style*="background-image"]) { background-image: linear-gradient(135deg, #134e4a, #0e7490 70%); }
.cov-f:not([style*="background-image"]) { background-image: linear-gradient(135deg, #3f3f46, #1f2937 70%); }
.proj-body { padding: 14px 16px 16px; }
.proj-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 6px;
}
.proj-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 10px;
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-3);
  letter-spacing: 0.02em;
}

/* ── Stack / skills ───────────────────────────────────── */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.skill-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--me-accent);
  margin: 0 0 10px;
  font-weight: 500;
}
.skill-col ul { list-style: none; padding: 0; margin: 0; }
.skill-col li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13.5px;
  color: var(--fg-1);
}
.skill-col li:last-child { border-bottom: none; }
.skill-col .yrs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

/* ── Speaking / entries ───────────────────────────────── */
.entries { display: flex; flex-direction: column; gap: 4px; }
.entry {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.entry:last-child { border-bottom: none; }
.entry .yr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
.entry .title {
  font-size: 14px;
  color: var(--fg-1);
  margin: 0 0 2px;
  font-weight: 500;
}
.entry .venue {
  font-size: 12px;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 4px;
}
.entry .venue .type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  color: var(--me-accent);
  background: color-mix(in srgb, var(--me-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--me-accent) 30%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}
.entry .link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--me-accent);
  text-decoration: none;
  border-bottom: none;
}
.entry .link.muted { color: var(--fg-3); font-style: italic; }
.entry .link:hover { color: #a5f3fc; }

/* ── Testimonials ─────────────────────────────────────── */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.testi {
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  position: relative;
}
.testi::before {
  content: "\201C";
  position: absolute;
  top: -4px; left: 10px;
  font-size: 52px;
  color: var(--me-accent);
  opacity: 0.3;
  line-height: 1;
  font-family: Georgia, serif;
}
.testi p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin: 0 0 14px;
  font-style: italic;
}
.testi .who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.testi .av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--me-accent), var(--me-accent2));
  display: grid; place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.testi .name { font-size: 13px; color: var(--fg-1); font-weight: 600; }
.testi .role { font-size: 11.5px; color: var(--fg-3); margin-top: 1px; }
.testi-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--fg-3);
  text-align: center;
}
.testi-note a { color: var(--me-accent); border-bottom: none; }
/* In-card achievement note tied to the testimonial context */
.testi-note-inline {
  margin-top: 12px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid var(--me-accent);
  background: color-mix(in srgb, var(--me-accent) 6%, transparent);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-2);
}
.testi-note-inline::before {
  content: "// ";
  color: var(--me-accent);
  opacity: 0.8;
}

/* ── Education ────────────────────────────────────────── */
.edu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.edu-card {
  padding: 16px 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
}
.edu-card .school {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-1);
  margin: 0 0 4px;
}
.edu-card .degree {
  font-size: 13px;
  color: var(--fg-2);
  margin: 0 0 8px;
  line-height: 1.5;
}
.edu-card .yr {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  margin: 0;
}

/* ── Contact ──────────────────────────────────────────── */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.contact a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--fg-1);
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.contact a:hover {
  border-color: color-mix(in srgb, var(--me-accent) 35%, transparent);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
  color: var(--fg-1);
}
.contact svg {
  width: 18px; height: 18px;
  color: var(--me-accent);
  flex-shrink: 0;
}
.contact .val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-2);
}

/* ── Footer ──────────────────────────────────────────── */
.me-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .about-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px 80px;
    /* Drop the stacking context so the fixed .sec-nav (z-index: 55)
       can rise above the root-level .toc-backdrop (z-index: 54). */
    z-index: auto;
  }
  /* Mobile section-nav: floating glass drawer anchored bottom-right,
     same pattern as the post TOC. */
  .sec-nav {
    display: block;
    position: fixed;
    top: auto; left: auto;
    bottom: 78px;
    right: 20px;
    width: calc(100vw - 40px);
    max-width: 300px;
    max-height: min(60vh, 480px);
    overflow-y: auto;
    background: rgba(18, 18, 26, 0.62);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform-origin: bottom right;
    transform: scale(0.85) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 260ms cubic-bezier(.22, .61, .36, 1),
      opacity 200ms ease;
    z-index: 55;
    padding-right: 8px;
  }
  .sec-nav.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .sec-nav h6 { margin-bottom: 8px; }
  /* Show the about-page section-nav FAB (the post TOC FAB uses
     body.has-toc .toc-fab — don't override that). */
  #secNavFab { display: flex; }
  .about-hero { padding: 32px 20px 28px; border-radius: 18px; }
  /* Stack avatar on top, text centered below. */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    text-align: center;
  }
  .about-hero .avatar { width: 96px; height: 96px; }
  .about-hero .avatar .inner { font-size: 30px; }
  .hero-text { max-width: 100%; }
  .hero-text .eyebrow {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 2px;
  }
  /* Mobile: hide the green live-status dot and the middle separator;
     break the role and company onto their own lines. */
  .hero-text .eyebrow .dot,
  .hero-text .eyebrow .sep { display: none; }
  .hero-text .eyebrow .role,
  .hero-text .eyebrow .company { flex-basis: 100%; text-align: center; }
  .hero-text h1 { font-size: 1.9rem; }
  .hero-text .hero-tag { margin-left: auto; margin-right: auto; }
  .hero-text .location { justify-content: center; gap: 8px 14px; }
  .entry { grid-template-columns: 50px 1fr; gap: 10px; }
  .entry .link { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  /* Push the type badge onto its own line and give it a consistent
     left-aligned presentation on mobile. */
  .entry .venue { gap: 6px 8px; }
  .entry .venue .type {
    flex-basis: 100%;
    max-width: max-content;
    text-align: center;
  }

  /* Now card: stack icon on top */
  .now-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }
  .now-card .now-icon { margin-bottom: 2px; }
  .now-card p { text-align: left; }
}

/* ════════════════════════════════════════════════════════════
   SPECIAL PAGES — About, Resume (not blog posts)
   Wide glass hero with image, centered title, own prose column.
   ════════════════════════════════════════════════════════════ */
.page-pane {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 28px 120px;
}

.page-hero {
  position: relative;
  padding: 56px 48px;
  margin-bottom: 48px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  overflow: hidden;
  isolation: isolate;
}
/* Animated cyan/purple gradient wash behind hero text */
.page-hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(400px circle at 15% 20%, rgba(34,211,238,0.28), transparent 55%),
    radial-gradient(500px circle at 85% 30%, rgba(168,85,247,0.22), transparent 60%),
    radial-gradient(600px circle at 50% 110%, rgba(6,182,212,0.16), transparent 60%);
  animation: page-hero-drift 22s ease-in-out infinite alternate;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,15,0.25) 100%);
  pointer-events: none;
}
@keyframes page-hero-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 1%, 0) scale(1.04); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

.page-hero__text {
  position: relative;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}
.page-hero__text .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 18px;
  padding: 4px 12px;
  border: 1px solid rgba(34,211,238,0.35);
  background: rgba(34,211,238,0.06);
  border-radius: var(--radius-pill);
}
.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  color: var(--fg-1);
  text-wrap: balance;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.98) 0%,
    var(--brand-300) 55%,
    #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--fg-2);
  margin: 0;
  line-height: 1.6;
  text-wrap: pretty;
}

.page-hero__cover {
  position: relative;
  margin: 40px auto 0;
  max-width: 780px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.08);
  background: #000;
}
.page-hero__cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  margin: 0;
  border: none;
  border-radius: 0;
  transition: transform 800ms var(--ease-out);
}
.page-hero:hover .page-hero__cover img { transform: scale(1.02); }
.page-hero__cover::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(400px circle at 25% 20%, rgba(34,211,238,0.18), transparent 60%),
    radial-gradient(500px circle at 80% 80%, rgba(168,85,247,0.14), transparent 60%);
  mix-blend-mode: overlay;
}

/* Page body — typography scoped to special pages */
.page-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  color: rgba(255,255,255,0.86);
  line-height: 1.7;
}
.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4 {
  font-family: var(--font-display);
  color: var(--fg-1);
  letter-spacing: -0.015em;
  margin: 40px 0 14px;
  line-height: 1.25;
}
.page-body h2 {
  font-size: 1.7rem;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.page-body h3 { font-size: 1.25rem; font-weight: 600; }
.page-body h4 { font-size: 1.05rem; font-weight: 600; color: var(--fg-2); }
.page-body > *:first-child { margin-top: 0; }
.page-body p { margin: 0 0 18px; text-wrap: pretty; }
.page-body a {
  color: var(--brand-300);
  border-bottom: 1px solid rgba(103,232,249,0.3);
  transition: color 150ms ease, border-color 150ms ease;
}
.page-body a:hover { color: #a5f3fc; border-bottom-color: var(--brand-300); }
.page-body strong { color: var(--fg-1); font-weight: 600; }
.page-body ul,
.page-body ol { padding-left: 22px; margin: 0 0 20px; }
.page-body li { margin-bottom: 8px; }
.page-body li::marker { color: var(--brand-400); }
.page-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 5px;
  color: var(--brand-300);
  white-space: nowrap;
}
.page-body img {
  max-width: 100%;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  margin: 24px 0;
}
.page-body figure { margin: 24px 0; text-align: center; }
.page-body figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg-3);
  font-style: italic;
}
.page-body hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 40px 0;
}

@media (max-width: 768px) {
  .page-pane { padding: 24px 16px 80px; }
  .page-hero {
    padding: 36px 22px;
    margin-bottom: 32px;
    border-radius: var(--radius-lg);
  }
  .page-hero__cover { margin-top: 28px; }
}

/* ════════════════════════════════════════════════════════════
   SINGLE POST — faithful port of preview/blog-post.css
   ════════════════════════════════════════════════════════════ */

/* Break full-width hero out of main container */
.site-main > .m-hero {
  width: 100vw;
  position: relative;
  left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  margin-top: -40px;
  margin-bottom: 0;
}
.site-main > .m-hero + .page-single { padding-top: 0; }

/* Optional full-bleed hero image (about/resume/post with .Params.image) */
.m-hero {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 365px;
}
.m-hero.with-picture {
  background: #000;
  color: var(--fg-1);
  min-height: 400px;
}
.m-hero__picture { position: absolute; inset: 0; z-index: 1; }
.m-hero__picture img { width: 100%; height: 100%; object-fit: cover; margin: 0; opacity: 0.75; border-radius: 0; }
.m-hero__content {
  position: relative; z-index: 2;
  text-align: center; width: 100%;
  padding: 80px 28px 28px;
}
.m-hero__content::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.85));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 50%, black);
  mask-image: linear-gradient(to bottom, transparent 50%, black);
}
.m-hero-title.bigger {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.15;
  color: var(--fg-1);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.m-hero-description {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
@media (min-width: 769px) {
  .m-hero.with-picture { min-height: 440px; }
  .m-hero__content { padding: 32px; }
  .m-hero-title.bigger { font-size: 3.25rem; letter-spacing: -0.025em; margin-bottom: 12px; }
  .m-hero-description { font-size: 1.125rem; }
}

.page-single { max-width: 100%; }

/* Post wrapper = grid: 220px sidebar + post column */
.post-wrap,
.site-main .post-body-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 28px 120px;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--post-width));
  gap: 56px;
  justify-content: center;
}
body.no-toc .post-wrap,
body.no-toc .site-main .post-body-wrap {
  grid-template-columns: minmax(0, var(--post-width));
  justify-content: center;
}
body.no-toc aside.toc { display: none; }

/* When a full-bleed hero is present, collapse top padding */
.site-main > .m-hero + .page-single .post-body-wrap { padding-top: 32px; }

/* TOC sidebar */
aside.toc {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
  font-size: 13px;
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto;
  padding-right: 8px;
}
aside.toc h6 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
}
aside.toc nav > ul,
aside.toc > ul {
  list-style: none;
  padding: 0; margin: 0;
  border-left: 1px solid rgba(255,255,255,0.08);
}
aside.toc ul ul {
  list-style: none;
  padding: 0; margin: 0;
}
aside.toc li { margin: 0; list-style: none; }
aside.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--fg-2);
  text-decoration: none;
  line-height: 1.4;
  transition: color 150ms ease, border-color 200ms ease;
}
aside.toc a:hover { color: var(--fg-1); }
aside.toc a.active {
  color: var(--brand-300);
  border-left-color: var(--brand-400);
  font-weight: 500;
}
/* Nested — smaller & indented */
aside.toc ul ul a { padding-left: 26px; font-size: 12.5px; color: var(--fg-3); }
aside.toc ul ul a.active { color: var(--brand-300); }

/* Article */
article.post {
  min-width: 0;
  font-size: var(--post-font-size);
  color: rgba(255,255,255,0.86);
}

/* Hero */
.post-hero { margin-bottom: 36px; }
.post-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 14px;
  background: none;
  border: none;
  padding: 0;
}
.post-hero .eyebrow::before {
  content: "";
  width: 16px; height: 1px;
  background: var(--brand-400);
}
.post-title,
.post-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--fg-1);
  text-wrap: balance;
}

/* Post meta row */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.post-meta time { color: inherit; font-family: inherit; }
.post-meta .dot,
.post-meta .meta-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--fg-3);
  flex-shrink: 0;
  /* Reset text-based styles from old implementation */
  display: inline-block;
  font-size: 0;
}
.post-meta .post-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.post-meta .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(34,211,238,0.08);
  color: var(--brand-300);
  border: 1px solid rgba(34,211,238,0.22);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.post-meta .tag:hover {
  background: rgba(34,211,238,0.18);
  border-color: rgba(34,211,238,0.45);
  color: var(--brand-300);
}

/* Tag pill (used outside post-meta too) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(34,211,238,0.08);
  color: var(--brand-300);
  border: 1px solid rgba(34,211,238,0.22);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  transition: background 150ms ease, border-color 150ms ease;
}
.tag:hover {
  background: rgba(34,211,238,0.18);
  border-color: rgba(34,211,238,0.45);
  color: var(--brand-300);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Post cover (decorative gradient with scanlines) */
.post-cover {
  margin-top: 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
  position: relative;
}
.post-cover::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px circle at 30% 30%, rgba(34,211,238,0.25), transparent 55%),
    radial-gradient(500px circle at 75% 70%, rgba(168,85,247,0.30), transparent 60%);
}
.post-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 24px,
    rgba(255,255,255,0.03) 24px 25px
  );
  mix-blend-mode: overlay;
}
.post-cover .cover-label {
  position: absolute; bottom: 14px; left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
}
.post-cover img,
.post-cover picture {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  margin: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.post-cover:has(img) { background: #000; }
.post-cover:has(img)::before,
.post-cover:has(img)::after { opacity: 0.6; }
body.no-hero .post-cover { display: none; }

/* ── Prose ───────────────────────────────────────────────── */
article.post h2 {
  font-family: var(--font-display);
  font-size: calc(var(--post-font-size) * 1.55);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: calc(52px * var(--post-density)) 0 14px;
  color: var(--fg-1);
  scroll-margin-top: 88px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
article.post h3 {
  font-family: var(--font-display);
  font-size: calc(var(--post-font-size) * 1.18);
  font-weight: 600;
  margin: calc(32px * var(--post-density)) 0 10px;
  color: var(--fg-1);
  scroll-margin-top: 88px;
  letter-spacing: -0.005em;
}
article.post h4 {
  font-family: var(--font-display);
  font-size: calc(var(--post-font-size) * 1.02);
  font-weight: 600;
  margin: calc(24px * var(--post-density)) 0 8px;
  color: var(--fg-1);
}
article.post p {
  margin: 0 0 calc(16px * var(--post-density));
  line-height: 1.7;
  color: rgba(255,255,255,0.86);
  text-wrap: pretty;
}
article.post a {
  color: var(--brand-300);
  text-decoration: none;
  border-bottom: 1px solid rgba(103,232,249,0.3);
  transition: border-color 150ms ease, color 150ms ease;
  position: relative;
  /* Long URLs pasted as link text must break so they don't blow out the
     column width on narrow screens. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
article.post a:hover { color: #a5f3fc; border-bottom-color: var(--brand-300); }

article.post ul,
article.post ol {
  margin: 0 0 calc(18px * var(--post-density));
  padding-left: 22px;
  line-height: 1.7;
}
article.post li { margin-bottom: 6px; }
article.post li::marker { color: var(--fg-3); }

article.post strong { color: var(--fg-1); font-weight: 600; }
article.post em { color: #e0e7ff; font-style: italic; }

/* Inline code */
article.post :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 5px;
  color: var(--brand-300);
  white-space: nowrap;
}

/* kbd */
article.post kbd,
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
  background: linear-gradient(180deg, #2a2a34, #1f1f28);
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom: 2px solid rgba(255,255,255,0.05);
  border-radius: 5px;
  color: var(--fg-1);
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  vertical-align: 1px;
}

/* Blockquote */
article.post blockquote {
  margin: calc(22px * var(--post-density)) 0;
  padding: 12px 20px;
  border-left: 3px solid var(--brand-400);
  background: rgba(255,255,255,0.025);
  border-radius: 0 10px 10px 0;
  color: var(--fg-2);
  font-style: italic;
}
article.post blockquote p { margin: 0; }

/* ── Callouts ─────────────────────────────────────────────── */
.callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  margin: calc(22px * var(--post-density)) 0;
  border-radius: 10px;
  background: rgba(34,211,238,0.04);
  border: 1px solid rgba(34,211,238,0.18);
  border-left: 3px solid var(--brand-400);
}
.callout > .icon,
.callout > svg.icon,
.callout > .callout-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--brand-400);
  margin-top: 2px;
}
.callout > .callout-icon { background: none; border-radius: 0; padding: 0; }
.callout > .callout-icon svg { width: 20px; height: 20px; color: inherit; }
.callout > .body,
.callout > .callout-body { flex: 1; min-width: 0; }
.callout > .body > :first-child,
.callout > .callout-body > :first-child { margin-top: 0; }
.callout > .body > :last-child,
.callout > .callout-body > :last-child { margin-bottom: 0; }
.callout .label,
.callout .callout-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin: 0 0 4px;
  font-weight: 600;
}
.callout.info { /* default */ }

.callout.warning {
  background: rgba(245,158,11,0.05);
  border-color: rgba(245,158,11,0.22);
  border-left-color: #f59e0b;
}
.callout.warning .icon,
.callout.warning .callout-icon { color: #f59e0b; }
.callout.warning .label,
.callout.warning .callout-title { color: #fbbf24; }

.callout.tip {
  background: rgba(16,185,129,0.05);
  border-color: rgba(16,185,129,0.22);
  border-left-color: #10b981;
}
.callout.tip .icon,
.callout.tip .callout-icon { color: #10b981; }
.callout.tip .label,
.callout.tip .callout-title { color: #34d399; }

.callout.danger {
  background: rgba(239,68,68,0.05);
  border-color: rgba(239,68,68,0.22);
  border-left-color: #ef4444;
}
.callout.danger .icon,
.callout.danger .callout-icon { color: #ef4444; }
.callout.danger .label,
.callout.danger .callout-title { color: #fca5a5; }

/* ── Figures ─────────────────────────────────────────────── */
figure.post-figure,
article.post figure {
  margin: calc(28px * var(--post-density)) 0;
}
figure.post-figure .placeholder {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: linear-gradient(135deg, #111827, #1e1b4b 60%, #312e81);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
figure.post-figure .placeholder.diagram {
  background: linear-gradient(135deg, #0c1220, #1a2233);
}
figure.post-figure .placeholder::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(400px circle at 30% 40%, rgba(34,211,238,0.22), transparent 55%),
    radial-gradient(400px circle at 75% 65%, rgba(236,72,153,0.20), transparent 55%);
}
figure.post-figure .placeholder svg {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 48px; height: 48px;
  color: rgba(255,255,255,0.28);
}
article.post figure img,
figure.post-figure img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
  margin: 0;
}
article.post figcaption,
figure.post-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg-3);
  text-align: center;
  font-style: italic;
}

/* Standalone img inside post (no figure) */
article.post > .post-content > p > img,
.post-content > p > img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  margin: calc(22px * var(--post-density)) 0;
}

/* Inline video (kg-video-card and bare <video>) — keep inside the column */
article.post video,
.post-content video {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
}
.kg-video-card {
  margin: calc(22px * var(--post-density)) 0;
}

/* ── Video embed (shortcode + design placeholder) ────────── */
.video-embed,
.youtube-embed {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
  margin: calc(28px * var(--post-density)) 0;
}
.video-embed iframe,
.youtube-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-embed .thumb {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0c1220 0%, #1e1b4b 100%);
}
.video-embed .thumb::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px circle at 50% 50%, rgba(168,85,247,0.22), transparent 55%);
}
.video-embed .play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center;
  transition: transform 180ms ease, background 180ms ease;
}
.video-embed:hover .play { transform: translate(-50%,-50%) scale(1.06); background: rgba(255,255,255,0.18); }
.video-embed .play svg { width: 22px; height: 22px; margin-left: 3px; color: var(--fg-1); }
.video-embed .meta {
  position: absolute; bottom: 14px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: end;
  color: rgba(255,255,255,0.85);
}
.video-embed .meta .title { font-size: 14px; font-weight: 600; }
.video-embed .meta .dur {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}

/* ── Tables ─────────────────────────────────────────────── */
.post-table-wrap,
article.post > .post-content > table,
article.post table {
  margin: calc(22px * var(--post-density)) 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
article.post table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(var(--post-font-size) * 0.9);
}
article.post th,
article.post td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
article.post th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  background: rgba(255,255,255,0.02);
}
article.post tbody tr:last-child td { border-bottom: 0; }
article.post tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ── Definition list ─────────────────────────────────────── */
dl.post-dl,
article.post > .post-content > dl,
article.post dl {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 12px 24px;
  margin: calc(22px * var(--post-density)) 0;
  padding: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
article.post dt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand-300);
  font-weight: 500;
}
article.post dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.55;
}

/* ── Link preview ───────────────────────────────────────── */
article.post a.with-preview { position: relative; }
.link-preview {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  padding: 10px 12px;
  background: rgba(18,18,24,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 20;
}
article.post a.with-preview:hover .link-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.link-preview .host {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--brand-300);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.link-preview .host .favicon {
  width: 12px; height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--brand-400), #a855f7);
  flex-shrink: 0;
}
.link-preview .title {
  font-size: 13px; font-weight: 600;
  color: var(--fg-1);
  line-height: 1.35;
  margin-bottom: 3px;
}
.link-preview .desc {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.4;
  border-bottom: none;
}

/* ── Footnotes ───────────────────────────────────────────── */
sup.footnote-ref,
article.post sup {
  font-size: 0.75em;
  margin-left: 1px;
  color: var(--brand-300);
}
sup.footnote-ref a,
article.post sup a {
  border-bottom: none;
  padding: 0 2px;
}
.footnotes {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  color: var(--fg-2);
}
.footnotes h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
  font-weight: 500;
}
.footnotes ol { padding-left: 20px; }
.footnotes li { margin-bottom: 8px; line-height: 1.55; }
.footnotes li::marker { color: var(--fg-3); font-family: var(--font-mono); }

/* ── Post footer: author + prev/next ─────────────────────── */
.post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.author-card,
.post-author {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 32px;
}
.author-card__avatar,
.post-author__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-400), #a855f7);
  flex-shrink: 0;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  position: relative;
}
.author-card__avatar img,
.post-author__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  margin: 0;
  box-shadow: none;
  border: none;
}
.author-card__info .name,
.author-card__name,
.post-author__name {
  font-weight: 600;
  color: var(--fg-1);
  font-size: 14px;
  margin: 0;
}
.author-card__info .bio,
.author-card__bio,
.post-author__bio {
  font-size: 12.5px;
  color: var(--fg-3);
  margin: 2px 0 0;
  line-height: 1.5;
}

.prev-next,
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
  max-width: none;
}
.prev-next a,
.post-nav-prev,
.post-nav-next {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  color: inherit;
  transition: background 150ms ease, border-color 150ms ease;
  display: block;
  max-width: none;
}
.prev-next a:hover,
.post-nav-prev:hover,
.post-nav-next:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(34,211,238,0.25);
}
.prev-next .dir,
.post-nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
  display: block;
}
.prev-next .t,
.post-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  border: none;
  text-decoration: none;
}
.prev-next .next { text-align: right; }
.post-nav-next { text-align: right; }
.post-nav-next::after { content: none; }
.post-nav a:hover { color: var(--brand-300); border: none; }

/* ═══════════ Code block chrome (.cb) ═══════════════════════ */
.cb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0f0f14;
  border: 1px solid rgba(255,255,255,0.08);
  margin: calc(22px * var(--post-density)) 0;
  font-size: 13.5px;
}
.cb-header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #17171d, #14141a);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
}
.cb-dots,
.cb-lights { display: inline-flex; gap: 5px; }
.cb-dots i,
.cb-lights span {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.cb-dots i:nth-child(1),
.cb-lights span:nth-child(1) { background: #ff5f57; }
.cb-dots i:nth-child(2),
.cb-lights span:nth-child(2) { background: #febc2e; }
.cb-dots i:nth-child(3),
.cb-lights span:nth-child(3) { background: #28c840; }
.cb-filename { color: var(--fg-1); }
.cb-lang {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-2);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cb-body {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
  overflow-y: hidden;
}
.cb-body pre {
  margin: 0;
  padding: 14px 16px;
  background: transparent !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.cb-body pre,
.cb-body code { font-size: inherit !important; }
.cb-body code {
  font-family: var(--font-mono);
  background: transparent !important;
  padding: 0 !important;
  white-space: pre;
  color: inherit;
}
.cb-copy {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 9px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 150ms ease, color 150ms ease;
  z-index: 3;
}
.cb:hover .cb-copy { opacity: 1; }
.cb-copy:hover { background: rgba(255,255,255,0.12); color: var(--fg-1); }
.cb-copy.copied { color: var(--accent-success); border-color: rgba(16,185,129,0.35); }
.cb-copy svg { width: 11px; height: 11px; }

/* Fallback pre (no chrome) */
article.post pre:not(.cb-body pre) {
  background: #0f0f14;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin: calc(22px * var(--post-density)) 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-1);
}

/* CRT signature — opt-in on bash/sh via .cb.crt */
.cb.crt .cb-body {
  background:
    linear-gradient(#0a0a0a 30%, #000 80%, #111),
    linear-gradient(rgba(0,161,255,0.02), transparent);
  background-size: 100% 4px, 100% 100%;
  background-repeat: repeat;
  text-shadow: 0 0 var(--bash-shadow-size, 2px) currentColor;
  animation: crt-bg 0.3s ease infinite;
  color: #d4d4d8;
}
.cb.crt .cb-body pre,
.cb.crt .cb-body code {
  font-weight: 600;
  font-size: 15px;
  text-shadow: 0 0 var(--bash-shadow-size, 2px) currentColor;
  animation: crt-text 0.2s steps(2) infinite;
}
.cb.crt .cb-body .hljs-keyword,
.cb.crt .cb-body .hljs-string,
.cb.crt .cb-body .hljs-built_in,
.cb.crt .cb-body .hljs-variable,
.cb.crt .cb-body .hljs-comment,
.cb.crt .cb-body .hljs-number {
  text-shadow: 0 0 var(--bash-shadow-size, 2px) currentColor;
}
@keyframes crt-text {
  0%, 100% { opacity: 0.88; }
  10%      { opacity: 0.94; }
  40%      { opacity: 0.98; }
}
@keyframes crt-bg {
  0%, 100% { opacity: 0.97; --bash-shadow-size: 1px; }
  30%      { opacity: 0.96; --bash-shadow-size: 3px; }
  60%      { opacity: 0.95; --bash-shadow-size: 2px; }
}

/* ── Design's .terminal output block ────────────────────── */
.terminal {
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 16px;
  margin: calc(22px * var(--post-density)) 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d4d4d8;
  overflow-x: auto;
}
.terminal .prompt { color: var(--brand-400); user-select: none; }
.terminal .out  { color: #a1a1aa; display: block; }
.terminal .ok   { color: #34d399; }
.terminal .warn { color: #fbbf24; }
.terminal .err  { color: #f87171; }

/* ── highlight.js theme overrides ────────────────────────── */
.hljs { color: #e6e6ec; background: transparent; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #c084fc; }
.hljs-string, .hljs-attr { color: #67e8f9; }
.hljs-number { color: #f59e0b; }
.hljs-comment { color: #6b7280; font-style: italic; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #22d3ee; }
.hljs-built_in { color: #f0abfc; }
.hljs-type, .hljs-title.class_ { color: #34d399; }
.hljs-name { color: #22d3ee; }
.hljs-property { color: #67e8f9; }
.hljs-selector-class, .hljs-selector-id { color: #f0abfc; }
.hljs-meta { color: #9ca3af; }

/* ── TOC mobile drawer ──────────────────────────────────── */
.toc-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 54;
}
.toc-fab {
  display: none;
  position: fixed;
  bottom: 20px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(20,20,26,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--fg-1);
  align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.toc-fab svg { width: 20px; height: 20px; }

/* ── Code caption (legacy markdown shorthand) ───────────── */
.code-caption {
  display: block;
  font-size: 13px;
  color: var(--fg-3);
  font-style: italic;
  text-align: center;
  margin-top: -14px;
  margin-bottom: 24px;
}

/* ── Bookmark card (restyled to design vocabulary) ─────── */
.kg-bookmark-card { margin: calc(22px * var(--post-density)) 0; }
.kg-bookmark-container {
  display: flex;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg-1);
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}
.post-content a.kg-bookmark-container,
article.post a.kg-bookmark-container { border-bottom: none; }
.kg-bookmark-container:hover {
  border-color: rgba(34,211,238,0.3);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
  color: var(--fg-1);
}
.kg-bookmark-content {
  flex: 1;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.kg-bookmark-title-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 10px;
}
.kg-bookmark-icon {
  width: 14px; height: 14px;
  border-radius: 3px;
  margin: 0;
  border: none;
  flex-shrink: 0;
}
.kg-bookmark-title {
  flex-basis: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  line-height: 1.4;
}
.kg-bookmark-description {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kg-bookmark-metadata {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 4px;
}
.kg-bookmark-author,
.kg-bookmark-publisher {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--brand-300);
  letter-spacing: 0.04em;
}
.kg-bookmark-publisher::before { content: "\2022"; margin: 0 0.3rem; color: var(--fg-3); }
.kg-bookmark-thumbnail {
  flex-shrink: 0;
  width: 160px;
  position: relative;
  overflow: hidden;
}
.kg-bookmark-thumbnail img {
  width: 100%; height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  border: none;
}
.kg-bookmark-thumbnail img[data-failed],
.kg-bookmark-icon[data-failed] { display: none; }
.kg-bookmark-thumbnail:has(img[data-failed]) { display: none; }

@media (max-width: 600px) {
  .kg-bookmark-container { flex-direction: column; }
  .kg-bookmark-thumbnail { width: 100%; height: 160px; order: -1; }
}

/* ── File card ─────────────────────────────────────────── */
.kg-file-card { margin: calc(22px * var(--post-density)) 0; }
.kg-file-card-container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--fg-1);
  transition: border-color 200ms ease, background 200ms ease;
}
.post-content a.kg-file-card-container { border-bottom: none; }
.kg-file-card-container:hover {
  border-color: rgba(34,211,238,0.3);
  background: rgba(255,255,255,0.05);
}
.kg-file-card-contents { flex: 1; min-width: 0; }
.kg-file-card-title { font-size: 14px; font-weight: 600; color: var(--fg-1); margin-bottom: 2px; }
.kg-file-card-caption { font-size: 12.5px; color: var(--fg-2); margin-bottom: 6px; }
.kg-file-card-metadata {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}
.kg-file-card-filename { font-weight: 500; }
.kg-file-card-filesize { opacity: 0.85; }
.kg-file-card-filesize::before { content: "\2022"; margin-right: 8px; }
.kg-file-card-icon { flex-shrink: 0; margin-left: 24px; }
.kg-file-card-icon svg { width: 28px; height: 28px; color: var(--brand-300); }

/* ── Mermaid ───────────────────────────────────────────── */
.mermaid {
  margin: calc(22px * var(--post-density)) 0;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 24px;
  overflow-x: auto;
}

/* ── Masonry gallery ───────────────────────────────────── */
.masonry-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 8px;
  margin: calc(22px * var(--post-density)) auto;
  max-width: calc(var(--post-width) + 200px);
}
.masonry-gallery-item {
  grid-column: span var(--col-span, 1);
  grid-row: span var(--row-span, 1);
  overflow: hidden;
  border-radius: 10px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
}
.masonry-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  border: none;
  cursor: zoom-in;
  transition: transform 250ms ease, filter 250ms ease;
}
.masonry-gallery-item:hover img { transform: scale(1.04); filter: brightness(1.08); }

@media (max-width: 768px) {
  .masonry-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; max-width: 100%; }
}
@media (max-width: 480px) {
  .masonry-gallery { grid-auto-rows: 120px; }
}

/* ── GLightbox overrides ──────────────────────────────── */
.glightbox-clean .gslide-description { background: rgba(18,18,28,0.92); color: var(--fg-1); }
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev { filter: invert(1); }
article.post a.glightbox,
.post-content a.glightbox,
article.post a.glightbox:hover,
.post-content a.glightbox:hover { border-bottom: none; }

/* ── Kg-width-wide (legacy) ──────────────────────────── */
.kg-width-wide {
  max-width: calc(var(--post-width) + 200px);
  margin-left: auto;
  margin-right: auto;
}

/* ── Wide figure in post column ──────────────────────── */
.post-content > p > img,
article.post > .post-content > p > img { width: 100%; }

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 32px 28px;
  background: rgba(10,10,15,0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  color: var(--fg-3);
  font-size: 13px;
}
.site-footer a { color: var(--fg-2); }
.site-footer a:hover { color: var(--brand-300); }
.footer-links { margin-top: 8px; display: flex; justify-content: center; gap: 20px; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34,211,238,0.4);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ── Search modal ───────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
#search-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 10vh;
}
#search-modal[hidden] { display: none; }
.search-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.search-box {
  position: relative; z-index: 1;
  width: min(640px, calc(100vw - 32px));
  background: rgba(18,18,24,0.86);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}
.search-input-row {
  display: flex; align-items: center;
  padding: 12px 16px; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.search-input-row .search-icon { width: 18px; height: 18px; color: var(--fg-2); flex-shrink: 0; }
#search-input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--fg-1); font-size: 15px;
  font-family: var(--font-body);
}
#search-input::placeholder { color: var(--fg-3); }
#search-input::-webkit-search-cancel-button { display: none; }
.search-esc-hint {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--fg-2);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 2px 7px;
  flex-shrink: 0;
}
#search-results { max-height: 60vh; overflow-y: auto; padding: 6px 0; }
#search-results:empty { display: none; }
.search-result-card {
  display: block; padding: 12px 16px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 150ms ease;
}
.search-result-card:last-child { border-bottom: none; }
.search-result-card:hover,
.search-result-card:focus { background: rgba(255,255,255,0.05); outline: none; }
.search-result-card:focus-visible { outline: 2px solid var(--brand-400); outline-offset: -2px; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--fg-1); margin-bottom: 4px; }
.search-result-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--fg-3);
}
.search-result-desc {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.search-result-tag {
  background: rgba(34,211,238,0.08);
  color: var(--brand-300);
  border: 1px solid rgba(34,211,238,0.22);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
}
.search-status {
  padding: 20px 16px;
  text-align: center;
  color: var(--fg-2);
  font-size: 14px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .post-wrap,
  .site-main .post-body-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 32px 20px 100px;
  }
  /* Mobile TOC: floating rounded glass block anchored bottom-right,
     just above the FAB. Opens with a subtle pop from the FAB origin. */
  aside.toc {
    position: fixed;
    top: auto;
    left: auto;
    bottom: 78px;
    right: 20px;
    width: calc(100vw - 40px);
    max-width: 300px;
    max-height: min(60vh, 480px);
    overflow-y: auto;
    background: rgba(18, 18, 26, 0.62);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform-origin: bottom right;
    transform: scale(0.85) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 260ms cubic-bezier(.22, .61, .36, 1),
      opacity 200ms ease;
    z-index: 55;
  }
  aside.toc.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  aside.toc h6 { margin-bottom: 8px; }
  body.has-toc .toc-fab { display: flex; }
  body.toc-open .toc-backdrop,
  .toc-backdrop.on,
  .toc-backdrop.open { display: block; }

  article.post h2 { font-size: calc(var(--post-font-size) * 1.35); }
  .site-header-inner { padding: 12px 18px; }
  .site-nav { gap: 16px; font-size: 12.5px; }
  .prev-next,
  .post-nav { grid-template-columns: 1fr; }
  article.post dl { grid-template-columns: 1fr; gap: 2px 0; padding: 14px; }
  article.post dd { margin-bottom: 10px; }
}

@media (max-width: 768px) {
  .site-main { padding: 24px 16px; }
  .post-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 24px 20px; border-radius: 12px; }

  .site-header .site-nav { display: none; }
  .site-nav--drawer {
    display: flex;
    position: fixed;
    top: 64px;
    right: 14px;
    left: auto;
    width: max-content;
    min-width: 160px;
    max-width: 200px;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px 16px 12px;
    background: rgba(18, 18, 26, 0.38);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform-origin: top right;
    transform: scale(0.9) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 220ms cubic-bezier(.22, .61, .36, 1),
      opacity 180ms ease;
    z-index: 55;
  }
  .site-nav--drawer.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav--drawer::before {
    content: "Menu";
    display: block;
    margin: 0 0 10px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
    font-weight: 500;
  }
  .site-nav--drawer a {
    display: block;
    padding: 10px 0 10px 14px;
    font-size: 16px;
    font-weight: 600;
    border-left: 1px solid rgba(255,255,255,0.08);
    color: var(--fg-2);
    transition: color 150ms ease, border-color 200ms ease, border-width 200ms ease;
  }
  .site-nav--drawer a.active {
    color: var(--brand-300, #22d3ee);
    border-left: 2px solid var(--brand-300, #22d3ee);
    padding-left: 13px;
    font-weight: 500;
  }
  .nav-toggle { display: flex; order: 3; }
  .search-trigger { order: 2; margin-left: auto; }
}

@media (max-width: 480px) {
  .site-header-inner { padding: 12px 16px; }
  .home-title { font-size: 1.4rem; }
}
