/* Подключение кастомного OTF шрифта */

@font-face {
    font-family: 'Ray Typewriter';
    src: url('font/ray typewriter.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #070707;
    --text-color: #ffffff;
    --muted-color: #8c8c8c;
    --font-accent: 'Ray Typewriter', 'Courier New', Courier, monospace;
    --font-body: 'Roboto', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* Принудительное скрытие системного курсора на десктопах */

@media (min-width: 901px) {
    *,
    *::before,
    *::after {
        cursor: none !important;
    }
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}


/* ==========================================================================
   ЭФФЕКТЫ: ПОЛНОЭКРАННЫЙ SVG ШУМ И КАСТОМНЫЙ КУРСОР ИЗ ПРИМЕРА
   ========================================================================== */

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.95;
    z-index: 9998;
    pointer-events: none;
}

.noise-overlay::before {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    right: -100%;
    bottom: -100%;
    filter: url(#grainy);
    animation: noiseGrainPlay 0.3s steps(5) infinite;
}

@keyframes noiseGrainPlay {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-0.5%, 1.5%);
    }
    100% {
        transform: translate(0, 0);
    }
}

.custom-cursor {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border 0.3s ease;
}


/* Трансформация курсора при наведении на .hover-target */

.custom-cursor.cursor-hover {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #ffffff;
}


/* ==========================================================================
   СТРУКТУРА ПОРТФОЛИО DSLX
   ========================================================================== */


/* --- ХЕДЕР --- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    z-index: 100;
    background-color: rgba(7, 7, 7, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header__logo {
    font-family: var(--font-accent);
    font-size: 14px;
    text-decoration: none;
    color: var(--text-color);
    letter-spacing: 1px;
    z-index: 102;
}

.header__nav {
    font-family: var(--font-accent);
    font-size: 12px;
    display: flex;
    gap: 15px;
}

.header__link {
    text-decoration: none;
    color: var(--muted-color);
    transition: color 0.3s;
}

.header__link:hover {
    color: var(--text-color);
}


/* Кнопка Бургер (по умолчанию скрыта) */

.burger-btn {
    display: none;
    background: none;
    border: none;
    outline: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    z-index: 102;
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}


/* --- ПЕРВЫЙ ЭКРАН (HERO) --- */

.hero {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    height: 100vh;
    padding: 120px 40px 80px;
    position: relative;
}

.hero__title-wrapper {
    grid-column: 1 / 9;
    grid-row: 2 / 8;
    z-index: 10;
    display: flex;
    align-items: center;
    position: relative;
    width: 66.66vw;
}

.hero__title-svg {
    width: 100%;
    height: auto;
    display: block;
}

.hero__dynamic-text {
    position: absolute;
    left: 0;
    bottom: -15%;
    font-family: var(--font-accent);
    font-size: clamp(48px, 12vw, 280pt);
    font-weight: normal;
    text-transform: lowercase;
    color: #ffffff;
    line-height: 0.8;
    pointer-events: none;
    white-space: nowrap;
    z-index: 15;
}

.hero__dynamic-text::after {
    content: '_';
    animation: blink 0.6s infinite alternate;
}

