* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5d4037;
    --secondary-color: #8d6e63;
    --accent-color: #6d4c41;
    --light-color: #efebe9;
    --background-light: rgba(239, 235, 233, 0.95);
    --text-dark: #5d4037;
    --text-medium: #6d4c41;
    --shadow: rgba(93, 64, 55, 0.2);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: 
        linear-gradient(135deg, rgba(215, 204, 200, 0.85) 0%, rgba(188, 170, 164, 0.85) 100%),
        url('../img/coffee.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header Styles */
.top-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--secondary-color);
    flex-wrap: nowrap;
    gap: 10px;
}

.main-menu {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1;
    justify-content: flex-start;
}

.menu-button {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: var(--light-color);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: bold;
    border: none;
    font-size: 13px;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
    border: 1px solid #7a5c52;
}

.menu-button:hover, .menu-button.current {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow);
}

.university-links {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    justify-content: flex-end;
}

.university-links a {
    color: var(--light-color);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--secondary-color);
    border: 1px solid #7a5c52;
    transition: all 0.3s;
    font-weight: bold;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.university-links a:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}


/* Main Header */
.header {
    background: var(--background-light);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px var(--shadow);
    border: 1px solid #bcaaa4;
    border-radius: 8px;
}

.header-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.photo-container {
    flex-shrink: 0;
}

.photo-frame {
    padding: 5px;
    background: linear-gradient(135deg, var(--secondary-color), #a1887f);
    box-shadow: 0 4px 10px var(--shadow);
    border-radius: 6px;
}

.profile-photo {
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    display: block;
    filter: sepia(0.3);
    border-radius: 4px;
    width: 180px;
    height: 240px;
    object-fit: cover;
}

.profile-photo:hover {
    transform: scale(1.02);
    filter: sepia(0.1);
    box-shadow: 0 4px 15px rgba(93, 64, 55, 0.4);
}

.header-text {
    flex: 1;
}

.header-text h1 {
    color: var(--primary-color);
    font-size: 2.4em;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    line-height: 1.3;
}



/* Простое круглое видео */
.simple-video-block {
    background: var(--background-light);
    padding: 25px;
    margin: 0 0 30px 0;
    box-shadow: 0 4px 15px var(--shadow);
    border: 1px solid #bcaaa4;
    border-radius: 8px;
    text-align: center;
}

.simple-video-block h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: bold;
}

.circle-video-container {
    display: inline-block;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.2);
}

.circle-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Адаптация для планшетов */
@media (max-width: 768px) {
    .simple-video-block {
        padding: 20px;
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .circle-video-container {
        width: 250px;
        height: 250px;
    }
    
    .simple-video-block h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 480px) {
    .simple-video-block {
        padding: 15px;
        margin-left: -3px;
        margin-right: -3px;
        width: calc(100% + 6px);
    }
    
    .circle-video-container {
        width: 200px;
        height: 200px;
    }
    
    .simple-video-block h2 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
}

.faculty-info {
    margin-bottom: 25px;
}

.faculty-info h3 {
    color: var(--text-medium);
    margin: 12px 0;
    font-weight: normal;
    font-size: 1.1em;
    line-height: 1.5;
}

.faculty-info a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: bold;
}

.faculty-info a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.thesis-info {
    padding: 20px;
    background: rgba(121, 85, 72, 0.08);
    border: 1px solid #d7ccc8;
    border-radius: 6px;
    margin-top: 20px;
}

.thesis-info h2 {
    color: var(--primary-color);
    font-size: 1.2em;
    margin: 0 0 12px 0;
    font-weight: bold;
    line-height: 1.4;
}

.thesis-info h3 {
    color: var(--accent-color);
    margin: 0;
    font-weight: normal;
    font-size: 1.1em;
    line-height: 1.4;
    font-style: italic;
}


/* Main Content */
.main-content {
    background: var(--background-light);
    padding: 30px 25px;
    box-shadow: 0 4px 15px var(--shadow);
    border: 1px solid #bcaaa4;
    border-radius: 8px;
    margin-bottom: 20px;
}

.main-content h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    font-size: clamp(1.6em, 4vw, 2.2em);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Resume Content */
.resume-content {
    background: rgba(250, 244, 240, 0.8);
    border: 1px solid #d7ccc8;
    border-radius: 6px;
    overflow: hidden;
}

.resume-item {
    display: grid;
    grid-template-columns: minmax(200px, 250px) 1fr;
    gap: 20px;
    padding: 18px 20px;
    align-items: flex-start;
}

.resume-label {
    font-weight: bold;
    color: var(--primary-color);
    font-size: clamp(1em, 2.5vw, 1.1em);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
    line-height: 1.4;
}

.resume-value {
    color: var(--text-medium);
    line-height: 1.7;
    font-size: clamp(0.9em, 2.5vw, 1em);
}

