:root {
    --bg: #fdfbf7;
    --text: #1c1917;
    --muted: #57534e;
    --blue: #1d2a44;
    --red: #8c1d11;
    --line: #e2dcd2;
    --paper: #f6f3ec;
    --surface: #fff;
    --tag: #eae4d9;
    --code-inline: #eee9df;
    --code-block: #252422;
    --code-text: #f8f5ef;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: ui-monospace, SFMono-Regular, Consolas, monospace
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141413;
    --text: #ece9e2;
    --muted: #aaa59b;
    --blue: #b8c9e6;
    --red: #e49b8f;
    --line: #393732;
    --paper: #1d1c1a;
    --surface: #242321;
    --tag: #2c313a;
    --code-inline: #2d2b27;
    --code-block: #090909;
    --code-text: #f8f5ef
}

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

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    padding: 0 1.5rem 4rem;
    background: var(--bg);
    color: var(--text);
    font: 1.15rem/1.7 var(--serif);
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease
}

.container {
    max-width: 920px;
    margin: auto
}

a {
    color: var(--blue);
    text-underline-offset: .16em
}

a:hover {
    color: var(--red)
}

a:focus-visible,
summary:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 4px
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 10;
    background: var(--surface);
    padding: .6rem 1rem;
    font: 600 .9rem var(--sans)
}

.skip-link:focus {
    top: 1rem
}

.journal-header {
    padding: 2rem 0 1.25rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 3rem
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem
}

.journal-title {
    margin: 0;
    color: var(--blue);
    font: bold 1.2rem/1.2 var(--serif);
    letter-spacing: .01em
}

.journal-title a {
    text-decoration: none;
    color: inherit
}

.site-controls {
    display: flex;
    align-items: center;
    gap: .5rem
}

.icon-button {
    min-height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: transparent;
    color: var(--text);
    font: 600 .75rem var(--sans)
}

.language-switch {
    display: flex;
    min-height: 2.35rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 3px;
    font: 600 .72rem var(--sans)
}

.language-switch a {
    display: grid;
    place-items: center;
    min-width: 2.4rem;
    padding: 0 .45rem;
    color: var(--muted);
    text-decoration: none
}

.language-switch a+a {
    border-left: 1px solid var(--line)
}

.language-switch a:hover,
.language-switch a.active {
    background: var(--paper);
    color: var(--blue)
}

.icon-button {
    width: 2.35rem;
    padding: 0;
    cursor: pointer;
    font-size: 1rem
}

.icon-button:hover,
.language-switch:hover {
    border-color: var(--muted)
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.journal-nav {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-top: 1.1rem;
    font: 600 .8rem var(--sans)
}

.journal-nav a {
    position: relative;
    width: fit-content;
    color: var(--blue);
    text-decoration: none;
    padding-bottom: .25rem
}

.journal-nav a:hover,
.journal-nav .active {
    color: var(--red)
}

.journal-nav .active::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: var(--red)
}

.page-header {
    margin-bottom: 2rem
}

.page-header h1 {
    margin: 0;
    color: var(--blue);
    font-size: 2.5rem;
    line-height: 1.2
}

.page-header p {
    color: var(--muted)
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
    color: var(--blue);
    font: 700 .85rem var(--sans);
    letter-spacing: .12em;
    text-transform: uppercase
}

.section-title small {
    color: var(--muted);
    font-weight: 400
}

.more-link {
    color: var(--red);
    font-size: .72rem;
    letter-spacing: .05em;
    text-decoration: none
}

.bio-block {
    max-width: 760px;
    margin: 0 0 4rem;
    padding: 1rem 0 3rem
}

.bio-text h1 {
    margin: .2rem 0 .8rem;
    color: var(--blue);
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    line-height: 1.12
}

.bio-text p {
    max-width: 680px;
    margin: 0 0 1rem
}