@keyframes blink {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.hero__philosophy {
    grid-column: 9 / 13;
    grid-row: 3 / 6;
    text-align: right;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 320px;
    justify-self: end;
}

.hero__images {
    grid-column: 7 / 10;
    grid-row: 4 / 9;
    position: relative;
    z-index: 20;
}

.hero__img-card {
    position: absolute;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.hero__img-card:hover {
    filter: grayscale(0%);
}

.hero__img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero__img-card--portrait {
    width: 160px;
    height: 220px;
    right: -20px;
    top: 0;
}

.hero__img-card--detail {
    width: 180px;
    height: 180px;
    left: 0;
    bottom: -40px;
}

.hero__footer-left {
    grid-column: 1 / 4;
    grid-row: 9 / 12;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 20px;
}

.hero__manifesto {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 320px;
}

.hero__cta {
    display: inline-block;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 14px 32px;
    text-align: center;
    width: fit-content;
    transition: opacity 0.3s ease;
}

.hero__cta:hover {
    opacity: 0.85;
}

.hero__footer-right {
    grid-column: 10 / 13;
    grid-row: 8 / 12;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 5;
}

.hero__logo-svg {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
}

.hero__scroll,
.hero__timezone {
    font-family: var(--font-accent);
    position: absolute;
    bottom: 24px;
    font-size: 0.8rem;
    color: var(--muted-color);
}

.hero__scroll {
    left: 40px;
}

.hero__timezone {
    right: 40px;
}


/* --- ВТОРОЙ ЭКРАН (ABOUT) --- */

.about {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 120px 40px;
    gap: 80px;
    border-bottom: 1px solid #1a1a1a;
}

.about__image-wrapper-full {
    width: 100%;
    display: flex;
    justify-content: center;
}

.about__svg-full {
    width: 100%;
    height: auto;
    display: block;
}

.about__content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    width: 100%;
}

.about__block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about__title {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    font-weight: normal;
}

.about__text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

.about__list {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* Стили блока компетенций со шкалами */

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 10px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-color);
}

.skill-name {
    font-family: var(--font-body);
}

.skill-value {
    font-family: var(--font-accent);
    color: var(--muted-color);
}

.skill-bar {
    width: 100%;
    height: 3px;
    background-color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: #ffffff;
    transition: width 1s ease-in-out;
}


/* --- ТРЕТИЙ ЭКРАН (PROJECTS) --- */

.projects {
    padding: 120px 40px;
    border-bottom: 1px solid #1a1a1a;
}

.projects__image-wrapper-full {
    width: 100%;
    margin-bottom: 40px;
}

.projects__svg-full {
    width: 100%;
    height: auto;
}

.projects__intro {
    width: 100%;
    max-width: 320px;
    margin-bottom: 80px;
}

.projects__intro-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

.projects__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
}

.projects__card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.projects__thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: #111;
    border: 1px solid #1a1a1a;
    overflow: hidden;
    position: relative;
}

.projects__thumb .slideshow-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0;
    transition: opacity 0.4s ease-in-out, filter 0.3s ease;
}

.projects__thumb .slideshow-img.active {
    opacity: 1;
}

.projects__card:hover .projects__thumb .slideshow-img {
    filter: grayscale(0%);
}

.projects__card-title {
    font-family: var(--font-accent);
    font-size: 1.3rem;
    font-weight: normal;
}

.projects__card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted-color);
}

.projects__card--cta {
    text-decoration: none;
    color: inherit;
}

.projects__thumb--cta {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.projects__plus-icon {
    font-family: var(--font-accent);
    font-size: 4rem;
    color: var(--muted-color);
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.projects__card--cta:hover .projects__thumb--cta {
    border-color: #ffffff;
    background-color: #161616;
}

.projects__card--cta:hover .projects__plus-icon {
    color: #ffffff;
    transform: scale(1.15) rotate(90deg);
}


/* --- ЧЕТВЕРТЫЙ ЭКРАН (STICKY HORIZONTAL CAROUSEL) --- */

.horizontal-scroll-container {
    position: relative;
    width: 100%;
    height: 500vh;
}

.horizontal-scroll-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 40px;
}

.horizontal-scroll-lane {
    display: flex;
    gap: 40px;
    align-items: center;
    will-change: transform;
}

.horizontal-card {
    flex-shrink: 0;
    height: 380px;
    width: auto;
    background-color: #111;
    border: 1px solid #1a1a1a;
    overflow: hidden;
    display: flex;
    align-items: center;
    transform-origin: center center;
    will-change: transform, margin;
    transition: margin 0.1s ease-out;
}

.horizontal-card img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.horizontal-card:hover img {
    filter: grayscale(0%);
}


/* --- ПЯТЫЙ ЭКРАН (CONTACTS) --- */

.contacts {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 120px 40px 40px;
}

.contacts__image-wrapper-full {
    width: 100%;
    margin-bottom: 80px;
}

.contacts__svg-full {
    width: 100%;
    height: auto;
}

.contacts__grid {
    display: grid;
    grid-template-columns: 4fr 5fr;
    gap: 100px;
    width: 100%;
}

.contacts__label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    color: var(--muted-color);
    display: block;
    margin-bottom: 25px;
}

