﻿*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* reset button styles — navigation via onclick */
button {
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
    -webkit-appearance: none;
    appearance: none;
}

*:focus {
    outline: none;
}

:root {
    --accent: #7c6ef5;
    --accent-soft: rgba(124, 110, 245, 0.13);
    --accent-mid: rgba(124, 110, 245, 0.28);
    --accent-glow: rgba(124, 110, 245, 0.5);
    --black: #0b0b0b;
    --ink: #1c1c2e;
    --muted: #6b7280;
    --muted2: #9ca3af;
    --bg: #ffffff;
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.45);
    --card-bg: rgba(250, 250, 253, 0.9);
    --card-border: rgba(0, 0, 0, 0.07);
    --ease: cubic-bezier(0.76, 0, 0.24, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur: 0.75s;
    --radius: 18px;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--black);
    font-family: "Inter", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Page loader (показывается только при незакэшированных шрифтах) ── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: var(--bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
#page-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* лого + полоска внутри лоадера */
.pl-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    opacity: 0;
    transform: translateY(8px);
    animation: pl-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}
.pl-logo {
    height: auto;
    max-height: 60px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(124, 110, 245, 0.22));
    animation: pl-breathe 2.6s ease-in-out 0.5s infinite;
    will-change: transform;
}
.pl-bar {
    position: relative;
    width: 100px;
    height: 1.5px;
    background: rgba(124, 110, 245, 0.12);
    border-radius: 2px;
    overflow: hidden;
}
.pl-bar-fill {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 0%;
    background: linear-gradient(90deg, #7c6ef5, #a89af5);
    border-radius: 2px;
    transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pl-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes pl-breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* custom cursor — pointer devices only */
@media (pointer: fine) {
    html,
    body {
        cursor: none;
    }
    * {
        cursor: none !important;
    }
}

/* restore defaults on touch devices */
@media (pointer: coarse) {
    body,
    * {
        cursor: auto !important;
    }
    #cursor-dot,
    #cursor-trail-canvas {
        display: none !important;
    }
    .slide-inner {
        will-change: auto; /* снимаем GPU-promotion с 5 inner'ов — экономим VRAM на мобайле */
    }
}

::selection {
    background: var(--accent-mid);
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3,
.eyebrow,
.contact-h2,
.portfolio-h2,
.big-h,
.hero-stat-num,
.svc-title,
.svc-badge,
.c-card-title,
.btn,
.btn-pf,
.tg-btn,
.pf-more {
    font-family: "Syne", system-ui, sans-serif;
}

/* ─ GRAIN NOISE OVERLAY ─ */
#grain {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain-shift 0.1s steps(1) infinite;
    will-change: transform;
    contain: strict;
}

@keyframes grain-shift {
    0% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-3%, 1%);
    }

    40% {
        transform: translate(2%, -3%);
    }

    60% {
        transform: translate(-2%, 3%);
    }

    80% {
        transform: translate(3%, -1%);
    }
}

/* ─ LOGO ─ */
/* fixed logo — hidden on desktop, shown on mobile (@media 900px) */
@media (min-width: 901px) {
    #site-logo {
        display: none;
    }
}

/* per-slide logo — desktop only */
.slide-logo {
    position: absolute;
    top: 24px;
    left: 32px;
    z-index: 10;
    opacity: 0;
    animation: fade-up 0.5s 0.45s ease forwards;
}

.logo-img {
    display: block;
    width: 116px;
    height: auto;
    filter: brightness(0);
    /* filter excluded from transition: brightness/invert causes repaint every frame */
    transition: opacity 0.2s ease;
    will-change: transform;
}

#site-logo:hover .logo-img,
.slide-logo:hover .logo-img {
    opacity: 0.7;
}

/* invert only s4 logo, not all logos */
#s4 .slide-logo .logo-img {
    filter: brightness(0) invert(1);
}

/* mobile fixed logo on dark slide */
body.s4 #site-logo .logo-img {
    filter: brightness(0) invert(1);
}

/* скрываем логотипы на не-героных слайдах раньше — на узких экранах
   centered slide-inner поднимается и налезает на logo top:24px */
@media (max-width: 1100px) {
    .slide:not(#s1) .slide-logo {
        display: none;
    }
}

/* на совсем узких экранах скрываем все логотипы включая hero */
@media (max-width: 520px) {
    .slide-logo {
        display: none;
    }
}

/* ─ CAT S3 ─ */
.s3-cat {
    position: absolute;
    bottom: 18px;
    left: 0;
    width: clamp(110px, 16vw, 200px);
    max-height: 200px;
    height: auto;
    pointer-events: none;
    z-index: 5;
    transform: translateX(-110%);
    opacity: 0;
}
.s3-cat.cat-run {
    will-change: transform;
    animation: cat-run 12s 0.15s linear forwards;
}
@keyframes cat-run {
    0% {
        transform: translateX(-110%);
        opacity: 1;
    }
    92% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 110%));
        opacity: 0;
    }
}

@media (max-width: 900px) {
    .s3-cat {
        width: clamp(143px, 20.8vw, 260px);
        max-height: 260px;
    }
    .s3-cat.cat-run {
        animation-duration: 5.2s;
    }
}

