:root {
    --bg: #0b0b14;
    --bg-alt: #12121f;
    --surface: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.09);
    --text: #eef0fb;
    --text-dim: #9494b8;
    --accent: #3399ff;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(51, 153, 255, 0.35);
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    scroll-padding-top: 70px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

::selection {
    background: var(--accent);
    color: #05050a;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #2a2a45;
    border-radius: 10px;
}

section {
    --stack-shade: 0;
    position: sticky;
    top: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 100px 20px;
    transform-origin: center top;
}

section.is-scrollable-section {
    position: relative;
    top: auto;
    overflow: clip;
}

section::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 50;
    background: #05050b;
    opacity: var(--stack-shade);
    pointer-events: none;
}

section:not(.hero) {
    border-radius: 36px 36px 0 0;
    box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.4);
}

.hero {
    z-index: 1;
    background: var(--bg);
}

.about {
    z-index: 2;
    background: var(--bg-alt);
}

.skills {
    z-index: 3;
    background: var(--bg);
}

.projects {
    z-index: 4;
    background: var(--bg-alt);
}

.services {
    z-index: 5;
    background: var(--bg-alt);
}

.contact {
    z-index: 6;
    background: var(--bg);
    padding-bottom: 110px;
}

.eyebrow {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    opacity: 0.8;
}

h2 {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 44px);
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    background:
        linear-gradient(
            120deg,
            #ffffff 30%,
            var(--accent) 90%
        );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- nav ---------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 40px;
    background: rgba(11, 11, 20, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text);
}

.nav-logo span {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav {
        padding-top:
            max(14px, env(safe-area-inset-top));
        padding-right:
            max(18px, env(safe-area-inset-right));
        padding-bottom: 14px;
        padding-left:
            max(18px, env(safe-area-inset-left));
    }

    .nav-burger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top:
            calc(
                60px +
                env(safe-area-inset-top)
            );
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: center;
        gap: 0;
        background: rgba(11, 11, 20, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition:
            max-height 0.3s ease,
            opacity 0.25s ease;
    }

    .nav-links.open {
        max-height: 60vh;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 16px 20px;
        font-size: 15px;
        border-top: 1px solid var(--border);
    }
}

/* ---------- hero ---------- */

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.35;
    pointer-events: none;
    animation:
        float 14s ease-in-out infinite alternate;
}

.glow-1 {
    width: 420px;
    height: 420px;
    background: var(--accent);
    top: -80px;
    left: -100px;
}

.glow-2 {
    width: 480px;
    height: 480px;
    background: var(--accent-2);
    bottom: -120px;
    right: -120px;
    animation-delay: -6s;
}

@keyframes float {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform:
            translate(40px, 30px)
            scale(1.1);
    }
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    -webkit-mask-image:
        radial-gradient(
            ellipse at center,
            black 0%,
            transparent 72%
        );
    mask-image:
        radial-gradient(
            ellipse at center,
            black 0%,
            transparent 72%
        );
}

