/*******************************************************************************
 * Base tokens
 ******************************************************************************/
:root {
    --text-color: #111;
    --background-color: #fff;
    --muted-color: #5c5c5c;
    --link-color: #0077cc;
    --link-hover-color: #005fa3;
    --border-color: #cfcfcf;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --line-height: 1.6;
    --heading-line-height: 1.25;
    --content-width: 44rem;
    --paragraph-spacing: 1.2rem;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: var(--line-height);
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
    padding-bottom: 1.5rem;
}

.container {
    width: min(90%, var(--content-width));
    margin: 0 auto;
}

img {
    max-width: 100%;
    display: block;
    margin: 2rem 0;
}

code,
pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: #f5f5f5;
    font-size: 0.92rem;
}

code {
    padding: 0.2em 0.4em;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    margin: var(--paragraph-spacing) 0;
}

a {
    color: var(--link-color);
    border-bottom: 1px solid transparent;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
    color: var(--link-hover-color);
    border-bottom-color: var(--link-hover-color);
}

p,
ul,
ol {
    margin-bottom: var(--paragraph-spacing);
}

.content-section ul,
.content-section ol,
.content ul,
.content ol {
    padding-left: 1.5rem;
    margin-left: 0;
    list-style-position: outside;
}

.content-section li,
.content li {
    margin-bottom: 0.35rem;
}

.content-section li::marker,
.content li::marker {
    color: var(--muted-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: var(--heading-line-height);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

h1 {
    margin-top: 0;
    font-size: clamp(2rem, 4vw, 2.5rem);
}

/*******************************************************************************
 * Header & navigation
 ******************************************************************************/
header {
    padding: 1.25rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-title a {
    color: var(--text-color);
    border: none;
    font-weight: 600;
}

.menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.menu a {
    color: var(--text-color);
    border: none;
    font-size: 0.95rem;
}

.menu-toggle {
    display: none;
    background: #f8fafd;
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle:focus-visible,
.menu-toggle:hover {
    border-color: var(--link-color);
    box-shadow: 0 6px 18px rgba(0, 119, 204, 0.25);
}

.menu-toggle--open {
    background: var(--text-color);
    border-color: var(--text-color);
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.18);
}

.menu-toggle-bar {
    display: block;
    width: 1.6rem;
    height: 2px;
    background: var(--text-color);
    margin: 0.25rem 0;
    transition: background 0.2s ease;
}

.menu-toggle--open .menu-toggle-bar {
    background: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 720px) {
    .menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-left: auto;
    }

    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        padding: 0.75rem 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 0.65rem;
        background: #fff;
        box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
    }

    .menu.menu--open {
        display: flex;
    }

    .menu li {
        width: 100%;
    }

    .menu a {
        display: block;
        padding: 0.4rem 0;
    }
}

/*******************************************************************************
 * Footer
 ******************************************************************************/
footer {
    text-align: center;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--muted-color);
}

/*******************************************************************************
 * Homepage profile blocks
 ******************************************************************************/
.home-intro {
    margin: 3vh 0 5vh;
}

.profile-info {
    max-width: var(--content-width);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-item {
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.profile-label {
    width: 7rem;
    font-weight: 600;
    color: var(--muted-color);
    text-transform: lowercase;
}

.profile-value {
    flex: 1;
    line-height: 1.4;
}

.profile-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/*******************************************************************************
 * Content layouts
 ******************************************************************************/
.content-section {
    margin: 2rem 0 4rem;
    max-width: var(--content-width);
}

.page-title {
    margin-bottom: 0.25rem;
}

.page-date,
time {
    font-size: 0.85rem;
    color: var(--muted-color);
}

.content {
    margin-top: 1.5rem;
}

/*******************************************************************************
 * Accessibility & responsive tweaks
 ******************************************************************************/
:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    body {
        font-size: 0.95rem;
    }

    .profile-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-label {
        width: auto;
    }
}
