/* ==================================================
HEADER
================================================== */

header {
    user-select: none;
    width: 100%;
    height: 65px;
    position: fixed;
    top: 0;
    left: 0;
    padding: 10px 5%;
    z-index: 1000;
}

.header {
    --hx: -999px;
    --hy: -999px;

    width: 100%;
    height: 100%;
    position: relative;

    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 24px;

    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    overflow: hidden;
}

/* glow border */
.header::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    z-index: 1;

    background: radial-gradient(
        180px circle at var(--hx) var(--hy),
        rgba(255,255,255,.95),
        rgba(255,255,255,.18) 18%,
        transparent 62%
    );

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);

    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;

    opacity: 0;
    transition: opacity .18s ease;
}

.header:hover::before {
    opacity: 1;
}

/* content above glow */
.header > * {
    position: relative;
    z-index: 2;
}

/* ==================================================
LOGO
================================================== */

.nav-logo {
    flex-shrink: 0;

    font-size: 15px;
    font-weight: 600;
    letter-spacing: .05em;

    color: var(--text);
    text-decoration: none;

    opacity: .9;
    transition: opacity var(--transition-fast);
}

.nav-logo:hover {
    opacity: 1;
}

/* ==================================================
NAVIGATION
================================================== */

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 999px;

    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;

    color: var(--text-muted);
    text-decoration: none;

    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-strong);
    background: var(--surface-hover);
}

.nav-link--active {
    color: var(--text-strong);
    background: var(--surface-strong);
}

/* ==================================================
LANGUAGE SWITCHER
================================================== */

.lang-switch {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn {
    padding: 4px 2px;

    background: none;
    border: none;
    cursor: pointer;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;

    color: var(--text-muted);

    transition: color var(--transition-fast);
}

.lang-btn:hover {
    color: var(--text-strong);
}

.lang-btn--active {
    color: var(--text);
}

.lang-sep {
    user-select: none;
    font-size: 11px;
    color: var(--text-soft);
}

/* ==================================================
BURGER
================================================== */

.burger {
    display: none;

    width: 42px;
    height: 42px;
    margin-left: 14px;

    border: none;
    background: none;
    cursor: pointer;

    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;

    padding: 0;
}

.burger span {
    width: 18px;
    height: 1.5px;
    border-radius: 10px;

    background: #fff;

    transition:
        transform .25s ease,
        opacity .25s ease;
}

/* active state */

.burger.active span:nth-child(1) {
    transform: translateY(3.75px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    transform: translateY(-3.75px) rotate(-45deg);
}

/* ==================================================
MOBILE MENU
================================================== */

.mobile-menu {
    position: fixed;
    top: 78px;
    right: 5%;
    z-index: 999;

    width: min(320px, 90vw);
    padding: 20px;

    border-radius: 22px;

    background: rgba(15,15,15,.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 20px 60px rgba(0,0,0,.45);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(.98);

    transition:
        opacity .25s ease,
        transform .25s ease,
        visibility .25s ease;
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-link {
    padding: 14px 16px;
    border-radius: 14px;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;

    color: var(--text-muted);

    transition:
        background .2s ease,
        color .2s ease;
}

.mobile-link:hover {
    background: rgba(255,255,255,.05);
    color: var(--text);
}

.mobile-lang {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid rgba(255,255,255,.06);

    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================================================
MOBILE HEADER MODE
================================================== */

@media (max-width: 768px) {

    .nav,
    .lang-switch {
        display: none;
    }

    .burger {
        display: inline-flex;
        margin-left: auto;
    }

}
/* ==================================================
TEXT ANIMATION
================================================== */

@keyframes blur-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    60% {
        opacity: .6;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vp-char {
    display: inline-block;
    opacity: 0;

    font-family: 'JetBrains Mono', monospace;

    will-change: transform, opacity;
    transition: font-weight .08s linear;
    animation: blur-in .65s cubic-bezier(.22,1,.36,1) forwards;
}

.vp-word {
    display: inline-block;
    white-space: nowrap;
}

.vp-space {
    display: inline-block;
    width: .3em;
}

.h-1,
.p1 {
    user-select: none;

    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;

    font-family: 'JetBrains Mono', monospace;
}

/* ==================================================
HERO SECTION
================================================== */

.box {
    width: 100%;
    height: 100vh;
    padding: 0 30px 30px;
    position: relative;
}

/* ==================================================
HERO VIDEO
================================================== */

.video-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 60px 60px;

    opacity: 0;

    --hero-y: 90px;
    --hero-blur: 10px;

    transform: translate3d(0, var(--hero-y), 0);
    filter: blur(var(--hero-blur));

    will-change: transform, opacity, filter;

    -webkit-mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 14%,
            black 86%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            black 0%,
            black 72%,
            rgba(0,0,0,.45) 88%,
            transparent 100%
        );

    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;

    mask-image:
        linear-gradient(
            to right,
            transparent 0%,
            black 14%,
            black 86%,
            transparent 100%
        ),
        linear-gradient(
            to bottom,
            black 0%,
            black 72%,
            rgba(0,0,0,.45) 88%,
            transparent 100%
        );

    mask-size: 100% 100%;
    mask-repeat: no-repeat;
}

/* overlays не мешают видео */
.video-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.72) 0%,
            rgba(0,0,0,.38) 24%,
            rgba(0,0,0,.12) 52%,
            rgba(0,0,0,0) 80%
        );
}

.video-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;

    background:
        /* справа */
        linear-gradient(
            to left,
            rgba(0,0,0,.95) 0%,
            rgba(0,0,0,.72) 10%,
            rgba(0,0,0,.38) 22%,
            rgba(0,0,0,.12) 34%,
            transparent 46%
        ),

        /* слева */
        linear-gradient(
            to right,
            rgba(0,0,0,.95) 0%,
            rgba(0,0,0,.72) 10%,
            rgba(0,0,0,.38) 22%,
            rgba(0,0,0,.12) 34%,
            transparent 46%
        ),

        /* снизу */
        linear-gradient(
            to top,
            rgba(0,0,0,.95) 0%,
            rgba(0,0,0,.72) 12%,
            rgba(0,0,0,.38) 24%,
            rgba(0,0,0,.12) 36%,
            transparent 52%
        );
}

