/* ═══════════════════════════════════════════════════════════════
   BLOG.CSS v4 — Premium Editorial Experience
   30-iteration polish: reading progress, micro-animations,
   premium typography, refined components, perfect spacing
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,opsz,wght@0,6..15,300;0,6..15,400;0,6..15,500;0,6..15,600;0,6..15,700;0,6..15,800;0,6..15,900;1,6..15,400;1,6..15,500&display=swap');

/* ── Tokens ── */
:root {
  --bg: #F5F6F8;
  --bg-2: #EDEEF2;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --border: rgba(0,0,0,0.065);
  --border-md: rgba(0,0,0,0.11);
  --ink: #0C1222;
  --ink-2: #1B2537;
  --ink-muted: #52637A;
  --ink-faint: #8796A9;
  --indigo: #6366F1;
  --indigo-d: #4F46E5;
  --indigo-dd: #3730A3;
  --indigo-l: #EEF2FF;
  --indigo-m: #C7D2FE;
  --sky: #0EA5E9;
  --sky-l: #E0F2FE;
  --green: #10B981;
  --green-l: #ECFDF5;
  --rose: #F43F5E;
  --rose-l: #FFF1F2;
  --amber: #F59E0B;
  --amber-l: #FFFBEB;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.07), 0 8px 24px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 16px 48px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 32px 80px rgba(0,0,0,0.07);
  --shadow-indigo: 0 4px 18px rgba(99,102,241,0.35);
}

/* ── Iteration 1: Base Reset & Smooth Scroll ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Iteration 2: Reading Progress Bar ── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--sky) 60%, #a855f7 100%);
  z-index: 2000;
  transition: width 0.1s linear;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(99,102,241,0.5);
}

/* ── Iteration 3: Particle Canvas ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

body > * { position: relative; z-index: 1; }

/* ── Iteration 4: Nav Bar — Frosted Glass Premium ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 58px;
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(32px) saturate(2);
  -webkit-backdrop-filter: blur(32px) saturate(2);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.nav--scrolled {
  background: rgba(255,255,255,0.94);
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.04);
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  transition: opacity 0.15s;
  user-select: none;
}
.nav__logo:hover { opacity: 0.7; }
.nav__logo span {
  color: var(--indigo);
  line-height: 1;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.14s, background 0.14s;
  position: relative;
}
.nav__link:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.nav__link--active { color: var(--indigo); font-weight: 600; }
.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--indigo);
  border-radius: 2px;
  opacity: 0.5;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  margin-left: 6px;
  background: var(--indigo);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 9999px;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.28), 0 1px 0 rgba(255,255,255,0.1) inset;
  letter-spacing: -0.01em;
}
.nav__cta:hover {
  background: var(--indigo-d);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.42);
  color: #fff;
}
.nav__cta:active { transform: translateY(0); }

/* Mobile nav toggle */
.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all 0.15s;
}
.nav__mobile-toggle:hover { background: var(--bg); color: var(--ink); }
.nav__mobile-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s var(--ease-spring), opacity 0.2s;
}

/* ── Iteration 5: Post Topbar ── */
.post__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.post__topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 7px 16px;
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  box-shadow: var(--shadow-indigo);
  letter-spacing: -0.01em;
}
.post__share-btn:hover {
  background: var(--indigo-d);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99,102,241,0.45);
}

.post__open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 15px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--border-md);
  border-radius: 9999px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s var(--ease-spring);
  letter-spacing: -0.01em;
}
.post__open-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(12,18,34,0.2);
}

/* ── Iteration 6: Back Button ── */
.post__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px 6px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: all 0.18s var(--ease-spring);
  flex-shrink: 0;
}
.post__back::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238796A9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s var(--ease-spring);
}
.post__back:hover {
  color: var(--indigo);
  border-color: var(--indigo-m);
  background: var(--indigo-l);
  transform: translateX(-2px);
}
.post__back:hover::before {
  filter: invert(40%) sepia(100%) saturate(500%) hue-rotate(220deg);
  transform: translateX(-2px);
}

/* ── Iteration 7: Post Layout ── */
.post {
  max-width: 740px;
  margin: 0 auto;
  padding: 90px 1.5rem 5rem;
}

/* ── Iteration 8: Hero Image ── */
.post__hero-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  margin-bottom: 2rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.post__hero-image:hover {
  transform: scale(1.005);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border), 0 0 40px rgba(99,102,241,0.06);
}

