@import url('https://fonts.cdnfonts.com/css/ica-rubrik-black');
@import url('https://fonts.cdnfonts.com/css/poppins');
*,
::before,
::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    margin: 0;
    overflow: hidden;
    display: flex;
    height: 100vh;
    flex-direction: column;
    line-height: 1.5;
    font-family: "Montserrat", sans-serif;
    font-size: 62.5%;
    color: #f4f4f4;
    background-color: #1d1e22;
}

.scrolls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1.25em;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 2rem;
    color: black;
}
.scrolls .center {
    font-size: 0.825rem;
}

.smooth {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.header {
    position: fixed;
    top: 0;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 60px;
    font-size: 1rem;
    background-image: linear-gradient(180deg, #1d1e22, rgba(29, 30, 34, 0.1), transparent);
    mix-blend-mode: luminosity;
}
.header ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}
.header ul li {
    margin: 0 1em;
    padding: 1em;
}
.header ul li a {
    cursor: pointer;
    position: relative;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    color: black;
    transition: color 0.5s ease;
}
/* Когда ссылку нужно сделать белой */
.header ul li a.white-links {
    color: white;
    transition: color 0.5s ease;
}

.header ul li a::after {
    position: absolute;
    bottom: -3px;
    left: 0;
    content: "";
    width: 0;
    height: 3px;
    transition: all 0.2s linear;

}
.header ul li a:hover::after {
    width: 100%;
    background-color: black;
}
.header ul li a.white-links:hover::after {
    background-color: white;
}

section {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 100vh;
    flex-flow: column wrap;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background-color: #f4f4f4;
    background-size: cover;
    scroll-snap-align: center;
}
section h2 {
    text-transform: uppercase;
    font-size: 2.25rem;
    font-weight: 900;
    padding: 0.5em 1em;
    color: white;
    background-color: black;
    border-radius: 0.25em;
    pointer-events: none;
    user-select: none;
}

.banner{
    width: 90%;
    height: 85vh;
    text-align: center;
    overflow: hidden;
    position: relative;
}
.banner .slider{
    position: absolute;
    width: 140px;
    height: 200px;
    top: 10%;
    left: calc(50% - 67px);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    animation: autoRun 20s linear infinite;
    z-index: 2;
}
@keyframes autoRun{
    from{
        transform: perspective(1000px) rotateX(-16deg) rotateY(0deg);
    }to{
         transform: perspective(1000px) rotateX(-16deg) rotateY(360deg);
     }
}

.banner .slider .item{
    position: absolute;
    inset: 0 0 0 0;
    transform:
            rotateY(calc( (var(--position) - 1) * (360 / var(--quantity)) * 1deg))
            translateZ(400px);
}
.banner .slider .item img{
    width: 100%;
    height: 100%;
    /*object-fit: cover;*/
}
.banner .content{
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1400px, 100vw);
    height: max-content;
    padding-bottom: 100px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}
.banner .content h1{
    font-family: 'ICA Rubrik';
    font-size: 16em;
    line-height: 1em;
    color: #25283B;
    position: relative;
}
.banner .content h1::after{
    position: absolute;
    inset: 0 0 0 0;
    content: attr(data-content);
    z-index: 2;
    -webkit-text-stroke: 2px #d2d2d2;
    color: transparent;
}
.banner .content .author{
    font-family: Poppins;
    text-align: right;
    max-width: 200px;
}
.banner .content h2{
    font-size: 3em;
}
.banner .content .model{
    background-image: url(../images/planet-intro.svg);
    width: 100%;
    height: 60vh;
    position: absolute;
    bottom: 60px;
    left: 0;
    background-size: auto 90%;
    background-repeat: no-repeat;
    background-position: top center;
    z-index: 1;
}
@media screen and (max-width: 1023px) {
    .banner .slider{
        width: 160px;
        height: 200px;
        left: calc(50% - 80px);
    }
    .banner .slider .item{
        transform:
                rotateY(calc( (var(--position) - 1) * (360 / var(--quantity)) * 1deg))
                translateZ(300px);
    }
    .banner .content h1{
        text-align: center;
        width: 100%;
        text-shadow: 0 10px 20px #000;
        font-size: 7em;
    }
    .banner .content .author{
        color: #fff;
        padding: 20px;
        text-shadow: 0 10px 20px #000;
        z-index: 2;
        max-width: unset;
        width: 100%;
        text-align: center;
        padding: 0 30px;
    }
}
@media screen and (max-width: 767px) {
    .banner .slider{
        width: 100px;
        height: 150px;
        left: calc(50% - 50px);
    }
    .banner .slider .item{
        transform:
                rotateY(calc( (var(--position) - 1) * (360 / var(--quantity)) * 1deg))
                translateZ(180px);
    }
    .banner .content h1{
        font-size: 5em;
    }
}

