/* Blog pages (/blog/ and /blog/<slug>/). Tokens, nav, buttons and footer are copied from index.html so
   the blog matches the landing page; keep them in sync when the landing palette changes. */
@font-face { font-family: "Maven Pro"; src: url("/Maven_Pro/MavenPro-VariableFont_wght.ttf") format("truetype-variations"); font-weight: 400 900; font-display: swap; }

:root {
  --background: oklch(0.990 0.003 250);
  --foreground: oklch(0.258 0.104 260);
  --card: oklch(1 0 0);
  --border: oklch(0.922 0.017 256);
  --border-subtle: oklch(0.953 0.010 253);
  --primary: oklch(0.519 0.175 256);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.969 0.008 254);
  --muted-foreground: oklch(0.399 0.042 259);
  --info: oklch(0.521 0.085 216);
  --info-soft: oklch(0.956 0.013 214);
  --worktable-row-hover: oklch(0.985 0.004 254);
  --worktable-grid-line: oklch(0.945 0.012 254);
  --pblue: oklch(0.605 0.210 257);
  --pteal: oklch(0.730 0.106 216);
  --font-brand: "Maven Pro", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-brand); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--primary) 50%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Nav (from index.html) ---------- */
nav.top { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--background) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border-subtle); }
.nav-in { max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px; }
.nav-in > a:first-child { justify-self: start; }
.nav-in img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; gap: 44px; font-size: 16.5px; font-weight: 500; color: var(--muted-foreground); }
.nav-links a { padding: 6px 0; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--foreground); }
.nav-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 500; }
.nav-login { color: var(--muted-foreground); transition: color .2s; }
.nav-login:hover { color: var(--foreground); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: transform .15s var(--ease), box-shadow .2s, background .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 0 oklch(1 0 0 / .2) inset, 0 1px 2px oklch(0.258 0.104 260 / .25), 0 4px 12px -2px color-mix(in oklab, var(--primary) 45%, transparent); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 88%, black); }
.btn-ghost { background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: 0 1px 2px oklch(0.258 0.104 260 / .06); }
.btn-ghost:hover { background: var(--secondary); }

.frame { max-width: 1200px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.eyebrow-chip { display: inline-flex; font-size: 13px; font-weight: 600; color: var(--primary); background: color-mix(in oklab, var(--primary) 9%, white); padding: 3px 9px; border-radius: 6px; }

/* ---------- Blog index ---------- */
.blog-hero { position: relative; isolation: isolate; }
.blog-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--worktable-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--worktable-grid-line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse 70% 90% at 30% 0%, black 20%, transparent 75%); }
.blog-hero .frame { position: relative; padding: 88px 48px 64px; border-bottom: 1px solid var(--border); }
.blog-hero h1 { margin: 18px 0 0; font-size: clamp(36px, 5.5vw, 60px); line-height: 1.05; letter-spacing: -.025em; font-weight: 700; max-width: 16ch; text-wrap: balance; }
.blog-hero p { margin: 18px 0 0; max-width: 560px; font-size: clamp(17px, 2vw, 19px); line-height: 1.5; color: var(--muted-foreground); text-wrap: pretty; }
.feed-link { position: absolute; top: 24px; right: 24px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: var(--card); }
.feed-link:hover { color: var(--foreground); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { display: flex; flex-direction: column; gap: 10px; padding: 36px 32px 32px; background: var(--card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background .2s; min-height: 260px; }
.post-card:nth-child(3n) { border-right: 0; }
.post-card:hover { background: var(--worktable-row-hover); }
.post-card-img { display: block; margin: -36px -32px 10px; border-bottom: 1px solid var(--border); overflow: hidden; }
.post-card-img img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; transition: transform .4s var(--ease); }
.post-card:hover .post-card-img img { transform: scale(1.02); }
.post-card-meta { font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.post-card h2, .post-card h3 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.post-card p { margin: 0; font-size: 15px; line-height: 1.55; color: color-mix(in oklab, var(--muted-foreground) 85%, transparent); }
.read-more { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--primary); }
.read-more svg { transition: transform .2s var(--ease); }
.post-card:hover .read-more svg { transform: translateX(3px); }
.empty { margin: 0; padding: 64px 48px; color: var(--muted-foreground); font-size: 17px; }
.draft-tag { color: oklch(0.55 0.17 40); }
.draft-bar { background: oklch(0.74 0.16 70); color: oklch(0.2 0.02 60); font-size: 13px; font-weight: 700; text-align: center; padding: 6px 16px; }

/* ---------- Article ---------- */
.post { max-width: 760px; margin: 0 auto; padding: 56px 24px 0; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted-foreground); min-width: 0; }
.crumbs a { color: var(--primary); font-weight: 600; flex: none; }
.crumbs span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 28px 0 0; padding: 0; }
.tags li { font-size: 12px; font-weight: 600; color: var(--info); background: var(--info-soft); padding: 3px 9px; border-radius: 999px; }
.post-head h1 { margin: 16px 0 0; font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
.lede { margin: 18px 0 0; font-size: 20px; line-height: 1.5; color: var(--muted-foreground); text-wrap: pretty; }
.post-meta { margin: 20px 0 0; padding-bottom: 28px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted-foreground); }
.post-cover { margin: 32px 0 0; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); }

