/* ---------- palette: af Klint's mauve ground and ochre, Mondrian's Prussian blue and vermilion ---------- */
:root {
    --paper: #ede8ee;
    --paper-deep: #e3dce6;
    --ink: #262430;
    --ink-soft: #5b5766;
    --ink-faint: #8d889a;
    --prussian: #1f2f6b;
    --vermilion: #c9553c;
    --vermilion-deep: #a33f2a;
    --ochre: #d9ad3c;
    --ochre-pale: rgba(217, 173, 60, 0.22);
    --accent: #4f7f4e;   /* the green of the orbs in The Ten Largest */
    --powder: #a9bfd8;
    --line: #2a2730;
    --hair: rgba(38, 36, 48, 0.16);
}

/* ---------- shared ---------- */
/* A Kandinsky watercolour, faded into the paper, on the About page only. The source is small, so a little blur hides the upscaling. */
body.home::before {
    content: '';
    position: fixed;
    inset: -12px;
    z-index: -1;
    background-image: url('/assets/images/lyrical.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.045;
    filter: blur(2px);
    pointer-events: none;
}

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--paper);
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

a {
    color: var(--vermilion);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 85, 60, 0.35);
    transition: color 0.3s ease, border-color 0.3s ease;
}

a:hover {
    color: var(--vermilion-deep);
    border-bottom-color: var(--vermilion-deep);
}

header {
    margin-bottom: 50px;
    position: relative;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--prussian);
}

h1 .cn {
    font-size: 1.8rem;
    font-weight: 400;
}

nav {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

nav a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: none;
    margin-right: 20px;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

nav a:hover {
    color: var(--vermilion);
    opacity: 1;
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}


.placeholder {
    text-align: center;
    margin-top: 100px;
    font-size: 1.3rem;
    color: var(--ink-faint);
    font-style: italic;
}

/* ---------- about page ---------- */
.profile-section {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
    align-items: flex-start;
}

.bio {
    flex: 1;
}

.profile-photo {
    flex-shrink: 0;
    order: 2;
}

.profile-photo img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.bio p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--hair);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

section {
    margin-bottom: 50px;
    position: relative;
}

h2 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--prussian);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: var(--ochre);
    bottom: -5px;
    left: 0;
}


/* ---------- cv page ---------- */
.cv-link {
    font-size: 1.1rem;
}

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

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

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

.post-list li:last-child {
    border-bottom: none;
}

.post-date {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 4px;
}

.post-list h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    display: block;
}

.post-list h2::after {
    display: none;
}

.post-list h2 a {
    color: var(--prussian);
    border-bottom: none;
}

.post-list h2 a:hover {
    color: var(--vermilion);
}

.post-desc {
    color: var(--ink-soft);
    font-size: 1.05rem;
}

/* ---------- single post ---------- */
.post {
    max-width: 720px;
}

.post-title {
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 30px;
    display: inline-block;
}

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

.post-body > * + * {
    margin-top: 1.1em;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    color: var(--prussian);
    margin-top: 2em;
    line-height: 1.3;
    display: block;
}

.post-body h2 { font-size: 1.5rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body h4 { font-size: 1.1rem; }

.post-body h2::after {
    display: none;
}

.post-body ul,
.post-body ol {
    padding-left: 1.6em;
}

.post-body li + li {
    margin-top: 0.3em;
}

.post-body blockquote {
    border-left: 1px solid var(--line);
    padding-left: 20px;
    color: var(--ink-soft);
    font-style: italic;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background-color: var(--paper-deep);
    padding: 2px 5px;
    border-radius: 3px;
}

.post-body pre {
    background-color: var(--paper-deep);
    padding: 16px 20px;
    overflow-x: auto;
    border-left: 1px solid var(--line);
    line-height: 1.5;
}

.post-body pre code {
    background: none;
    padding: 0;
    font-size: 0.9rem;
}

.post-body table {
    border-collapse: collapse;
    width: 100%;
    font-size: 1rem;
}

.post-body th,
.post-body td {
    border-bottom: 1px solid var(--hair);
    padding: 8px 12px;
    text-align: left;
}

.post-body th {
    border-bottom: 1px solid var(--line);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.5em 0;
}

.post-body .footnotes {
    margin-top: 3em;
    padding-top: 1.5em;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.post-body .footnotes ol {
    padding-left: 1.4em;
}

.post-back a,
.post-body .reversefootnote,
.post-body .footnote {
    border-bottom: none;
}

.post-back {
    margin-top: 50px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-photo {
        order: 0;
    }

    h1 {
        font-size: 2rem;
    }

    .post-title {
        font-size: 1.7rem;
    }
}
