/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0f0c;
  --bg-card: #121a16;
  --accent: #4ade80;
  --accent-dim: #16a34a;
  --text: #e8f5ec;
  --text-muted: #8fa89a;
  --border: #1f2a24;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* Nav */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 2rem;
  position: sticky;
  top: 0;
  background: rgba(10, 15, 12, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.sidebar-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.2rem 0.3rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, opacity 0.18s;
}

.sidebar-toggle:hover {
  color: var(--accent);
  opacity: 0.95;
}

nav ul a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav ul a:hover { color: var(--accent); }

/* Shell + Sidebar */
.site-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 0;
  display: block;
}

.site-main {
  min-width: 0;
}

.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(86vw, 320px);
  height: 100vh;
  z-index: 220;
  transform: translateX(-104%);
  transition: transform 0.28s ease;
  background:
    linear-gradient(180deg, rgba(16, 28, 22, 0.9) 0%, rgba(10, 16, 14, 0.88) 100%);
  border-right: 1px solid rgba(232, 245, 236, 0.08);
  box-shadow:
    10px 0 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(232, 245, 236, 0.06);
  backdrop-filter: blur(6px) saturate(105%);
  -webkit-backdrop-filter: blur(6px) saturate(105%);
  padding: 1rem 0.9rem 1.2rem;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.sidebar-open .site-sidebar {
  transform: translateX(0);
}

.sidebar-top-nav {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.4rem;
  flex-wrap: nowrap;
  width: 100%;
  padding: 0.3rem 0 0.9rem;
  border-bottom: 1px solid rgba(74, 222, 128, 0.14);
}