.role-badges {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.role-badges span {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    background: var(--surface);
}

/* ---------- terminal ---------- */

.terminal {
    position: relative;
    z-index: 1;
    width: min(600px, 90vw);
    background: rgba(20, 20, 31, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 10px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px var(--border);
    overflow: hidden;
}

.hero-terminal {
    --mx: 50%;
    --my: 50%;
}

.hero-terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background:
        radial-gradient(
            240px circle at
                var(--mx)
                var(--my),
            var(--accent),
            transparent 70%
        );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

.terminal-bar {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.terminal-title {
    margin-left: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 13px;
}

.terminal-body {
    padding: 26px 28px;
    font-family: var(--font-mono);
    font-size: clamp(14px, 2vw, 17px);
    line-height: 1.9;
}

.prompt {
    color: #27c93f;
}

.cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.contact-line {
    margin-top: 6px;
}

.contact-line a {
    color: var(--accent);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-line a:hover {
    text-decoration: underline;
}

.scroll-hint {
    position: absolute;
    bottom: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    animation: bounce 2s ease-in-out infinite;
    z-index: 1;
}

.scroll-hint svg {
    width: 16px;
    height: 16px;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ---------- about ---------- */

#matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.about-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    text-align: center;
}

.about-content p:not(.eyebrow) {
    margin-top: 20px;
    line-height: 1.9;
    font-family: var(--font-body);
    font-size: clamp(15px, 2vw, 18px);
}

.about-content .eyebrow {
    text-align: center;
}

.about-content h2.scramble,
.about-content p.scramble {
    color: transparent;
}

/* оборачивает буквы одного слова, чтобы браузер не переносил строку
   посередине слова (см. комментарий в scrambleBlock в script.js) */
.scramble-word {
    white-space: nowrap;
}

/* каждая буква принудительно растянута до 1ch (шире её обычной ширины),
   а пробел между словами остаётся "родным" узким — без этого добавочного
   интервала слова визуально слипаются друг с другом */
.scramble {
    word-spacing: 0.3em;
}

.scramble .scramble-word span {
    display: inline-block;
    width: 1ch;
    text-align: center;
    color: var(--accent);
}

.about-content p.scramble .scramble-word span {
    color: #cfcfe6;
}

/* ---------- skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(120px, 1fr)
        );
    gap: 16px;
    max-width: 780px;
    width: 100%;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    opacity: 0;
    transform: translateY(16px);
    transition:
        transform 0.4s
            cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.35s ease,
        box-shadow 0.4s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow:
        0 12px 30px
        rgba(51, 153, 255, 0.15);
}

.skill-card span:last-child {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
}

.skill-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.skill-icon.mono {
    background-color: var(--text-dim);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition:
        background-color 0.25s ease;
}

.skill-card:hover .skill-icon.mono {
    background-color: var(--accent);
}

.mask-linux {
    -webkit-mask-image:
        url('assets/icons/linux.svg');
    mask-image:
        url('assets/icons/linux.svg');
}

.mask-mikrotik {
    -webkit-mask-image:
        url('assets/icons/mikrotik.svg');
    mask-image:
        url('assets/icons/mikrotik.svg');
}

.mask-wireguard {
    -webkit-mask-image:
        url('assets/icons/wireguard.svg');
    mask-image:
        url('assets/icons/wireguard.svg');
}

/* ---------- projects ---------- */

.projects {
    background: var(--bg-alt);
    padding-top: clamp(72px, 9vh, 86px);
    padding-bottom: clamp(52px, 7vh, 68px);
}

.projects h2 {
    margin-bottom: 28px;
}

.net-lines {
    position: absolute;
    top: 55%;
    left: 50%;
    transform:
        translate(-50%, -50%)
        rotate(90deg);
    width: 2px;
    height: min(1240px, 86vw);
    overflow: visible;
}

.net-lines line {
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    vector-effect: non-scaling-stroke;
}

.projects-list {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
    max-width: 1280px;
    width: calc(100vw - 112px);
    z-index: 1;
}

.node {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 26px 28px;
    opacity: 0;
    transform: translateY(18px);
    transition:
        transform 0.45s
            cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
}

.node:hover {
    transform: translateY(-3px);
    box-shadow:
        0 16px 40px
        rgba(0, 0, 0, 0.35);
}

.node-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: rgba(51, 153, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 14px;
}

.node-icon svg {
    width: 20px;
    height: 20px;
}

.node h3 {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.node p {
    flex-grow: 1;
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.node-tags span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    border:
        1px solid
        rgba(51, 153, 255, 0.3);
    border-radius: 20px;
    padding: 4px 10px;
}

/* ---------- services ---------- */

.orbit-wrap {
    position: relative;
    width: 100%;
    height:
        min(
            52rem,
            94vw,
            calc(100dvh - 320px)
        );
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at center,
            rgba(0, 191, 255, 0.1),
            transparent 70%
        );
    z-index: -1;
}

.orbit-circle {
    position: relative;
    width: 17rem;
    height: 17rem;
    border:
        2px solid
        rgba(102, 255, 247, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.orbit-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(0, 191, 255, 0.1),
            transparent 70%
        );
    box-shadow:
        0 0 120px
            rgba(102, 255, 247, 0.3),
        inset 0 0 60px
            rgba(0, 191, 255, 0.1);
    animation:
        orbit-pulse 3s ease-in-out infinite;
}

@keyframes orbit-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.orbit-inner {
    position: absolute;
    width: 14.5rem;
    height: 14.5rem;
    border:
        2px solid
        rgba(102, 255, 247, 0.2);
    border-radius: 50%;
    animation:
        orbit-flash 2s infinite ease-in-out;
}

.orbit-text {
    position: relative;
    text-align: center;
    color: #fff;
    z-index: 2;
}

.orbit-text h3 {
    font-family: var(--font-head);
    font-size: 1.8rem;
    margin: 0 0 0.4rem;
    color: #fff;
}

.orbit-text p {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    margin: 0;
}

.orbit-module {
    position: absolute;
    width: 4rem;
    height: 4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(0, 191, 255, 0.15),
            rgba(30, 30, 47, 0.8)
        );
    box-shadow:
        0 0 40px
        rgba(0, 191, 255, 0.4);
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    animation:
        orbit-flash 2s infinite ease-in-out;
    text-decoration: none;
}

.orbit-module::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5rem;
    height: 5rem;
    border: 2px solid #3399ff;
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
}

@keyframes orbit-flash {
    0%,
    100% {
        box-shadow:
            0 0 40px
            rgba(0, 191, 255, 0.4);
    }

    50% {
        box-shadow:
            0 0 80px
            rgba(0, 191, 255, 0.8);
    }
}

.orbit-module:hover {
    transform: scale(1.1);
    animation:
        orbit-flash 1s infinite;
}

.orbit-module svg {
    width: 23px;
    height: 23px;
    fill: #3399ff;
    pointer-events: none;
}

.orbit-label {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translate(-50%, 100%);
    opacity: 0;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #3399ff;
    white-space: nowrap;
    transition: opacity 0.3s;
    pointer-events: none;
}

.orbit-module:hover .orbit-label {
    opacity: 1;
}

.orbit-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orbit-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orbit-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #00cfff;
    border-radius: 50%;
    opacity: 0.8;
    animation:
        orbit-float-up 4s linear infinite;
}

@keyframes orbit-float-up {
    0% {
        transform:
            translateY(0)
            translateX(0);
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform:
            translateY(-200px)
            translateX(var(--shift-x));
        opacity: 0;
    }
}

/* ---------- contact ---------- */

.contact .eyebrow {
    text-align: center;
}

.icon-links {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 16px;
    margin-top: 26px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow:
        0 10px 26px
        rgba(51, 153, 255, 0.25);
}

.icon-btn span {
    width: 20px;
    height: 20px;
    display: inline-block;
    background-color: var(--text-dim);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition:
        background-color 0.2s ease;
}

.icon-btn:hover span {
    background-color: var(--accent);
}

.mask-telegram {
    -webkit-mask-image:
        url('assets/icons/telegram.svg');
    mask-image:
        url('assets/icons/telegram.svg');
}

.mask-github {
    -webkit-mask-image:
        url('assets/icons/github.svg');
    mask-image:
        url('assets/icons/github.svg');
}

.mask-mail {
    -webkit-mask-image:
        url('assets/icons/mail.svg');
    mask-image:
        url('assets/icons/mail.svg');
}

/* ---------- footer ---------- */

.site-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    text-align: center;
    padding-top: 20px;
    padding-right:
        max(20px, env(safe-area-inset-right));
    padding-bottom:
        max(20px, env(safe-area-inset-bottom));
    padding-left:
        max(20px, env(safe-area-inset-left));
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* ---------- точки навигации ---------- */

.scroll-dots {
    position: fixed;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.scroll-dots .dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--text-dim);
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.scroll-dots .dot:hover {
    border-color: var(--accent);
}

.scroll-dots .dot.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.35);
    box-shadow:
        0 0 14px var(--accent-glow);
}