/* ── Iteration 9: Category Badge ── */
.post__category {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 4px 13px;
  background: var(--indigo-l);
  color: var(--indigo-d);
  border-radius: 9999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid var(--indigo-m);
  transition: background 0.15s, transform 0.15s;
}
.post__category:hover { background: var(--indigo); color: #fff; border-color: var(--indigo); transform: scale(1.03); }

/* ── Iteration 10: Premium Title ── */
.post__title {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.1rem;
  font-optical-sizing: auto;
  hyphens: auto;
}

/* ── Iteration 11: Meta Row ── */
.post__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 500;
  flex-wrap: wrap;
}
.post__meta-dot {
  width: 3px; height: 3px;
  background: var(--border-md);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Iteration 12: Skeleton Loader ── */
#post-skeleton {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.skeleton {
  background: linear-gradient(90deg,
    var(--bg-2) 0%, #F5F6F8 30%, var(--bg-2) 60%
  );
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
  border-radius: 10px;
  display: block;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Iteration 13: Article Body — Premium Editorial Typography ── */
#post-rendered {
  animation: slideUp 0.45s var(--ease-spring) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post__content {
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--ink-2);
  font-weight: 400;
}

.post__content > * + * { margin-top: 1.3rem; }
.post__content p { color: var(--ink-2); }

.post__content h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 2.5rem 0 0.7rem;
  line-height: 1.2;
  position: relative;
  padding-top: 1.5rem;
}
.post__content h2::before {
  content: '';
  display: block;
  width: 40px; height: 3px;
  background: linear-gradient(90deg, var(--indigo), var(--sky));
  border-radius: 2px;
  margin-bottom: 1rem;
}

.post__content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.post__content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-2);
  margin: 1.5rem 0 0.4rem;
  letter-spacing: -0.01em;
}

.post__content ul,
.post__content ol {
  padding-left: 1.5rem;
}
.post__content li {
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 0.45rem;
}
.post__content li::marker { color: var(--indigo); }

.post__content strong { color: var(--ink); font-weight: 700; }
.post__content em { color: var(--ink-muted); font-style: italic; }

/* ── Iteration 14: Links ── */
.post__content a {
  color: var(--indigo);
  text-decoration: none;
  background-image: linear-gradient(var(--indigo), var(--indigo));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0% 100%;
  transition: background-size 0.25s ease, color 0.15s;
  padding-bottom: 1px;
}
.post__content a:hover {
  background-size: 100% 1.5px;
  color: var(--indigo-d);
}

/* ── Iteration 15: Code Blocks — Night Sky ── */
.post__content pre {
  background: #0C1222;
  color: #CBD5E1;
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,255,255,0.05) inset;
  position: relative;
}
.post__content pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--indigo), var(--sky), #a855f7);
  border-radius: 16px 16px 0 0;
}

.post__content code {
  background: var(--indigo-l);
  color: var(--indigo-d);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.875em;
  font-weight: 500;
  border: 1px solid var(--indigo-m);
}
.post__content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  font-weight: 400;
}

/* ── Iteration 16: Blockquotes ── */
.post__content blockquote {
  position: relative;
  border-left: none;
  background: linear-gradient(135deg, var(--indigo-l) 0%, rgba(14,165,233,0.08) 100%);
  margin: 2rem 0;
  padding: 1.5rem 1.75rem 1.5rem 2rem;
  border-radius: 16px;
  color: var(--ink-2);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.75;
  border: 1px solid var(--indigo-m);
  overflow: hidden;
}
.post__content blockquote::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--indigo), var(--sky));
  border-radius: 4px 0 0 4px;
}
.post__content blockquote::after {
  content: '\201C';
  position: absolute;
  top: -0.5rem; right: 1.25rem;
  font-size: 5rem;
  line-height: 1;
  color: var(--indigo);
  opacity: 0.12;
  font-style: normal;
  font-weight: 900;
  pointer-events: none;
}
.post__content blockquote p { color: var(--indigo-dd); }

/* ── Iteration 17: Horizontal Rule ── */
.post__content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-md), transparent);
  margin: 2.5rem 0;
}

/* ── Iteration 18: Images in Content ── */
.post__content img {
  max-width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
}

/* ── Iteration 19: Tables ── */
.post__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 1.75rem 0;
}
.post__content th {
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.post__content td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  background: var(--surface);
}
.post__content tr:last-child td { border-bottom: none; }
.post__content tr:nth-child(even) td { background: var(--surface-2); }

/* ── Iteration 20: Author Card ── */
.post__author {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 4rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.post__author::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--indigo), var(--sky), #a855f7);
}