.sidebar-top-link {
  display: inline-block;
  flex: 0 0 auto;
  text-align: left;
  padding: 0.36rem 0.56rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.sidebar-top-link:hover {
  color: var(--text);
  background: rgba(74, 222, 128, 0.09);
  border-color: rgba(74, 222, 128, 0.22);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  border: 0;
  background: rgba(2, 6, 4, 0.16);
}

.sidebar-panel {
  border-bottom: 1px solid rgba(74, 222, 128, 0.13);
  padding: 0.2rem 0 1rem;
}

.sidebar-panel:last-of-type {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

.sidebar-panel h3 {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.sidebar-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.sidebar-search {
  width: 100%;
  border: 1px solid rgba(74, 222, 128, 0.14);
  border-radius: 9px;
  background: rgba(8, 13, 11, 0.5);
  color: var(--text);
  padding: 0.62rem 0.72rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.sidebar-search:focus {
  border-color: var(--accent);
  background: rgba(8, 13, 11, 0.75);
}

.sidebar-help {
  margin-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sidebar-post-list {
  list-style: none;
  margin-top: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-post-list a {
  display: block;
  border-radius: 8px;
  padding: 0.45rem 0.56rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.sidebar-post-list a:hover {
  background: rgba(74, 222, 128, 0.08);
  color: var(--text);
  border-color: rgba(74, 222, 128, 0.2);
}

.sidebar-empty {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sidebar-tag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(74, 222, 128, 0.14);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.14);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.sidebar-tag-link span {
  color: var(--accent);
  font-size: 0.73rem;
}

.sidebar-tag-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
}

.site-sidebar::-webkit-scrollbar,
.sidebar-post-list::-webkit-scrollbar {
  display: none;
}

.site-sidebar::-webkit-scrollbar-track,
.sidebar-post-list::-webkit-scrollbar-track {
  background: transparent;
}

.site-sidebar::-webkit-scrollbar-thumb,
.sidebar-post-list::-webkit-scrollbar-thumb {
  background: rgba(74, 222, 128, 0.22);
  border-radius: 999px;
}

.site-sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-post-list::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 222, 128, 0.32);
}

/* Hero */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: radial-gradient(ellipse at top, #123022 0%, var(--bg) 70%);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  background: var(--accent);
  color: #08110d;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
  display: inline-block;
}

.btn:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
}

/* Posts Section */
.posts-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.posts-section h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(74, 222, 128, 0.14);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.card-tag {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Single Post */
.post-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 2rem;
}

.post {
  max-width: 760px;
  margin: 0;
  padding: 0.8rem 0 0;
}

.post-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin: 1rem 0;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tag {
  background: rgba(74, 222, 128, 0.12);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.post-date { color: var(--text-muted); font-size: 0.9rem; }

/* Post Content */
.post-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: var(--accent); }
.post-content h1,
.post-content h2,
.post-content h3 {
  scroll-margin-top: 96px;
}
.post-content p { margin-bottom: 1.25rem; color: var(--text-muted); }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; color: var(--text-muted); }
.post-content li { margin-bottom: 0.5rem; }

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-card);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.post-share {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-share h3 {
  font-size: 1rem;
  margin-bottom: 0.7rem;
  color: var(--text);
}

.post-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.share-btn {
  border: 1px solid rgba(74, 222, 128, 0.24);
  color: var(--text-muted);
  background: rgba(74, 222, 128, 0.04);
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.share-btn:hover {
  color: var(--text);
  border-color: rgba(74, 222, 128, 0.48);
  background: rgba(74, 222, 128, 0.1);
}

.post-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
  padding-right: 0.65rem;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.post-toc h3 {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.post-toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  position: relative;
}

.post-toc a {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
  padding: 0.25rem 0.32rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.18s;
  position: relative;
  z-index: 1;
}

.post-toc a:hover {
  color: var(--text);
  background: rgba(74, 222, 128, 0.08);
}

.post-toc a.active {
  color: var(--text);
  border-color: transparent;
}

.toc-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: transparent;
  opacity: 0;
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease, opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.post-toc .toc-h1 a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.post-toc .toc-h2 a { padding-left: 0.6rem; }
.post-toc .toc-h3 a { padding-left: 0.95rem; }

.post-toc::-webkit-scrollbar {
  display: none;
}

.post-recent {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.post-recent h3 {
  font-size: 0.86rem;
  margin-bottom: 0.55rem;
  color: var(--text);
}

.post-recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.post-recent-list a {
  display: block;
  padding: 0.3rem 0.32rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  transition: border-color 0.18s, background 0.18s;
}

.post-recent-list a:hover {
  border-color: rgba(74, 222, 128, 0.45);
  background: transparent;
}

.post-recent-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.post-recent-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.post-side-tags {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.post-side-tags h3 {
  font-size: 0.86rem;
  margin-bottom: 0.55rem;
  color: var(--text);
}

.post-side-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.post-side-tags-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.22rem 0.54rem;
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--text-muted);
  border: 1px solid rgba(74, 222, 128, 0.18);
  background: rgba(74, 222, 128, 0.04);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.post-side-tags-list a span {
  color: var(--accent);
  font-size: 0.7rem;
}

.post-side-tags-list a:hover {
  color: var(--text);
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.1);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 1.6rem 1rem 0.4rem;
  }

  .post-toc { display: none; }

  .site-shell { padding: 0 0.85rem 0; }

  .sidebar-post-list { max-height: 220px; }

  /* Nav */
  header { padding: 1rem; }
  nav ul { gap: 0.75rem; }
  nav ul a { font-size: 0.85rem; }
  .logo { font-size: 1.2rem; }

  /* Slider */
  .hero-slider { height: auto; min-height: 85vh; }
  .slide { padding: 2rem 1.5rem; padding-bottom: 5rem; }
  .slide-inner h1 { font-size: 1.8rem; }
  .slide-inner p { font-size: 0.9rem; }
  .slide-meta { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .slider-arrow { display: none; }
  .slide { padding: 1.5rem 1.25rem 4rem 1.25rem; }
  .slider-dots { bottom: 2rem; }

  /* Posts */
  .posts-section { padding: 2rem 1rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .posts-section h2 { font-size: 1.4rem; }

  /* Cards */
  .card { padding: 1.25rem; }

  /* Single post */
  .post { padding: 0.4rem 0 0; }
  .post-header h1 { font-size: 1.6rem; }

  /* About */
  .about { padding: 2rem 1rem; }
  .about h1 { font-size: 1.8rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-content p { font-size: 0.95rem; }

  /* Footer */
  footer { padding: 1.5rem 1rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .slide-inner h1 { font-size: 1.5rem; }
  nav ul { gap: 0.5rem; }
  nav ul a { font-size: 0.8rem; }
  .btn { padding: 0.7rem 1.5rem; font-size: 0.85rem; }
}

/* Slider */
.hero-slider {
  position: relative;
  height: 80vh;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #123022 0%, var(--bg) 70%);
}

.slides { width: 100%; height: 100%; }

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 2rem 6rem;
  opacity: 0;
  transform: none;
  pointer-events: none;
}

.slide-inner {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.slide.active {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

.slide-tag {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.slide-inner h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.slide-inner p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
}

.slide-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.slide-date { color: var(--text-muted); font-size: 0.85rem; }

/* Dots */
.slider-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* Arrows */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-arrow:hover { border-color: var(--accent); background: var(--bg); }
.slider-arrow.left { left: 1.5rem; padding-bottom: 6px; }
.slider-arrow.right { right: 1.5rem; padding-bottom: 6px; }

/* Progress bar */
.slider-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  transition: width linear;
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideOutToLeft {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideOutToRight {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes mobileFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide.enter-right { animation: slideInFromRight 0.55s ease both; }
.slide.enter-left { animation: slideInFromLeft 0.55s ease both; }
.slide.exit-left { animation: slideOutToLeft 0.55s ease both; }
.slide.exit-right { animation: slideOutToRight 0.55s ease both; }

/* About */
/* About */
.about {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.about h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
}

.about h1 span { color: var(--accent); }

.about-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.about-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.about-card h3 {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.about-links h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}

.link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile overrides kept at end so they always win over base slider styles */
@media (max-width: 768px) {
  header { padding: 0.9rem 1rem; }

  nav { gap: 0.75rem; }
  .brand-group { gap: 0.42rem; }

  .logo { font-size: 1.1rem; }

  nav ul {
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  nav ul a { font-size: 0.8rem; }
  .sidebar-toggle {
    font-size: 1.15rem;
    padding: 0.18rem 0.2rem;
  }

  .hero-slider {
    height: auto;
    min-height: 0;
  }

  .slides { height: auto; }

  .slide {
    position: static;
    inset: auto;
    display: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: 1.5rem 1rem 3.6rem;
    align-items: flex-start;
  }

  .slide.active { display: flex; }

  /* Mobile dynamic-height slides cannot overlap cleanly.
     Hide outgoing slide instantly and fade only incoming slide. */
  .slide.exit-left,
  .slide.exit-right {
    display: none !important;
    animation: none !important;
  }

  .slide.enter-left,
  .slide.enter-right {
    animation: mobileFadeIn 0.34s ease both;
  }

  .slide-inner {
    max-width: 100%;
    gap: 0.75rem;
  }

  .slide-inner h1 {
    font-size: clamp(1.6rem, 8.6vw, 2.2rem);
    line-height: 1.14;
    letter-spacing: -0.3px;
  }

  .slide-inner p {
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .slide-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.25rem;
  }

  .slide-date { font-size: 0.8rem; }

  .btn {
    padding: 0.62rem 1rem;
    font-size: 0.8rem;
  }

  .slider-arrow { display: none; }

  .slider-dots { bottom: 1.2rem; }

  .posts-section { padding: 2.2rem 1rem; }

  .posts-section h2 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card { padding: 1.1rem; }

  .card h3 {
    font-size: 1.35rem;
    line-height: 1.28;
  }
}

@media (max-width: 480px) {
  .logo { font-size: 1rem; }

  nav ul a { font-size: 0.75rem; }
  .sidebar-toggle {
    font-size: 1.05rem;
    padding: 0.15rem 0.18rem;
  }

  .slide { padding: 1.25rem 0.85rem 3.3rem; }

  .slide-inner h1 { font-size: clamp(1.45rem, 8.2vw, 1.9rem); }

  .slide-inner p {
    font-size: 0.9rem;
    -webkit-line-clamp: 4;
  }

  .posts-section { padding: 2rem 0.75rem; }
}

/* Final mobile polish overrides */
@media (max-width: 768px) {
  header {
    padding: 0.72rem 0.85rem;
  }

  nav {
    gap: 0.65rem;
  }

  .brand-group {
    flex: 0 0 auto;
    gap: 0.35rem;
  }

  .logo {
    font-size: 1rem;
    line-height: 1.1;
  }

  nav ul {
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
  }

  nav ul a {
    font-size: 0.76rem;
    padding: 0.22rem 0.12rem;
  }

  .site-shell {
    padding: 0 0.7rem 0;
  }

  .site-sidebar {
    width: min(76vw, 280px);
    padding: 0.72rem 0.62rem 0.78rem;
    gap: 0.72rem;
  }

  .sidebar-top-nav {
    gap: 0.22rem;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .sidebar-top-link {
    font-size: 0.72rem;
    white-space: nowrap;
    padding: 0.24rem 0.28rem;
  }

  .sidebar-panel {
    padding-bottom: 0.62rem;
  }

  .sidebar-panel h3 {
    font-size: 0.84rem;
    margin-bottom: 0.45rem;
  }

  .sidebar-label,
  .sidebar-help {
    font-size: 0.7rem;
  }

  .sidebar-search {
    padding: 0.46rem 0.52rem;
    font-size: 0.8rem;
  }

  .sidebar-post-list {
    margin-top: 0.55rem;
    max-height: 170px;
  }

  .sidebar-post-list a {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }

  .sidebar-tag-link {
    padding: 0.22rem 0.46rem;
    font-size: 0.7rem;
  }

  .posts-section {
    padding: 1.7rem 0.75rem;
  }

  .posts-section h2 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1rem;
  }

  .card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .post-layout {
    padding: 1.25rem 0.8rem 0.35rem;
  }

  .post-share {
    margin-top: 1.7rem;
    padding-top: 0.8rem;
  }

  .post-share h3 {
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
  }

  .post-share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .share-btn {
    width: auto;
    min-height: 0;
    padding: 0.34rem 0.62rem;
    font-size: 0.73rem;
    border-radius: 999px;
  }

  .post-header h1 {
    font-size: clamp(1.45rem, 7.5vw, 1.9rem);
  }

  .post-content h2 {
    font-size: 1.28rem;
  }

  .post-content h3 {
    font-size: 1.08rem;
  }

  .post-content p,
  .post-content li {
    font-size: 0.96rem;
  }

  .slide-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}

@media (max-width: 420px) {
  .site-sidebar {
    width: min(72vw, 250px);
    padding: 0.66rem 0.56rem 0.7rem;
  }

  nav ul a {
    font-size: 0.72rem;
  }

  .sidebar-top-link {
    font-size: 0.68rem;
  }

  .slide-inner h1 {
    font-size: clamp(1.34rem, 8.6vw, 1.72rem);
  }

  .slide-inner p {
    -webkit-line-clamp: 3;
  }

  .post-share-buttons { gap: 0.34rem; }
}

/* Mobile overflow fixes for post pages */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  nav {
    min-width: 0;
  }

  nav ul {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.18rem;
  }

  .site-main,
  .post-layout,
  .post,
  .post-content {
    min-width: 0;
    max-width: 100%;
  }

  .post-content * {
    overflow-wrap: anywhere;
  }

  .post-content pre,
  .post-content code {
    overflow-wrap: normal;
    word-break: normal;
  }

  .post-content img,
  .post-content video,
  .post-content iframe,
  .post-content table {
    max-width: 100%;
  }

  .post-content table {
    display: block;
    overflow-x: auto;
  }

  .post-content pre {
    max-width: 100%;
    overflow-x: auto;
  }
}

.callout {
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 14px 16px;
  border-radius: 8px;
  margin:1rem 0;
}

.callout strong {
  display: block;
  margin-bottom: 12px;
  color: var(--fg);
}

.callout-content {
  color: var(--muted);
  margin-bottom: -20px;
}

/* optional types */
.callout.info {
  border-left: 1px solid #4ade80;
}

.callout.warning {
  border-left: 1px solid #facc15;
}

.callout.error {
  border-left: 1px solid #f87171;
}
