/* Memory Notes — editorial design matching homepage visual language */

:root {
  --bg: #000000;
  --bg-card: #141420;
  --text: #b4b4c8;
  --text-bright: #ededf4;
  --text-muted: #6e6e88;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Atmospheric background — echoes the homepage canvas without Three.js */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: none;
  z-index: 0;
  pointer-events: none;
}

/* Reading progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--violet));
  z-index: 200;
  transition: width 50ms linear;
}

/* Nav — matches homepage */
.blog-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.blog-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.blog-nav-logo .icon { font-size: 24px; color: var(--accent); }
.blog-nav-logo .name { font-size: 18px; font-weight: 600; color: var(--text-bright); letter-spacing: -0.3px; }
.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.blog-nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.blog-nav-links a:hover {
  background: linear-gradient(135deg, var(--accent), var(--cyan), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-nav-links .active,
.blog-nav-links .primary,
.blog-nav-links .nav-primary {
  color: var(--cyan);
  -webkit-text-fill-color: var(--cyan);
  background: none;
}

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.nav-dropdown-trigger:hover {
  background: linear-gradient(135deg, var(--accent), var(--cyan), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-caret { font-size: 10px; opacity: 0.6; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: rgba(14, 14, 22, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text) !important;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-bright) !important;
  text-decoration: none;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-bright); }

/* Shared layout */
.blog-wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 100px 24px 120px;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Blog Index ── */

.blog-header {
  margin-bottom: 64px;
}
.blog-header h1 {
  font-size: 44px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.blog-tagline {
  font-size: 17px;
  color: var(--text);
  font-weight: 300;
  line-height: 1.65;
  max-width: 540px;
}

.post-list { list-style: none; }

.post-card {
  padding: 32px 28px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-radius: var(--radius);
  transition: all 0.3s;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s, background 0.2s, box-shadow 0.2s;
}
.post-card.visible { opacity: 1; transform: translateY(0); }
.post-card:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 0 30px rgba(99, 102, 241, 0.08), 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}
.post-card a { color: inherit; text-decoration: none; display: block; }
.post-card a:hover { color: inherit; }
.post-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  line-height: 1.25;
  transition: color 0.2s;
}
.post-card:hover h2 { color: var(--cyan); }
.post-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-meta .dot { opacity: 0.4; }
.post-excerpt {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}
.post-tags {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.upcoming {
  margin-top: 48px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.06);
}
.upcoming h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.upcoming ul { list-style: none; }
.upcoming li {
  font-size: 15px;
  color: var(--text-muted);
  padding: 6px 0;
  line-height: 1.6;
}
.upcoming li::before { content: '→ '; color: rgba(255,255,255,0.15); }

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
.rss-link:hover { color: var(--text-bright); }

/* ── Article Layout ── */

.article-wrap {
  position: relative;
  z-index: 1;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}
@media (min-width: 1100px) {
  .article-layout {
    grid-template-columns: 1fr 180px;
    max-width: 1000px;
    gap: 56px;
  }
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 0.3px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-bright); }

.article-header {
  margin-bottom: 56px;
}
.article-header h1 {
  font-size: 44px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 18px;
}
.article-lede {
  font-size: 20px;
  color: var(--text-bright);
  font-weight: 300;
  line-height: 1.55;
  margin-bottom: 20px;
}
.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.article-meta .dot { opacity: 0.4; }

/* Article body */
.article-body h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.5px;
  margin: 64px 0 20px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.5s ease;
}
.article-body h2.visible { opacity: 1; transform: translateY(0); }

.article-body p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 22px;
  color: var(--text);
}
.article-body strong { color: var(--text-bright); font-weight: 600; }
.article-body em { color: var(--text-bright); font-style: italic; }
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.article-body ul, .article-body ol {
  margin: 0 0 22px 20px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}
.article-body li { margin-bottom: 8px; }
.article-body li strong { color: var(--text-bright); }

/* Callout — glass card */
.callout {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 32px 0;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.5s ease;
}
.callout.visible { opacity: 1; transform: translateY(0); }
.callout p { font-size: 16px; line-height: 1.75; margin-bottom: 10px; }
.callout p:last-child { margin-bottom: 0; }

