/* Общие стили */
:root {
    --logo-url: url('pics/@Pakenrolcom Logo.webp');
    --logo-size: 80px;
    --logo-size-mobile: 60px;
    --logo-size-footer: 40px;
    
    /* Размеры картинок проектов */
    --project-image-size-desktop: clamp(150px, 25vw, 250px);
    --project-image-size-mobile: 120px;
    --project-image-size-small: 200px;
    
    /* Отступы для картинок проектов */
    --project-image-margin-desktop: clamp(8px, 1.2vw, 10px);
    --project-image-margin-large: 10px;
    --project-image-margin-4k: 9px;
    --project-image-margin-tablet: 8px;
    --project-image-margin-mobile: 6px;
    
    /* Цветовая схема - светлая тема */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-toolbar: #ffffff;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --text-heading: #000;
    --text-footer: #888;
    --border-light: #eee;
    --border-medium: #e9ecef;
    --button-bg: #000000;
    --button-text: #ffffff;
    --button-hover: #222222;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --card-bg: #f8f9fa;
    --card-border: #e9ecef;
}

    /* Темная тема */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-toolbar: #21262d;
        --text-primary: #e6edf3;
        --text-secondary: #7d8590;
        --text-muted: #8b949e;
        --text-heading: #f0f6fc;
        --text-footer: #7d8590;
        --border-light: #30363d;
        --border-medium: #21262d;
        --button-bg: #f0f6fc;
        --button-text: #0d1117;
        --button-hover: #e6edf3;
        --glass-bg: rgba(240, 246, 252, 0.15);
        --glass-shadow: rgba(0, 0, 0, 0.4);
        --card-bg: #161b22;
        --card-border: #30363d;
    }
    
    /* Улучшенные стеклянные эффекты для темной темы */
    .project-title, .achievement-title {
        background: rgba(13, 17, 23, 0.75);
        border: 1px solid rgba(48, 54, 61, 0.6);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.8),
            inset 0 1px 0 rgba(240, 246, 252, 0.08),
            inset 0 -1px 0 rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(48, 54, 61, 0.3);
        text-shadow: 
            0 1px 2px rgba(0, 0, 0, 1),
            0 2px 4px rgba(0, 0, 0, 0.8) !important;
        color: #e6edf3 !important;
    }
    
    .project-title::before, .achievement-title::before {
        background: linear-gradient(45deg, 
            rgba(13, 17, 23, 0.3),
            rgba(48, 54, 61, 0.5),
            rgba(13, 17, 23, 0.3));
        opacity: 0.7;
    }
    
    .project-card:hover .project-title, .achievement-item:hover .achievement-title,
    .project-card.mobile-active .project-title, .achievement-item.mobile-active .achievement-title {
        background: rgba(21, 26, 33, 0.85);
        border-color: rgba(48, 54, 61, 0.8);
        box-shadow: 
            0 16px 48px rgba(0, 0, 0, 0.9),
            inset 0 1px 0 rgba(240, 246, 252, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(48, 54, 61, 0.5);
        text-shadow: 
            0 1px 2px rgba(0, 0, 0, 1),
            0 2px 4px rgba(0, 0, 0, 0.9) !important;
        color: #f0f6fc !important;
    }
    
    .project-card:hover .project-title::before, .achievement-item:hover .achievement-title::before,
    .project-card.mobile-active .project-title::before, .achievement-item.mobile-active .achievement-title::before {
        background: linear-gradient(45deg, 
            rgba(48, 54, 61, 0.4),
            rgba(64, 70, 77, 0.6),
            rgba(48, 54, 61, 0.4));
        opacity: 1;
    }
    
    /* Обновленные hover эффекты для карточек в темной теме */
    .project-card:hover, .achievement-item:hover,
    .project-card.mobile-active, .achievement-item.mobile-active {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    
    /* Более светлый текст для описания в темной теме */
    .banner h3 {
        color: #c9d1d9;
    }
}

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

/* Фон для всей страницы */
html {
    background-color: var(--bg-primary);
}

/* Темная тема для html */
@media (prefers-color-scheme: dark) {
    html {
        background-color: var(--bg-primary);
    }
}

html, body {
    background-color: var(--bg-primary);
    min-height: 100vh;
}

body {
    font-family: 'SF Pro Rounded', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--bg-primary);
}

/* Заголовки */
h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-heading);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 0.5rem 0;
    color: var(--text-heading);
}

h3 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 1.5rem 0 0.5rem 0;
    color: var(--text-secondary);
}

