:root {
  --ink: #101820;
  --paper: #fafafa;
  --line: #e5e7eb;
  --muted: #6b7280;
  --green: #00b140;
  --green-deep: #007a2c;
}

.blog-wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 640px) { .blog-wrap { padding: 0 2.5rem; } }

/* Index */
.blog-hero { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--line); }
.blog-hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.025em; font-weight: 800; max-width: 18ch; }
.blog-hero p { margin-top: 1.25rem; max-width: 42ch; color: var(--muted); font-size: 1.125rem; line-height: 1.6; }

.post-row { display: grid; gap: 0.5rem 3rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
@media (min-width: 768px) { .post-row { grid-template-columns: 11rem 1fr; } }
.post-row-meta { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.post-row-title { font-size: clamp(1.5rem, 3vw, 2.125rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; transition: color .15s; }
.post-row:hover .post-row-title, .post-row:focus-visible .post-row-title { color: var(--green-deep); }
.post-row-desc { margin-top: 0.75rem; max-width: 60ch; color: #374151; font-size: 1.0625rem; line-height: 1.6; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag { font-size: 0.75rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.65rem; background: #fff; }

/* Article */
.article-head { padding: 3.5rem 0 2.5rem; }
.article-head a.back { font-size: 0.875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.article-head a.back:hover { color: var(--ink); }
.article-head h1 { margin-top: 1.5rem; font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 800; max-width: 22ch; }
.article-head .lede { margin-top: 1.25rem; max-width: 52ch; color: #374151; font-size: 1.1875rem; line-height: 1.6; }
.article-head .byline { margin-top: 1.5rem; color: var(--muted); font-size: 0.875rem; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-bottom: 5rem; border-top: 1px solid var(--line); padding-top: 3rem; }
@media (min-width: 1024px) { .article-grid { grid-template-columns: 13rem minmax(0, 40rem); gap: 5rem; } }
.toc { display: none; }
@media (min-width: 1024px) { .toc { display: block; position: sticky; top: 7rem; align-self: start; font-size: 0.875rem; } }
.toc p { font-weight: 700; margin-bottom: 0.75rem; }
.toc ol { list-style: none; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 0.35rem 0 0.35rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 600; border-left-color: var(--green); }

.prose-tuna { font-size: 1.125rem; line-height: 1.75; color: #1f2937; }
.prose-tuna > * + * { margin-top: 1.25rem; }
.prose-tuna h2 { margin-top: 3rem; scroll-margin-top: 6rem; font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); }
.prose-tuna h2 + * { margin-top: 0.75rem; }
.prose-tuna a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose-tuna a:hover { color: var(--ink); }
.prose-tuna strong { color: var(--ink); font-weight: 700; }
.prose-tuna ul, .prose-tuna ol { padding-left: 1.5rem; }
.prose-tuna ul { list-style: disc; }
.prose-tuna ol { list-style: decimal; }
.prose-tuna li + li { margin-top: 0.5rem; }
.prose-tuna li::marker { color: var(--green); }
.prose-tuna :not(pre) > code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.875em; background: #f3f4f6; border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.35em; color: var(--ink); }
.prose-tuna table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.prose-tuna th { text-align: left; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 2px solid var(--ink); font-weight: 700; color: var(--ink); }
.prose-tuna td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose-tuna td:first-child { white-space: nowrap; }

/* Code and prompt blocks */
.code-block, .prompt-block { position: relative; border-radius: 10px; overflow: hidden; margin-top: 1.5rem; }
.code-block { background: var(--ink); color: #e5e7eb; }
.code-block figcaption { padding: 0.55rem 1rem; font: 500 0.75rem 'JetBrains Mono', monospace; color: #9ca3af; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-block pre { padding: 1rem; overflow-x: auto; line-height: 1.65; }
.code-block code, .prompt-block code { font: 400 0.875rem/1.65 'JetBrains Mono', ui-monospace, monospace; }
.prompt-block { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 4px 10px 10px 4px; }
.prompt-block figcaption { padding: 0.75rem 1rem 0; font-size: 0.8125rem; font-weight: 700; color: var(--green-deep); }
.prompt-block pre { padding: 0.5rem 1rem 1rem; white-space: pre-wrap; }
.prompt-block code { font-family: 'Rethink Sans', sans-serif; font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }
.copy-btn { position: absolute; top: 0.4rem; right: 0.5rem; font: 600 0.75rem 'Rethink Sans', sans-serif; padding: 0.3rem 0.6rem; border-radius: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #d1d5db; }
.prompt-block .copy-btn { border-color: var(--line); color: var(--muted); }
.copy-btn:hover { border-color: var(--green); color: var(--green); }
.copy-btn:focus-visible, .btn-primary:focus-visible, .post-row:focus-visible, .toc a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Skill download card */
.skill-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; margin-top: 1.75rem; padding: 1.5rem; background: var(--ink); color: #fff; border-radius: 12px; }
.skill-card-title { font-size: 1.125rem; font-weight: 800; }
.skill-card p + p { margin-top: 0.35rem; font-size: 0.9375rem; line-height: 1.5; color: #9ca3af; max-width: 34ch; }
.skill-card-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.skill-card a { text-decoration: none; }
.btn-primary { font-size: 0.875rem; font-weight: 700; padding: 0.65rem 1.1rem; border-radius: 6px; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--green); color: #fff !important; }
.btn-primary:hover { background: #00c948; }

/* Closing call to action */
.article-cta { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article-cta h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.article-cta p { margin-top: 0.5rem; color: var(--muted); max-width: 44ch; }
.article-cta .btn-primary { display: inline-block; margin-top: 1.25rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto !important; } }
