/* Refined homepage layout and visual system. */

html {
    scroll-behavior: smooth;
}

body {
    color: #35434e;
    font-family: Georgia, 'Times New Roman', serif;
}

.container {
    max-width: 54rem;
}

h1 {
    color: #0876c9;
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h2 {
    color: #293640;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.012em;
}

a {
    color: #0969b2;
}

.site-header {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    align-items: start;
    gap: 2.25rem;
    margin-bottom: 1.7rem;
}

.site-identity .subtitle {
    color: #69747e;
}

.site-header .profile-links {
    justify-content: flex-start;
    justify-items: start;
    margin-top: 0.95rem;
    font-size: 0.84rem;
}

.site-header .profile-links a {
    display: grid;
    grid-template-columns: 1.15rem minmax(0, auto);
    align-items: baseline;
    column-gap: 0.3rem;
}

.site-header .profile-links a,
.selected-code a,
.publications ol li a {
    color: #39749f;
}

.site-header .profile-links i {
    width: 1.15rem;
    color: #5c7f92;
    text-align: center;
}

.section-nav {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 0.7rem;
    padding: 0.62rem 0;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.012em;
}

.section-nav a {
    color: #536673;
    text-decoration: none;
}

.section-nav-links {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.section-nav a:hover {
    color: #0876c9;
    text-decoration: none;
}

.section-nav a[aria-current] {
    color: #0876c9;
}

.site-header,
.research-focus,
.selected-contributions,
.publications {
    scroll-margin-top: 4rem;
}

.header-copy {
    display: grid;
    gap: 0.78rem;
}

.compact-bio,
.research-intro {
    max-width: none;
    margin: 0;
    color: #3f4d58;
    font-size: 0.96rem;
    line-height: 1.62;
}

.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;
}

.research-lead {
    margin: 0 0 0.55rem;
    color: #4d5c67;
    font-size: 0.94rem;
    line-height: 1.5;
}

.research-map {
    gap: 0.9rem;
}

.research-line {
    grid-template-columns: 4.9rem minmax(0, 1fr);
    column-gap: 0.9rem;
    min-height: 7.65rem;
    padding: 0.95rem 0.3rem;
    border: 0;
    border-top: 1px solid #d9e1e6;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.research-icon {
    width: 4.9rem;
    height: 4.2rem;
}

.research-icon img {
    filter: saturate(1.08) contrast(1.04);
}

.research-icon img[src$=".svg"] {
    filter: saturate(0.96) contrast(1.03);
}

.research-line h3 {
    margin-bottom: 0.34rem;
    font-weight: 600;
}

.research-line p {
    color: #485b68;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.48;
}

.selected-contributions {
    margin-top: 2.4rem;
}

.contribution-list {
    gap: 0.85rem;
}

.contribution-list li {
    min-height: 9.7rem;
    justify-content: flex-start;
    gap: 0.48rem;
    padding: 1rem 1.1rem;
}

.selected-title {
    color: #293640;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 600;
}

.selected-methods {
    color: #566672;
    font-size: 0.76rem;
}

.selected-papers {
    margin-top: auto;
    color: #5c6974;
    font-size: 0.86rem;
}

.selected-code {
    color: #77848d;
    font-size: 0.72rem;
}

.selected-code a {
    font-size: 0.78rem;
}

.publications ol li {
    color: #56636f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.publications ol li > strong:first-child {
    color: #27343e;
    font-size: 0.93rem;
}

.publications ol li a {
    font-size: 0.86rem;
}

.writing-index {
    max-width: 42rem;
    margin: 3.25rem auto 0;
}

.writing-header {
    margin-bottom: 0;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #dfe5e8;
}

.writing-header h1 {
    margin: 0 0 0.55rem;
}

.writing-deck {
    max-width: 34rem;
    margin: 0;
    color: #4d5c67;
    font-size: 1rem;
    line-height: 1.6;
}

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

.writing-list li {
    margin: 0;
    padding: 1.25rem 0;
    border-bottom: 1px solid #e4e8eb;
}

.writing-list h2 {
    margin: 0.18rem 0 0.35rem;
    font-size: 1.2rem;
    line-height: 1.35;
}

.writing-meta {
    margin: 0;
    color: #77848d;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.writing-summary {
    margin: 0;
    color: #56636f;
    font-size: 0.9rem;
    line-height: 1.55;
}

:focus-visible {
    outline: 2px solid #0876c9;
    outline-offset: 3px;
}

@media (min-width: 72rem) {
    .section-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        right: auto;
        left: max(0rem, calc((100vw - 54rem) / 2 - 8rem));
        width: 7rem;
        box-sizing: border-box;
        align-items: flex-start;
        justify-content: flex-start;
        margin: 0;
        padding: 2rem 1rem 0 0;
        border-right: 1px solid #dfe5e8;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .section-nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }

    .section-nav a[aria-current] {
        text-decoration: underline;
        text-underline-offset: 0.16em;
    }
}

@media (max-width: 42rem) {
    h1 {
        font-size: 2.15rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .site-header {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        margin-bottom: 1.5rem;
    }

    .section-nav {
        gap: 1rem;
        margin-bottom: 0.6rem;
        padding: 0.52rem 0;
        font-size: 0.82rem;
    }

    .section-nav-links {
        gap: 1rem;
    }

    .research-line,
    .research-line:nth-child(odd),
    .research-line:nth-child(even) {
        grid-template-columns: 4.25rem minmax(0, 1fr);
        column-gap: 0.75rem;
        min-height: 0;
        padding: 0.9rem 0.15rem;
    }

    .research-icon {
        width: 4.25rem;
        height: 3.7rem;
    }

    .contribution-list li {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
