/* Отображение кнопок в intro */
@media screen and (max-width: 736px) {
    #intro .actions.visible {
        display: flex;
    }
}

/* Поведение svg-иконок */
.svg-icon {
    height: 3rem;
    width: 3rem;
}

@media (max-width: 768px) {
    .svg-icon {
        height: 2.4rem;
        width: 2.4rem;
    }
}

@media (max-width: 480px) {
    .svg-icon {
        height: 2rem;
        width: 2rem;
    }

}

/* Анимации иконки */
.animated {
    animation: float-rotate 3s ease-in-out infinite;
}

@keyframes float-rotate {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-12px) rotate(1deg);
    }
}

/* Фоновые квадраты с градиентами */
.bg-square {
    background: linear-gradient(135deg, #238B01, #02633B);
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.7);
}

.bg-square.n1 {
    animation: float-reverse 4s ease-in-out infinite;
}

.bg-square.n2 {
    animation: float-tertiary 5s ease-in-out infinite;
    animation-delay: 1s;
}

.bg-square.n3 {
    animation: float-secondary 3.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes float-reverse {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(15px) rotate(-3deg);
    }
}

@keyframes float-secondary {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(12px) rotate(6deg);
    }
}

@keyframes float-tertiary {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-18px) rotate(5deg);
    }
}

/* анимация картинок */
.img-container {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
    max-height: 600px;
    aspect-ratio: 2/3;
    /* сохраняем вертикальную пропорцию */
    margin-bottom: 3rem;
}

@media screen and (max-width: 736px) {
    .img-container {
        max-width: 400px;
        margin: auto
    }
}

.floating-img {
    position: absolute;
    width: 60%;
    /* относительно родителя */
    height: auto;
    z-index: -100;
}

.floating-img img {
    width: 100%;
}

.img-1 {
    top: 5%;
    left: 10%;
    animation: float1 4s ease-in-out infinite;
}

.img-2 {
    top: 30%;
    left: 30%;
    animation: float2 5s ease-in-out infinite;
}

.img-3 {
    top: 55%;
    left: 15%;
    animation: float3 6s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-10%, -8%) rotate(-2deg);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(10%, -8%) rotate(4deg);
    }
}

@keyframes float3 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-5%, 8%) rotate(-1deg);
    }
}

/* Оформление страниц */
.accent-header h2 {
    color: var(--accent-primary);
    font-size: 2rem;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* ← вот это выровняет по центру */
    gap: 20px;

}

.article-card {
    display: flex;
    flex-direction: column;

    flex: 1 1 calc(33.333% - 20px);
    /* максимум 3 в ряду */
    min-width: 300px;
    /* минимальный размер */

    /* flex: 1 1 300px; */
    border: 1px solid transparent;
    padding: 20px;
    background: var(--bg-card);
    /* text-align: left; */
    margin-top: 4rem;

    /* Градиентная обводка как в других элементах */
    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        var(--gradient-hero) border-box;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card-inner .image {
    flex: 1 1 150px;
}

.card-inner .image img {
    width: 100%;
    height: auto;
    /* max-height: 100px; */
    object-fit: contain;
}

.card-inner>div {
    flex: 2 1 200px;
    display: flex;
    flex-direction: column;
}

.card-inner .actions {
    margin-top: auto;
}

/* .lower {
    vertical-align: bottom !important;
} */


/* Блок с кнопками */
.social-links {
    text-align: center;
    margin: 3rem 0;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--text-muted);
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.social-links::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-hero);
}

.social-links h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.social-links h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-hero);
    border-radius: 2px;
}

.social-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-links li {
    width: 200px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--gradient-hero);
    color: var(--text-primary) !important;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    height: 100%;
}

.social-links a:hover {
    transform: translateY(-3px);
}

