@import url('https://fonts.googleapis.com/css2?family=CMU+Serif:wght@400;500;700&display=swap');

:root {
    --sunrise: #f3f3f3;
    --sunset: #e6e6e6;
    --accent: #111111;
    --muted: #5d5d5d;
    --ink: #101010;
    --cream: #f9f9f9;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 18px 38px rgba(0, 0, 0, 0.15);
    --radius: 20px;
}

html {
    height: 100%;
}

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

body {
    min-height: 100vh;
    font-family: 'CMU Serif', 'Times New Roman', serif;
    background: linear-gradient(180deg, var(--sunrise), var(--sunset));
    color: var(--ink);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 18px 12px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

a {
    color: inherit;
}

.container {
    width: min(700px, 100%);
    background: rgba(249, 249, 249, 0.9);
    border-radius: var(--radius);
    padding: 18px clamp(16px, 4vw, 26px) 18px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

header {
    margin-bottom: 28px;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-name {
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: baseline;
}

.name-block {
    letter-spacing: 0.18em;
}

.name-block::first-letter {
    font-size: 1.4em;
    color: var(--ink);
}

.nav {
    display: inline-flex;
    gap: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    position: relative;
    padding-bottom: 6px;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    transition: transform 0.3s ease, background 0.3s ease;
    transform: scaleX(0);
    transform-origin: left;
}

.nav-link.active,
.nav-link:hover {
    color: var(--umber);
}

.nav-link.active::after,
.nav-link:hover::after {
    background: var(--ink);
    transform: scaleX(1);
}

.scene {
    perspective: 1800px;
}

.card {
    border-radius: calc(var(--radius) + 2px);
    background: rgba(249, 249, 249, 0.92);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border);
    padding: 0;
}

.card-inner {
    position: relative;
    display: grid;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    min-height: 0;
}

.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    grid-area: 1 / 1 / 2 / 2;
    backface-visibility: hidden;
    border-radius: calc(var(--radius) + 2px);
    padding: clamp(22px, 4vw, 36px);
    background: rgba(249, 249, 249, 0.92);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card-face.card-front {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.card-back {
    transform: rotateY(180deg);
    background: rgba(245, 245, 245, 0.92);
}

.identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-picture {
    width: 185px;
    height: 185px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    filter: grayscale(100%);
}

.identity-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.identity-email {
    font-size: 0.95rem;
    color: var(--muted);
    text-align: center;
}

.identity-social {
    display: inline-flex;
    gap: 10px;
}

.identity-social a {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    background: #fff;
    transition: background 0.2s ease, color 0.2s ease;
}

.identity-social a:hover {
    background: var(--ink);
    color: #fff;
}

.intro-text {
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--muted);
    margin-bottom: 8px;
}

.bio-link {
    color: var(--ink);
    text-decoration: none;
}

.bio-link:hover {
    text-decoration: underline;
}

.back-header {
    text-align: center;
    margin-bottom: 8px;
}

.back-header h2 {
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0;
}

.publications-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 420px;
    padding-bottom: 28px;
    position: relative;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.publications-list::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(180deg, rgba(255, 245, 237, 0) 0%, rgba(255, 245, 237, 0.9) 100%);
    pointer-events: none;
}
.publications-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
    margin-top: 8px;
}

.publication-item {
    background: transparent;
    border-radius: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(74, 52, 41, 0.08);
    transition: padding 0.2s ease, background 0.2s ease;
    position: relative;
}

.publication-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    padding-left: 20px;
}

.publication-header::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.publication-item:hover .publication-header::before {
    transform: translateX(3px);
    opacity: 0.6;
}

.publication-title {
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ink);
}

.publication-year-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.publication-year {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    margin-left: auto;
}

.publication-icons {
    display: inline-flex;
    gap: 6px;
}

.publication-icon {
    color: var(--ink);
}

.publication-authors,
.publication-details {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

.publication-details {
    font-style: italic;
    color: var(--rose);
    font-size: 0.85rem;
}

.publication-item:hover .publication-authors,
.publication-item:hover .publication-details {
    max-height: 200px;
    opacity: 1;
}

.abstract-trigger {
    margin-top: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: transparent;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    display: none;
}

.abstract-trigger:hover {
    text-decoration: underline;
}

.publication-item:hover .abstract-trigger {
    display: inline-block;
}

.abstract-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.abstract-panel.visible {
    opacity: 1;
    pointer-events: auto;
}

.abstract-panel-card {
    width: min(520px, calc(100% - 48px));
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    padding: 24px 28px 26px;
    position: relative;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
}

.abstract-close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    margin-left: auto;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 6px;
    z-index: 2;
    background: #fff;
}

.abstract-panel-content h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.abstract-panel-content p {
    margin: 6px 0;
    color: var(--muted);
}

.abstract-authors {
    font-size: 0.9rem;
}

.abstract-venue {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink);
}

.abstract-label {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--ink);
}

.abstract-body {
    font-size: 0.9rem;
    line-height: 1.6;
}

.abstract-list {
    margin: 6px 0 6px 20px;
    color: var(--muted);
}

.publication-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

main {
    margin-top: 20px;
}

.section {
    border-radius: calc(var(--radius) - 6px);
    padding: clamp(20px, 3vw, 32px);
    background: var(--cream);
    border: 1px solid rgba(92, 64, 51, 0.08);
    box-shadow: 0 25px 45px rgba(44, 31, 22, 0.08);
}

.publications {
    background: rgba(255, 245, 237, 0.85);
    position: relative;
}

.publications-message {
    text-align: center;
    font-style: italic;
    color: var(--muted);
    margin-bottom: 18px;
}

@media (max-width: 700px) {
    .identity {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 600px) {
    body {
        padding: 20px 10px 24px;
    }

    .container {
        padding: 18px 14px 22px;
    }
}