.scroll-dots .dot::after {
    content: attr(data-label);
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.scroll-dots .dot:hover::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration:
            0.001ms !important;
        animation-iteration-count:
            1 !important;
        transition-duration:
            0.001ms !important;
    }
}

/* ---------- планшеты ---------- */

@media (max-width: 1100px) and (min-width: 769px) {
    .projects {
        padding-top: 74px;
        padding-bottom: 50px;
    }

    .projects h2 {
        margin-bottom: 22px;
    }

    .projects-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 16px;
        max-width: 860px;
        width: calc(100vw - 72px);
    }

    .node {
        padding: 19px 21px;
    }

    .node-icon {
        margin-bottom: 10px;
    }

    .node p {
        font-size: 14px;
        line-height: 1.55;
    }

    .node-tags {
        margin-top: 12px;
    }

    .net-lines {
        top: 0;
        width: 2px;
        height: 100%;
        transform: translateX(-50%);
    }
}

/* ---------- невысокие экраны ---------- */

@media (max-height: 760px) and (min-width: 1101px) {
    .projects {
        padding-top: 66px;
        padding-bottom: 40px;
    }

    .projects h2 {
        margin-bottom: 18px;
    }

    .node {
        padding: 18px 20px;
    }

    .node-icon {
        margin-bottom: 9px;
    }

    .node p {
        font-size: 14px;
        line-height: 1.5;
    }

    .node-tags {
        margin-top: 10px;
    }
}

