/* ============================================
   VITALI PETSIUK — PERSONAL ACADEMIC PAGE
   Sidebar layout, light minimal design
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Source Serif 4', Georgia, serif;

    --c-bg: #FAFAF7;
    --c-surface: #FFFFFF;
    --c-sidebar: #F3F1EC;
    --c-border: #E2DFD8;
    --c-text: #1A1A1A;
    --c-text-secondary: #6B6560;
    --c-accent: #C7522A;
    --c-accent-soft: #F5E6DF;
    --c-accent-dark: #9E3E1C;
    --c-tag-oral: #2A6BC7;
    --c-tag-oral-bg: #E0ECFA;
    --c-tag-award: #1A9B72;
    --c-tag-award-bg: #DFF5EE;

    --sidebar-w: 260px;
    --content-max: 760px;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    --radius: 8px;
    --radius-lg: 16px;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    color: var(--c-text);
    background-color: #E8E5DE;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(199, 82, 42, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(42, 107, 199, 0.04) 0%, transparent 50%);
    line-height: 1.7;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

a {
    color: var(--c-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--c-accent-dark);
}

img {
    display: block;
    max-width: 100%;
}

strong {
    font-weight: 600;
}

/* --- Mobile Header (hidden on desktop) --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 52px;
    padding: 0 var(--space-md);
    background: rgba(243, 241, 236, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--c-text);
    letter-spacing: -0.02em;
}

.nav__logo:hover {
    color: var(--c-accent);
}

.nav__toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
}

.nav__toggle span {
    display: block;
    height: 2px;
    background: var(--c-text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* --- Layout --- */
.layout {
    display: flex;
    width: 100%;
    max-width: 1080px;
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 8px 40px rgba(0, 0, 0, 0.10);
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--c-sidebar);
    border-right: 1px solid var(--c-border);
}

.sidebar__inner {
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-height: 100%;
}

.sidebar__photo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--c-surface);
    box-shadow: 0 0 0 1px var(--c-border);
    margin-bottom: var(--space-sm);
}

.sidebar__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar__location {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--c-text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
}

.sidebar__role {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--c-text-secondary);
    line-height: 1.4;
    margin-top: var(--space-sm);
}

.sidebar__org {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    line-height: 1.4;
}

.sidebar__social {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    margin: var(--space-sm) 0;
}

.sidebar__social a {
    color: var(--c-text-secondary);
    transition: color 0.2s, transform 0.2s;
    display: flex;
}

.sidebar__social a:hover {
    color: var(--c-accent);
    transform: translateY(-1px);
}

.sidebar__nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__nav ul a {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-text-secondary);
    display: block;
    padding: 0.35rem 0.625rem;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

.sidebar__nav ul a:hover,
.sidebar__nav ul a.active {
    color: var(--c-text);
    background: var(--c-border);
}


/* --- Main Content --- */
.main {
    flex: 1;
    min-width: 0;
    background: var(--c-bg);
}

/* --- Sections --- */
.section {
    display: none;
    padding: var(--space-xl) var(--space-xl);
    max-width: var(--content-max);
    animation: fadeSlideIn 0.25s ease;
}

.section--active {
    display: block;
}

.section__title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
    margin-bottom: var(--space-lg);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section__title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.section__title-link {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--c-text-secondary);
    letter-spacing: 0.01em;
    text-transform: none;
    border-bottom: 1px dashed var(--c-border);
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.section__title-link:hover {
    color: var(--c-accent);
    border-color: var(--c-accent);
}

.section__subtitle {
    color: var(--c-text-secondary);
    font-size: 1rem;
    margin-top: calc(-1 * var(--space-md));
    margin-bottom: var(--space-lg);
}

/* --- About --- */
.subsection__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.about__bio p {
    font-size: 1.0625rem;
    margin-bottom: var(--space-md);
}

.about__bio p:last-child {
    margin-bottom: 0;
}


/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--c-border);
}

.timeline__item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__item--hidden {
    display: none;
}