.contacts__primary-zone {
    border: 1px solid #1a1a1a;
    padding: 40px;
}

.contacts__main-title {
    font-family: var(--font-accent);
    font-size: 3vw;
    margin-bottom: 20px;
}

.contacts__subtext {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 40px;
    color: var(--muted-color);
}

.contacts__main-button {
    display: inline-block;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    padding: 14px 32px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.contacts__main-button:hover {
    opacity: 0.85;
}

.contacts__secondary-zone {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contacts__list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #1a1a1a;
    margin-bottom: 60px;
}

.contacts__item {
    display: flex;
    justify-content: space-between;
    padding: 25px 0;
    border-bottom: 1px solid #1a1a1a;
    text-decoration: none;
    color: var(--muted-color);
    transition: color 0.3s;
}

.contacts__item:hover {
    color: var(--text-color);
}

.contacts__item-name {
    font-size: 1rem;
}

.contacts__footer-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted-color);
    border-top: 1px solid #1a1a1a;
    padding-top: 30px;
}


/* ==========================================================================
   АДАПТИВНОСТЬ ПОД МОБИЛЬНЫЕ (<= 900px)
   ========================================================================== */

@media (max-width: 900px) {
    .custom-cursor {
        display: none !important;
    }
    /* 1. БУРГЕР-МЕНЮ В ШАПКЕ */
    .burger-btn {
        display: flex;
    }
    .burger-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .burger-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    .header__nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        font-size: 1.5rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 101;
    }
    .header__nav.active {
        opacity: 1;
        pointer-events: all;
    }
    .header__link {
        font-size: 1.5rem;
    }
    /* 2. СКРЫТИЕ БЛОКОВ В HERO И ИСПРАВЛЕНИЕ НАЛЕЗАНИЯ КНОПКИ */
    .hero__manifesto {
        display: none !important;
    }
    .hero__footer-right,
    .hero__logo-svg {
        display: none !important;
    }
    .hero {
        display: flex;
        flex-direction: column;
        height: auto;
        padding-top: 100px;
    }
    .hero__title-wrapper {
        width: 100%;
        margin-bottom: 40px;
    }
    .hero__dynamic-text {
        bottom: -15px;
        font-size: 10vw;
    }
    .hero__philosophy {
        text-align: left;
        margin-bottom: 40px;
    }
    .hero__images {
        position: relative;
        height: 350px;
        margin-bottom: 80px;
        /* Увеличен отступ до 80px, чтобы фото с ротацией/абсолютом не залезали на кнопку */
    }
    .hero__img-card--portrait {
        right: 0;
    }
    .about__content-grid,
    .projects__grid,
    .contacts__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    /* 3. СЛАЙДЕР НА МОБИЛКАХ ДЛЯ БОЛЬШИХ КЕЙСОВ */
    .projects__thumb {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .projects__thumb .slideshow-img {
        position: relative !important;
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        opacity: 1 !important;
        filter: grayscale(0%) !important;
        scroll-snap-align: start;
    }
    .horizontal-scroll-container {
        height: auto;
    }
    .horizontal-scroll-sticky {
        position: relative;
        height: auto;
        padding: 40px 0;
    }
    .horizontal-scroll-lane {
        overflow-x: auto;
        width: 100%;
        gap: 20px;
    }
    .horizontal-card {
        height: 260px;
        transform: none !important;
        margin: 0 !important;
    }
}