/* ─ PROGRESS ─ */
#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #c4b5fd);
    z-index: 800;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.65s var(--ease); /* scaleX вместо width — compositor, zero layout */
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 14px var(--accent-glow);
}

/* ─ NAV DOTS ─ */
#dots {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 9px;
    z-index: 600;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    position: relative;
    transition:
        background 0.3s,
        height 0.4s var(--spring),
        border-radius 0.4s var(--spring),
        width 0.4s var(--spring);
}

/* transparent click area */
.dot::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    z-index: 0;
}

/* slide label — positioned relative to #dots container */
.dot::after {
    content: attr(data-label);
    position: absolute;
    right: 20px; /* fixed offset: dot width + gap */
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
    font-family: "Syne", sans-serif;
}

.dot:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.dot.active {
    background: var(--accent);
    height: 22px;
    border-radius: 4px;
}

body.s4 .dot {
    background: rgba(255, 255, 255, 0.22);
}

body.s4 .dot.active {
    background: var(--accent);
}

/* ─ SLIDE COUNTER ─ */
#slide-counter {
    position: fixed;
    bottom: 26px;
    right: 36px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(0, 0, 0, 0.2);
    z-index: 600;
    user-select: none;
    transition: color 0.5s;
    font-family: "Syne", sans-serif;
}

body.s4 #slide-counter {
    color: rgba(255, 255, 255, 0.18);
}

/* ─ SCROLL HINT ─ */
#scroll-hint {
    position: fixed;
    bottom: 26px;
    left: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: hint-in 1s 2.2s ease forwards;
    z-index: 600;
}

@keyframes hint-in {
    to {
        opacity: 1;
    }
}

.scroll-wheel {
    width: 22px;
    height: 36px;
    border: 1.5px solid rgba(0, 0, 0, 0.22);
    border-radius: 11px;
    position: relative;
    flex-shrink: 0;
}

.scroll-wheel::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    /* translate + opacity — compositor only */
    transform: translateX(-50%) translateY(0);
    width: 3px;
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    animation: sw 2s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes sw {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) translateY(12px);
        opacity: 0.4;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.scroll-hint-text {
    font-size: 10.5px;
    color: rgba(0, 0, 0, 0.28);
    font-weight: 600;
    letter-spacing: 0.06em;
    font-family: "Syne", sans-serif;
}

body.s4 .scroll-wheel {
    border-color: rgba(255, 255, 255, 0.2);
}

body.s4 .scroll-hint-text {
    color: rgba(255, 255, 255, 0.22);
}

/* cursor elements — hidden on touch */
#cursor-dot,
#cursor-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100001; /* выше #page-loader (100000) — курсор виден поверх прелоадера */
    will-change: transform;
}

/* hide all custom cursor elements on touch */
@media (pointer: coarse) {
    #cursor-dot,
    #cursor-trail-canvas {
        display: none;
    }
}

#cursor-dot {
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    background: var(--accent);
    /* background not animated — compositor-only via opacity below */
}

body.s4 #cursor-dot {
    background: #c4b5fd;
}

/* ─ FULLPAGE WRAPPER ─ */
#fp-wrap {
    position: fixed;
    inset: 0;
    will-change: transform;
    transition: transform var(--dur) var(--ease);
}

.slide {
    position: absolute;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh; /* dvh = реальная видимая область, исключает browser UI на мобильных */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout style paint; /* paint — рисование не вытекает за границу слайда */
}

.slide-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1140px;
    padding: 0 48px;
    will-change: transform, opacity;
    transition:
        transform var(--dur) var(--ease),
        opacity var(--dur) var(--ease);
}

/* ─ EYEBROW ─ */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.eyebrow::before {
    content: "";
    display: block;
    width: 28px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 2px;
}

/* ─ BUTTONS ─ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    border: none;
    transition: transform 0.24s var(--spring);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-primary {
    background: var(--black);
    color: #fff;
    position: relative;
    /* static shadow — not animated */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* hover shadow via opacity — compositor only */
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32);
    opacity: 0;
    transition: opacity 0.24s ease;
    pointer-events: none;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.92);
    color: var(--black);
    border: 1.5px solid rgba(0, 0, 0, 0.14);
    /* backdrop-filter removed: caused repaint on hover near blur blobs */
    position: relative;
    overflow: hidden;
}

/* color animation via pseudo-element — no color/border in transition */
.btn-outline::before {
    content: "";
    position: absolute;
    inset: -1.5px;
    border-radius: 50px;
    border: 1.5px solid var(--accent);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.btn-outline::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: rgba(124, 110, 245, 0.07);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.btn-outline:hover {
    color: var(--accent);
    transition:
        transform 0.24s var(--spring),
        color 0.22s ease;
}

.btn-outline:hover::before {
    opacity: 1;
}

.btn-outline:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════
       SLIDE 1 — HERO
    ═══════════════════════════════ */
#s1 {
    background: #f8f7ff;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(88px);
    will-change: transform;
}

.hero-blob-1 {
    width: 680px;
    height: 680px;
    background: radial-gradient(circle, rgba(124, 110, 245, 0.16) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.hero-blob-2 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.13) 0%, transparent 70%);
    bottom: -130px;
    left: -70px;
}