/* ---------- мобильная версия ---------- */

@media (max-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
        scroll-behavior: auto;
        scroll-padding-top: 0;
        overscroll-behavior-y: none;
    }

    body {
        touch-action: auto;
        overscroll-behavior-y: none;
    }

    section {
        --stack-shade: 0 !important;
        position: relative;
        top: auto;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: center;
        overflow: clip;
        scroll-snap-align: start;
        scroll-snap-stop: normal;
        padding-top: 82px;
        padding-right:
            max(
                16px,
                env(safe-area-inset-right)
            );
        padding-bottom: 58px;
        padding-left:
            max(
                16px,
                env(safe-area-inset-left)
            );
        transform: none !important;
    }

    section::after {
        display: none;
    }

    .nav,
    .nav-links,
    .terminal,
    .node {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav {
        background: rgba(11, 11, 20, 0.94);
    }

    .terminal {
        background: rgba(20, 20, 31, 0.96);
    }

    .node {
        background: rgba(255, 255, 255, 0.045);
    }

    .hero-glow {
        animation: none;
        filter: blur(80px);
    }

    .orbit-inner,
    .orbit-module,
    .orbit-module:hover {
        animation: none;
    }

    .orbit-module {
        width: 3.4rem;
        height: 3.4rem;
        box-shadow:
            0 0 26px
            rgba(0, 191, 255, 0.38);
    }

    .orbit-module::before {
        width: 4.3rem;
        height: 4.3rem;
    }

    .orbit-module svg {
        width: 19px;
        height: 19px;
    }

    .orbit-circle {
        width: 13rem;
        height: 13rem;
    }

    .orbit-inner {
        width: 11rem;
        height: 11rem;
    }

    .orbit-text h3 {
        font-size: 1.4rem;
    }

    .orbit-text p {
        font-size: 0.95rem;
    }

    .orbit-label {
        font-size: 0.65rem;
    }

    .node:hover {
        transform: none !important;
        box-shadow: none;
    }

    .skill-card:hover,
    .icon-btn:hover {
        transform: none !important;
        box-shadow: none;
    }

    .skill-card:hover {
        border-color: var(--border);
    }

    section:not(.hero) {
        border-radius: 24px 24px 0 0;
    }

    h2 {
        margin-bottom: 26px;
    }

    .terminal {
        width: 100%;
        max-width: 600px;
    }

    .terminal-body {
        padding: 21px 18px;
        font-size: 14px;
        line-height: 1.75;
        overflow-wrap: anywhere;
    }

    .role-badges {
        gap: 8px;
        margin-top: 22px;
    }

    .role-badges span {
        padding: 6px 11px;
        font-size: 11px;
    }

    .scroll-hint {
        bottom:
            max(
                22px,
                env(safe-area-inset-bottom)
            );
    }

    .about-content p:not(.eyebrow) {
        font-size: 16px;
        line-height: 1.7;
    }

    .skills {
        justify-content: flex-start;
    }

    .skills-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
        gap: 10px;
        max-width: 100%;
    }

    .skill-card {
        gap: 8px;
        padding: 15px 7px;
        border-radius: 11px;
    }

    .skill-icon {
        width: 29px;
        height: 29px;
    }

    .skill-card span:last-child {
        font-size: 11px;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .projects {
        justify-content: flex-start;
        padding-top: 76px;
        padding-bottom: 48px;
    }

    .projects h2 {
        margin-bottom: 20px;
    }

    .projects-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
        max-width: 100%;
        width: 100%;
    }

    .node {
        padding: 14px 12px;
        border-left-width: 2px;
    }

    .node-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }

    .node-icon svg {
        width: 18px;
        height: 18px;
    }

    .node h3 {
        margin-bottom: 7px;
        font-size:
            clamp(14px, 3.7vw, 16px);
        line-height: 1.2;
    }

    .node p {
        font-size: 13px;
        line-height: 1.45;
    }

    .node-tags {
        gap: 5px;
        margin-top: 10px;
    }

    .node-tags span {
        padding: 3px 7px;
        font-size: 10px;
    }

    .net-lines {
        top: 0;
        width: 2px;
        height: 100%;
        transform: translateX(-50%);
    }

    .services {
        height: 100svh;
        min-height: 100svh;
        padding-top:
            max(
                72px,
                env(safe-area-inset-top)
            );
        padding-bottom:
            max(
                28px,
                env(safe-area-inset-bottom)
            );
        overflow: hidden;
    }

    .services h2 {
        flex: 0 0 auto;
        margin-bottom: 18px;
    }

    .services .orbit-wrap {
        flex: 0 1 auto;
        width: 100%;
        height:
            min(
                360px,
                90vw,
                calc(100svh - 190px)
            );
        min-height: 0;
        max-height: 360px;
    }

    .contact {
        padding-bottom:
            calc(
                104px +
                env(safe-area-inset-bottom)
            );

        /*
         * Последний блок выравниваем по реальному
         * достижимому концу страницы.
         */
        scroll-snap-align: end;
        overflow-anchor: none;
    }

    .scroll-dots {
        display: none;
    }
}