.social-links i {
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-links a:hover i {
    transform: scale(1.2);
}

/* Адаптивность */
@media (max-width: 768px) {
    .social-links {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .social-links ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .social-links li {
        width: 100%;
        max-width: 280px;
    }

    .social-links h3 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 1280px) {
    .social-links {
        font-size: 1.2rem;
    }
}


/* Блок с видео */
.portfolio-video {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-secondary);
}

.video-container {
    position: relative;
    border-radius: 12px;
}

.video-desktop,
.video-mobile {
    display: none;
    width: fit-content;
    max-width: 100%;
    max-height: 50vh;
    height: auto;

    border: 1px solid transparent;
    border-radius: 12px;

    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        var(--gradient-hero) border-box;
    padding: 12px;
    margin: 0 auto;

    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-mobile {
    display: block;
    margin: 0 auto;
}

.video-desktop:hover,
.video-mobile:hover {
    transform: translateY(-12px) translateZ(0);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 55px color-mix(in srgb, var(--accent-secondary) 40%, transparent);
}

/* блок-схема */
.process-steps {
    list-style: none;
    padding: 0;
    margin: 0;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    row-gap: 2rem;
    column-gap: 0;
    counter-reset: step-counter;
}

.step {
    display: flex;
    align-items: center;
    counter-increment: step-counter;
    position: relative;
    flex: 1 1 260px;
    max-width: 50%;
}

.step-content {
    flex: 1 1 250px;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid transparent;
    text-align: center;
    font-weight: 500;
    background:
        linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) padding-box,
        linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) border-box;

    position: relative;
    padding-top: 2.5rem;
}

.step-content h3 {
    color: var(--bg-primary);
}

.step-content p {
    color: var(--bg-secondary);
    font-size: 1rem;
}

.step-content::before {
    content: counter(step-counter);
    position: absolute;
    top: -1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-hero);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    z-index: 2;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.step-arrow {
    font-size: 3rem;
    color: var(--accent-primary);
    margin: 0 1rem;
    font-weight: bold;
}

@media (max-width: 1100px) {
    .process-steps {
        flex-direction: column;
        row-gap: 0rem;
        column-gap: 0;
        align-items: center;
    }

    .step {
        flex: 1 1 100px;
        flex-direction: column;
        max-width: 50%;
    }

    .step-content {
        flex: 1 1 100px;
    }

    .step-arrow {
        transform: rotate(90deg);
        /* → становится ↓ */
        margin: 0.5rem 0;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .step {
        max-width: none;
    }

    .step-content {
        min-width: 150px;
        padding: 1rem;
        padding-top: 2rem;
    }

    .step-content::before {
        width: 2rem;
        height: 2rem;
        top: -1rem;
        font-size: 0.9rem;
    }
}

/* Элементы */
.radial-layout-six {
    font-weight: 500;
    position: relative;
    height: 700px;
    max-width: 900px;
    margin: 4rem auto;
    background: var(--bg-secondary);
}


.radial-center {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--accent-primary) 12%, var(--accent-secondary) 88%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: bold;
    font-size: 0.8rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid var(--bg-card);
}

.radial-item {
    position: absolute;
    width: 260px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.4s ease;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid transparent;
    background:
        linear-gradient(135deg, var(--accent-neon), var(--accent-hot)) padding-box,
        linear-gradient(135deg, var(--accent-neon), var(--accent-hot)) border-box;
}

.radial-item:hover {
    transform: scale(1.05);
    z-index: 3;
}

/* Позиционирование */
.radial-item.item-1 {
    top: 5%;
    left: calc(50% - 130px);
}

.radial-item.item-4 {
    bottom: 5%;
    left: calc(50% - 130px);
}

.radial-item.item-2 {
    top: 20%;
    right: 3%;
}

.radial-item.item-3 {
    bottom: 20%;
    right: 3%;
}

.radial-item.item-5 {
    bottom: 20%;
    left: 3%;
}

.radial-item.item-6 {
    top: 20%;
    left: 3%;
}

.radial-visual {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-primary);
}

.radial-visual i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.radial-visual img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.radial-visual .svg-icon {
    height: 2.5rem;
    width: 2.5rem;
    color: var(--accent-primary);
}

.radial-content {
    flex: 1;
    min-width: 0;
}

.radial-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: clamp(8px, 1rem, 18px);
    color: var(--bg-primary);
    line-height: 1.3;
}

.radial-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bg-secondary);
    line-height: 1.4;
}

.radial-layout-six::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 550px;
    height: 550px;
    border: 2px dashed var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
}

@media screen and (min-width: 1680px) {
    .radial-center {
        width: 240px;
        height: 240px;
    }

    .radial-layout-six {
        position: relative;
        height: 1100px;
        max-width: 1000px;
        margin: 4rem auto;
        background: var(--bg-secondary);
    }

    .radial-item {
        width: 270px;
    }
}


