:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666666;
    --border: #d0d0d0;
    --accent: #0066cc;
    --code-bg: #f5f5f5;
    --max-width: 900px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

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

a:hover {
    text-decoration: underline;
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    border-bottom: 2px solid var(--border);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-title-wrap {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text);
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-role {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Main content */
main {
    min-height: calc(100vh - 12rem);
}

.page-shell,
.home-shell {
    display: grid;
    gap: 2rem;
    padding: 0 0 3rem;
}

.hero-panel,
.content-panel,
.page-panel,
.article-panel {
    border: 2px solid var(--border);
    padding: 2rem;
    max-width: 100%;
    box-sizing: border-box;
}

/* Typography */
.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-panel h1,
.page-panel h1,
.article-panel h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-role {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-intro,
.section-copy {
    max-width: 70ch;
    margin-top: 1rem;
    line-height: 1.7;
}

.hero-tags,
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.tag-chip,
.tag,
.post-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--code-bg);
    color: var(--text);
    font-size: 0.813rem;
    text-decoration: none;
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.button,
.section-link,
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--text);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.button:hover,
.section-link:hover,
.pagination-link:hover {
    background: var(--text);
    color: var(--bg);
    text-decoration: none;
}

.button-primary {
    background: var(--text);
    color: var(--bg);
}

.button-primary:hover {
    background: transparent;
    color: var(--text);
}

.button-secondary,
.section-link,
.pagination-link {
    background: transparent;
}

/* Sections */
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.section-heading h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
}

.info-grid,
.post-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.post-item {
    padding: 1.5rem;
    border: 2px solid var(--border);
    background: var(--bg);
}

.info-card h3,
.post-item h2,
.post-item h3 {
    font-size: 1.125rem;
    line-height: 1.3;
    font-weight: 700;
}

.post-item h2 a,
.post-item h3 a {
    text-decoration: none;
    color: var(--text);
}

.post-item h2 a:hover,
.post-item h3 a:hover {
    color: var(--accent);
}

.info-card p {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.813rem;
}

.post-item time,
.article-panel time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.post-item time {
    display: inline-block;
    margin-top: 0.5rem;
}

.post-item p {
    margin-top: 0.75rem;
    color: var(--text-muted);
}

.article-panel time {
    display: inline-block;
    margin-top: 1rem;
}

/* Article content */
.article-content {
    margin-top: 2rem;
    max-width: 100%;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content > * + * {
    margin-top: 1.25rem;
}

.article-content h2 {
    margin-top: 2.5rem;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.article-content h3 {
    margin-top: 2rem;
    font-size: 1.375rem;
    font-weight: 700;
}

.article-content h4 {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.article-content ul,
.article-content ol {
    padding-left: 2rem;
}

.article-content li + li {
    margin-top: 0.5rem;
}

.article-content code {
    padding: 0.2rem 0.4rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    font-size: 0.9em;
}

.article-content pre,
.chroma {
    overflow-x: auto;
    padding: 1rem;
    border: 2px solid var(--border);
    background: var(--code-bg);
    max-width: 100%;
}

.article-content pre code {
    padding: 0;
    border: none;
    background: transparent;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
}

.article-content a:hover {
    text-decoration: none;
}

.article-content img {
    margin: 2rem auto;
    border: 2px solid var(--border);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.article-content strong,
.article-content b {
    font-weight: 700;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    overflow-x: auto;
    display: table;
}

.article-content table th,
.article-content table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 2px solid var(--border);
}

.article-content table th {
    background: var(--code-bg);
    font-weight: 700;
    color: var(--text);
}

.article-content table td {
    color: var(--text-muted);
}

.article-content table tr:hover {
    background: var(--code-bg);
}

/* Skills section */
.skills-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 2px solid var(--text);
    background: transparent;
    color: var(--text);
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.skills-toggle:hover {
    background: var(--text);
    color: var(--bg);
}

.skills-list {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.skill-category h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.skill-category p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Contact section */
.contact-section {
    margin: 2rem 0;
}

.contact-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.contact-intro {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
}

.proof-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.proof-card {
    display: grid;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 2px solid var(--border);
    background: var(--code-bg);
}

.proof-card strong {
    font-size: 1.5rem;
    line-height: 1;
}

.proof-card span {
    color: var(--text-muted);
}

.article-content a.contact-card {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    grid-template-rows: auto auto 1fr;
    height: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.article-content a.contact-card:hover {
    border-color: var(--text);
    background: var(--code-bg);
}

.contact-card-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-card-value {
    color: var(--accent);
    font-weight: 600;
    word-break: break-word;
}

.contact-card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.related-posts h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
}

/* Pagination */
.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.pagination .pagination-link:last-child {
    justify-self: end;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Footer */
.site-footer {
    padding: 0 0 2rem;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem 0 0;
    border-top: 2px solid var(--border);
}

.footer-title {
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 700;
}

.footer-copy {
    max-width: 50ch;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Responsive */
@media (max-width: 760px) {
    .site-nav,
    .footer-inner,
    .section-heading {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        flex-wrap: wrap;
        width: 100%;
        gap: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .proof-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .page-panel,
    .article-panel,
    .content-panel {
        padding: 1.5rem;
    }

    .button,
    .section-link,
    .pagination-link {
        width: 100%;
    }

    .hero-actions,
    .footer-links {
        display: grid;
    }

    .pagination {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    .page-shell,
    .home-shell {
        padding: 0 0 2rem;
    }

    .hero-panel h1,
    .page-panel h1,
    .article-panel h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .article-content table {
        display: block;
        overflow-x: auto;
    }
}