/* Параграфы */
p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Ссылки */
a {
    color: #0066cc;
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: #004499;
}

a strong {
    font-weight: 600;
}

/* Заголовок сайта */
.banner {
    margin-bottom: 2rem;
    text-align: center;
}

/* Логотип */
.logo-container {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    width: var(--logo-size);
    height: var(--logo-size);
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 4px 20px var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--glass-bg);
    padding: 8px;
}

.site-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--glass-shadow);
}

.banner h1 {
    margin-bottom: 0.5rem;
    font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 900;
}

.banner h3 {
    font-family: 'SF Pro Display Rounded', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
}

/* Вкладки */
.tab-container {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 742px;
    margin-left: auto;
    margin-right: auto;
}

.tab-content-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    height: 200px;
    position: relative;
    overflow: hidden;
    background-image: url('pics/howen-2EQ0Nmovq8g-unsplash.webp');
    background-size: 120% auto;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: scroll;
    transition: background-position 0.4s ease-out;
    
    /* Оптимизация рендеринга */
    will-change: background-position;
    transform: translateZ(0);
    contain: layout style paint;
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    
    /* Дополнительные оптимизации */
    content-visibility: auto;
    isolation: isolate;
    transform-style: preserve-3d;
}

/* Позиции фона для разных вкладок */
.tab-content-card.tab-models {
    background-position: 0% center;
}

.tab-content-card.tab-achievements {
    background-position: 50% center;
}

.tab-content-card.tab-skills {
    background-position: 100% center;
}

.tab-content-card.tab-experience {
    background-position: 60% center;
}

.tab-content-card.tab-contact {
    background-position: 90% center;
}

.tab-content {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tab-content.active {
    opacity: 1;
}

/* Убрали волны, теперь используем звездный фон */

/* Убрали анимацию мерцающих звезд */

.tab-content-text {
    position: relative;
    z-index: 10;
    padding: 1rem;
    text-align: center;
    
    /* Оптимизация рендеринга текста */
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
}

.tab-content-text h3 {
    font-size: 67px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

.tab-content-text p {
    color: #e0e0e0;
    font-size: 1.2rem;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 400;
    max-width: 350px;
}

/* Панель вкладок */
.tab-toolbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-toolbar);
    border-radius: 12px;
    padding: 8px;
    margin: 20px auto;
    width: 100%;
    max-width: 742px; /* Совпадает с tab-container */
    box-shadow: 0 2px 4px var(--glass-shadow);
    border: 1px solid var(--border-light);
}

.tab-button {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: min(16px, 4vw);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--button-text);
}

.tab-button:focus {
    outline: none;
}

/* Секция "О себе" */
.about {
    margin-bottom: 3rem;
}

.about h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Контакты */
.contacts {
    margin-top: 1.5rem;
}

.contacts p {
    margin-bottom: 0.5rem;
}

/* Футер */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

/* Логотип в футере */
.footer-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: var(--logo-size-footer);
    height: var(--logo-size-footer);
    object-fit: contain;
    border-radius: 50%;
    background: var(--glass-bg);
    padding: 4px;
    box-shadow: 0 2px 10px var(--glass-shadow);
    transition: transform 0.3s ease;
}

.footer-logo-img:hover {
    transform: scale(1.1);
}