.hero-blob-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.1) 0%, transparent 70%);
    top: 38%;
    left: 38%;
}

@keyframes bd1 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    30% {
        transform: translate(3%, 2%) scale(1.05);
    }

    60% {
        transform: translate(-2%, 3%) scale(0.97);
    }
}

@keyframes bd2 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    40% {
        transform: translate(4%, -3%) scale(1.08);
    }

    70% {
        transform: translate(-3%, 4%) scale(0.95);
    }
}

@keyframes bd3 {
    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-5%, 6%);
    }
}

.hero-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(124, 110, 245, 0.18) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 72%);
    opacity: 0.5;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    /* backdrop-filter removed: expensive near blur blobs */
    border: 1px solid rgba(124, 110, 245, 0.22);
    border-radius: 50px;
    padding: 6px 14px 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 28px;
    letter-spacing: 0.02em;
    opacity: 0;
    box-shadow: 0 4px 16px rgba(124, 110, 245, 0.1);
    font-family: "Syne", sans-serif;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px #4ade80;
}

/* pulse via scale+opacity — compositor only */
.live-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.45);
    animation: live-pulse 2.2s ease-out infinite;
    will-change: transform, opacity;
}

@keyframes live-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    70% {
        transform: scale(2.2);
        opacity: 0;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.hero-h1 {
    font-size: clamp(64px, 11vw, 140px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.044em;
    color: var(--black);
    opacity: 0;
}

.hero-h1 .accent-line {
    display: block;
    background: linear-gradient(118deg, #2d18a0 0%, #6d5fe0 45%, #a487f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* background-position removed: causes repaint at 60fps.
               Заменяем на opacity-пульс — compositor only */
    animation: grad-shift 4s ease-in-out infinite;
    will-change: opacity;
}

@keyframes grad-shift {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.82;
    }
}

.hero-sub {
    font-size: clamp(15px, 1.8vw, 18px);
    color: var(--muted);
    font-weight: 400;
    line-height: 1.75;
    max-width: 510px;
    margin: 22px 0 38px;
    opacity: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    opacity: 0;
}

.hero-stats {
    display: flex;
    align-items: center;
    margin-top: 52px;
    opacity: 0;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    padding: 0 28px 0 0;
    margin: 0 28px 0 0;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.hero-stat:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.hero-stat-num {
    font-size: clamp(20px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--black);
    line-height: 1;
}

.hero-stat-label {
    font-size: 11px;
    color: var(--muted2);
    margin-top: 4px;
    font-weight: 500;
    font-family: "Inter", sans-serif;
}

#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s ease;
}

#s1.neural-ready #neural-canvas {
    opacity: 1;
}

.hero-scroll-down {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    animation: none;
    z-index: 5;
}

.scroll-arrow {
    width: 26px;
    height: 26px;
    color: var(--accent);
    animation: arrow-bob 2.2s ease-in-out infinite;
}

@keyframes arrow-bob {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    50% {
        transform: translateY(7px);
        opacity: 1;
    }
}

/* ═══════════════════════════════
       SLIDE 2 — CAPABILITIES
    ═══════════════════════════════ */
#s2 {
    background: #f6f5ff;
}

.s2-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(124, 110, 245, 0.048) 1px, transparent 1px), linear-gradient(90deg, rgba(124, 110, 245, 0.048) 1px, transparent 1px);
    background-size: 56px 56px;
    /* transform instead of background-position — compositor only, zero paint */
    animation: grid-sh 30s ease-in-out infinite;
    will-change: transform;
    mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 0%, transparent 75%);
}

@keyframes grid-sh {
    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(8px, 6px);
    }
}

.big-h {
    font-size: clamp(38px, 6.5vw, 82px);
    font-weight: 800;
    letter-spacing: -0.038em;
    line-height: 0.97;
    color: var(--black);
    margin-bottom: 10px;
}

.big-h em {
    font-style: normal;
    color: var(--black); /* начальное состояние — чёрный; анимация окрашивает при входе на слайд */
}

/* Плавная подсветка "любой" при входе на слайд #s2 */
body.anim-s2 #s2 .big-h em {
    animation: s2-em-in 0.95s 0.2s var(--ease) both;
}
@keyframes s2-em-in {
    from {
        color: #09090f;
    }
    to {
        color: #7c6ef5;
    }
}

.cap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 36px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    overflow: hidden;
    counter-reset: cap-counter;
}

.cap-card {
    position: relative;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 26px 22px 24px;
    counter-increment: cap-counter;
    /* background hover via ::before opacity — compositor, no paint */
}

/* hover fill — pre-rendered, animate opacity only */
.cap-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(124, 110, 245, 0.038);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.cap-card:hover::after {
    opacity: 1;
}

/* index number */
.cap-card::before {
    content: counter(cap-counter, decimal-leading-zero);
    position: absolute;
    top: 22px;
    right: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(0, 0, 0, 0.12);
    font-family: "Syne", sans-serif;
    line-height: 1;
}

.cap-card:nth-child(3n) {
    border-right: none;
}

