/* Shared blog styles – nav, footer, layout. Link from blog index and post pages. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Geist+Mono:wght@300;400;500;600&display=swap');

:root {
  --bg: #09090b;
  --fg: #fafafa;
  --dim: #888;
  --dimmer: #555;
  --border: rgba(255,255,255,0.1);
  --border-bright: rgba(255,255,255,0.15);
  --accent: #fff;
  --green: #a78bfa;
  --green-dim: rgba(167, 139, 250, 0.1);
  --green-glow: rgba(167, 139, 250, 0.06);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   SCROLL PROGRESS BAR (CSS scroll-driven animation)
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(167,139,250,0.4) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  animation: read-progress linear both;
  animation-timeline: scroll(root block);
  z-index: 99;
}

@keyframes read-progress {
  to { transform: scaleX(1); }
}

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,0.9);
  backdrop-filter: blur(16px);
}

.nav-left { display: flex; align-items: center; gap: 40px; }

.nav-logo {
  font-family: 'Geist Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--dim);
  transition: color 0.15s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.agent-btn {
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 0;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--dim);
  transition: all 0.15s var(--ease);
}
.agent-btn:hover { border-color: var(--fg); color: var(--fg); }
.nav-new {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--fg); color: var(--bg); padding: 2px 6px; border-radius: 100px;
  margin-left: 6px; vertical-align: middle;
  font-family: 'Inter', sans-serif;
}

/* Dropdown */
.nav-links > a:not(.agent-btn),
.nav-dropdown > .nav-trigger {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--dim);
  transition: color 0.15s var(--ease);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links > a:not(.agent-btn):hover,
.nav-dropdown:hover > .nav-trigger { color: var(--fg); }

.nav-trigger svg {
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: transform 0.2s var(--ease);
}
.nav-dropdown:hover .nav-trigger svg { transform: rotate(180deg); }

.nav-dropdown {
  position: relative;
}

.nav-mega {
  position: absolute;
  top: calc(100% + 20px);
  left: -24px;
  min-width: 340px;
  background: rgba(9,9,11,0.97);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.nav-dropdown:hover .nav-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-mega-item {
  display: block;
  padding: 14px 20px;
  transition: background 0.15s var(--ease);
}
.nav-mega-item:hover { background: rgba(255,255,255,0.04); }

.nav-mega-title {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 3px;
}

.nav-mega-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--dimmer);
  line-height: 1.4;
}

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-link-right {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--dim);
  transition: color 0.15s var(--ease);
}
.nav-link-right:hover { color: var(--fg); }

.nav-btn-solid {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s var(--ease);
}
.nav-btn-solid:hover { opacity: 0.85; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-top { display: flex; gap: 64px; margin-bottom: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title { font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dimmer); margin-bottom: 4px; }
.footer-col a { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--dim); transition: color 0.15s var(--ease); }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); }
.footer-logo { font-family: 'Geist Mono', monospace; font-size: 14px; font-weight: 500; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.footer-meta { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--dimmer); }
.footer-partner { display: flex; align-items: center; align-self: flex-start; gap: 6px; margin-left: auto; font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--fg); letter-spacing: 0.02em; }
.footer-partner .stripe-logo { height: 22px; width: auto; }

/* ============================================================
   BLOG WRAP (shared: index + single post)
   ============================================================ */
.blog-wrap { max-width: 700px; margin: 0 auto; padding: 100px 32px 100px; }

/* ============================================================
   BLOG INDEX
   ============================================================ */
.blog-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -1.2px;
  color: var(--accent);
  margin-bottom: 0;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  animation: header-in 0.5s ease both;
}

.post-list {
  display: flex;
  flex-direction: column;
}

/* Two-column grid: [date | content] */
.post-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  animation: post-in 0.45s ease both;
}

@keyframes post-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered delays for the first several posts */
.post-item:nth-child(1)  { animation-delay: 0.04s; }
.post-item:nth-child(2)  { animation-delay: 0.08s; }
.post-item:nth-child(3)  { animation-delay: 0.12s; }
.post-item:nth-child(4)  { animation-delay: 0.16s; }
.post-item:nth-child(5)  { animation-delay: 0.20s; }
.post-item:nth-child(6)  { animation-delay: 0.24s; }
.post-item:nth-child(7)  { animation-delay: 0.28s; }
.post-item:nth-child(8)  { animation-delay: 0.32s; }
.post-item:nth-child(9)  { animation-delay: 0.36s; }
.post-item:nth-child(10) { animation-delay: 0.40s; }
.post-item:nth-child(11) { animation-delay: 0.44s; }