.prose { padding-top: 12px; font-size: 18px; line-height: 1.75; color: color-mix(in oklab, var(--foreground) 88%, var(--muted-foreground)); overflow-wrap: break-word; }
.prose > * { margin: 22px 0 0; }
.prose h2, .prose h3 { position: relative; color: var(--foreground); letter-spacing: -.015em; scroll-margin-top: 88px; text-wrap: balance; }
.prose h2 { margin-top: 48px; font-size: 28px; line-height: 1.25; font-weight: 650; }
.prose h3 { margin-top: 36px; font-size: 21px; line-height: 1.3; font-weight: 600; }
.prose h4 { margin-top: 28px; font-size: 18px; color: var(--foreground); }
.prose .anchor { position: absolute; left: -1em; width: 1em; color: var(--border); opacity: 0; transition: opacity .2s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--primary) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--foreground); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--muted-foreground); }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--pteal); color: var(--muted-foreground); }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--secondary); border: 1px solid var(--border-subtle); border-radius: 5px; padding: 1px 5px; }
.prose pre { background: oklch(0.17 0.035 262); color: oklch(0.92 0.01 250); border-radius: 12px; padding: 18px 20px; overflow-x: auto; font-size: 15px; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--muted-foreground); text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose th { background: var(--secondary); color: var(--foreground); font-weight: 600; }

.post-cta { margin: 56px 0 0; padding: 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); display: flex; align-items: center; justify-content: space-between; gap: 24px; box-shadow: 0 12px 24px -16px oklch(0.258 0.104 260 / .2); }
.post-cta h2 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.01em; }
.post-cta p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted-foreground); }
.post-cta-btns { display: flex; gap: 10px; flex: none; }

.blog-list.more { margin-top: 88px; border-top: 1px solid var(--border); }
.more-h { margin: 0; padding: 40px 48px; font-size: 24px; letter-spacing: -.015em; border-bottom: 1px solid var(--border); }

/* ---------- Closing CTA + footer (from index.html) ---------- */
.cta-dark { --dk: oklch(0.17 0.035 262); background: var(--dk); color: oklch(0.97 0.008 242); margin-top: 96px; }
.cta-dark .frame { position: relative; overflow: hidden; border-color: oklch(1 0 0 / .1); text-align: center; padding: 120px 24px; }
.cta-dark .frame::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, oklch(1 0 0 / .045) 0 1px, transparent 1px 7px), repeating-linear-gradient(90deg, transparent 0 41px, oklch(0.73 0.106 216 / .07) 41px 42px, transparent 42px 97px);
  mask-image: linear-gradient(transparent, black 30%, black 70%, transparent); }
.cta-dark .frame::after { content: ""; position: absolute; left: 50%; bottom: -220px; width: 760px; height: 380px; transform: translateX(-50%); background: radial-gradient(closest-side, oklch(0.605 0.21 257 / .35), transparent); filter: blur(10px); pointer-events: none; }
.cta-dark h2 { position: relative; margin: 0; font-size: clamp(36px, 5vw, 60px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
.cta-dark p { position: relative; max-width: 560px; margin: 20px auto 0; font-size: 18px; line-height: 1.5; color: oklch(0.8 0.02 255); }
.cta-btns { position: relative; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn-d { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 1px solid oklch(1 0 0 / .18); background: oklch(1 0 0 / .04); color: white; transition: background .2s, transform .15s; }
.btn-d:hover { background: oklch(1 0 0 / .1); }
.btn-d.solid { background: white; color: var(--foreground); border-color: white; }
.btn-d.solid:hover { background: oklch(0.93 0.01 256); }

.foot { background: oklch(0.17 0.035 262); color: oklch(0.8 0.02 255); border-top: 1px solid oklch(1 0 0 / .08); }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 72px 48px 56px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.foot-brand img { display: block; height: 34px; width: auto; }
.foot-brand p { max-width: 280px; margin: 18px 0 14px; font-size: 14px; line-height: 1.5; color: oklch(0.7 0.02 255); }
.foot-brand a { font-size: 14px; color: white; }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.foot-cols h4 { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: oklch(0.6 0.02 255); }
.foot-cols a { display: flex; align-items: center; gap: 6px; font-size: 14px; color: oklch(0.92 0.01 250); padding: 5px 0; transition: color .2s; }
.foot-cols a:hover { color: white; }
.foot .new { font-size: 10px; font-weight: 600; background: var(--pblue); color: white; border-radius: 999px; padding: 1px 7px; }
.foot-bar { max-width: 1200px; margin: 0 auto; padding: 20px 48px 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: oklch(0.6 0.02 255); border-top: 1px solid oklch(1 0 0 / .08); }
.foot-bar a { color: oklch(0.92 0.01 250); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card:nth-child(3n) { border-right: 1px solid var(--border); }
  .post-card:nth-child(2n) { border-right: 0; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
}
@media (max-width: 640px) {
  .nav-in { padding: 0 16px; }
  .nav-login { display: none; }
  .blog-hero .frame { padding: 64px 16px 40px; }
  .feed-link { top: 16px; right: 16px; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-card { padding: 28px 16px; border-right: 0 !important; min-height: 0; }
  .post-card-img { margin: -28px -16px 8px; }
  .empty { padding: 48px 16px; }
  .post { padding: 36px 16px 0; }
  .lede { font-size: 18px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 24px; }
  .prose .anchor { display: none; }
  .post-cta { flex-direction: column; align-items: stretch; padding: 22px 18px; }
  .post-cta-btns .btn { flex: 1; }
  .more-h { padding: 32px 16px; }
  .cta-dark { margin-top: 64px; }
  .cta-dark .frame { padding: 88px 16px; }
  .foot-in { padding: 56px 16px 40px; }
  .foot-bar { padding: 20px 16px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