.bio-kicker {
    color: var(--red);
    font: 700 .78rem var(--sans);
    letter-spacing: .08em;
    text-transform: uppercase
}

.bio-actions,
.taxonomy-list {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem
}

.taxonomy-tag {
    padding: .2rem .6rem;
    background: var(--tag);
    color: var(--blue);
    border-radius: 2px;
    font: 600 .72rem var(--sans)
}

.bio-actions {
    margin-top: 1.5rem
}

.bio-actions a {
    padding: .55rem .85rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    font: 600 .78rem var(--sans);
    text-decoration: none
}


.bio-actions a:hover {
    border-color: var(--red);
    color: var(--red)
}

.home-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem
}

.home-contact-label {
    color: var(--muted);
    font: 600 .8rem var(--sans)
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem
}

.article-card {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line)
}

.article-card-header {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    color: var(--muted);
    font: .72rem var(--sans)
}

.article-card-title {
    margin: .4rem 0;
    font-size: 1.55rem;
    line-height: 1.3
}

.article-card-title a,
.project-card-title a {
    text-decoration: none
}

.article-card-excerpt {
    margin: .5rem 0
}

.card-tags {
    color: var(--muted);
    font: .72rem var(--mono);
    text-transform: uppercase
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--paper);
    border: 1px solid var(--line)
}

.project-card-title {
    margin: .3rem 0 .6rem;
    color: var(--blue);
    font-size: 1.35rem;
    line-height: 1.3
}

.project-card-desc {
    margin: 0 0 1rem
}

.card-tags {
    margin: 0 0 .75rem
}

.project-links,
.article-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font: 600 .8rem var(--sans)
}

.article-meta-header {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    text-align: left
}

.article-meta-header .taxonomy-list {
    justify-content: flex-start;
    margin: 1rem 0 .8rem
}

.article-title {
    margin: 0;
    color: var(--blue);
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    line-height: 1.12
}

.article-meta {
    margin: 0;
    color: var(--muted);
    font: .8rem var(--sans);
    letter-spacing: .03em
}

.abstract-box {
    margin: 2rem 0 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid var(--line);
    text-align: left
}

.abstract-title {
    margin: 0 0 .5rem;
    color: var(--blue);
    font: 700 .78rem var(--sans);
    letter-spacing: .1em;
    text-transform: uppercase
}

.abstract-box p {
    margin: 0
}

.article-links {
    justify-content: flex-start
}

.article-body {
    max-width: 760px;
    margin: auto;
    overflow-wrap: anywhere
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    color: var(--blue);
    line-height: 1.25;
    margin: 1.8em 0 .55em
}

.article-body h2 {
    font-size: 1.7rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: .2rem
}

.article-body h3 {
    font-size: 1.35rem
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body pre,
.article-body table,
.article-body blockquote,
.article-body figure {
    margin: 0 0 1.2rem
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem
}

.article-body li+li {
    margin-top: .25rem
}

.article-body blockquote {
    padding: .6rem 1.2rem;
    border-left: 4px solid var(--red);
    color: var(--muted);
    font-style: italic
}

.article-body code {
    font: 85% var(--mono);
    background: var(--code-inline);
    padding: .1em .3em;
    border-radius: 2px
}

.article-body pre {
    max-width: 100%;
    overflow: auto;
    padding: 1rem;
    background: var(--code-block);
    color: var(--code-text);
    border-radius: 2px;
    font: .82rem/1.55 var(--mono);
    tab-size: 2
}

.article-body pre code {
    padding: 0;
    background: none;
    color: inherit
}

.article-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse
}

.article-body th,
.article-body td {
    padding: .5rem;
    border: 1px solid var(--line);
    text-align: left
}

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

.article-body figure figcaption {
    text-align: center;
    color: var(--muted);
    font: .75rem var(--sans)
}

.cv-section {
    margin-bottom: 3rem
}