.cap-card:nth-child(n + 4) {
    border-bottom: none;
}

.cap-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--black);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
}

.cap-icon svg {
    width: 17px;
    height: 17px;
    display: block;
    flex-shrink: 0;
}

/* ── Cap-icon animations ── */

/* 1. Чистый код — строки кода появляются одна за другой через stroke-dashoffset */
.cap-i-cl1 {
    stroke-dasharray: 8;
    stroke-dashoffset: 8;
    animation: cap-draw1 2.8s 0.2s ease-in-out infinite;
}
.cap-i-cl2 {
    stroke-dasharray: 5;
    stroke-dashoffset: 5;
    animation: cap-draw2 2.8s 0.7s ease-in-out infinite;
}
@keyframes cap-draw1 {
    0%,
    8% {
        stroke-dashoffset: 8;
    }
    45%,
    60% {
        stroke-dashoffset: 0;
    }
    92%,
    100% {
        stroke-dashoffset: 8;
    }
}
@keyframes cap-draw2 {
    0%,
    8% {
        stroke-dashoffset: 5;
    }
    45%,
    60% {
        stroke-dashoffset: 0;
    }
    92%,
    100% {
        stroke-dashoffset: 5;
    }
}

/* 2. Авторский дизайн — лучи вращаются */
.cap-i-rays {
    transform-box: fill-box;
    transform-origin: center;
    animation: cap-spin 10s linear infinite;
}
@keyframes cap-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 3. Полная адаптивность — углы рамки пульсируют, центральная точка мигает */
.cap-i-fr {
    transform-box: fill-box;
    transform-origin: center;
    animation: cap-expand 2.4s ease-in-out infinite;
}
.cap-i-dot {
    animation: cap-dot-pulse 2.4s ease-in-out infinite;
}
@keyframes cap-expand {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}
@keyframes cap-dot-pulse {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* 4. Анимации & эффекты — молния пульсирует */
.cap-i-bolt {
    transform-box: fill-box;
    transform-origin: center;
    animation: cap-zap 2s ease-in-out infinite;
}
@keyframes cap-zap {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.88);
    }
    45%,
    55% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 5. Качество — галочка рисуется */
.cap-i-check {
    stroke-dasharray: 11;
    stroke-dashoffset: 11;
    animation: cap-check 2.8s ease-in-out infinite;
}
@keyframes cap-check {
    0%,
    12% {
        stroke-dashoffset: 11;
    }
    50%,
    68% {
        stroke-dashoffset: 0;
    }
    95%,
    100% {
        stroke-dashoffset: 11;
    }
}

/* 6. Кому это нужно? — человечек машет рукой */
.cap-i-wavearm {
    transform-origin: 15px 9.5px;
    animation: cap-wave 1.4s ease-in-out infinite;
}
@keyframes cap-wave {
    0%,
    100% {
        transform: rotate(0deg);
    }
    30% {
        transform: rotate(-18deg);
    }
    65% {
        transform: rotate(22deg);
    }
}

/* 2. Авторский дизайн — сердце бьётся */
.cap-i-heart {
    transform-box: fill-box;
    transform-origin: center;
    animation: cap-beat 1.7s ease-in-out infinite;
}
@keyframes cap-beat {
    0%,
    100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.18);
    }
    35% {
        transform: scale(0.93);
    }
    50% {
        transform: scale(1.1);
    }
    65% {
        transform: scale(1);
    }
}

.cap-card h3 {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--black);
    margin-bottom: 7px;
    font-family: "Syne", sans-serif;
    line-height: 1.2;
}

.cap-card p {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.72;
    font-family: "Inter", sans-serif;
}

/* ═══════════════════════════════
       SLIDE 3 — SERVICES
    ═══════════════════════════════ */
#s3 {
    background: #ffffff;
    overflow: hidden;
}

.s3-blob {
    position: absolute;
    width: 700px;
    height: 500px;
    top: -150px;
    right: -200px;
    background: radial-gradient(ellipse, rgba(124, 110, 245, 0.07) 0%, transparent 65%);
    filter: blur(60px);
    pointer-events: none;
    will-change: transform;
    /* animation removed: filter:blur + CSS keyframes = repaint every frame */
}

.services-grid {
    display: none;
} /* deprecated */

/* ── Services carousel ── */
/* overflow: visible — card shadows not clipped */
.svc-carousel-wrap {
    width: 100%;
    overflow: visible;
}
.svc-carousel-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 38px;
}
.svc-carousel-nav {
    display: none;
}