#v1,
#v2 {
    user-select: none;
    pointer-events: none;

    position: absolute;
    inset: 0;
    z-index: 1;

    width: 100%;
    height: 100%;

    object-fit: cover;
    transition: opacity .4s ease;
}

/* ==================================================
HERO TEXT
================================================== */

.txt-box1 {
    position: absolute;
    top: 20%;
    left: 5%;
    z-index: 10;

    width: 35%;
    height: 20%;

    font-size: 20px;

    word-wrap: break-word;
    overflow-wrap: break-word;
}

.p1 {
    overflow-wrap: anywhere;
}

/* ==================================================
REDUCED MOTION
================================================== */

@media (prefers-reduced-motion: reduce) {
    .video-wrap {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .vp-char {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==================================================
SECTIONS
================================================== */

.section {
    padding: 120px 0;
    border-top: 1px solid var(--surface-border);
}

.section--last {
    padding-bottom: 160px;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.section-inner--split {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    align-items: start;
}

.section-inner--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-head {
    margin-bottom: 64px;
}

.section-label {
    user-select: none;
    display: block;

    margin-bottom: 16px;

    font-size: 11px;
    letter-spacing: .25em;
    text-transform: uppercase;

    color: var(--text-soft);
}

.section-title {
    font-size: clamp(36px, 4vw, 60px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.02em;

    color: var(--text);
}

/* ==================================================
SERVICES CARDS
================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;

    perspective: 1200px;
}

.card {
    position: relative;
    overflow: hidden;

    min-height: 260px;
    padding: 34px 30px;
    border-radius: 18px;

    display: flex;
    flex-direction: column;
    gap: 18px;

    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);

    transition:
        transform .18s ease,
        border-color .25s ease,
        background .25s ease;
}

/* glow border */
.card::before {
    content: "";
    position: absolute;
    inset: 0;

    border-radius: inherit;
    padding: 1px;

    pointer-events: none;

    background: radial-gradient(
        240px circle at var(--x,50%) var(--y,50%),
        rgba(255,255,255,.9),
        rgba(255,255,255,.15) 18%,
        transparent 60%
    );

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);

    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;

    opacity: 0;
    transition: opacity .18s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-6px);

    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.16);
}

.card > * {
    position: relative;
    z-index: 2;
}

.card-icon {
    margin-bottom: 6px;

    font-size: 26px;
    line-height: 1;

    color: rgba(255,255,255,.92);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;

    color: #fff;
}

.card-text {
    margin-top: auto;

    font-size: 14px;
    line-height: 1.65;

    color: rgba(255,255,255,.72);
}

/* ==================================================
ABOUT
================================================== */

.about-left .section-label {
    margin-bottom: 20px;
}

.about-left .section-title {
    position: sticky;
    top: 100px;
}

.about-text {
    margin-bottom: 20px;

    font-size: 15px;
    line-height: 1.75;

    color: var(--text-secondary);

    hyphens: auto;
    -webkit-hyphens: auto;
    word-break: keep-all;
    overflow-wrap: break-word;

}

.about-text .scramble-char {
    display: inline;

    min-width: unset;
    text-align: unset;
    vertical-align: baseline;
    white-space: normal;
}

.scramble-word {
    display: inline-block;
    white-space: nowrap;
}

.about-stats {
    display: flex;
    gap: 48px;

    margin-top: 56px;
    padding-top: 40px;

    border-top: 1px solid var(--surface-border);
}

.stat-num {
    display: block;
    margin-bottom: 8px;

    font-size: clamp(32px, 3.5vw, 48px);
    font-weight: 200;
    line-height: 1;
    letter-spacing: -.03em;

    color: var(--text);
}

.stat-label {
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;

    color: var(--text-muted);
}

/* ==================================================
WORKS
================================================== */

.works-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;

    border-radius: 24px;
}

/* edge fade */
.works-wrap::before,
.works-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;

    width: 90px;
    z-index: 3;

    pointer-events: none;
}

