/* Blog styles. Tokens mirror /styles.css :root (Warm Vanilla). */
:root {
    --vanilla-cream: #faf7f0;
    --warm-beige: #f5f1e8;
    --soft-tan: #eae5d6;
    --warm-brown: #8b7355;
    --deep-brown: #5d4e37;
    --coral-accent: #ff6b6b;
    --sunset-orange: #ff8c42;
    --sage-green: #87a96b;
    --text-primary: #2c2417;
    --text-secondary: #5d4e37;
    --text-light: #8b7355;
    --bg-card: #ffffff;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --shadow: 0 4px 20px rgba(139, 115, 85, 0.10);
    --shadow-raised: 0 12px 40px rgba(139, 115, 85, 0.18);
    --transition: 0.4s ease;
    --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--vanilla-cream);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

a { color: inherit; }

/* ---------- Nav ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(250, 247, 240, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--soft-tan);
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nav-back {
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
}
.nav-back:hover { color: var(--coral-accent); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    position: relative;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.2rem 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--coral-accent);
    transition: width 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a.is-active::after { width: 100%; }
.nav-links a.is-active { color: var(--text-primary); }

/* ---------- Shared bits ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--deep-brown);
    background: var(--warm-beige);
    border: 1px solid var(--soft-tan);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
.meta .dot { opacity: 0.7; }
.ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-light);
    border: 1px solid var(--soft-tan);
    background: transparent;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    margin-left: 0.25rem;
    white-space: nowrap;
}
.ai-pill i { font-size: 0.65rem; opacity: 0.8; }

/* ---------- Index ---------- */
.index-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}
.index-hero {
    text-align: center;
    padding: 4.5rem 0 2.5rem;
    max-width: 720px;
    margin: 0 auto;
}
.index-hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}
.lede {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}
.split-note {
    font-size: 0.98rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}
.split-note strong { color: var(--text-secondary); font-weight: 600; }

.shelf { padding: 2.5rem 0; }
.shelf + .shelf { border-top: 1px solid var(--soft-tan); }
.shelf h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 0 0 0.5rem;
}
.shelf-note {
    text-align: center;
    color: var(--text-light);
    margin: 0 0 2rem;
}
.empty-state {
    max-width: 560px;
    margin: 1.5rem auto 0;
    text-align: center;
    padding: 2.25rem 1.5rem;
    border: 1.5px dashed var(--soft-tan);
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-light);
}
.empty-state i { font-size: 1.4rem; color: var(--warm-brown); opacity: 0.7; }
.empty-state p { margin: 0.75rem 0 0; font-size: 1.05rem; }

.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}
.cards li { display: flex; }
.card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--soft-tan);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-raised); }
.card:focus-visible { outline: 2px solid var(--coral-accent); outline-offset: 3px; }
.card h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text-primary);
}
.card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}
.card .meta { font-size: 0.82rem; padding-top: 0.5rem; border-top: 1px solid var(--warm-beige); }

/* ---------- Post ---------- */
.post-main { padding: 3rem 2rem 4rem; }
.post {
    max-width: var(--measure);
    margin: 0 auto;
}
.crumb {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 1.5rem;
}
.crumb:hover { color: var(--coral-accent); }
.post-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 1rem 0 1rem;
}
.dek {
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}
.post > .meta {
    padding-bottom: 1.75rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--soft-tan);
}

.prose { font-size: 1.1rem; line-height: 1.8; color: var(--text-secondary); }
.prose > * { margin-top: 0; margin-bottom: 1.25rem; }
.prose h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 2.75rem 0 1rem;
}
.prose h3 {
    font-size: 1.2rem;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 2rem 0 0.6rem;
}
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: rgba(255, 107, 107, 0.6);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.prose a:hover { color: var(--coral-accent); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--warm-brown); }
.prose blockquote {
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--coral-accent);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
}
.prose hr { border: 0; border-top: 1px solid var(--soft-tan); margin: 2.5rem 0; }

.prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--warm-beige);
    border: 1px solid var(--soft-tan);
    border-radius: 6px;
    padding: 0.08em 0.35em;
    color: var(--text-primary);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.prose pre {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1c2129 100%);
    color: #e6edf3;
    border-radius: var(--border-radius);
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.65;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}
.prose pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    color: inherit;
}
.prose pre .c { color: #8b949e; }
.prose pre .k { color: #ff7b72; }
.prose pre .s { color: #a5d6ff; }

.callout {
    background: var(--bg-card);
    border: 1px solid var(--soft-tan);
    border-radius: var(--border-radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    font-size: 1rem;
    line-height: 1.7;
}
.callout > :last-child { margin-bottom: 0; }

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--soft-tan);
    border-radius: var(--border-radius);
    background: var(--bg-card);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}
.prose th, .prose td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--warm-beige);
    vertical-align: top;
}
.prose th {
    background: var(--warm-beige);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }

/* ---------- End of post ---------- */
.interactive {
    display: grid;
    gap: 0.75rem;
    margin: 3rem 0 1.5rem;
}
.cta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    padding: 1.1rem 1.4rem;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--coral-accent), var(--sunset-orange));
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.30);
    transition: transform var(--transition), box-shadow var(--transition);
}
.cta:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(255, 107, 107, 0.38); }
.cta-label { font-size: 0.85rem; opacity: 0.92; }
.cta-text { font-size: 1.1rem; font-weight: 700; }
.cta-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--soft-tan);
    box-shadow: var(--shadow);
}
.cta-secondary:hover { box-shadow: var(--shadow-raised); }
.cta-secondary .cta-label { color: var(--text-light); opacity: 1; }

.ai-note {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-light);
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--soft-tan);
}
.post-end {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    font-weight: 600;
}
.post-end a { text-decoration: none; color: var(--text-secondary); }
.post-end a:hover { color: var(--coral-accent); }

.site-footer {
    border-top: 1px solid var(--soft-tan);
    background: var(--warm-beige);
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-inner { padding: 0.85rem 1.5rem; }
    .index-main { padding: 0 1.5rem 3rem; }
    .post-main { padding: 2rem 1.5rem 3rem; }
}
@media (max-width: 480px) {
    .nav-inner { padding: 0.8rem 1rem; }
    .nav-links { gap: 1rem; }
    .index-main { padding: 0 1rem 2.5rem; }
    .index-hero { padding: 3rem 0 1.5rem; }
    .post-main { padding: 1.5rem 1rem 2.5rem; }
    .dek { font-size: 1.12rem; }
    .prose { font-size: 1.05rem; line-height: 1.75; }
    .prose h2 { font-size: 1.4rem; margin-top: 2.25rem; }
    .prose pre { font-size: 0.82rem; padding: 1rem; border-radius: 12px; }
    .card { padding: 1.25rem; }
    .prose table { font-size: 0.88rem; }
    .prose th, .prose td { padding: 0.55rem 0.65rem; }
    .prose td code { white-space: normal; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .cta { transition: none; }
    .card:hover, .cta:hover { transform: none; }
}