/*Раздел intro*/
.intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px;
    position: relative;
    z-index: 2;
}

.intro-text {
    max-width: 400px;
    z-index: 3;
    position: relative;
}

/* Анимация для каждого символа */
.intro-text h1 {
    font-size: 1.65rem;
    margin-bottom: 20px;
    color: black;
    display: inline-block;
}

.intro-text h1 span {
    display: inline-block;
    animation: blink 1.5s infinite alternate;
    animation-delay: calc(0.1s * var(--i)); /* Различная задержка для каждого символа */
}

.intro-text p {
    position: relative;
    font-size: 20px;
    line-height: 1.5;
    z-index: 3;
}

/* Мерцание символов */
@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Перелив градиента по тексту */
.gradient-text {
    background: linear-gradient(90deg, #000000, #dc0032, #000000);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

#threejs-canvas {
    width: 500px;
    height: 500px;
}

/* Фоновая анимация с полосами */
.background-lines {
    position: absolute;
    top: 5rem;
    left: 0;
    width: 100%;
    height: 90%;
    z-index: 1;
    overflow: hidden;
}

.line {
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #0A0A0AFF;
    animation: moveLine 5s linear infinite;
}

@keyframes moveLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Создаём несколько полос */
.line:nth-child(2) { top: 20%; animation-duration: 6s; }
.line:nth-child(3) { top: 40%; animation-duration: 7s; }
.line:nth-child(4) { top: 60%; animation-duration: 8s; }
.line:nth-child(5) { top: 80%; animation-duration: 9s; }

/*Раздел Info*/

.info-section {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
    overflow: hidden;
}

#threejs-canvas-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}


.info-popup {
    position: absolute;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #fff;
    border-radius: 5px;
    display: none;
    color: #fff;
    pointer-events: none;
    transition: opacity 0.3s;
    max-width: 250px;
}

/*Раздел Works*/

.works-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#planet-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.projects-container {
    position: relative;
    z-index: 2;
}

.project-item {
    position: absolute;
    text-align: center;
    color: #000;
    font-size: 14px;
    transition: transform 0.3s;
}

.project-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

.project-item .dot {
    width: 8px;
    height: 8px;
    background-color: #000;
    border-radius: 50%;
    margin: 5px auto;
}

.project-item .year {
    font-size: 12px;
    color: #000;
}
.project-item .name {
    font-size: 9px;
    color: #701616;
}

.project-item:hover {
    transform: scale(1.2);
}

/*Раздел Skills*/

.skills-container {
    width: 80%;
    max-width: 800px;
    margin: 50px auto;
}
.skill-bar {
    margin-bottom: 30px;
}
.skill-bar .label {
    color: black;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}
.skill-bar .bar {
    background: #333;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.skill-bar .progress {
    background: #818181; /* Цвет для прогресса */
    height: 100%;
    width: 0;
    border-radius: 10px;
    transition: width 1s ease-in-out;
    position: relative;
}
.skill-bar .progress::before {
    content: attr(data-label);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-weight: bold;
}
/* Стили для звезд */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.star {
    position: absolute;
    border-radius: 50%;
    background: #000;
    opacity: 0.6;
    animation: moveStars 50s linear infinite;
}
@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

/*Блок Contacts*/