@media (max-width: 900px) {
    .svc-carousel-wrap {
        overflow: hidden;
    }
    .svc-carousel-track {
        display: flex;
        gap: 0;
        margin-top: 14px;
        overflow: visible;
        /* start on featured card (index 1) — CSS guarantees it, no JS timing issues */
        transform: translateX(-100%);
        transition: transform 0.38s cubic-bezier(0.76, 0, 0.24, 1);
        will-change: transform;
    }
    .svc-carousel-track .svc-card {
        flex: 0 0 100%;
        width: 100%;
        margin: 0;
    }
    /* on mobile overflow:hidden clips external shadows — just remove them */
    .svc-carousel-track .svc-card.featured,
    .svc-carousel-track .svc-card.featured:hover {
        transform: none;
        box-shadow: none;
        margin: 0;
        padding: 28px 24px 26px;
    }
    .svc-carousel-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 14px;
        gap: 12px;
    }
    .svc-nav-btn {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: transparent;
        border: 1.5px solid rgba(124, 110, 245, 0.35);
        color: var(--accent);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition:
            border-color 0.2s,
            background 0.2s,
            opacity 0.2s;
        touch-action: manipulation;
        cursor: pointer;
    }
    .svc-nav-btn:active {
        background: rgba(124, 110, 245, 0.1);
        border-color: var(--accent);
    }
    .svc-nav-btn:disabled {
        opacity: 0.3;
    }
    .svc-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    .svc-pips {
        display: flex;
        gap: 7px;
        align-items: center;
    }
    .svc-pip {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.18);
        transition: all 0.3s var(--spring);
    }
    .svc-pip.svc-pip-active {
        background: var(--accent);
        width: 22px;
        border-radius: 4px;
    }
}

/* desktop: reset transform, show full grid */
@media (min-width: 901px) {
    .svc-carousel-wrap {
        overflow: visible;
    }
    .svc-carousel-track {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        transform: none !important;
        transition: none !important;
        flex: unset;
        width: auto;
    }
    .svc-carousel-nav {
        display: none !important;
    }
}

.svc-card {
    position: relative;
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 28px 24px 26px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* translateY(0) в базовом состоянии — Firefox не переключает режим
       рендеринга текста при окончании hover (transform всегда присутствует) */
    transform: translateY(0);
    transition:
        border-color 0.25s ease,
        transform 0.25s ease;
}

.svc-card:not(.featured):hover {
    transform: translateY(-3px);
}

.svc-card.featured {
    margin: -10px -8px;
    padding: 36px 30px 32px;
}

.svc-card.featured:hover {
    transform: translateY(-2px);
}

/* accent stripe left:
           top/bottom % → layout каждый кадр; заменяем на scaleY — compositor */
.svc-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
    opacity: 0;
    transform: scaleY(0.6);
    transform-origin: center;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* hover shadow via opacity — compositor only */
.svc-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow:
        0 0 0 3px rgba(124, 110, 245, 0.08),
        0 8px 32px rgba(124, 110, 245, 0.1);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.svc-card:hover {
    border-color: rgba(124, 110, 245, 0.35);
}

.svc-card:hover::before {
    opacity: 1;
    transform: scaleY(0.76);
}

.svc-card:hover::after {
    opacity: 1;
}

/* контент всегда поверх canvas-эффекта */
.svc-card.featured > *:not(canvas) {
    position: relative;
    z-index: 2;
    /* фикс размытости текста внутри transform:scale — принудительный GPU-слой */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

.svc-card.featured {
    background: var(--black);
    border: 1.5px solid var(--accent);
    box-shadow:
        0 0 0 4px rgba(124, 110, 245, 0.12),
        0 20px 60px rgba(0, 0, 0, 0.32),
        0 0 40px rgba(124, 110, 245, 0.18);
}

.svc-card.featured::before {
    background: #c4b5fd;
    opacity: 1;
    transform: scaleY(0.68);
}

.svc-card.featured:hover {
    border-color: #a78bfa;
}

/* featured hover shadow via opacity too */
.svc-card.featured::after {
    background: linear-gradient(135deg, rgba(124, 110, 245, 0.12) 0%, transparent 55%);
    box-shadow:
        0 0 0 5px rgba(124, 110, 245, 0.18),
        0 20px 56px rgba(0, 0, 0, 0.35);
    opacity: 1;
}

.svc-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.38);
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 50px;
    padding: 3px 10px;
    margin-bottom: 18px;
}

.svc-card.featured .svc-badge {
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.18);
}

.svc-price {
    font-family: "Exo 2", "Syne", sans-serif;
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--black);
    line-height: 1;
    margin-bottom: 3px;
    display: inline-block;
    transform: scaleX(1.2);
    transform-origin: left center;
}

.svc-card.featured .svc-price {
    color: #fff;
}

.svc-price-note {
    font-size: 11.5px;
    color: var(--muted2);
    margin-bottom: 18px;
    font-weight: 500;
    font-family: "Inter", sans-serif;
}

.svc-card.featured .svc-price-note {
    color: rgba(255, 255, 255, 0.4);
}

.svc-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.svc-card.featured .svc-title {
    color: #fff;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.svc-desc {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 18px;
    font-family: "Inter", sans-serif;
}

.svc-card.featured .svc-desc {
    color: rgba(255, 255, 255, 0.5);
}

.svc-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    padding-top: 16px;
}

.svc-features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12px;
    color: var(--muted);
    font-family: "Inter", sans-serif;
}

.svc-features li::before {
    content: "—";
    flex-shrink: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    line-height: 1.6;
    margin-top: 0;
}

.svc-card.featured .svc-features li {
    color: rgba(255, 255, 255, 0.55);
}

.svc-prepay-note {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid rgba(124, 110, 245, 0.18);
    font-family: "Inter", sans-serif;
    letter-spacing: 0.005em;
    box-shadow:
        0 2px 12px rgba(124, 110, 245, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.06);
    line-height: 1.5;
}

