/* Starcat Blog — Tuple-inspired light editorial layout.
 * Why diverge from the dark marketing site: reading / browsing posts
 * benefits from high-contrast paper cards on soft gray, not slate glass.
 */

:root {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --text: #111111;
    --text-muted: #6b7280;
    --text-subtle: #9ca3af;
    --border: #e8e8ea;
    --border-strong: #d4d4d8;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-hover: 0 10px 30px rgba(17, 17, 17, 0.06);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(37, 99, 235, 0.18); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* —— Top bar —— */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: var(--max); margin: 0 auto; padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; }
.topbar-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.topbar-nav a { color: var(--text-muted); font-weight: 500; }
.topbar-nav a:hover { color: var(--text); }
.topbar-nav a.is-active { color: var(--text); }

/* —— Hero —— */
.hero { padding: 72px 28px 40px; }
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(40px, 6vw, 56px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--text);
}
.hero-lead {
    margin: 0;
    max-width: 36rem;
    font-size: 18px;
    line-height: 1.55;
    color: var(--text-muted);
    font-weight: 500;
}

/* Grow so footer sits at viewport bottom when content is short. */
main.blog-main,
main.article-main {
    flex: 1 0 auto;
    width: 100%;
}

main.blog-main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 12px 28px 64px;
}

main.article-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 28px 64px;
}

/* —— Post grid (Tuple-style) —— */
.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.post-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    height: 100%;
    padding: 28px 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.post-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: inherit;
}
.post-card-body { flex: 1 1 auto; }
.post-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
    color: var(--text);
}
.post-card .summary {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 4px;
}
.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    background: #eee;
    flex: 0 0 auto;
}
.author-text { min-width: 0; }
.author-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
}
.author-meta {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-subtle);
    line-height: 1.3;
}

.status-msg {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.status-msg.error { color: #b91c1c; border-color: #fecaca; }

/* —— Article —— */
.article-back {
    display: inline-flex;
    margin-bottom: 28px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}
.article-back:hover { color: var(--text); }
.article-header { margin-bottom: 36px; }
.article-header h1 {
    margin: 0 0 20px;
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--text);
}
.article-body {
    color: #374151;
    font-size: 17px;
    line-height: 1.75;
}
.article-body > *:first-child { margin-top: 0; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.25;
}
.article-body h1 { font-size: 28px; margin: 44px 0 14px; }
.article-body h2 { font-size: 24px; font-weight: 700; margin: 44px 0 14px; }
.article-body h3 { font-size: 19px; font-weight: 600; margin: 32px 0 12px; }
.article-body h4 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
.article-body p { margin: 0 0 1.15em; }
.article-body a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--link-hover); }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body ul, .article-body ol { padding-left: 1.35em; margin: 0 0 1.15em; }
.article-body li { margin: 0.4em 0; }
.article-body hr {
    border: none; border-top: 1px solid var(--border); margin: 40px 0;
}
.article-body blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-muted);
    font-style: italic;
}
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: #f0f0f2;
    border-radius: 5px;
    padding: 2px 6px;
    color: var(--text);
}
.article-body pre {
    background: #111827;
    color: #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    overflow-x: auto;
    margin: 24px 0;
}
.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13.5px;
    line-height: 1.55;
}
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 24px 0;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}
.article-body th, .article-body td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}
.article-body th { background: #fafafa; color: var(--text); }

footer.site-footer {
    flex: 0 0 auto;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 36px 28px 48px;
    text-align: center;
    color: var(--text-subtle);
    font-size: 13px;
    background: transparent;
}
footer.site-footer .links {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 14px;
}
footer.site-footer .links a { color: var(--text-muted); font-weight: 500; }
footer.site-footer .links a:hover { color: var(--text); }
footer.site-footer .copyright { margin: 0; color: var(--text-subtle); }

@media (max-width: 960px) {
    .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .topbar-nav { display: none; }
    .hero { padding: 48px 20px 28px; }
    .hero h1 { font-size: 36px; }
    main.blog-main, main.article-main { padding-left: 20px; padding-right: 20px; }
    .post-list { grid-template-columns: 1fr; gap: 14px; }
    .post-card { min-height: 0; padding: 24px; }
}