/* ---------- узкие телефоны ---------- */

@media (max-width: 390px) {
    .skills-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .projects-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .node {
        padding: 16px 15px;
    }

    .net-lines {
        display: none;
    }

    .orbit-circle {
        width: 10.5rem;
        height: 10.5rem;
    }

    .orbit-inner {
        width: 8.8rem;
        height: 8.8rem;
    }

    .orbit-module {
        width: 2.8rem;
        height: 2.8rem;
    }

    .orbit-module::before {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* ---------- стабильный contact ---------- */

.contact .terminal,
.contact .icon-links {
    opacity: 1 !important;
    transform: none !important;
}

/* ---------- размер сервисов на компьютере ---------- */

.services {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top:
        clamp(72px, 8vh, 90px);
    padding-bottom:
        clamp(32px, 5vh, 52px);
    overflow: hidden;
}

.services h2 {
    flex: 0 0 auto;
    margin-bottom:
        clamp(12px, 2vh, 24px);
}

.services .orbit-wrap {
    flex: 0 1 auto;
    width: 100%;
    height:
        min(
            430px,
            90vw,
            calc(100dvh - 170px)
        );
    min-height: 0;
    max-height: 430px;
}

/*
 * Этот блок расположен после общих настроек,
 * поэтому повторно фиксируем мобильные значения.
 */
@media (max-width: 768px) {
    .services {
        height: 100svh;
        min-height: 100svh;
        padding-top:
            max(
                72px,
                env(safe-area-inset-top)
            );
        padding-bottom:
            max(
                28px,
                env(safe-area-inset-bottom)
            );
    }

    .services .orbit-wrap {
        height:
            min(
                360px,
                90vw,
                calc(100svh - 190px)
            );
        min-height: 0;
        max-height: 360px;
    }

    .contact {
        scroll-snap-align: end;
        overflow-anchor: none;
    }
}

@media (max-width: 768px) {
    .contact {
        height: 100svh;
        min-height: 100svh;
        padding-bottom: 72px;
        scroll-snap-align: end;
        overflow-anchor: none;
    }

    .site-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 72px;
        min-height: 72px;
        padding: 0 12px;
        line-height: 1;
        font-size: clamp(9px, 2.7vw, 12px);
        white-space: nowrap;
        overflow: hidden;
        contain: layout paint;
    }
}