:root {
    --bg: #0b0b0d;
    --bg-elevated: #17171a;
    --text: #f2f2f0;
    --text-muted: #9a9a9f;
    --border: rgba(255, 255, 255, 0.09);
    --accent: var(--ghost-accent-color, #ff1a75);
    --radius: 10px;
    --gh-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --gh-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--gh-font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.hero-title,
.post-card-title,
.post-title {
    font-family: var(--gh-font-heading);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrap-narrow {
    max-width: 720px;
}

/* Header */

.site-header {
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 76px;
}

.site-logo {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.site-logo img {
    max-height: 32px;
}

.site-nav {
    display: flex;
    gap: 24px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.site-nav a:hover,
.site-nav .nav-current {
    color: var(--text);
}

/* Hero */

.hero {
    padding: 96px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero.has-cover {
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 13, 0.72);
}

.hero.has-cover .hero-inner {
    position: relative;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0 auto;
    max-width: 540px;
}

/* Post feed */

.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    padding: 56px 0 32px;
}

.post-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-card-image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 20px 22px 24px;
}

.post-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 14px;
}

.post-card-meta,
.post-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-card-meta-sep,
.post-meta-sep {
    margin: 0 6px;
}

/* Pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 64px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination-status {
    order: 2;
}

/* Single post / page */

.post {
    padding: 64px 0 96px;
}

.post-header {
    text-align: center;
    margin-bottom: 32px;
}

.post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.post-feature-image {
    border-radius: var(--radius);
    margin: 32px 0;
}

.post-content {
    font-size: 1.1rem;
}

.post-content h2,
.post-content h3 {
    letter-spacing: -0.01em;
}

.post-content a {
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-color: var(--accent);
}

.post-content img {
    border-radius: var(--radius);
}

.post-content .kg-width-wide {
    width: 100%;
    max-width: 1080px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.post-content .kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.post-content .kg-width-full img {
    border-radius: 0;
}

.post-content pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
}

.post-content code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    margin: 0;
    padding-left: 20px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.post-tags {
    margin-top: 32px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post-tags a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-tags a:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Error page */

.error-page {
    text-align: center;
    padding: 120px 0;
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    margin: 0;
}

.error-message {
    color: var(--text-muted);
    margin: 8px 0 24px;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
}

.site-footer-inner {
    height: 72px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .site-nav { gap: 16px; }
    .hero { padding: 64px 0; }
    .post-feed { grid-template-columns: 1fr; padding-top: 40px; }
}
