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

:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --border: #e5e7eb;
    --border-hover: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --accent: #000000;
    --accent-hover: #1f1f1f;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-md: 0 2px 4px rgba(15,23,42,.06), 0 6px 16px rgba(15,23,42,.05);
    --reading-w: 720px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 64px;
}

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

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 200;
    transition: width .1s linear;
}

.blog-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    padding: 12px 16px;
    pointer-events: none;
}
.blog-nav-inner { pointer-events: auto; }
.blog-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 32px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.blog-logo {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.blog-nav-links { display: flex; gap: 24px; flex: 1; }
.blog-nav-links a {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color .15s;
}
.blog-nav-links a:hover,
.blog-nav-links a.is-active { color: var(--text); }
.blog-nav-actions { display: flex; align-items: center; gap: 16px; }
.blog-link-muted { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.blog-link-muted:hover { color: var(--text); }
.blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    transition: background .15s;
}
.blog-btn:hover { background: var(--accent-hover); }
@media (max-width: 768px) {
    .blog-nav-links, .blog-nav-actions { display: none; }
}

.article-head {
    max-width: var(--reading-w);
    margin: 0 auto;
    padding: 48px 24px 36px;
}
.article-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    transition: color .15s;
}
.article-breadcrumb:hover { color: var(--text); }
.article-breadcrumb svg { width: 12px; height: 12px; }

.article-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 18px;
}
.article-title {
    font-size: clamp(28px, 4.5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 20px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.article-meta-sep { color: #d1d5db; }
.article-meta-author { font-weight: 600; color: var(--text); }

.featured-image-wrap {
    max-width: 960px;
    margin: 0 auto 48px;
    padding: 0 24px;
}
.featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: block;
}

.article-wrap {
    max-width: var(--reading-w);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.article-body {
    font-size: 17px;
    line-height: 1.75;
    color: #1f2937;
}

.article-body > * + * { margin-top: 1.2em; }

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

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--text);
    margin-top: 2em;
    margin-bottom: -0.2em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.article-body h3 {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text);
    margin-top: 1.6em;
}
.article-body h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.4em;
}

.article-body strong { font-weight: 600; color: var(--text); }
.article-body em { font-style: italic; }
.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity .15s;
}
.article-body a:hover { opacity: .7; }

.article-body ul,
.article-body ol {
    padding-left: 28px;
}
.article-body li { margin-top: 6px; }
.article-body li::marker { color: var(--text-dim); }

.article-body .key-takeaways {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    margin: 1.6em 0;
}
.article-body .key-takeaways > p:first-child {
    margin: 0 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.article-body .key-takeaways ul { margin: 0; }

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 0 8px 24px;
    color: var(--text);
    font-style: italic;
    font-size: 18px;
    line-height: 1.6;
    background: var(--bg-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 22px;
}

.article-body code {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
}
.article-body pre {
    background: #0f172a;
    color: #f1f5f9;
    border-radius: var(--radius);
    padding: 18px 22px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
}
.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.2em auto;
    display: block;
}
.article-body figure {
    margin: 1.6em 0;
}
.article-body figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.4em 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.article-body th,
.article-body td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.article-body th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--text);
}
.article-body figure:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.article-body figure > table {
    min-width: 460px;
}
.article-body thead th {
    white-space: nowrap;
}
.article-body th[scope="row"] {
    background: transparent;
    font-weight: 500;
}
.article-body tbody td {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.article-body tbody tr:last-child th,
.article-body tbody tr:last-child td {
    border-bottom: none;
}

.article-tags {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}
.article-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text);
    transition: background .15s, border-color .15s;
}
.article-tag:hover { background: #f1f5f9; border-color: var(--border-hover); }

.related-section {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 56px 24px 80px;
}
.related-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.related-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 24px;
    color: var(--text);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 920px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.related-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}
.related-card-img-wrap {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    overflow: hidden;
}
.related-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-card-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}
.related-card-placeholder svg { width: 32px; height: 32px; opacity: .5; }
.related-card-body {
    padding: 16px 18px 20px;
}
.related-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-tldr {
    margin: 0 0 32px;
    padding: 22px 26px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}
.article-tldr-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.article-tldr ul {
    margin: 0;
    padding-left: 20px;
}
.article-tldr li {
    margin: 8px 0;
    line-height: 1.6;
}

.article-cta {
    margin: 34px 0;
    padding: 24px 26px;
    background: var(--accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.article-cta-text {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    flex: 1 1 300px;
}
.article-cta-btn {
    flex: 0 0 auto;
    display: inline-block;
    padding: 12px 22px;
    background: #fff;
    color: var(--accent);
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}
.article-cta-btn:hover {
    background: #f1f3f4;
}
.article-cta-inline {
    margin-top: 0;
}

.article-faq {
    margin: 48px 0 0;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.article-faq-title {
    margin: 0 0 18px;
    font-size: 26px;
    font-weight: 600;
}
.article-faq-item {
    border-bottom: 1px solid var(--border);
}
.article-faq-item > summary {
    cursor: pointer;
    padding: 16px 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.article-faq-item > summary::-webkit-details-marker {
    display: none;
}
.article-faq-item > summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
}
.article-faq-item[open] > summary::after {
    content: "–";
}
.article-faq-item > summary h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    display: inline;
}
.article-faq-answer {
    padding: 0 0 18px;
    color: var(--text-muted);
    line-height: 1.7;
}
.article-faq-answer p {
    margin: 0;
}

@media (max-width: 640px) {
    .article-cta {
        padding: 20px;
    }
    .article-cta-btn {
        width: 100%;
        text-align: center;
    }
}

.article-cta-link {
    margin: 0 0 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
}
.article-cta-link a {
    font-weight: 600;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-cta-link-note {
    color: var(--text-muted);
}

.preview-banner {
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px 18px;
    background: #b45309;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}
.preview-banner strong {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 12px;
}
.preview-banner-date {
    opacity: .85;
}