.post__author-image {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--indigo-m);
  transition: transform 0.3s var(--ease-spring);
}
.post__author:hover .post__author-image { transform: scale(1.05) rotate(-2deg); }

.post__author-info { flex: 1; }
.post__author-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.post__author-role {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--indigo-l);
  padding: 2px 10px;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.post__author-info p {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.post__author-info a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--indigo);
  color: #fff;
  border-radius: 9999px;
  padding: 7px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s var(--ease-spring);
  box-shadow: 0 2px 10px rgba(99,102,241,0.32);
  letter-spacing: -0.01em;
}
.post__author-info a:hover {
  background: var(--indigo-d);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(99,102,241,0.45);
  background-size: 0;
}

/* ── Iteration 21: Related Posts / Next-Read callout ── */
.post__next {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.22s var(--ease-spring);
  text-decoration: none;
  color: inherit;
}
.post__next:hover {
  border-color: var(--indigo-m);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.post__next-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}
.post__next-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.post__next-arrow {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--indigo-l);
  color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s var(--ease-spring);
}
.post__next:hover .post__next-arrow {
  background: var(--indigo);
  color: #fff;
  transform: translateX(4px);
}

/* ── Iteration 22: Floating Share Bar — Premium Redesign ── */
#share-bar {
  position: fixed;
  right: -180px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 900;
  transition: right 0.5s var(--ease-spring);
  padding: 12px 10px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  box-shadow: -6px 0 32px rgba(0,0,0,0.08), -1px 0 0 var(--border);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
}
#share-bar:hover { right: 0; }

#share-bar-label {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  padding: 0 2px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

#share-bar button,
#share-bar a {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s var(--ease-spring);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
}
#share-bar button::after,
#share-bar a::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  background: var(--ink);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: all 0.2s var(--ease-spring);
  font-family: var(--font);
}
#share-bar button:hover::after,
#share-bar a:hover::after { opacity: 1; transform: translateX(0); }

#share-copy { background: var(--indigo-l); color: var(--indigo-d); }
#share-copy:hover { background: var(--indigo); color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.45); transform: scale(1.1); }

#share-linkedin { background: #EFF6FF; color: #0A66C2; }
#share-linkedin:hover { background: #0A66C2; color: #fff; box-shadow: 0 4px 16px rgba(10,102,194,0.4); transform: scale(1.1); }

#share-twitter { background: var(--surface-2); color: var(--ink); }
#share-twitter:hover { background: var(--ink); color: #fff; box-shadow: 0 4px 14px rgba(12,18,34,0.25); transform: scale(1.1); }

#share-native { background: var(--green-l); color: var(--green); }
#share-native:hover { background: var(--green); color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,0.4); transform: scale(1.1); }

/* ── Iteration 23: Copy Toast ── */
#copy-toast {
  position: fixed;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff;
  padding: 10px 22px;
  border-radius: 9999px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(16,185,129,0.45);
  opacity: 0;
  transition: all 0.45s var(--ease-spring);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
#copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Iteration 24: Mobile Menu ── */
@media (max-width: 680px) {
  .nav { padding: 0 1rem; }
  .nav__links { display: none; }
  .nav__links--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 58px; left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    gap: 0;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
    animation: slideDown 0.3s var(--ease-spring);
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav__links--open .nav__link { padding: 12px 10px; border-radius: 10px; }
  .nav__links--open .nav__cta { margin: 8px 0; width: 100%; justify-content: center; border-radius: 12px; }
  .nav__mobile-toggle { display: flex; }
  #share-bar { display: none; }
  .post { padding-top: 80px; padding-left: 1rem; padding-right: 1rem; }
  .post__topbar { flex-direction: column; align-items: flex-start; }
}

/* ── Iteration 25: Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 3rem;
}
.footer__content {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer__logo {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-decoration: none;
}
.footer__logo span { color: var(--indigo); }

.footer__copy {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 400;
}

.footer__social { display: flex; gap: 0.5rem; align-items: center; }

.footer__social-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  transition: all 0.2s var(--ease-spring);
  text-decoration: none;
}
.footer__social-link:hover {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.35);
}

/* ── Iteration 26: Callout Box (for content) ── */
.callout {
  background: var(--amber-l);
  border: 1px solid rgba(245,158,11,0.25);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  color: #92400E;
  line-height: 1.65;
}
.callout--info {
  background: var(--sky-l);
  border-color: rgba(14,165,233,0.25);
  border-left-color: var(--sky);
  color: #075985;
}
.callout--success {
  background: var(--green-l);
  border-color: rgba(16,185,129,0.25);
  border-left-color: var(--green);
  color: #065F46;
}