/* Date — left column, spans both content rows */
.post-meta {
  grid-column: 1;
  grid-row: 1 / 3;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: var(--dimmer);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.5;
  padding-top: 3px;
  word-break: break-word;
}

/* Title — right column, row 1 */
.post-item h2 {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.post-item h2 a {
  color: var(--fg);
  transition: color 0.15s;
}

.post-item h2 a::after {
  content: ' →';
  display: inline-block;
  color: var(--green);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

.post-item h2 a:hover {
  color: var(--accent);
}

.post-item h2 a:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

/* Excerpt — right column, row 2 */
.post-excerpt {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  font-weight: 300;
  color: var(--dimmer);
  line-height: 1.8;
}

/* ============================================================
   SINGLE POST — BACK LINK
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--dimmer);
  margin-bottom: 44px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: color 0.15s, gap 0.2s;
}
.back-link:hover {
  color: var(--green);
  gap: 10px;
}

/* ============================================================
   SINGLE POST — HEADER
   ============================================================ */
.article-header {
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  /* Subtle fade-in on load */
  animation: header-in 0.6s ease both;
}

@keyframes header-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.article-title {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 24px;
}

.article-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--dimmer);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.article-meta::before {
  content: '';
  display: block;
  width: 18px;
  height: 1px;
  background: var(--green);
  opacity: 0.7;
}

/* ============================================================
   SINGLE POST — BODY
   ============================================================ */
.article-body {
  font-size: 14px;
  font-weight: 300;
  color: #999;
  line-height: 2;
  animation: body-in 0.6s 0.1s ease both;
}

@keyframes body-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Consistent vertical rhythm */
.article-body > * { margin-bottom: 20px; }
.article-body > *:last-child { margin-bottom: 0; }

/* --- Paragraphs --- */
.article-body p {
  margin-bottom: 0;
}

/* --- Links --- */
.article-body a {
  color: var(--green);
  border-bottom: 1px solid rgba(167, 139, 250, 0.25);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.article-body a:hover {
  color: var(--accent);
  border-bottom-color: rgba(255,255,255,0.4);
}

/* --- H2 --- */
.article-body h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin-top: 52px;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: -0.2px;
}

.article-body h2::before {
  content: '##';
  color: var(--green);
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* --- H3 --- */
.article-body h3 {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  margin-top: 32px;
  margin-bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.article-body h3::before {
  content: '###';
  color: var(--green);
  font-size: 9px;
  font-weight: 400;
  opacity: 0.5;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* --- Inline code --- */
.article-body code {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 0;
  padding: 1px 6px;
}

/* --- Code blocks --- */
.article-body pre {
  margin: 28px 0;
  background: #080808;
  border: 1px solid var(--border-bright);
  border-radius: 0;
  overflow: hidden;
}

/* Terminal-style header bar */
.article-body pre::before {
  content: '● ● ●';
  display: block;
  padding: 9px 14px;
  font-size: 9px;
  color: #333;
  background: #0f0f0f;
  border-bottom: 1px solid var(--border);
  letter-spacing: 3px;
}

.article-body pre code {
  display: block;
  padding: 18px 20px;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  line-height: 1.75;
  color: #bbb;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
}

.article-body pre code::-webkit-scrollbar { height: 3px; }
.article-body pre code::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* --- Blockquotes --- */
.article-body blockquote {
  margin: 28px 0;
  padding: 16px 22px;
  border-left: 2px solid var(--green);
  background: var(--green-glow);
  border-radius: 0;
}

.article-body blockquote p {
  color: #ccc;
  font-size: 13px;
  font-style: italic;
  line-height: 1.85;
  margin-bottom: 0;
}

/* --- Unordered lists --- */
.article-body ul {
  list-style: none;
  padding-left: 0;
}

.article-body ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  line-height: 1.85;
}

.article-body ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--green);
  font-size: 10px;
  opacity: 0.7;
}

/* --- Ordered lists --- */
.article-body ol {
  list-style: none;
  padding-left: 0;
  counter-reset: ol-counter;
}

.article-body ol li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
  line-height: 1.85;
  counter-increment: ol-counter;
}

