:root {
    --blue: #3a6ea5;
    --blue-bright: #5b8fd4;
    --bg: #0a0a0a;
    --bg2: #111111;
    --bg3: #1a1a1a;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --muted: #888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Syne', sans-serif;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* THREE.JS CANVAS — выше всего */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Весь контент страницы */
.page-content {
    position: relative;
    z-index: 1;
}

/* ── NAV ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 3rem;
    background: rgba(10, 10, 10, 0.93);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav__logo {
    font-size: 1.4rem;
    font-weight: 800;
    cursor: default;
    letter-spacing: -0.02em;
}

.nav__logo .dash {
    color: var(--blue);
}

.nav__links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav__links a {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    position: relative;
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 100%;
    height: 1px;
    background: var(--blue);
    transition: right 0.25s ease;
}

.nav__links a:hover {
    color: var(--text);
}

.nav__links a:hover::after {
    right: 0;
}

.nav__tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
}

.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 210;
}

.nav__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

.nav__burger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__burger.open span:nth-child(2) {
    opacity: 0;
}

.nav__burger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.mobile-menu.open {
    transform: translateY(0);
    pointer-events: all;
}

.mob-link {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.mob-link:hover {
    color: var(--blue);
}

/* ── HERO ── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: -20%;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(58, 110, 165, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 10% 80%, rgba(42, 74, 106, 0.12) 0%, transparent 60%);
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 860px;
    padding-top: 5rem;
}

.hero__eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.6s 0.05s ease forwards;
}

.hero__title {
    font-size: clamp(2.8rem, 7.5vw, 7.5rem);
    font-weight: 800;
    line-height: 0.95;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.hero__title .line {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__title .line:nth-child(1) {
    animation-delay: 0.1s;
}

.hero__title .line:nth-child(2) {
    animation-delay: 0.22s;
}

.hero__title .line:nth-child(3) {
    animation-delay: 0.34s;
}

.hero__title .accent {
    color: var(--blue);
}

.hero__sub {
    font-family: 'DM Mono', monospace;
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeIn 0.8s 0.5s ease forwards;
}

.hero__ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeIn 0.8s 0.65s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* FIX 2: кнопки — только цвет меняется, никаких transform */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0a0a0a;
    background: var(--blue);
    padding: 0.9rem 1.8rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-primary:hover {
    background: var(--blue-bright);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 0.9rem 1.8rem;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* ── MARQUEE ── */
.marquee-wrap {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
    padding: 0.9rem 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-track span {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    padding: 0 3rem;
    white-space: nowrap;
}

.marquee-track span .dot {
    color: var(--blue);
    margin: 0 0.5rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── SECTIONS ── */
.section {
    padding: 7rem 0;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 3rem;
}

.section-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 3rem;
}

/* ── ABOUT ── */
.about {
    background: var(--bg3);
}

.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
}

.about__right p {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.85;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--blue);
}

.stat-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

/* ── PROJECTS ── */
.projects {
    background: var(--bg2);
}

.projects__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.proj-tab {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.proj-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.proj-tab.active {
    color: var(--text);
}

.proj-tab.active::after {
    transform: scaleX(1);
}

.proj-tab:hover {
    color: var(--text);
}

/* Belt */
.projects__belt-wrap {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.projects__belt {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 2rem 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.projects__belt:active {
    cursor: grabbing;
}

.projects__belt::-webkit-scrollbar {
    display: none;
}

.proj-card {
    flex: 0 0 310px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.proj-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, rgba(58, 110, 165, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.proj-card:hover {
    border-color: var(--blue);
    box-shadow: 0 20px 60px rgba(58, 110, 165, 0.15);
}

.proj-card:hover::before {
    opacity: 1;
}

.proj-card__num {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(58, 110, 165, 0.07);
    line-height: 1;
    pointer-events: none;
    transition: color 0.3s;
}

.proj-card:hover .proj-card__num {
    color: rgba(58, 110, 165, 0.14);
}

.proj-card__tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.proj-card__tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
}

.proj-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    line-height: 1.3;
}

.proj-card__desc {
    font-family: 'DM Mono', monospace;
    font-size: 0.77rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.proj-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-badge {
    font-family: 'DM Mono', monospace;
    font-size: 0.67rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 0.22rem 0.55rem;
    border-radius: 4px;
    transition: border-color 0.2s, color 0.2s;
}

.proj-card:hover .tech-badge {
    border-color: rgba(58, 110, 165, 0.4);
    color: var(--text);
}

.belt-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.belt-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.belt-btn:hover {
    background: var(--blue);
    color: #0a0a0a;
    border-color: var(--blue);
}

/* ── STACK ── */
.stack__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stack-card {
    background: var(--bg3);
    padding: 2.2rem 1.6rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stack-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stack-card:hover {
    border-color: var(--blue);
    box-shadow: 0 16px 40px rgba(58, 110, 165, 0.12);
}

.stack-card:hover::after {
    transform: scaleX(1);
}

.stack-card__icon {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    display: block;
}

.stack-card__num {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--blue);
    margin-bottom: 0.75rem;
}

.stack-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.stack-card p {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ── TEAM ── */
.team {
    background: var(--bg);
}

.team__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
}

.team__text p {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.85;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.team__text strong {
    color: var(--blue);
}

.team__skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-content: flex-start;
}

.skill-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.82rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    cursor: pointer;
}

.skill-tag:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: #0a0a0a;
}

/* ── APPLY ── */
.apply {
    background: var(--bg3);
}

.apply__grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 5rem;
}

.apply__desc {
    font-family: 'DM Mono', monospace;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.tg-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--blue);
    padding-bottom: 0.2rem;
    transition: color 0.2s;
}

.tg-link:hover {
    color: var(--blue);
}

.form__group {
    margin-bottom: 1.3rem;
}

.form__row--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form__group label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
    letter-spacing: 0.05em;
}