footer p {
    color: var(--text-footer);
    font-size: 0.9rem;
    margin: 0;
    max-width: 742px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.footer-content {
    max-width: 742px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.footer-copyright {
    text-align: left;
    margin: 8px 0 0 0;
    color: var(--text-footer);
    font-size: 0.9rem;
    max-width: 742px;
    margin-left: 0;
    padding-left: 0;
}

/* Карточка с флагами */
.flags-card {
    width: 160px;
    min-height: 60px;
    background: rgba(0, 129, 252, 0.2);
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flags-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flags-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flags-left h3 {
    font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: 18px;
    line-height: 100%;
    color: #0081FC !important;
    margin: 0;
}

.flags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    justify-content: flex-start;
}

.flag-item {
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: inline-block;
    line-height: 1;
    color: #FFFFFF;
}

.flag-item:hover {
    transform: scale(1.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .flags-card {
        width: 160px;
        min-height: 50px;
        padding: 10px;
    }
    
    .flags-left h3 {
        font-size: 16px;
        color: #0081FC !important;
    }
    
    .flags-grid {
        gap: 3px;
    }
    
    .flag-item {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .flags-card {
        width: 160px;
        min-height: 45px;
        padding: 8px;
    }
    
    .flags-left h3 {
        font-size: 14px;
        color: #0081FC !important;
    }
    
    .flags-grid {
        gap: 2px;
    }
    
    .flag-item {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .flags-card {
        width: 160px;
        min-height: 40px;
        padding: 6px;
    }
    
    .flags-left h3 {
        font-size: 12px;
        color: #0081FC !important;
    }
    
    .flags-grid {
        gap: 1px;
    }
    
    .flag-item {
        font-size: 12px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    body {
        padding: 20px 10px;
    }
    
    /* Логотип на мобильных */
    .site-logo {
        width: var(--logo-size-mobile);
        height: var(--logo-size-mobile);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .tab-toolbar {
        width: 100%;
        padding: 6px;
    }
    
    .tab-button {
        padding: 10px 6px;
        font-size: min(14px, 3.5vw);
    }
    
    /* Футер на мобильных */
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .social-button-container {
        margin-top: 0;
    }
    
    .tab-button {
        min-width: 33.333%; /* Принудительная минимальная ширина */
    }
    
    /* Дополнительные стили для tab-slider на мобильных */
    .tab-slider {
        transition: all 0.15s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    .tab-content-card {
        background-size: cover;
        background-position: center center;
    }
    
    .tab-content-card.tab-models {
        background-position: left center;
    }
    
    .tab-content-card.tab-achievements {
        background-position: center center;
    }
    
    .tab-content-card.tab-skills {
        background-position: right center;
    }
    
    .tab-content-text {
        padding: 0.5rem;
    }
    
    .tab-content-text h3 {
        font-size: 34px;
    }
    
    .tab-content-text p {
        font-size: 1rem;
        max-width: 250px;
    }
}

/* Для средних экранов (планшеты) */
@media (max-width: 768px) {
    .tab-button {
        padding: 8px 4px;
        font-size: min(13px, 3.2vw);
    }
}

/* Для очень узких экранов */
@media (max-width: 400px) {
    .tab-content-card {
        height: 180px;
        background-size: cover;
    }
    
    .tab-content-text h3 {
        font-size: 28px;
    }
    
    .tab-content-text p {
        font-size: 0.9rem;
        max-width: 200px;
    }
    
    .tab-button {
        padding: 6px 2px;
        font-size: min(12px, 3vw);
        min-width: 0;
    }
}

/* Для экстремально узких экранов */
@media (max-width: 320px) {
    body {
        padding: 15px 8px;
    }
    
    .tab-content-card {
        height: 160px;
        background-size: cover;
        background-position: center center;
    }
    
    .tab-content-text h3 {
        font-size: 22px;
    }
    
    .tab-content-text p {
        font-size: 0.8rem;
        max-width: 180px;
    }
    
    .tab-button {
        padding: 4px 1px;
        font-size: min(10px, 2.8vw);
        min-width: 0;
    }
}

/* Социальная кнопка */
.social-button-container {
    margin-top: 0;
    display: flex;
    justify-content: flex-start;
}

.social-button-wrapper {
    position: relative;
    display: inline-block;
}

.social-main-button {
    min-width: 160px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.social-main-button:hover {
    background: var(--button-hover);
}

.social-main-button .link-icon {
    width: 16px;
    height: 16px;
}

.social-buttons-panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 40px;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    width: 0;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}

.social-button-wrapper:hover .social-buttons-panel {
    width: 160px;
}

.social-button-wrapper:hover .social-main-button {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.social-btn {
    width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
}

.social-btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.social-btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-right: none;
}

.social-btn:hover {
    background: var(--button-hover);
}

.social-btn.active {
    transform: scale(0.85);
}

.social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.social-btn.active::before {
    opacity: 1;
}

/* Анимация появления кнопок */
.social-button-wrapper:hover .social-btn:nth-child(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0ms;
}

.social-button-wrapper:hover .social-btn:nth-child(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 50ms;
}

/* Стили для секции с книгами */
.books-section {
    display: none;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.books-section.active {
    display: block;
}

.bookshelf-content {
    width: 100%;
    max-width: 742px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.books-timeline {
    position: relative;
    padding-left: 20px;
}

.books-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--text-heading);
}

.year-section {
    margin-bottom: 30px;
}

.year-section:last-child {
    margin-bottom: 0;
}

.year-title {
    font-family: 'SF Compact Rounded', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 900;
    font-size: 40px;
    color: var(--text-heading);
    margin: 0 0 12px 0;
    line-height: 1;
}

.books-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-item {
    font-family: 'SF Compact Rounded', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
    font-size: 35px;
    color: var(--text-primary);
    line-height: 1.2;
}

.empty-state {
    font-family: 'SF Compact Rounded', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 20px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* Адаптивные стили для секции с книгами */
@media (max-width: 600px) {
    .bookshelf-content {
        padding: 20px;
    }
    
    .books-timeline {
        padding-left: 15px;
    }
    
    .year-title {
        font-size: 28px;
    }
    
    .book-item {
        font-size: 24px;
    }
}

@media (max-width: 400px) {
    .bookshelf-content {
        padding: 15px;
    }
    
    .books-timeline {
        padding-left: 12px;
    }
    
    .year-title {
        font-size: 24px;
    }
    
    .book-item {
        font-size: 20px;
    }
}

/* Стили для секции с проектами */
.projects-section {
    display: none;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.projects-section.active {
    display: block;
}

.projects-content {
    padding: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 742px;
    margin: 0 auto;
}

/* Карточка проекта */
.project-card {
    width: 100%;
    min-height: 300px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: clamp(30px, 6vw, 50px);
    position: relative;
    display: grid;
    grid-template-columns: 1fr minmax(180px, 33%);
    grid-template-rows: auto 1fr auto;
    gap: clamp(15px, 2vw, 20px);
    padding: clamp(15px, 2.5vw, 20px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover,
.project-card.mobile-active {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Заголовок проекта с Liquid Glass эффектом */
.project-title {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: clamp(32px, 5vw, 48px);
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    z-index: 2;
    line-height: 1;
    margin: 0;
    align-self: start;
    
    /* Цвет текста */
    color: var(--text-secondary);
    
    /* Стеклянная подложка только под текстом */
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 20px);
    border-radius: clamp(12px, 2vw, 20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Стеклянный фон */
    background: rgba(255, 255, 255, 0.2);
    
    /* Стеклянная рамка */
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.25);
    
    /* Дополнительные эффекты */
    text-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.08);
    
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Псевдоэлементы для дополнительных стеклянных слоев */
.project-title::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1));
    border-radius: clamp(14px, 2.2vw, 22px);
    z-index: -1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Анимация при наведении */
.project-card:hover .project-title,
.project-card.mobile-active .project-title {
    transform: translateY(clamp(-2px, -0.4vw, -3px)) scale(1.015);
    box-shadow: 
        0 16px 48px rgba(31, 38, 135, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.4);
    
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
}

.project-card:hover .project-title::before,
.project-card.mobile-active .project-title::before {
    opacity: 1;
}

/* Бокс с описанием */
.project-description-box {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    width: 100%;
    height: auto;
    margin: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}

.project-description {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-heading);
    line-height: 1.25;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Обертка для картинки проекта */
.project-image-wrapper {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    padding-right: var(--project-image-margin-desktop);
    width: 100%;
    box-sizing: border-box;
}

/* Картинка проекта */
.project-image {
    width: 100%;
    /* Квадратное соотношение сторон для современных браузеров */
    aspect-ratio: 1 / 1;
    border-radius: clamp(25px, 5vw, 50px);
    object-fit: cover;
    object-position: center;
    background: var(--bg-primary);
    /* Fallback для браузеров без поддержки aspect-ratio */
    height: auto;
    display: block;
}

/* Для браузеров с поддержкой aspect-ratio убираем фиксированную высоту */
@supports (aspect-ratio: 1 / 1) {
    .project-image {
        height: auto;
    }
}

/* Обертка для кнопки проекта */
.project-button-wrapper {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    padding-right: var(--project-image-margin-desktop);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: end;
}

/* Кнопка проекта */
.project-button {
    width: 100%;
    height: clamp(45px, 8vw, 65px);
    background: var(--button-bg);
    border: none;
    border-radius: clamp(22px, 4vw, 32px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.project-button:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

.project-button-text {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: clamp(20px, 4vw, 32px);
    color: var(--button-text);
    margin: 0;
}

/* Пустой блок для сетки */
.project-spacer {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

/* Годы проекта */
.project-years {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: clamp(14px,3.5vw,18px);
    color: var(--text-secondary);
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    margin: 0;
    align-self: end;
}

/* Адаптивность для больших экранов */
@media (min-width: 1200px) {
    .project-card {
        grid-template-columns: 1fr 230px;
        gap: 20px;
        padding: 20px;
    }
    
    .project-image-wrapper {
        padding-right: var(--project-image-margin-large);
    }
    
    .project-button-wrapper {
        padding-right: var(--project-image-margin-large);
    }
    
    .project-title {
        font-size: 44px;
        padding: 12px 20px;
        border-radius: 16px;
    }
    
    .project-title::before {
        border-radius: 18px;
    }
    
    .project-description {
        font-size: 22px;
    }
    
    .project-button {
        height: 55px;
    }
    
    .project-button-text {
        font-size: 26px;
    }
}

/* Адаптивность для очень больших экранов */
@media (min-width: 1440px) {
    .project-card {
        grid-template-columns: 1fr 210px;
    }
    
    .project-title {
        font-size: 40px;
        padding: 11px 18px;
        border-radius: 15px;
    }
    
    .project-title::before {
        border-radius: 17px;
    }
    
    .project-description {
        font-size: 20px;
    }
    
    .project-button {
        height: 52px;
    }
    
    .project-button-text {
        font-size: 24px;
    }
}

/* Для экстремально больших экранов (4K и выше) */
@media (min-width: 1920px) {
    .project-card {
        grid-template-columns: 1fr 190px;
        gap: 18px;
        padding: 18px;
    }
    
    .project-image-wrapper {
        padding-right: var(--project-image-margin-4k);
    }
    
    .project-button-wrapper {
        padding-right: var(--project-image-margin-4k);
    }
    
    .project-title {
        font-size: 36px;
        padding: 10px 16px;
        border-radius: 14px;
    }
    
    .project-title::before {
        border-radius: 16px;
    }
    
    .project-description {
        font-size: 18px;
    }
    
    .project-button {
        height: 48px;
    }
    
    .project-button-text {
        font-size: 22px;
    }
}

/* Адаптивность для планшетов */
@media (max-width: 768px) {
    .project-card {
        grid-template-columns: 1fr 180px;
        gap: 15px;
        padding: 15px;
        min-height: clamp(200px, 40vw, 280px);
    }
    
    .project-image-wrapper {
        padding-right: var(--project-image-margin-tablet);
    }
    
    .project-button-wrapper {
        padding-right: var(--project-image-margin-tablet);
    }
    
    .project-spacer {
        display: none;
    }
    
    .project-title {
        font-size: clamp(32px, 6vw, 40px);
        padding: 10px 16px;
        border-radius: 14px;
    }
    
    .project-title::before {
        border-radius: 16px;
    }
    
    .project-description {
        font-size: clamp(18px, 3vw, 22px);
    }
    
    .project-button {
        height: 50px;
    }
    
    .project-button-text {
        font-size: 24px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .project-card {
        grid-template-columns: 1fr 110px;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 12px;
        border-radius: 30px;
        min-height: clamp(180px, 35vw, 220px);
    }
    
    .project-title {
        font-size: clamp(24px, 6vw, 30px);
        padding: 6px 12px;
        border-radius: 12px;
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .project-description-box {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        align-self: start;
    }

    .project-years {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        font-size: clamp(14px, 3.5vw, 16px);
        margin-top: 8px;
    }

    .project-image-wrapper {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        max-width: 110px;
        padding-right: var(--project-image-margin-mobile);
    }
    
    .project-button-wrapper {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        padding-right: var(--project-image-margin-mobile);
    }
    
    .project-spacer {
        display: none;
    }
    
    .project-description {
        font-size: clamp(15px, 3.8vw, 18px);
        line-height: 1.2;
    }
    
    .project-button {
        height: 45px;
        border-radius: 22px;
    }
    
    .project-button-text {
        font-size: clamp(18px, 4vw, 20px);
    }
}

/* Для очень маленьких экранов */
@media (max-width: 400px) {
    .project-card {
        grid-template-columns: 1fr 120px;
        grid-template-rows: auto 1fr auto;
        gap: 8px;
        padding: 12px;
        text-align: left;
    }

    .project-title {
        font-size: clamp(22px, 6vw, 28px);
        padding: 6px 10px;
        border-radius: 10px;
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        justify-self: start;
    }

    .project-image-wrapper {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        max-width: 120px;
        padding-right: var(--project-image-margin-mobile);
    }

    .project-button-wrapper {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        padding-right: var(--project-image-margin-mobile);
    }

    .project-description-box {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    .project-description {
        font-size: clamp(15px,4vw,17px);
    }
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для модального окна */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: auto;
    background: transparent;
    padding: 40px;
    z-index: 2;
    animation: modalSlideIn 0.3s ease;
    overflow: visible;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 24px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.modal-images {
    display: flex;
    gap: 20px;
    width: 100%;
    height: auto;
    overflow: visible;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-image {
    flex: 1;
    min-width: 0;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 50px;
    filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
    display: block;
}

.modal-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.5));
    z-index: 10;
    position: relative;
}

/* Для кнопки модального окна нужен курсор */
.project-modal-button {
    cursor: pointer;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .modal-images {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
    }
    
    .modal-images {
        flex-direction: row;
        gap: 6px;
        padding: 6px;
    }
    
    .modal-image {
        flex: 0 0 calc((100% - 12px) / 3);
        max-height: 70vh;
        border-radius: 20px;
    }
}

/* Блокировка скролла когда модалка открыта */
body.modal-open {
    overflow: hidden;
}

/* Achievements Section */
.achievements-section {
    display: none;
    margin-top: 20px;
    padding: 0;
}

.achievements-section.active {
    display: block;
}

.achievements-content {
    max-width: 742px;
    margin: 0 auto;
    padding: 0;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

.achievement-item {
    width: 100%;
    min-height: 200px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: clamp(30px, 6vw, 50px);
    position: relative;
    padding: clamp(15px, 2.5vw, 20px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.achievement-item:hover,
.achievement-item.mobile-active {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.achievement-title {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1;
    margin: 0;
    align-self: start;
    color: var(--text-secondary);
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 20px);
    border-radius: clamp(12px, 2vw, 20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.25);
    text-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.achievement-title::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1));
    border-radius: clamp(14px, 2.2vw, 22px);
    z-index: -1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.achievement-item:hover .achievement-title,
.achievement-item.mobile-active .achievement-title {
    transform: translateY(clamp(-2px, -0.4vw, -3px)) scale(1.015);
    box-shadow: 
        0 16px 48px rgba(31, 38, 135, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
}

.achievement-item:hover .achievement-title::before,
.achievement-item.mobile-active .achievement-title::before {
    opacity: 1;
}

.achievement-description {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-heading);
    line-height: 1.25;
    margin: 20px 0 40px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.achievement-meta {
    position: absolute;
    bottom: clamp(15px, 2.5vw, 20px);
    right: clamp(15px, 2.5vw, 20px);
}

.achievement-date {
    font-family: 'SF Compact Rounded', 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--text-secondary);
    padding-right: clamp(12px, 2vw, 20px);
}

@media (max-width: 600px) {
    .achievement-item {
        padding: 15px;
        min-height: 180px;
    }
    
    .achievement-title {
        font-size: 28px;
        padding: 8px 16px;
    }
    
    .achievement-description {
        font-size: 16px;
        margin: 15px 0 35px 0;
    }
    
    .achievement-date {
        font-size: 16px;
        padding-right: 8px;
    }
}

@media (max-width: 400px) {
    .achievement-item {
        padding: 12px;
        min-height: 160px;
    }
    
    .achievement-title {
        font-size: 24px;
        padding: 6px 12px;
    }
    
    .achievement-description {
        font-size: 14px;
        margin: 12px 0 30px 0;
    }
    
    .achievement-date {
        font-size: 14px;
        padding-right: 6px;
    }
}

.tab-slider {
    position: absolute;
    height: calc(100% - 16px);
    background: var(--button-bg);
    border-radius: 8px;
    top: 8px;
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 0;
    /* Начальные размеры для корректной инициализации */
    width: 0;
    left: 0;
    will-change: transform, width, left;
}

/* Заглушка для правильного размера слайдера до загрузки JS */
.tab-toolbar:not(.loaded) .tab-slider {
    width: 33.333%;
    left: 0;
    transition: none;
}

/* Для мобильных устройств - показываем примерный размер */
@media (max-width: 768px) {
    .tab-toolbar:not(.loaded) .tab-slider {
        width: 33.333%;
        left: 0;
    }
}

/* Улучшенная поддержка для мобильных устройств */
@media (max-width: 768px) {
    .tab-slider {
        /* Более быстрая анимация для мобильных */
        transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    /* Принудительная перерисовка для мобильных браузеров */
    .tab-toolbar {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .tab-button {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* Исправление для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .tab-slider {
        /* Отключаем transition при первой загрузке */
        transition: none;
    }
    
    .tab-toolbar.loaded .tab-slider {
        /* Включаем transition после загрузки */
        transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    }
}

.tab-button.active {
    color: var(--button-text);
}

.tab-button:not(.active):hover {
    color: var(--text-primary);
}

 