@media (max-width: 980px) {
    .radial-item.item-1 {
        top: -5%;
        left: 50%;
        transform: translateX(-50%);
    }

    .radial-item.item-4 {
        bottom: -5%;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 736px) {
    .radial-layout-six {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 0;
        max-width: 100%;
    }

    .radial-layout-six::before {
        display: none;
    }

    .radial-center {
        position: static;
        transform: none;
        align-self: center;
        margin-bottom: 2rem;
        order: -1;
    }

    .radial-item {
        position: static;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        transform: none !important;
    }

    .radial-content h3 {
        font-size: 1.1rem;
    }

    .radial-content p {
        font-size: 0.9rem;
    }
}

/* Шахматные элементы */
.chess-layout {
    font-weight: 500;
    max-width: 1000px;
    margin: 4rem auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
    background: var(--bg-secondary);
}

/* Центральная линия */
.chess-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

.chess-item {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    position: relative;
    transition: all 0.4s ease;
}

/* Элементы слева */
.chess-item.left-item {
    flex-direction: row;
    margin-right: 50%;
}

/* Элементы справа */
.chess-item.right-item {
    flex-direction: row-reverse;
    margin-left: 50%;
    align-self: flex-end;
}

/* Вертикальное - чередуем верх/низ */
.chess-item.left-item:nth-child(odd) {
    margin-top: -2rem;
}

.chess-item.left-item:nth-child(even) {
    margin-top: 2rem;
}

.chess-item.right-item:nth-child(odd) {
    margin-top: 2rem;
}

.chess-item.right-item:nth-child(even) {
    margin-top: -2rem;
}

.chess-visual {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-primary);
    position: relative;
    z-index: 2;
}

.chess-visual i,
.chess-visual svg {
    font-size: 2rem;
    color: var(--accent-primary);
}

.chess-visual img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.chess-content {
    flex: 1;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid transparent;


    /* Градиентная обводка */
    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        var(--gradient-hero) border-box;
}

.chess-item.left-item .chess-content::after,
.chess-item.right-item .chess-content::before {
    display: none;
}

/* Для левых элементов - тень справа указывает на центр */
.chess-item.left-item .chess-content {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 20px color-mix(in srgb, var(--accent-primary) 20%, transparent),
        5px 0 0 0 var(--accent-primary);
    /* Тень справа указывает на центр */
}

/* Для правых элементов - тень слева указывает на центр */
.chess-item.right-item .chess-content {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 20px color-mix(in srgb, var(--accent-primary) 20%, transparent),
        -5px 0 0 0 var(--accent-primary);
}

.chess-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.chess-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Hover эффекты */
.chess-item:hover {
    transform: translateY(-5px);
}

.chess-item:hover .chess-visual {
    transform: scale(1.1);
    box-shadow: 0 12px 35px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.chess-item:hover .chess-content {
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px color-mix(in srgb, var(--accent-secondary) 30%, transparent),
        8px 0 0 0 var(--accent-secondary);
}

.chess-item.right-item:hover .chess-content {
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px color-mix(in srgb, var(--accent-secondary) 30%, transparent),
        -8px 0 0 0 var(--accent-secondary);
}

@media (max-width: 768px) {
    .chess-layout {
        gap: 2rem;
    }

    .chess-layout::before {
        display: none;
    }

    .chess-item {
        flex-direction: column !important;
        margin: 0 !important;
        gap: 1rem;
        align-self: stretch !important;
        transform: none !important;
    }

    .chess-item.left-item,
    .chess-item.right-item,
    .chess-item.left-item:nth-child(n),
    .chess-item.right-item:nth-child(n) {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: stretch !important;
    }

    .chess-visual {
        align-self: center;
        width: 70px;
        height: 70px;
        order: -1;
    }

    .chess-visual i {
        font-size: 1.7rem;
    }

    .chess-content {
        padding: 1.5rem;
        text-align: center;
        box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.3),
            0 0 20px color-mix(in srgb, var(--accent-primary) 20%, transparent) !important;
    }

    .chess-content h3 {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 0.8rem;
    }

    .chess-content p {
        font-size: 0.95rem;
        text-align: center;
        line-height: 1.5;
    }

    .chess-item:hover {
        transform: none !important;
    }

    .chess-item:hover .chess-visual {
        transform: scale(1.05);
    }

    .chess-item:hover .chess-content {
        box-shadow:
            0 8px 25px rgba(0, 0, 0, 0.3),
            0 0 15px color-mix(in srgb, var(--accent-primary) 20%, transparent) !important;
    }
}

@media (max-width: 480px) {
    .chess-layout {
        gap: 1.5rem;
    }

    .chess-item {
        gap: 0.8rem;
    }

    .chess-visual {
        width: 60px;
        height: 60px;
    }

    .chess-visual i {
        font-size: 1.5rem;
    }

    .chess-content {
        padding: 1.2rem;
    }

    .chess-content h3 {
        font-size: 1.1rem;
    }

    .chess-content p {
        font-size: 0.9rem;
    }
}