/* Personal portfolio refinements, loaded after the original template. */
:root {
    --portfolio-ink: #17283f;
    --portfolio-muted: #526174;
    --portfolio-blue: #245b9e;
    --portfolio-border: #dce3eb;
}

#wrapper h1, #wrapper h2, #wrapper h3 {
    font-family: inherit;
    letter-spacing: -0.025em;
    text-transform: none;
}

#wrapper a:focus-visible {
    outline: 3px solid #6199d8;
    outline-offset: 4px;
    border-radius: 3px;
}

#wrapper {
    width: min(88%, 1440px);
    padding-top: 2.5rem;
    background: transparent;
    color: var(--portfolio-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: clamp(16px, calc(13px + 0.4vw), 21px);
    font-weight: 400;
    line-height: 1.7;
}

#wrapper > .wrapper {
    margin-bottom: 2.75rem;
    scroll-margin-top: 5rem;
}

#wrapper .inner {
    width: 100%;
    padding: 0;
}

#wrapper .major {
    color: var(--portfolio-ink);
    font-size: 1.8em;
    font-weight: 700;
    border-bottom: 1px solid var(--portfolio-border);
    padding-bottom: 0.75rem;
    margin: 0 0 1.5rem;
}

#wrapper a {
    color: var(--portfolio-blue);
}

.adoption-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.5rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 2rem auto;
    padding: 0.85rem 1.2rem;
    background: #fff;
    border: 1px solid var(--portfolio-border);
    border-radius: 10px;
    box-shadow: 0 2px 8px #17283f06;
}

.adoption-caption {
    font-size: 0.85em;
    line-height: 1.5;
    margin: 0;
}

.adoption-caption strong {
    display: block;
    font-weight: 650;
}

.adoption-caption a {
    font-size: 0.9em;
    text-decoration: none;
}

.adoption-caption a:hover {
    text-decoration: underline;
}

.adoption-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.adoption-logos a {
    display: flex;
    align-items: center;
    border: 0;
    padding: 0.45rem 0;
}

.adoption-logos img {
    display: block;
    width: auto;
    height: 2rem;
    max-width: 160px;
    object-fit: contain;
}

.adoption-logos .aisi-logo {
    height: 2.35rem;
    max-width: 210px;
}

#intro p {
    font-size: 1em;
    text-indent: 0;
    margin: 0;
    max-width: 100%;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--portfolio-border);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
}

#wrapper .section-heading .major {
    border: 0;
    padding: 0;
    margin: 0;
}

.contribution-note {
    color: var(--portfolio-blue);
    background: #e8eff9;
    border: 1px solid #c9d8e9;
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 0.95em;
    font-weight: 600;
    margin: 0;
}

.contribution-symbol {
    font-size: 1.25em;
    font-weight: 800;
}

#pub .papers-list {
    display: grid;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

#pub .paper-card {
    display: block;
    padding: 1.25rem 1.5rem;
    margin: 0;
    background: #fff;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

#pub .paper-card:hover,
#pub .paper-card:focus-within {
    border-color: #a9bfd9;
    box-shadow: 0 4px 18px #17283f08;
}

#pub .paper-card:target,
#pub .paper-card.highlight {
    scroll-margin-top: 120px;
    border-color: #729bd0;
    animation: paper-highlight 4s ease-in-out;
}

@keyframes paper-highlight {
    0%, 60% {
        background-color: #e8eff9;
        box-shadow: 0 0 0 3px #245b9e20;
    }
    100% {
        background-color: #fff;
        box-shadow: 0 0 0 0 #245b9e00;
    }
}

#pub .paper-card h2 {
    color: var(--portfolio-ink);
    font-family: inherit;
    font-size: 1.2em;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.015em;
    text-transform: none;
    margin: 0 0 0.6rem;
}

#pub .paper-card a {
    text-decoration: none;
    border-bottom: 0;
}