.works-wrap::before {
    left: 0;

    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;

    background: linear-gradient(
        to right,
        #000 0%,
        rgba(0,0,0,.92) 35%,
        transparent 100%
    );
}

.works-wrap::after {
    right: 0;

    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;

    background: linear-gradient(
        to left,
        #000 0%,
        rgba(0,0,0,.92) 35%,
        transparent 100%
    );
}

/* track */
.works-track {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
}

.works-track.is-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
}

.works-track.is-marquee {
    display: flex;
    width: max-content;

    animation: works-scroll 35s linear infinite;
}

.works-track.is-marquee:hover {
    animation-play-state: paused;
}

@keyframes works-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-50% - 9px));
    }
}

/* cards */
.work-card {
    --mx: 50%;
    --my: 50%;

    flex: 0 0 360px;

    position: relative;
    z-index: 2;
    overflow: hidden;

    min-height: 360px;
    padding: 34px;
    border-radius: 22px;

    display: flex;
    flex-direction: column;
    gap: 18px;

    text-decoration: none;
    color: inherit;

    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);

    user-select: none;
    -webkit-user-drag: none;

    transition:
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.work-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;

    border-radius: inherit;
    pointer-events: none;

    background: radial-gradient(
        180px circle at var(--mx) var(--my),
        rgba(255,255,255,.08),
        transparent 70%
    );

    opacity: 0;
    transition: opacity .18s ease;
}

.work-card:hover::before {
    opacity: 1;
}

.work-card:hover {
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.14);
}

.work-card > * {
    position: relative;
    z-index: 5;
}

/* meta */
.work-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.work-tag {
    padding: 6px 10px;
    border-radius: 999px;

    font-size: 10px;
    letter-spacing: .22em;
    text-transform: uppercase;

    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.72);
}

.work-year {
    font-size: 12px;
    color: rgba(255,255,255,.34);
}

.work-title {
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.04em;

    color: #fff;
}

.work-desc {
    font-size: 14px;
    line-height: 1.7;

    color: rgba(255,255,255,.64);
}

.work-stack {
    margin-top: auto;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-stack span {
    padding: 7px 10px;
    border-radius: 999px;

    font-size: 11px;

    background: rgba(255,255,255,.045);
    color: rgba(255,255,255,.62);
}

/* ==================================================
TECH STACK
================================================== */

.tech-list {
    user-select: none;

    position: relative;
    max-width: 900px;

    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-list .svg .path {
    fill: #fff;
}

.tech-item {
    --glow: 0;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;

    color: rgba(255,255,255,calc(.38 + var(--glow) * .62));

    background:
        rgba(255,255,255,calc(var(--glow) * .045));

    border: 1px solid rgba(255,255,255,calc(.08 + var(--glow) * .34));

    transform:
        translateY(calc(var(--glow) * -3px))
        scale(calc(1 + var(--glow) * .025));

    box-shadow:
        0 0 calc(var(--glow) * 24px)
        rgba(255,255,255,calc(var(--glow) * .12));

    transition:
        transform .14s ease-out,
        color .14s linear,
        background .14s linear,
        border-color .14s linear,
        box-shadow .14s linear;
}

.tech-item:hover {
    color: var(--text);
}

.tech-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ==================================================
CONTACT
================================================== */

.contact-sub {

    user-select: none;
    pointer-events: none;
    max-width: 520px;
    margin: 20px auto 42px;

    font-size: 15px;
    line-height: 1.7;
    text-align: center;

    color: var(--text-secondary);
}

.contact-link {
    position: relative;
    display: inline-block;

    margin-bottom: 42px;
    padding-bottom: 10px;

    font-size: clamp(24px, 3vw, 42px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.03em;

    color: var(--text);
    text-decoration: none;

    transition:
        color .25s ease,
        transform .25s ease;
}

.contact-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background: var(--text-soft);

    transition:
        height .25s ease,
        background .25s ease,
        transform .25s ease;
}

.contact-link:hover {
    transform: translateY(-2px);
}

.contact-link:hover::after {
    height: 2px;
    background: var(--text);
}

.contact-socials {
    user-select: none;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.social-link {
    position: relative;

    font-size: 11px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    text-decoration: none;

    color: var(--text-muted);

    transition:
        color .2s ease,
        transform .2s ease;
}

.social-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;

    width: 0%;
    height: 1px;

    background: var(--text);

    transition: width .25s ease;
}

.social-link:hover {
    color: var(--text);
    transform: translateY(-2px);
}

.social-link:hover::after {
    width: 100%;
}

.social-sep {
    font-size: 12px;
    opacity: .8;

    color: var(--text-soft);
}

/* ==================================================
SCROLLBAR / TRANSITION
================================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    border-radius: 100px;

    background: linear-gradient(
        180deg,
        transparent,
        var(--text-soft),
        transparent
    );
}

.page-transition-overlay .transition-cell {
    background: var(--text) !important;
}