.prepay-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.prepay-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    flex-shrink: 0;
}

.prepay-body {
    font-size: 14px;
    color: rgba(15, 14, 23, 0.68);
}

/* ═══════════════════════════════
       SLIDE 4 — PORTFOLIO (dark)
    ═══════════════════════════════ */
#s4 {
    background: #07060f;
}

.s4-glow {
    position: absolute;
    width: 900px;
    height: 900px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(124, 110, 245, 0.26) 0%, rgba(68, 51, 200, 0.1) 35%, transparent 65%);
    filter: blur(70px);
    pointer-events: none;
    animation: s4g 16s ease-in-out infinite;
    will-change: opacity; /* opacity — compositor-only: filter:blur + transform-кадры = repaint каждый кадр в Firefox */
}

@keyframes s4g {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.82;
    }
}

.s4-grid {
    position: absolute;
    inset: -30px;
    pointer-events: none;
    /* grid drawn on canvas in JS — fish-eye at cursor */
}

.portfolio-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(167, 139, 250, 0.65);
    margin-bottom: 22px;
    font-family: "Syne", sans-serif;
}

.portfolio-eyebrow::before {
    content: "";
    display: block;
    width: 28px;
    height: 1.5px;
    background: rgba(167, 139, 250, 0.5);
}

.portfolio-h2 {
    font-size: clamp(54px, 10.5vw, 128px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.87;
    color: #fff;
}

.portfolio-h2 .grad-line {
    display: block;
    background: linear-gradient(118deg, #a78bfa 0%, #7c6ef5 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* opacity pulse, phase-offset for variety */
    animation: grad-shift 4s 1.2s ease-in-out infinite;
    will-change: opacity;
}

.portfolio-sub {
    font-size: clamp(14px, 1.6vw, 16px);
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.8;
    max-width: 460px;
    margin: 22px 0 40px;
    font-family: "Inter", sans-serif;
}

.btn-pf {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 34px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    border: none;
    transition: transform 0.28s var(--spring);
    box-shadow: 0 8px 32px rgba(124, 110, 245, 0.5);
    position: relative;
    overflow: visible;
    /* required for ::after pulse ring */
}

/* gloss overlay — static */
.btn-pf::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    border-radius: 50px;
    pointer-events: none;
}

/* pulse ring via scale+opacity — compositor only */
.btn-pf::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50px;
    border: 2px solid rgba(124, 110, 245, 0.5);
    pointer-events: none;
    animation: pf-pulse 3s ease-out infinite;
    will-change: transform, opacity;
}

@keyframes pf-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    70% {
        transform: scale(1.18);
        opacity: 0;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

.btn-pf:hover {
    transform: translateY(-3px) scale(1.04);
}

/* hide ring on hover — use paused instead of animation:none (avoids reflow) */
.btn-pf:hover::after {
    opacity: 0;
    animation-play-state: paused;
}

.btn-pf svg {
    transition: transform 0.24s var(--spring);
}

.btn-pf:hover svg {
    transform: translateX(5px);
}

.pf-row {
    display: flex;
    gap: 14px;
    margin-top: 50px;
    align-items: flex-end;
}

.pf-thumb {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    animation: pf-float 5s ease-in-out infinite;
    position: relative;
    width: 104px;
    height: 68px;
}

.pf-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 6, 15, 0.65) 100%);
}

.pf-thumb:nth-child(2) {
    animation-delay: -1.6s;
    opacity: 0.7;
}

.pf-thumb:nth-child(3) {
    animation-delay: -3.2s;
    opacity: 0.42;
}

@keyframes pf-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

.pf-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px;
}

.pf-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(124, 110, 245, 0.44);
}

.pf-bar:nth-child(2) {
    width: 62%;
    background: rgba(255, 255, 255, 0.14);
}

.pf-bar:nth-child(3) {
    width: 42%;
    background: rgba(255, 255, 255, 0.07);
}

.pf-more {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 700;
    align-self: flex-end;
    padding-bottom: 4px;
}

/* ═══════════════════════════════
       SLIDE 5 — CONTACT
    ═══════════════════════════════ */
#s5 {
    background: #f8f7ff;
}

.s5-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(124, 110, 245, 0.09) 0%, transparent 65%);
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
    /* animation removed: filter:blur + CSS keyframes = repaint every frame */
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}

.contact-h2 {
    font-size: clamp(52px, 9vw, 116px);
    font-weight: 800;
    letter-spacing: -0.044em;
    line-height: 0.88;
    color: var(--black);
    margin-bottom: 22px;
}

.contact-h2 em {
    font-style: normal;
    display: block;
    background: linear-gradient(118deg, #2d18a0 0%, #6d5fe0 45%, #a487f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-sub {
    font-size: clamp(14px, 1.6vw, 16px);
    color: var(--muted);
    line-height: 1.8;
    max-width: 360px;
    margin-bottom: 38px;
    font-family: "Inter", sans-serif;
}

.tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background: var(--black);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: none;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.28s var(--spring);
    /* shadow not clipped — no overflow on button */
    overflow: visible;
}