#pub .paper-card a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#pub .paper-card a:hover h2 {
    color: var(--portfolio-blue);
}

#pub .paper-authors {
    color: var(--portfolio-muted);
    font-size: 1em;
    font-style: normal;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#pub .paper-authors b {
    color: var(--portfolio-ink);
    font-weight: 700;
}

#pub .paper-authors sup {
    color: var(--portfolio-blue);
    font-size: 0.95em;
    font-weight: 800;
    top: -0.25em;
    padding: 0 0.08em;
}

#pub .paper-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #edf0f5;
}

#pub .paper-meta,
#pub .paper-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    font-size: 0.85em;
    line-height: 1.5;
}

#pub .paper-meta {
    flex: 1 1 22rem;
}

#pub .paper-actions {
    flex: 0 1 auto;
}

.paper-status {
    display: inline-block;
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
    font-size: 0.88em;
    font-weight: 650;
    white-space: nowrap;
}

.paper-status.published,
.paper-status.accepted {
    color: #226044;
    background: #eaf5ee;
}

.paper-status.review,
.paper-status.submitted {
    color: #87581b;
    background: #fbf2e3;
}

.paper-status.whitepaper,
.paper-status.preparation {
    color: #526174;
    background: #edf1f5;
}

.paper-note {
    color: var(--portfolio-muted);
}

#pub .paper-actions a {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    min-height: 2rem;
    border: 1px solid var(--portfolio-border);
    border-radius: 6px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#pub .paper-actions a:hover {
    background: #f0f5fc;
    border-color: #a9bfd9;
    text-decoration: none;
}

.paper-repository {
    font-size: 0.94em;
    font-weight: 400;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.skill-group {
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--portfolio-border);
    border-radius: 10px;
}

#skills .skill-group h2 {
    font-family: inherit;
    font-size: 1em;
    text-decoration: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

#skills .skill-group p {
    color: var(--portfolio-muted);
    font-size: 0.95em;
    font-style: normal;
    padding: 0;
    margin: 0;
}

#research .experience {
    border-left: 2px solid #c9d8e9;
    padding: 0 0 0 1.5rem;
    margin: 0 0 2rem;
}

#research .experience-header {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.35rem;
}

#research .university {
    font-size: 1em;
}

#research .dates {
    color: var(--portfolio-muted);
    font-size: 0.85em;
    font-style: normal;
    white-space: nowrap;
}

#research .supervision {
    color: var(--portfolio-muted);
    font-size: 0.95em;
    font-style: normal;
    margin-bottom: 0.75rem;
}

#research .description {
    color: var(--portfolio-muted);
    padding: 0;
    text-align: left;
}

#research ul {
    margin-left: 0;
    padding-left: 1.25rem;
}

@media (max-width: 640px) {
    #wrapper {
        width: calc(100% - 2rem);
        padding-top: 2rem;
    }

    #wrapper > .wrapper {
        margin-bottom: 2.5rem;
    }

    .adoption-strip {
        width: 100%;
        margin-bottom: 1.75rem;
        padding: 0.8rem 1rem;
    }

    .adoption-logos {
        gap: 1.25rem;
    }

    .adoption-logos img {
        height: 1.65rem;
        max-width: 130px;
    }

    .adoption-logos .aisi-logo {
        height: 2rem;
        max-width: 130px;
    }

    #pub .paper-card {
        padding: 1.1rem;
    }

    #pub .paper-card h2 {
        font-size: 1.125em;
    }

    #pub .paper-authors {
        font-size: 0.9375em;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    #research .experience {
        padding-left: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wrapper, #pub .paper-card {
        transition: none;
    }

    body.is-preload #wrapper {
        opacity: 1;
        transform: none;
    }

    #wrapper :target, #wrapper .highlight {
        animation: none;
    }

    #pub .paper-card:target,
    #pub .paper-card.highlight {
        animation: none;
        background-color: #e8eff9;
    }
}
