#services {
    scroll-margin-top: 120px;
}

.services {
    width: 1081px;
    padding: 50px 0;
    margin-bottom: 50px;
}

.services h2 {
    font-size: 34px;
    font-weight: 300;
    margin-bottom: 40px;
    color: #fff;
    text-align: left;
    padding-left: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.service-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.service-icon .dark-icon {
    display: none;
}

body.dark-theme .service-icon .light-icon {
    display: none;
}

body.dark-theme .service-icon .dark-icon {
    display: block;
}

.service-title {
    font-family: 'Ubuntu';
    font-size: 34px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 18px;
    text-align: center;
}

.service-desc {
    font-family: 'Ubuntu';
    font-size: 22px;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

.service-block {
    background-color: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.service-block:active {
    transform: translateY(0);
}

[data-theme="dark"] .service-block {
    transform: translateY(0);
}

[data-theme="dark"] .service-block:hover {
    transform: translateY(-5px);
}

[data-theme="dark"] .service-block:active {
    transform: translateY(0);
}


.service-block.modal-animating {
    opacity: 0;
    transform: translate3d(-50%, 10%, 0);
    pointer-events: none;
}

@media (max-width: 400px) {
  .service-block.active {
    max-width: 98vw;
    max-height: 98vw;
  }
}

.service-details {
    display: none;
    font-family: 'Ubuntu';
    font-size: 20px;
    color: #fff;
    margin-top: 18px;
    text-align: center;
    line-height: 1.5;
}

.service-block.active .service-details {
    display: block;
    overflow-y: auto;
    max-height: 180px;
    margin-top: 12px;
}

/* Затемнение фона при активном модальном блоке */
.services-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.666s ease, visibility 0.666s ease;
    will-change: opacity, visibility;
}

.services-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.services-modal-backdrop.fade-out {
    opacity: 0;
    visibility: hidden;
}

.service-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 680px;
    height: 680px;
    background-color: transparent;
    border: 1px solid #666;
    border-radius: 30px;
    z-index: 10000;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.666s ease, opacity 0.666s ease, visibility 0.666s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 36px 36px 36px;
    box-sizing: border-box;
    overflow: hidden;
}

.service-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.service-modal.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

.service-modal-header {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    padding-bottom: 0;
    z-index: 2;
    margin-bottom: 20px;
    height: auto;
    margin-top: -20px;
}

.service-modal-content {
    width: 100%;
    overflow-y: auto;
    padding-top: 20px;
    flex-grow: 1;
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

.service-modal-content::-webkit-scrollbar {
    width: 8px;
}

.service-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.service-modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 102, 102, 0.5);
    border-radius: 4px;
}

.service-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 102, 102, 0.7);
}

.service-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 102, 102, 0.5) rgba(0, 0, 0, 0.1);
}

.service-modal .service-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 15px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.service-modal .service-icon img {
    filter: brightness(0) invert(1);
}

.service-modal .service-title {
    font-size: 34px;
    margin-bottom: 8px;
    color: #666;
    text-shadow: 0 0 10px rgba(102, 102, 102, 0.1);
}

.service-modal .service-desc {
    font-size: 22px;
    color: #666;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0;
}

.service-modal .service-details {
    font-size: 20px;
    display: block;
    text-align: left;
    padding: 0 10px;
    color: #fff;
    line-height: 1.5;
}

.service-modal .service-details b {
    color: #666;
    font-weight: 700;
}

.service-modal-close,
.service-modal-close:hover,
.service-modal-close svg,
.service-modal-close svg circle,
.service-modal-close svg path,
[data-theme="dark"] .service-modal-close,
[data-theme="dark"] .service-modal-close:hover,
[data-theme="dark"] .service-modal-close svg,
[data-theme="dark"] .service-modal-close svg circle,
[data-theme="dark"] .service-modal-close svg path,
[data-theme="light"] .service-modal-close,
[data-theme="light"] .service-modal-close:hover,
[data-theme="light"] .service-modal-close svg,
[data-theme="light"] .service-modal-close svg circle,
[data-theme="light"] .service-modal-close svg path {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.666s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-overlay.fade-out {
    opacity: 0;
}

body.modal-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

body.modal-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
}

body.modal-open .container:not(.service-modal):not(.services-modal-backdrop),
body.modal-open header,
body.modal-open footer {
    pointer-events: none;
}

body.modal-open .service-modal,
body.modal-open .services-modal-backdrop {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] .service-desc,
[data-theme="dark"] .service-modal .service-desc,
[data-theme="dark"] .service-modal .service-details b {
    color: #fff;
}
[data-theme="dark"] .service-icon {
    color: #fff;
    fill: #fff;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #666;
    text-shadow: 0 0 10px #666;
    transform: scale(1.1);
}


[data-theme="dark"] .service-modal {
    background: linear-gradient(135deg, rgba(16,24,26,0.95) 0%, rgba(16,24,26,0.98) 100%);
    border: 1px solid #181818;
}

[data-theme="dark"] .service-modal-close:hover {
    filter: none;
}

[data-theme="dark"] .service-modal-close svg {
    fill: none;
    stroke: #666;
}

[data-theme="dark"] .service-modal-close svg circle {
    stroke: #666;
    stroke-width: 2;
}

[data-theme="dark"] .service-modal-close svg path {
    stroke: #666;
    stroke-width: 2;
    stroke-linecap: round;
}

body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after,
[data-theme="dark"] body::before,
[data-theme="dark"] body::after,
[data-theme="dark"] .parallax-bg::before,
[data-theme="dark"] .parallax-bg::after,
.parallax-bg,
.parallax-bg::before,
.parallax-bg::after {
    display: none !important;
}

.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.parallax-bg::before,
.parallax-bg::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.parallax-bg::before {
    background-image: 
        radial-gradient(circle at 50% 50%, 
            rgba(0, 255, 156, 0.15) 0%, 
            transparent 50%);
    transform: translateZ(-1px) scale(2.5);
}

.parallax-bg::after {
    background-image: 
        radial-gradient(circle at 50% 50%, 
            rgba(0, 255, 156, 0.08) 0%, 
            transparent 70%);
    transform: translateZ(-2px) scale(3.5);
}

@media (max-width: 768px) {
    .service-modal {
        width: 90vw;
        height: 90vh;
        padding: 24px 18px;
    }

}

[data-theme="light"] .service-block {
    transform: translateY(0);
}

[data-theme="light"] .service-block:hover {
    transform: translateY(-5px);
}

[data-theme="light"] .service-block:active {
    transform: translateY(0);
}

[data-theme="light"] .service-modal-close:hover {
    filter: none;
}

[data-theme="light"] .service-modal-close svg {
    fill: none;
    stroke: #666;
}

[data-theme="light"] .service-modal-close svg circle {
    stroke: #666;
    stroke-width: 2;
}

[data-theme="light"] .service-modal-close svg path {
    stroke: #666;
    stroke-width: 2;
    stroke-linecap: round;
}

[data-theme="dark"] .service-modal-close,
[data-theme="light"] .service-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}