/* Pull quote */
.article-body blockquote {
  border: none;
  margin: 48px 0;
  padding: 32px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(6, 182, 212, 0.04));
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.6s ease;
}
.article-body blockquote.visible { opacity: 1; transform: translateY(0); }
.article-body blockquote p {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* Comparison — punch card style from homepage */
.compare-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 36px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.compare-block.visible { opacity: 1; transform: translateY(0); }

.compare-side {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.compare-side.highlight {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}
.compare-side h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.compare-side.highlight h3 { color: var(--text-bright); opacity: 0.85; }
.compare-side ul { list-style: none; margin: 0; padding: 0; }
.compare-side li {
  font-size: 14px;
  line-height: 1.7;
  padding: 4px 0;
  color: var(--text);
}
.compare-side li::before { content: "→ "; color: var(--text-muted); }
.compare-side.highlight li::before { color: var(--cyan); }

/* TOC — sticky sidebar on wide screens */
.toc { display: none; }
@media (min-width: 1100px) {
  .toc {
    display: block;
    position: sticky;
    top: 100px;
    align-self: start;
  }
  .toc-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 14px;
  }
  .toc ul { list-style: none; }
  .toc li { margin-bottom: 10px; }
  .toc a {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    padding: 2px 0 2px 12px;
    border-left: 1px solid transparent;
  }
  .toc a:hover { color: var(--text-bright); }
  .toc a.active {
    color: var(--text-bright);
    border-left-color: var(--accent);
  }
}

/* Article CTA — glass card with glow */
.article-cta {
  background: rgba(99, 102, 241, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin: 64px 0 36px;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.06), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.5s ease;
}
.article-cta.visible { opacity: 1; transform: translateY(0); }
.article-cta p {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--text);
}
.article-cta p:last-of-type { margin-bottom: 0; }
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  color: var(--cyan) !important;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 4px 24px rgba(0, 0, 0, 0.4);
}
.cta-link:hover {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-glow);
  color: var(--text-bright) !important;
}

/* Discuss section */
.discuss {
  margin-top: 40px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
}

/* Agents can comment too */
.agents-comment {
  margin: 56px 0 32px;
  padding: 32px 28px;
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(6,182,212,0.03));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.05), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}
.agents-comment h2 {
  margin-top: 0 !important;
  font-size: 22px !important;
}
.agents-comment > p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 24px;
}
.agent-block {
  margin: 20px 0;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  overflow: hidden;
}
.agent-block-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}
.agent-copy {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--cyan);
  font-family: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.agent-copy:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-bright);
}
.agent-copy.copied { color: var(--text-bright); }
.agent-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: transparent;
}
.agent-block pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: transparent;
  padding: 0;
}
.agents-note {
  font-size: 14px !important;
  color: var(--text-muted) !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  line-height: 1.65 !important;
  font-style: italic;
}

/* Comments section */
.comments-section {
  margin-top: 48px;
}
.comments-section h2 {
  margin-top: 0 !important;
}
.comments-intro {
  font-size: 14px !important;
  color: var(--text-muted) !important;
  margin-bottom: 20px !important;
}
#giscus-mount {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 8px 20px;
  min-height: 80px;
}
.giscus, .giscus-frame { width: 100%; }
.giscus-frame { border: none; }

/* Related posts */
.related-posts {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related-posts h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
}
.related-posts ul { list-style: none; }
.related-posts li { margin-bottom: 10px; }
.related-posts a { font-size: 15px; color: var(--text-bright); }
.related-posts a:hover { color: var(--cyan); }
.coming { color: var(--text-muted); font-size: 12px; margin-left: 6px; font-style: italic; }

/* Footer */
.blog-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
}
.blog-footer-inner {
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.blog-footer-inner a {
  color: var(--text-muted);
  margin: 0 10px;
  text-decoration: none;
}
.blog-footer-inner a:hover { color: var(--text-bright); }

/* Mobile */
@media (max-width: 768px) {
  .blog-nav { padding: 12px 20px; }
  .blog-nav-links { gap: 16px; }
  .blog-nav-links a { font-size: 13px; }
  .blog-wrap { padding: 80px 20px 80px; }
  .blog-header h1 { font-size: 32px; letter-spacing: -1px; }
  .article-layout { padding: 80px 20px 60px; }
  .article-header h1 { font-size: 32px; letter-spacing: -1px; }
  .article-lede { font-size: 17px; }
  .article-body h2 { font-size: 22px; margin-top: 48px; }
  .article-body p { font-size: 16px; line-height: 1.75; }
  .article-body blockquote p { font-size: 18px; }
  .compare-block { grid-template-columns: 1fr; gap: 12px; }
  .article-cta { padding: 28px 24px; }
  .post-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .blog-nav-links .hide-sm { display: none; }
}