.req {
    color: var(--blue);
}

.form__group input,
.form__group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 0.82rem;
    color: var(--text);
    padding: 0.8rem 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form__group input:focus,
.form__group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.15);
}

.form__group textarea {
    resize: vertical;
    min-height: 110px;
}

.field-err {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: #e74c3c;
    margin-top: 0.3rem;
}

.custom-select {
    position: relative;
}

.select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 0.82rem;
    color: var(--text);
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-btn:hover {
    border-color: var(--blue);
}

.select-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    list-style: none;
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.select-list.open {
    display: block;
}

.select-list li {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.select-list li:hover {
    background: rgba(58, 110, 165, 0.15);
    color: var(--blue);
}

.form__submit {
    width: 100%;
    margin-top: 0.5rem;
    background: var(--blue);
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    padding: 1rem 2rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: background 0.2s;
    font-weight: 600;
}

.form__submit:hover {
    background: var(--blue-bright);
}

.form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 10, 10, 0.3);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form-msg {
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.2rem;
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
}

.form-msg.success {
    background: rgba(46, 125, 50, 0.15);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.form-msg.error {
    background: rgba(198, 40, 40, 0.15);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* ── REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── FOOTER ── */
.footer {
    background: #000;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    position: relative;
    z-index: 1;
}

/* ── RESPONSIVE FIX 4 ── */
@media (max-width: 900px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .nav__links,
    .nav__tag {
        display: none;
    }

    .nav__burger {
        display: flex;
    }

    .hero {
        padding: 0 1.5rem;
        min-height: 100svh;
    }

    .hero__content {
        padding-top: 6rem;
        padding-bottom: 2rem;
    }

    .hero__eyebrow {
        font-size: 0.65rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 4rem 0;
    }

    .about__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .stat-num {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: clamp(1.6rem, 5vw, 2.4rem);
        margin-bottom: 2rem;
    }

    .stack__grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stack-card {
        padding: 1.5rem 1.2rem;
    }

    .team__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .apply__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .proj-card {
        flex: 0 0 270px;
    }

    .projects__tabs {
        flex-wrap: wrap;
    }

    .proj-tab {
        padding: 0.6rem 1rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 600px) {
    .hero__title {
        font-size: clamp(2.2rem, 11vw, 3.5rem);
    }

    .hero__sub {
        font-size: 0.82rem;
    }

    .hero__ctas {
        gap: 0.75rem;
    }

    .btn-primary,
    .btn-outline {
        font-size: 0.72rem;
        padding: 0.75rem 1.3rem;
    }

    .stack__grid {
        grid-template-columns: 1fr;
    }

    .form__row--2 {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }

    .proj-card {
        flex: 0 0 85vw;
    }

    .section-label {
        font-size: 0.65rem;
    }

    .skill-tag {
        font-size: 0.75rem;
        padding: 0.55rem 0.9rem;
    }
}