/* ---- Reset & base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #fafafa;
    --color-text: #1a1a1a;
    --color-text-muted: #555;
    --color-accent: #2a6496;
    --color-accent-hover: #1d4e73;
    --color-border: #e0e0e0;
    --color-surface: #fff;
    --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --max-width: 48rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
}

html {
    font-size: 100%;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    font-family: var(--font-body);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

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

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

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

/* ---- Hero ---- */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.cta:hover {
    background: var(--color-accent-hover);
    color: #fff;
    text-decoration: none;
}

/* ---- Sections ---- */
section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

section + section {
    border-top: 1px solid var(--color-border);
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

/* ---- Services ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-md);
}

.service-card {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-surface);
}

.service-card h3 {
    margin-bottom: var(--space-sm);
}

.service-primary {
    border-color: var(--color-accent);
    border-width: 2px;
}

/* ---- How I work ---- */
.how-i-work p + p {
    margin-top: var(--space-sm);
}

/* ---- Blog ---- */
.post-list {
    list-style: none;
}

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.post-list time {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    margin-left: var(--space-sm);
}

/* ---- Post ---- */
.post {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.post-header {
    margin-bottom: var(--space-md);
}

.post-header h1 {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
}

.post-header time {
    color: var(--color-text-muted);
}

.post-content h2 {
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

.post-content p {
    margin-bottom: var(--space-sm);
}

.post-content pre {
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--space-sm);
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.post-content :not(pre) > code {
    background: var(--color-border);
    padding: 0.125em 0.375em;
    border-radius: 3px;
}

/* ---- Contact ---- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-width: 32rem;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.contact-form label {
    font-weight: 600;
    font-size: 0.9375rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form button {
    align-self: flex-start;
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.contact-form button:hover {
    background: var(--color-accent-hover);
}

/* ---- Footer ---- */
.site-footer {
    border-top: 1px solid var(--color-border);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    width: 100%;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: var(--space-sm);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-tagline {
        font-size: 1.0625rem;
    }

    .nav {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .post-list li {
        flex-direction: column;
        gap: 0.25rem;
    }

    .site-footer {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
}