.cv-section>h2 {
    padding-bottom: .35rem;
    border-bottom: 2px solid var(--blue);
    color: var(--blue);
    font: 700 .9rem var(--sans);
    letter-spacing: .1em;
    text-transform: uppercase
}

.cv-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
    margin: 1.7rem 0
}

.cv-date {
    padding-top: .25rem;
    color: var(--muted);
    font: .75rem var(--mono);
    text-transform: uppercase
}

.cv-details h3 {
    margin: 0;
    color: var(--blue);
    font-size: 1.3rem;
    line-height: 1.3
}

.cv-institution {
    margin: .2rem 0 .7rem;
    color: var(--red);
    font: 600 .88rem var(--sans)
}

.cv-description {
    font-size: 1.02rem
}

.cv-description h3 {
    font-size: 1.2rem
}

.contact-block {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line)
}

.contact-block h2 {
    margin: 0;
    color: var(--blue);
    font-size: 1.4rem
}

.contact-block p {
    margin: .35rem 0 .8rem
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font: 600 .8rem var(--sans)
}

.search-page {
    max-width: 760px
}

.search-form label {
    display: block;
    margin-bottom: .4rem;
    font: 600 .8rem var(--sans)
}

.search-form input {
    width: 100%;
    min-height: 3rem;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
    font: 1rem var(--sans)
}

.search-status {
    min-height: 1.5rem;
    color: var(--muted);
    font: .78rem var(--sans)
}

.search-results {
    margin-top: 2rem
}

.search-result {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--line)
}

.search-result-type {
    color: var(--red);
    font: 700 .68rem var(--sans);
    letter-spacing: .08em;
    text-transform: uppercase
}

.search-result h2 {
    margin: .25rem 0;
    font-size: 1.4rem;
    line-height: 1.3
}

.search-result h2 a {
    text-decoration: none
}

.search-result p {
    margin: 0
}

.journal-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 3px double var(--text);
    color: var(--muted);
    font: .78rem var(--sans)
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: .5rem
}

.footer-contact a {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted)
}

.footer-contact a:hover {
    border-color: var(--red);
    color: var(--red)
}

.footer-contact svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor
}

.footer-contact a:first-child svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8
}

@media(max-width:900px) {
    body {
        padding-right: 1.25rem;
        padding-left: 1.25rem
    }

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

@media(max-width:680px) {
    body {
        padding: 0 1rem 2rem
    }

    .journal-header {
        padding-top: 1.3rem;
        margin-bottom: 2rem
    }

    .header-row {
        align-items: center
    }

    .journal-title {
        font-size: 1rem
    }

    .journal-nav {
        gap: .35rem 1.1rem
    }

    .journal-nav a {
        padding: .3rem 0
    }

    .bio-block {
        margin-bottom: 3rem;
        padding-top: .5rem
    }

    .bio-actions {
        align-items: stretch;
        flex-direction: column
    }

    .bio-actions a {
        text-align: center
    }

    .article-card-header {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .25rem
    }

    .cv-item {
        grid-template-columns: 1fr;
        gap: .35rem
    }

    .article-title {
        font-size: 2.1rem
    }

    .project-grid {
        grid-template-columns: 1fr
    }

    .journal-footer {
        flex-direction: column
    }
}

@media(max-width:420px) {
    .header-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem
    }

    .journal-title {
        font-size: 1.9rem
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
        gap: .35rem
    }
}

@media print {
    body {
        padding: 0;
        background: #fff;
        color: #000;
        font-size: 11pt
    }

    .skip-link,
    .journal-nav,
    .site-controls,
    .more-link {
        display: none
    }

    .journal-header {
        padding-top: 0
    }

    .journal-footer {
        margin-top: 2rem
    }

    .article-body pre {
        white-space: pre-wrap;
        color: #000;
        background: #eee
    }

    .project-card,
    .bio-block,
    .abstract-box {
        break-inside: avoid;
        background: #fff
    }
}