.article-body ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-size: 10px;
  opacity: 0.7;
  width: 22px;
  text-align: right;
  padding-right: 4px;
}

/* --- Nested li code --- */
.article-body li code {
  font-size: 11px;
}

/* ============================================================
   SCROLL BANNER — Floating Pill (single posts only)
   ============================================================ */

/* Fixed container: full-width, pointer-events off so the page
   remains clickable in the empty space around the pill */
.scroll-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 0 24px 20px;
  pointer-events: none;
  transform: translateY(calc(100% + 24px));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-banner--visible {
  transform: translateY(0);
}

/* The pill itself */
.scroll-banner-pill {
  max-width: 560px;
  width: 100%;
  background: #0f0f0f;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-bright);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  gap: 10px 12px;
  pointer-events: all;
}

.scroll-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.scroll-banner-brand {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.scroll-banner-sep {
  font-size: 12px;
  color: var(--dimmer);
  flex-shrink: 0;
  padding: 0 2px;
}

.scroll-banner-text {
  font-size: 12px;
  font-weight: 300;
  color: var(--dim);
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.scroll-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.scroll-banner-cta {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: #000;
  background: var(--green);
  border: none;
  border-radius: 0;
  padding: 6px 14px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  display: inline-block;
}

.scroll-banner-cta:hover { opacity: 0.88; }

.scroll-banner-close {
  background: none;
  border: none;
  color: var(--dimmer);
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 4px;
  transition: color 0.15s;
}

.scroll-banner-close:hover { color: var(--fg); }

/* ============================================================
   UPDATES PAGE
   ============================================================ */
.updates-day {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  animation: post-in 0.45s ease both;
}

.updates-day:first-child {
  padding-top: 0;
}

.updates-date {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: var(--dimmer);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.5;
  margin-bottom: 18px;
}

.updates-group {
  margin-bottom: 16px;
}

.updates-group:last-child {
  margin-bottom: 0;
}

.updates-tag {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px 3px 10px;
  margin-bottom: 10px;
  border-left: 2px solid;
}

.updates-tag--added {
  color: #a78bfa;
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
}

.updates-tag--improved {
  color: #f5a623;
  border-color: #f5a623;
  background: rgba(245, 166, 35, 0.08);
}

.updates-tag--fixed {
  color: #5eead4;
  border-color: #5eead4;
  background: rgba(94, 234, 212, 0.08);
}

.updates-group ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.updates-item {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  font-weight: 300;
  color: #999;
  line-height: 2;
}

.updates-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--dimmer);
  font-size: 10px;
}

/* ============================================================
   QUICK-ANSWER BOX
   ============================================================ */
.quick-answer {
  border-left: 3px solid var(--green);
  background: var(--green-glow);
  padding: 18px 22px;
  margin-bottom: 32px;
  font-size: 13px;
  line-height: 1.85;
  color: #ccc;
}

.quick-answer strong {
  color: var(--fg);
  font-weight: 500;
}

/* ============================================================
   FAQ SECTION (visible HTML)
   ============================================================ */
.faq-section {
  margin-top: 52px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.faq-section h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: -0.2px;
}

.faq-section h2::before {
  content: '##';
  color: var(--green);
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  flex-shrink: 0;
  letter-spacing: 0;
}

.faq-item {
  margin-bottom: 24px;
}

.faq-item summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.faq-item summary::before {
  content: '▸';
  color: var(--green);
  font-size: 10px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease);
}

.faq-item[open] summary::before {
  transform: rotate(90deg);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item p {
  font-size: 13px;
  font-weight: 300;
  color: #999;
  line-height: 1.85;
  padding: 8px 0 0 18px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .blog-wrap { padding: 88px 20px 80px; }
  .article-title { font-size: 24px; letter-spacing: -0.5px; }
  .footer-top { flex-direction: column; gap: 32px; }
  footer { padding: 32px 20px; }

  /* Banner on mobile */
  .scroll-banner { padding: 0 12px 14px; }
  .scroll-banner-text { display: none; }
  .scroll-banner-sep  { display: none; }

  /* Collapse post index grid on mobile */
  .post-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 0;
    row-gap: 6px;
  }
  .post-meta   { grid-column: 1; grid-row: 1; }
  .post-item h2 { grid-column: 1; grid-row: 2; }
  .post-excerpt { grid-column: 1; grid-row: 3; }
}
