/* Base page styling */
:root {
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 2.5rem;
    --page-bg: #fcfcfd;
    --text-color: #1f2937;
    --muted-text: #4b5563;
    --soft-text: #6b7280;
    --accent: #2F6F6D;
    --accent-strong: #245754;
    --surface: #f8fafc;
    --surface-border: #e6ebf1;
    --divider: #e6ebf1;
    --code-surface: #f4f7fb;
    --content-width: 780px;
    --measure: 65ch;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    background: var(--page-bg);
    font-size: 17px;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
    line-height: 1.25;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent);
    text-underline-offset: 0.16em;
    text-decoration-thickness: 1px;
}

a:visited {
    color: var(--accent);
}

a:hover {
    color: var(--accent-strong);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Header info card */
.info {
    max-width: var(--content-width);
    margin: var(--space-6) auto var(--space-6);
    padding: 1.5rem 2.1rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.info img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.info h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3.1vw, 2.45rem);
    letter-spacing: -0.02em;
}

.info p {
    margin: var(--space-1) 0 var(--space-3);
    font-size: 0.9rem;
    color: var(--soft-text);
    font-weight: 400;
}

.info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info li {
    margin: 0;
}

.info a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}

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

.info a:focus-visible {
    text-decoration: underline;
}

/* Main content container */
.container {
    max-width: var(--content-width);
    margin: 0 auto 3.5rem;
    padding: 0 var(--space-5);
}

.container p,
.container ul,
.container ol {
    margin-bottom: 1.15rem;
}

.container p {
    max-width: var(--measure);
}

.container li {
    max-width: 72ch;
}

.container ul,
.container ol {
    padding-left: 1.35rem;
}

.container li + li {
    margin-top: 0.3rem;
}

.container h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--surface-border);
}

.container h2,
.container h3 {
    margin-bottom: 0.65rem;
}

.updates-list {
    margin-top: 1rem;
}

.updates-more {
    margin-top: 0.8rem;
}

/* Blog index and post readability */
.post-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 2rem;
}

.post-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--divider);
}

.post-list li:first-child {
    padding-top: 0;
}

.post-list-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
}

.post-list-header a {
    font-size: 1.05rem;
    font-weight: 600;
}

.post-date {
    color: var(--soft-text);
    font-size: 0.9rem;
    white-space: nowrap;
}

.post-excerpt {
    margin: 0.45rem 0 0;
    color: var(--muted-text);
}

.post-empty {
    color: var(--soft-text);
}

.post {
    margin-top: 0.5rem;
}

.post h1 {
    margin: 0 0 1rem;
}

.post-body {
    line-height: 1.75;
}

.post-body > * + * {
    margin-top: 1rem;
}

.post-body h2,
.post-body h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.post-body ul,
.post-body ol {
    padding-left: 1.3rem;
}

.post-body pre {
    margin: 1.25rem 0;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    border-radius: 8px;
    background: var(--code-surface);
    border: 1px solid var(--divider);
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.92em;
}

.post-body blockquote {
    margin: 1.25rem 0;
    padding: 0 0 0 1rem;
    border-left: 3px solid var(--divider);
    color: var(--muted-text);
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.post-body th,
.post-body td {
    border: 1px solid var(--divider);
    padding: 0.5rem 0.6rem;
    text-align: left;
}

.blog-back,
.post-back {
    margin-top: 1.5rem;
}

/* Links inside the header card */
.links {
    display: flex;
    justify-content: center;
    column-gap: 1.6rem;
    row-gap: 0.65rem;
    flex-wrap: wrap;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.44rem;
    white-space: nowrap;
}

.link-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.link-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.info-text {
    text-align: center;
    max-width: 34rem;
}

.site-footer {
    text-align: center;
    margin: 2.5rem 0 1.9rem;
    font-size: 0.85rem;
    color: var(--soft-text);
}

/* Mobile responsive layout */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .info {
        flex-direction: column;
        text-align: center;
        align-items: center;
        margin-top: var(--space-5);
        padding: 1.2rem 1.1rem;
        gap: 1rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .info img {
        width: 100px;
        height: 100px;
    }

    .info h1 {
        font-size: 1.95rem;
    }

    .links {
        column-gap: 1rem;
        row-gap: 0.7rem;
    }

    .post-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-date {
        white-space: normal;
    }
}