/* hover shadow via opacity — compositor only */
.tg-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.tg-btn:hover {
    transform: translateY(-3px);
}

.tg-btn:hover::after {
    opacity: 1;
}

.tg-icon-wrap {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tg-icon-wrap svg {
    width: 13px;
    height: 13px;
    fill: #fff;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    /* gap:1px + background — разделитель = 1px flex-gap, не принадлежащий ни одной карточке;
       overflow:hidden клипает card backgrounds по border-radius контейнера — без него
       background прорезается в угловые зазоры (12px card-radius vs 14px container-radius) */
    gap: 1px;
    background: rgba(0, 0, 0, 0.08);
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    overflow: hidden;
}

/* ─── OFERTA LINK ─── */
.oferta-link {
    align-items: center;
    gap: 6px;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    padding-bottom: 1px;
    transition:
        color 0.2s,
        border-color 0.2s;
    white-space: nowrap;
}

.oferta-link::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
    transition:
        width 0.2s,
        opacity 0.2s;
}

.oferta-link:hover {
    color: #5b46d6;
    border-color: rgba(91, 70, 214, 0.35);
}

.oferta-link:hover::before {
    width: 20px;
    opacity: 0.7;
}

/* desktop-вариант: внутри .contact-right, linearly под карточками */
.contact-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oferta-link--desktop {
    display: inline-flex;
    align-self: flex-start;
}

/* mobile-вариант: скрыт на десктопе */
.oferta-link--mobile {
    display: none;
    margin-top: 18px;
}

.c-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border-radius: 0;
    /* margin-left вместо transform: translateX — не создаёт stacking context,
       поэтому при hover Firefox не пересчитывает высоту карточки в физических пикселях
       и не съедает 1px gap контейнера */
    margin-left: 0;
    transition: margin-left 0.22s ease;
    position: relative;
    overflow: visible;
}

/* скруглённые углы вместо overflow:hidden на родителе */
.c-card:first-child {
    border-radius: 12px 12px 0 0;
}
.c-card:last-child {
    border-radius: 0 0 12px 12px;
}

/* background hover via opacity — no paint */
.c-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(124, 110, 245, 0.038);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.c-card:hover {
    margin-left: 4px;
}

.c-card:hover::before {
    opacity: 1;
}

.c-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--black);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.c-card-icon svg {
    width: 16px;
    height: 16px;
}

.c-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--black);
    line-height: 1.4;
    margin-bottom: 2px;
}

.c-card-text {
    font-size: 12px;
    color: var(--muted);
    font-family: "Inter", sans-serif;
}

/* ─ SITE END: cliff shadow ─ */
#s5::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to top, rgba(15, 14, 23, 0.13) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* cliff waves — три анимированных SVG-слоя */
.s5-cliff {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

/* каждый SVG вдвое шире контейнера — два периода волны для бесшовного цикла */
.s5-cliff .s5-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    will-change: transform;
}

@keyframes s5-wave-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.s5-wave-1 {
    animation: s5-wave-scroll 12s linear infinite;
}
.s5-wave-2 {
    animation: s5-wave-scroll 8s linear infinite reverse;
    animation-delay: -3s;
}
.s5-wave-3 {
    animation: s5-wave-scroll 5s linear infinite;
    animation-delay: -1.5s;
}

@media (prefers-reduced-motion: reduce) {
    .s5-wave {
        animation: none;
    }
}