.resume-value a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: bold;
    word-break: break-all;
}

.resume-value a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.resume-value strong {
    color: var(--primary-color);
    font-weight: bold;
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    margin: 0 20px;
}

/* Footer */
.footer-menu {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 25px;
    padding: 15px;
    background: rgba(121, 85, 72, 0.9);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    flex-wrap: nowrap;
}

.footer-item {
    padding: 8px 16px;
    color: var(--light-color);
    text-decoration: none;
    transition: all 0.3s;
    background: var(--secondary-color);
    border: 1px solid #7a5c52;
    font-size: 13px;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
}

.footer-item:hover, .footer-item.current {
    background: var(--primary-color);
    transform: translateY(-1px);
}

/* Стили для списков в резюме */
.resume-value ul {
    list-style-type: none;
    padding-left: 0;
}

.resume-value li {
    margin: 5px 0;
    padding-left: 15px;
    position: relative;
}

.resume-value li:before {
    content: "•";
    color: var(--secondary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Адаптация для планшетов */
@media (max-width: 1024px) {

    .menu-button,
    .university-links a,
    .footer-item {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    .container {
        padding: 12px;
    }
    
    .header-container {
        gap: 25px;
    }
    
    .resume-item {
        grid-template-columns: 200px 1fr;
        gap: 15px;
        padding: 15px 18px;
    }
    
    .main-content {
        padding: 25px 20px;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        overflow-x: hidden; /* Предотвращаем горизонтальный скролл контейнера */
    }
    
    .top-block {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .main-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .menu-button {
        flex: 1;
        min-width: calc(50% - 10px);
        font-size: 12px;
        padding: 8px 10px;
        text-align: center;
    }

    .university-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    .university-links a {
        flex: 1;
        min-width: calc(50% - 10px);
        font-size: 12px;
        padding: 8px 10px;
        text-align: center;
    }
    
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .header {
        padding: 20px 15px;
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .photo-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .photo-frame {
        max-width: 180px;
    }
    
    .profile-photo {
        width: 100%;
        height: auto;
    }
    
    .header-text {
        min-width: auto;
        width: 100%;
    }
    
    .resume-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px;
    }
    
    .resume-label {
        border-bottom: 1px dashed var(--secondary-color);
        padding-bottom: 5px;
        margin-bottom: 5px;
    }
    
    .divider {
        margin: 0 15px;
    }
    
    .main-content {
        padding: 20px 15px;
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .footer-menu {
        flex-wrap: wrap;
        gap: 5px;
        padding: 12px 10px;
        justify-content: center;
        overflow-x: visible;
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .footer-item {
        flex: 1;
        min-width: calc(50% - 10px);
        font-size: 12px;
        padding: 8px 10px;
        text-align: center;
    }
}

/* Адаптация для маленьких мобильных устройств */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        overflow-x: hidden;
    }
    
    .menu-button,
    .university-links a,
    .footer-item {
        padding: 8px 8px;
        font-size: 11px;
        min-width: calc(50% - 8px);
    }
    
    .top-block {
        gap: 8px;
    }
    
    .header {
        padding: 15px 12px;
        margin-bottom: 20px;
        margin-left: -3px;
        margin-right: -3px;
        width: calc(100% + 6px);
    }
    
    .header-text h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }
    
    .faculty-info,
    .thesis-info {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .main-content {
        padding: 18px 12px;
        margin-left: -3px;
        margin-right: -3px;
        width: calc(100% + 6px);
    }
    
    .main-content h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .resume-item {
        padding: 12px;
    }
    
    .resume-label {
        font-size: 1em;
    }
    
    .resume-value {
        font-size: 0.9em;
    }
    
    .footer-menu {
        margin-top: 20px;
        margin-left: -3px;
        margin-right: -3px;
        width: calc(100% + 6px);
    }
    
    /* Улучшение читаемости на маленьких экранах */
    body {
        font-size: 14px;
        line-height: 1.5;
        overflow-x: hidden; /* Запрещаем горизонтальный скролл для body */
    }
    
    .resume-value br {
        display: none;
    }
    
    .resume-value {
        word-wrap: break-word;
    }
}

/* Дополнительные исправления для очень маленьких экранов */
@media (max-width: 360px) {
    .menu-button,
    .university-links a,
    .footer-item {
        min-width: 100%; /* На очень маленьких экранах делаем кнопки во всю ширину */
        font-size: 11px;
        padding: 7px 5px;
    }
    
    .main-menu,
    .university-links,
    .footer-menu {
        gap: 4px;
    }
}

/* Исправление для горизонтальной ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .menu-button,
    .university-links a,
    .footer-item {
        min-width: calc(33.333% - 10px); /* В ландшафте размещаем по 3 в ряд */
        font-size: 11px;
    }
}