.timeline__item--hidden.visible {
    display: block;
    animation: fadeSlideIn 0.4s ease forwards;
}

.timeline__marker {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--c-accent);
    background: var(--c-bg);
}

.timeline__item--current .timeline__marker {
    background: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.timeline__present {
    font-weight: 600;
    color: var(--c-accent);
}

.timeline__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
}

.timeline__role {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.timeline__company {
    font-size: 0.875rem;
    color: var(--c-text-secondary);
    margin-top: 1px;
}

.timeline__date {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--c-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 3px;
}

.timeline__desc {
    font-size: 0.9375rem;
    color: var(--c-text-secondary);
    margin-top: var(--space-sm);
}

/* --- Publications --- */
.pub-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.pub {
    display: grid;
    grid-template-columns: 152px 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
    align-items: center;
}

.pub__sticker {
    position: absolute;
    top: 12px;
    right: -22px;
    width: 90px;
    background: var(--c-tag-oral);
    color: white;
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 4px 0;
    transform: rotate(45deg);
    transform-origin: center;
    pointer-events: none;
}

.pub:hover {
    border-color: var(--c-accent);
    box-shadow: var(--shadow-md);
}

.pub--hidden {
    display: none;
}

.pub--hidden.visible {
    display: grid;
    animation: fadeSlideIn 0.4s ease forwards;
}

.pub__thumb {
    width: 152px;
    height: 114px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.pub__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pub__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.pub__tag--award {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-tag-award);
    background: var(--c-tag-award-bg);
    margin-left: var(--space-sm);
    vertical-align: middle;
}

.pub__title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--c-text);
}

.pub__title a {
    color: inherit;
    transition: color 0.2s;
}

.pub__title a:hover {
    color: var(--c-accent);
}

.pub__authors {
    font-size: 0.8125rem;
    color: var(--c-text-secondary);
    line-height: 1.5;
}

.pub__me {
    color: var(--c-text);
    font-weight: 600;
}

.pub__venue {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-accent);
    letter-spacing: 0.01em;
}

.pub__venue-links {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 4px;
}

.pub__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-secondary);
    padding: 3px 5px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.pub__link:hover {
    color: var(--c-accent);
    background: var(--c-accent-soft);
}

.pub__link:active {
    background: #ebd0c5;
}

.pub__link img {
    filter: grayscale(1) brightness(0.5);
    transition: filter 0.2s;
}

.pub__link:hover img {
    filter: sepia(1) saturate(4) hue-rotate(-20deg) brightness(0.8);
}

/* --- Side Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
}

.project-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--c-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card__icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-accent-soft);
    border-radius: var(--radius);
}

.project-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.project-card__desc {
    font-size: 0.875rem;
    color: var(--c-text-secondary);
    flex-grow: 1;
    margin-bottom: var(--space-sm);
}

.project-card__tech {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.project-card__tech span {
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--c-sidebar);
    border-radius: 100px;
    color: var(--c-text-secondary);
}

.project-card__links {
    display: flex;
    gap: var(--space-md);
}

.project-card__links a {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* --- Show More Button --- */
.show-more {
    display: inline-block;
    margin-top: var(--space-md);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-accent);
    background: none;
    border: 1.5px solid var(--c-accent);
    border-radius: 100px;
    padding: 0.4rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.show-more:hover,
.show-more--active {
    background: var(--c-accent);
    color: white;
}

/* --- Footer --- */
.footer {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--c-border);
}

.footer p {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--c-text-secondary);
    text-align: center;
}

/* --- Animations --- */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .layout {
        display: block;
        max-width: 100%;
        box-shadow: none;
    }

    .sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: var(--sidebar-w);
        height: auto;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        padding-top: 52px;
    }

    .section {
        padding: var(--space-lg) var(--space-md);
        max-width: 100%;
    }

    .pub {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .pub__thumb {
        width: 100%;
        height: 160px;
    }

    .pub__body {
        padding-right: 0;
    }

    .timeline__header {
        flex-direction: column;
        gap: 2px;
    }

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