/* Обёртка для эффекта коробки */
.box-wrapper {
    perspective: 1000px; /* Перспектива для создания 3D эффекта */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Контейнер с контактным блоком */
.contact-section {
    width: 800px;
    height: 500px;
    transform-style: preserve-3d;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-shadow: inset 0px 0px 20px rgba(255, 255, 255, 0.1), 0px 0px 50px rgba(0, 0, 0, 0.6);
    transform: rotateX(10deg) rotateY(10deg); /* Наклон коробки */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

/* Стили для теней */
.contact-section::before, .contact-section::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    transform: translateZ(-50px); /* Создаем глубину */
    top: 0;
    left: 0;
    z-index: -1;
}

.contact-section::after {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), transparent);
    transform: translateZ(-50px) rotateY(90deg);
}

/* Стили для текста и иконок */
.contact-text {
    padding-right: 50px;
    font-size: 24px;
    color: white;
    z-index: 1;
}

.glitch-text span {
    display: inline-block;
    color: white;
    transition: color 0.3s, background-color 0.3s;
}

.contact-icon {
    display: inline-block;
    font-size: 18px;
    margin-top: 20px;
    margin-right: 20px;
    text-decoration: none;
    color: white;
    transition: color 0.3s;
}

.contact-icon:hover {
    color: gray;
}


/* Стили для голограммы */
#hologram {
    width: 300px;
    height: 300px;
    z-index: 1;
}

/* Дополнительные эффекты объема */
.contact-section:hover {
    transform: rotateX(5deg) rotateY(5deg) translateZ(20px);
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}

/*Окно загрузки*/
/* Полноэкранное окно загрузки */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* Черный фон */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* На переднем плане */
    transition: opacity 1s ease; /* Плавное скрытие за 1 секунду */
    visibility: visible; /* Видимость по умолчанию */
    overflow: hidden;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 0s 1s;
}

/* Фон со звездами */
.loader-stars {
    width: 100%;
    height: 100%;
    position: absolute;
    background: url('/images/stars-loader.jpg') repeat;
    animation: moveStars 50s linear infinite; /* Движение звезд */
    z-index: 1;
}

@keyframes moveStars {
    0% { background-position: 0 0; }
    100% { background-position: 1000px 1000px; }
}

/* Контейнер для лоадера */
.loader-container {
    position: relative;
    z-index: 2; /* Поверх звезд */
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* Текст под лоадером */
.loader-text {
    margin-top: 20px; /* Отступ от лоадера */
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    color: #ffffff; /* Белый цвет текста */
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.8; /* Небольшая прозрачность */
    animation: fadeIn 2s ease-in-out infinite alternate; /* Анимация пульсации */
}

@keyframes fadeIn {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Анимация для лоадера (пульсирующая планета или голограмма) */
.loader {
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top: 8px solid #ffffff; /* Цвет верха */
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.5s linear infinite;
    z-index: 2;
    box-shadow: 0 0 20px #ffffff, 0 0 30px #ffffff;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Пульсирующее свечение вокруг лоадера */
.loader-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    z-index: 1;
    animation: glow 2s infinite ease-in-out;
}

@keyframes glow {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Плавное исчезновение лоадера */
#preloader.hidden .loader, #preloader.hidden .loader-glow {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.5s;
}


@media (max-width: 991px) {

    .scrolls{
        display: none;
    }

    .header{
        font-size: 0.5rem;
    }

    .intro-text h1 {
        font-size: 0.9rem;
        display: block;
    }

    .intro{
        display: block;
        padding: 10px;
        text-align: center;
    }

    .intro-text p {
        font-size: 12px;
    }

    .banner .content .model{
        bottom: 30px;
    }

    .info-popup {
        font-size: 10px;
    }

    .contact-section {
        width: 100%;
        height: auto;
        padding: 10px;
        flex-direction: column;
        border-radius: 0;
    }

    #hologram {
        width: 200px;
        height: 200px;
        margin-bottom: 20px;
    }

    #hologram canvas{
        width: 200px!important;
        height: 200px!important;
    }

    .contact-text {
        font-size: 18px;
        text-align: center;
        padding: 20px;
    }

    .contact-icons {
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }

    .contact-icon {
        font-size: 16px;
        margin-right: 15px;
    }

    .banner {
        width: 100%;
    }


}