.footer-note {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4; /* поверх волн */
    font-family: "Inter", "Syne", sans-serif;
    font-size: 10.5px;
    color: rgba(0, 0, 0, 0.38);
    white-space: nowrap;
    font-weight: 200;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@media (min-width: 901px) {
    .footer-note {
        bottom: 68px;
    }
}

/* ─ KEYFRAMES ─ */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Hero: анимации запускаются только после исчезновения лоадера (body.hero-ready) ── */
body.hero-ready .hero-tag {
    animation: fade-up 0.55s ease both;
}
body.hero-ready .hero-h1 {
    animation: fade-up 0.65s 0.12s ease both;
}
body.hero-ready .hero-sub {
    animation: fade-up 0.65s 0.26s ease both;
}
body.hero-ready .hero-actions {
    animation: fade-up 0.65s 0.4s ease both;
}
body.hero-ready .hero-stats {
    animation: fade-up 0.65s 0.54s ease both;
}
body.hero-ready .hero-scroll-down {
    animation: hint-in 1s 2s ease forwards;
}

/* ─ RESPONSIVE ─ */
@media (max-width: 1024px) {
    .hero-code-tag {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .slide-inner {
        padding: 0 24px;
    }

    /* logo: fixed hidden on mobile, per-slide via .slide:not(#s1) */
    #site-logo {
        display: none;
    }

    /* dots / hint */
    #dots {
        right: 4px;
    }
    #scroll-hint {
        display: none;
    }

    /* hide stats */
    .hero-stats,
    .pf-row {
        display: none;
    }

    /* hero */
    .hero-h1 {
        font-size: clamp(46px, 13vw, 86px);
    }
    .hero-sub {
        font-size: 13px;
        margin-bottom: 22px;
        margin-top: 10px;
    }
    .hero-actions {
        gap: 10px;
    }

    /* capabilities */
    .big-h {
        font-size: clamp(30px, 9vw, 56px);
        margin-bottom: 6px;
    }
    .cap-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 14px;
        /* gap + background = гарантированные разделители во всех браузерах */
        gap: 1px;
        background: rgba(0, 0, 0, 0.18);
        border: 1px solid rgba(0, 0, 0, 0.18);
    }
    /* сбрасываем все десктопные border-правила — разделители теперь через gap */
    .cap-card,
    .cap-card:nth-child(odd),
    .cap-card:nth-child(even),
    .cap-card:nth-child(3n),
    .cap-card:nth-child(n + 5),
    .cap-card:last-child {
        border-right: none;
        border-bottom: none;
    }
    .cap-card {
        padding: 14px 12px 12px;
    }
    .cap-card h3 {
        font-size: 13px;
        margin-bottom: 4px;
    }
    .cap-card p {
        font-size: 11.5px;
        line-height: 1.45;
    }
    .cap-icon {
        width: 26px;
        height: 26px;
        border-radius: 7px;
        margin-bottom: 9px;
    }
    .cap-icon svg {
        width: 13px;
        height: 13px;
        display: block;
        flex-shrink: 0;
    }

    /* services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 7px;
        margin-top: 14px;
    }
    .svc-card {
        padding: 26px 22px 24px;
    }
    .svc-card.featured,
    .svc-card.featured:hover {
        transform: none;
    }
    .svc-desc {
        display: none;
    }

    /* portfolio */
    .portfolio-h2 {
        font-size: clamp(40px, 12vw, 76px);
    }

    /* contacts */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .contact-cards {
        display: none;
    }
    .contact-right {
        display: none;
    }
    .oferta-link--desktop {
        display: none;
    }
    .oferta-link--mobile {
        display: inline-flex;
    }
    .contact-h2 {
        font-size: clamp(42px, 12vw, 76px);
    }
    .contact-sub {
        margin-bottom: 24px;
    }
}

@media (max-width: 600px) {
    .slide-inner {
        padding: 0 18px;
    }
    .hero-actions .btn-outline {
        display: none;
    }
    #slide-counter {
        display: none;
    }

    /* S1 — hero */
    .hero-h1 {
        font-size: clamp(40px, 12.5vw, 68px);
        line-height: 0.88;
    }
    .hero-sub {
        font-size: 12.5px;
        line-height: 1.65;
        max-width: 320px;
        margin-bottom: 20px;
    }
    .hero-tag {
        font-size: 11px;
        padding: 5px 12px 5px 8px;
        margin-bottom: 18px;
    }

    /* S2 — capabilities */
    .big-h {
        font-size: clamp(28px, 9.5vw, 48px);
        margin-bottom: 4px;
    }
    .eyebrow {
        margin-bottom: 12px;
    }
    .cap-grid {
        margin-top: 10px;
    }
    .cap-card {
        padding: 10px 9px 9px;
    }
    .cap-icon {
        width: 20px;
        height: 20px;
        margin-bottom: 6px;
        border-radius: 5px;
    }
    .cap-icon svg {
        width: 10px;
        height: 10px;
        display: block;
        flex-shrink: 0;
    }
    .cap-card h3 {
        font-size: 11.5px;
        margin-bottom: 3px;
    }
    .cap-card p {
        font-size: 10.5px;
        line-height: 1.4;
    }

    /* S3 — services */
    .services-grid {
        margin-top: 10px;
        gap: 5px;
    }
    .svc-card {
        padding: 22px 18px 20px;
    }
    .svc-badge {
        font-size: 8px;
        margin-bottom: 10px;
    }
    .svc-price {
        font-size: clamp(18px, 5.5vw, 26px);
        margin-bottom: 0;
    }
    .svc-price-note {
        font-size: 10px;
        margin-bottom: 8px;
    }
    .svc-title {
        font-size: 14px;
        padding-top: 10px;
        margin-bottom: 4px;
    }
    .svc-features {
        gap: 3px;
    }
    .svc-features li {
        font-size: 10.5px;
    }
    .svc-prepay-note {
        padding: 12px 16px;
        margin-top: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .prepay-title {
        font-size: 15px;
        white-space: normal;
    }
    .prepay-body {
        font-size: 13px;
        line-height: 1.5;
    }

    /* S4 — portfolio */
    .portfolio-h2 {
        font-size: clamp(36px, 12vw, 60px);
    }

    /* S5 — contacts */
    .contact-h2 {
        font-size: clamp(52px, 16vw, 82px);
        line-height: 0.86;
    }
    .tg-btn {
        width: auto;
        align-self: flex-start;
        padding: 13px 24px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .dot {
        opacity: 0.35;
    }
    .dot.active {
        opacity: 1;
    }
}

@media (max-width: 400px) {
    .hero-h1 {
        font-size: 38px;
    }
    .big-h {
        font-size: 26px;
    }
    .contact-h2 {
        font-size: 34px;
    }
    .portfolio-h2 {
        font-size: 32px;
    }
    .svc-price {
        font-size: 18px;
    }
}
