@import url('https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

/* Базовые параметры */
#famil p {
    padding-bottom: 10px;
    height: 10px;
}

.language-switcher {
    position: relative;
    z-index: 9999;
    padding-left: 5vw;
    padding-top: 5vh;
    /* Убираем проблемы с touch на iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.lang-btn {
    text-decoration: none;
    color: #453b24ff;
    margin-right: 10px;
    cursor: pointer;
    display: inline-block;
    padding: 0 15px 0 0;
    /* Увеличиваем область касания */
    min-width: 40px;
    min-height: 44px;
    text-align: center;
    /* Touch-оптимизация */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
        transition: all 0.2s linear;
}

.lang-btn:active {
    opacity: 0.7;
    color: #b76319;
    font-weight: bold
}
.lang-btn.active {
    opacity: 1;
    color: #b76319;
    font-weight: bold;
}
.lang-btn:hover {
    opacity: 0.8;
    color: #d5741f;
    transition: all 0.2s linear;
}


/* Основной контейнер с адаптивным размером шрифта */
#contents {
    position: absolute;
    z-index: 2;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: top;
    justify-content: center;
    flex-direction: row;
    color: #333;
    /* Плавный переход от 9px (1024px) до 13px (2560px) */
    font-size: clamp(9px, 0.35vw + 0.35vh, 13px);
}

.col {
    width: 50vw;
    height: 100%;
}

#left-col {
    padding-left: 5vw;
    padding-top: 10vh;
    padding-right: calc(2.5vw + 2.5vh);
    display: flex;
    align-items: flex-start;
    justify-content: top;
    flex-direction: column;
}

/* Заголовок с адаптивным размером */
#famil {
    width: 70%;
    color: #453b24ff;
    /* Плавный переход от ~20px (1024px) до 48px (2560px) */
    font-size: clamp(20px, 1vw + 1vh, 48px);
    margin-bottom: 5vh;
    font-family: "Major Mono Display", monospace;
    font-weight: 400;
    font-style: normal;
    display: flex;
    align-items: center;
    align-content: space-around;
    justify-content: space-between;
    flex-direction: row;
}

#about {
    max-width: 70%;
    font-size: inherit;
    text-align: justify;
    line-height: 2;
}

/* Кнопка email с адаптивными размерами */
#email-button {
    margin-top: 50px;
    width: 70%;
    max-width: 70%;
    /* Плавный переход от 40px до 60px */
    height: clamp(40px, 2.5vw + 1vh, 60px);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #b6afa1b7;
    border-radius: 30px;
    text-decoration: none;
    color: #453b24ff;
    cursor: pointer;
    transition: all 0.5s linear;
    background-color: rgba(216, 190, 139, 0.12);
    font-size: inherit;
}

#email-button:hover {
    background-color: rgba(216, 190, 139, 0.29);
    border-color: #b6afa167;
}

#about p span {
    font-weight: bold;
    color: black;
}

#right-col {
    width: 50%;
    height: 100vh;
    padding-right: 5vw;
    padding-top: 10vh;
    padding-left: calc(2.5vw + 2.5vh);
    display: flex;
    align-items: flex-start;
    justify-content: top;
    flex-direction: column;
    pointer-events: auto;
}

.col1 {
    width: 100%;
    height: 100%;
}

#names {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    margin-bottom: 5vh;
    pointer-events: auto;
    z-index: 4;
}

/* Кнопки табов с адаптивными размерами */
.nam {
    /* Плавный переход от 40px до 60px */
    height: clamp(40px, 2.5vw + 1vh, 60px);
    /* Плавный переход от 100px до 160px */
    width: clamp(100px, 5vw + 2vh, 160px);
    border: 1px solid #b6afa176;
    padding: 5px;
    border-radius: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    filter: blur(1);
    /* Плавный переход от 10px до 13px */
    font-size: clamp(10px, 0.35vw + 0.35vh, 13px);
    font-weight: 400;
    background-color: rgba(216, 190, 139, 0.12);
    transition: all 0.2s linear;
}

.nam:hover {
    background-color: rgba(216, 190, 139, 0.21);
    border: 1px solid #8b867c76;
    cursor: pointer;
}

.nam.active {
    background-color: rgba(216, 190, 139, 0.29);
    border: 1px solid rgba(118, 106, 94, 1);
}

/* Общие стили для контента */
.content {
    display: none;
    height: 100%;
}

.content.active {
    display: block;
}

/* Общий контейнер */
.gemor {
    height: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    font-size: inherit;
    text-align: justify;
    line-height: 2;
}

/* Текстовый блок */
.first-pole {
    width: 100%;
    height: auto;
    padding: 20px 20px 0 20px;
    overflow-y: auto;
}

/* Контейнер для фото */
.second-pole {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 2;
}

.second-pole div {
    line-height: 0;
}

/* Фото */
.photo {
    position: relative;
    display: inline-block;
    width: 80%;
    margin-left: auto;
    /* Добавьте для плавного изменения размера */
    transition: width 0.3s ease;
}

.photo img {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.photo-pixel {
    position: absolute;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-out;
    will-change: opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Добавьте эти строки */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.photo-pixel img {
    /* Сглаживание краёв */
    image-rendering: auto;
}

/* Для очень широких экранов */
@media screen and (min-aspect-ratio: 21/9) {
    .photo {
        width: 60%; /* Уменьшаем ширину на ультраширокиx */
        max-width: 600px;
    }
}

@media screen and (min-aspect-ratio: 3/1) {
    .photo {
        width: 50%; /* Ещё меньше для экстремально широких */
        max-width: 350px;
    }
    
    .first-pole {
        max-height: 60vh; /* Ограничиваем высоту текстового блока */
        overflow-y: auto;
    }
}


/* Квадраты сетки */
.photo-pixel {
    position: absolute;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.photo-pixel.reveal {
    opacity: 1;
}

/* Дополнительные медиа-запросы для экстремально маленьких экранов */
@media screen and (max-width: 1024px) {
    #contents {
        font-size: 9px;
    }
    
    #famil {
        font-size: 20px;
    }
    
    .nam {
        height: 40px;
        width: 100px;
        font-size: 10px;
    }
    
    #email-button {
        height: 40px;
    }
}

/* Оптимизация для очень больших экранов */
@media screen and (min-width: 2560px) {
    #contents {
        font-size: 13px;
    }
    
    #famil {
        font-size: 48px;
    }
    
    .nam {
        height: 60px;
        width: 160px;
        font-size: 13px;
    }
    
    #email-button {
        height: 60px;
    }
}