/* ── Iteration 27: Breadcrumb in Nav ── */
.nav__breadcrumb {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 500;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-md);
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.nav--has-title .nav__breadcrumb { display: flex; }

/* ── Iteration 28: Scroll-Reveal Utility ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ── Iteration 29: Print Styles ── */
@media print {
  #reading-progress, #particle-canvas, .nav, #share-bar, .post__back,
  .post__topbar-actions, .footer { display: none !important; }
  .post { padding: 0; max-width: 100%; }
  .post__content pre { background: #f4f4f4 !important; color: #333 !important; }
  .post__content a::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #666; }
}

/* ── Iteration 30: Final Polish — Selection, Focus, Scrollbar ── */
::selection {
  background: rgba(99,102,241,0.18);
  color: var(--ink);
}
::-moz-selection {
  background: rgba(99,102,241,0.18);
  color: var(--ink);
}

:focus-visible {
  outline: 2.5px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 4px;
}

html {
  scrollbar-color: rgba(99,102,241,0.25) transparent;
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.2);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); }

/* Smooth image load */
img { transition: opacity 0.3s ease; }
img[loading] { opacity: 0; }
img.loaded { opacity: 1; }

/* ============================================================
   Post Reactions
   ============================================================ */

.reaction-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
  padding: 1.1rem 1.25rem;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
}
.reaction-bar__label {
  font-size: .75rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: .25rem;
  white-space: nowrap;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .85rem;
  border-radius: 9999px;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
  user-select: none;
  white-space: nowrap;
}
.reaction-btn:hover {
  border-color: #6366F1;
  transform: scale(1.08);
  box-shadow: 0 2px 12px rgba(99,102,241,.15);
}
.reaction-btn--active {
  border-color: #6366F1;
  background: linear-gradient(135deg, #EEF2FF, #F0FDFF);
  box-shadow: 0 2px 10px rgba(99,102,241,.2);
}
.reaction-btn__emoji { font-size: 1.05rem; line-height: 1; }
.reaction-btn__count {
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
  min-width: 14px;
  text-align: center;
  transition: all .2s;
}
.reaction-btn--active .reaction-btn__count { color: #6366F1; }
.reaction-btn--pop {
  animation: reaction-pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes reaction-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mini reaction summary on blog cards */
.post-card__reactions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .4rem;
}
.post-card__reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .72rem;
  color: #94A3B8;
  background: #F1F5F9;
  padding: .18rem .5rem;
  border-radius: 9999px;
}

/* Reaction bar inside dark valo reader */
.valo-article .reaction-bar {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.valo-article .reaction-bar__label {
  color: rgba(255,255,255,0.4);
}
.valo-article .reaction-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
.valo-article .reaction-btn:hover {
  border-color: #06b6d4;
  box-shadow: 0 2px 12px rgba(6,182,212,.2);
  background: rgba(6,182,212,0.1);
}
.valo-article .reaction-btn--active {
  border-color: #06b6d4;
  background: rgba(6,182,212,0.15);
}
.valo-article .reaction-btn__count {
  color: rgba(255,255,255,0.7);
}
.valo-article .reaction-btn--active .reaction-btn__count {
  color: #06b6d4;
}

/* ============================================================
   UX IMPROVEMENTS BATCH — May 2026
   ============================================================ */

/* ── #1 Reading Progress Bar (ensure always visible) ── */
#reading-progress {
  display: block !important;
  pointer-events: none;
}

/* ── #6 Skeleton shimmer for blog card list ── */
.card-skeleton {
  background: #f1f5f9;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  position: relative;
}
.card-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
  animation: card-shimmer 1.4s ease-in-out infinite;
}
@keyframes card-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.card-skeleton__line {
  height: 14px;
  background: #e2e8f0;
  border-radius: 6px;
  margin-bottom: .75rem;
}
.card-skeleton__line--sm  { width: 40%; height: 10px; }
.card-skeleton__line--md  { width: 80%; }
.card-skeleton__line--full{ width: 100%; }
.card-skeleton__line--title { width: 90%; height: 20px; }
.card-skeleton__img {
  width: 100%;
  height: 140px;
  background: #e2e8f0;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* ── #7 Cover image placeholder for cards without image ── */
.tpl-blog__card-cover {
  width: 100%;
  height: 150px;
  border-radius: 10px 10px 0 0;
  margin: -1.5rem -1.5rem 1rem;
  width: calc(100% + 3rem);
  overflow: hidden;
  position: relative;
}
.tpl-blog__card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .3s ease;
  opacity: 0;
}
.tpl-blog__card-cover img.loaded { opacity: 1; }
.tpl-blog__card:hover .tpl-blog__card-cover img { transform: scale(1.04); }
.tpl-blog__card-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
}

/* ── #9 Category filter pills ── */
.blog-filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: .5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.blog-filter-bar::-webkit-scrollbar { display: none; }
.blog-filter-pill {
  flex-shrink: 0;
  padding: .35rem 1rem;
  border-radius: 9999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  color: #64748b;
}
.blog-filter-pill:hover,
.blog-filter-pill--active {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff;
}

/* ── #10 Hero CTA buttons ── */
.classic-hero__cta-row {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.classic-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.6rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
  border: 2px solid transparent;
}
.classic-hero__cta--primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}
.classic-hero__cta--primary:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 28px rgba(99,102,241,.45);
}
.classic-hero__cta--secondary {
  background: transparent;
  border-color: #6366f1;
  color: #6366f1;
}
.classic-hero__cta--secondary:hover {
  background: #6366f1;
  color: #fff;
  transform: translateY(-2px);
}

/* ── #12 Back to top button ── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px rgba(99,102,241,.4);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transform: translateY(16px);
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 28px rgba(99,102,241,.5);
}

/* ── #13 Post card hover — left accent border ── */
.tpl-blog__card {
  position: relative;
  overflow: hidden;
}
.tpl-blog__card::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 3px;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.tpl-blog__card:hover::before { transform: scaleY(1); }

/* ── #14 Progress ring ── */
.progress-ring-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  position: relative;
}
.progress-ring {
  transform: rotate(-90deg);
  transition: stroke-dashoffset .2s linear;
}
.progress-ring__bg { fill: none; stroke: #e2e8f0; }
.progress-ring__fill { fill: none; stroke: url(#ring-grad); stroke-linecap: round; transition: stroke-dashoffset .2s linear; }

/* ── #15 Reaction chips on cards ── */
.tpl-blog__card-reactions {
  display: flex;
  gap: .3rem;
  margin-top: .4rem;
}
.tpl-blog__card-reaction {
  font-size: .7rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: .15rem .45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: .15rem;
}

/* ── #17 Code block copy button ── */
.post__content pre {
  position: relative;
}
.code-copy-btn {
  position: absolute;
  top: .6rem;
  right: .6rem;
  padding: .25rem .65rem;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .04em;
}
.code-copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.code-copy-btn--copied { background: #10b981 !important; color: #fff !important; border-color: #10b981 !important; }

/* ── #18 External link arrow ── */
.post__content a[target="_blank"]::after {
  content: ' ↗';
  font-size: .8em;
  opacity: .6;
}

/* ── #19 Image lightbox ── */
#img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
}
#img-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
#img-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  transform: scale(.96);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  object-fit: contain;
}
#img-lightbox.open img { transform: scale(1); }
#img-lightbox-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#img-lightbox-close:hover { background: rgba(255,255,255,.25); }
.post__content img { cursor: zoom-in; }

/* ── #26 Lazy load blur-in ── */
.post__content img,
.tpl-blog__card-cover img,
.valo-hero__img {
  transition: opacity .4s ease, transform .4s ease, filter .4s ease;
  filter: blur(0);
}
.post__content img:not(.loaded),
.tpl-blog__card-cover img:not(.loaded) {
  opacity: 0;
  filter: blur(6px);
}

/* ── #28 Branded OG / social card (no-cover fallback visual shown on site) ── */
.post__og-fallback-notice { display: none; }

/* ── #29 Last updated badge ── */
.post__updated {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  color: #10b981;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  padding: .25rem .65rem;
  border-radius: 9999px;
  margin-left: .75rem;
  font-weight: 600;
}
.post__updated svg { flex-shrink: 0; }


/* ── #11 Valo Reader Sticky TOC ── */
.valo-toc {
  margin: 1rem 0;
  padding: .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.valo-toc__label {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.valo-toc__item {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  padding: .25rem .4rem;
  border-radius: 4px;
  line-height: 1.35;
  transition: color .15s, background .15s;
  margin-bottom: .15rem;
}
.valo-toc__item:hover { color: #06b6d4; background: rgba(6,182,212,.08); }
.valo-toc__item--sub { padding-left: 1rem; font-size: .68rem; }

/* ── #20 Favicon pulse (CSS only - no JS needed) ── */
@keyframes favicon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
