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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: -webkit-linear-gradient(90deg, #000000, #0d1521, #070e18, #000000, #0d1521, #070e18);
    background: linear-gradient(90deg, #000000, #0d1521, #070e18, #000000, #0d1521, #070e18);
    background-size: 400% 100%;
    animation: gradientShift 15s ease infinite;
    color: #e0e0e0;
    min-height: 100vh;
    position: relative;
    padding-top: 60px;
    padding-bottom: 60px;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(45, 45, 45, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-title {
    font-size: 18px;
    font-weight: bold;
    color: #e0e0e0;
    flex: 1;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(61, 61, 61, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-button:hover {
    background: rgba(77, 77, 77, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:active {
    background: rgba(53, 53, 53, 0.4);
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
}

.nav-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.nav-button:has(img[alt="VK"]) .nav-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) saturate(2000%) hue-rotate(200deg) brightness(1.1);
}

.nav-button:has(img[alt="GitHub"]) .nav-icon {
    filter: brightness(0) invert(1);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.container-inner {
    width: 100%;
}

.layout-wrapper {
    display: flex;
    width: 100%;
}

.right-content {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.header {
    width: 25%;
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rectangles-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 40px 20px;
    min-height: calc(100vh - 120px);
}

.rectangle {
    height: 600px;
    background: rgba(45, 45, 45, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-comparison {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.image-comparison-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.comparison-image-left {
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.1s ease-out;
}

.comparison-image-right {
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0.1s ease-out;
}

.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: default;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: left 0.1s ease-out;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.comparison-handle::before,
.comparison-handle::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 12px;
    background-color: rgba(0, 0, 0, 0.5);
}

.comparison-handle::before {
    left: 12px;
}

.comparison-handle::after {
    right: 12px;
}

.rectangle-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.rectangle-text {
    color: #e0e0e0;
    text-align: center;
    padding: 20px;
    line-height: 1.6;
    max-width: 100%;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Скрываем scrollbar, но сохраняем возможность прокрутки */
.rectangle-text {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE и Edge */
}

.rectangle-text::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.rectangle-text .text-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 13px;
    color: #ffffff;
}

.rectangle-text .text-description {
    font-size: 11px;
    font-weight: 400;
    margin-bottom: 13px;
    color: #d0d0d0;
    text-align: left;
}

.rectangle-text .text-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 10px;
    color: #c0c0c0;
}

.rectangle-text .text-features li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.rectangle-text .text-features li.feature-broken {
    color: #ff0000;
    opacity: 0.9;
}

.rectangle-text .text-features li.feature-broken:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.2);
        box-shadow: 0 0 0 8px rgba(255, 0, 0, 0);
    }
}

.rectangle-text .text-features li.feature-warning {
    color: #ffd700;
    opacity: 0.9;
}

.rectangle-text .text-features li.feature-warning:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #ffd700;
    border-radius: 50%;
    animation: pulseYellow 1.5s ease-in-out infinite;
}

@keyframes pulseYellow {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.2);
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
    }
}

.rectangle-text .text-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: rgba(65, 154, 254, 0.8);
    font-weight: bold;
}

.rectangle-text .download-button {
    margin-top: 25px;
    margin-bottom: 10px;
}

.download-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.2s ease;
    background: rgba(61, 61, 61, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-button .download-text {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.download-button.loading .download-text {
    opacity: 0;
}

.download-button .path {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    margin: -36px 0 0 -36px;
    width: 72px;
    height: 72px;
}

.download-button .path .arrow {
    bottom: 27px;
    width: 2px;
    height: 21px;
    position: absolute;
    left: 50%;
    border-radius: 1px;
    margin: 0 0 0 -1px;
    transform-origin: 50% 100%;
    background: rgba(255, 255, 255, 0.9);
}

.download-button .path .arrow:before,
.download-button .path .arrow:after {
    content: '';
    display: block;
    width: 2px;
    height: 14px;
    bottom: -2px;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    border-radius: 1px;
    transform-origin: 50% 100%;
}

.download-button .path .arrow:before {
    right: 50%;
    transform: rotate(-44deg) translateX(2px);
}

.download-button .path .arrow:after {
    left: 50%;
    transform: rotate(44deg) translateX(-2px);
}

.download-button .path svg {
    width: 72px;
    height: 72px;
    display: block;
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-dashoffset: 592.73;
    stroke-dasharray: 0 592.73 20 592.73;
}

.download-button .circle {
    position: absolute;
    width: 70px;
    height: 70px;
    margin: -35px 0 0 -35px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    overflow: hidden;
}

.download-button .circle .water {
    transform: translateY(116%);
    background: rgba(65, 154, 254, 0.6);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.download-button .circle .water svg {
    display: block;
    width: 116px;
    height: 6px;
    position: absolute;
    bottom: 100%;
}

.download-button .circle .water svg:nth-child(1) {
    right: 0;
    fill: rgba(48, 143, 250, 0.6);
    animation: forward 1.65s infinite;
}

.download-button .circle .water svg:nth-child(2) {
    left: 0;
    fill: rgba(65, 154, 254, 0.6);
    margin-bottom: -1px;
    animation: backward 0.825s infinite linear;
}

.download-button.loading .path {
    animation: movePath 0.4s linear forwards;
}

.download-button.loading .path .arrow {
    animation: arrow 0.5s linear forwards 3.7s;
}

.download-button.loading .path .arrow:before {
    animation: arrowB 0.4s linear forwards, arrowBCheck 0.5s linear forwards 3.7s;
}

.download-button.loading .path .arrow:after {
    animation: arrowA 0.4s linear forwards, arrowACheck 0.5s linear forwards 3.7s;
}

.download-button.loading .path svg {
    animation: load 3s linear forwards 0.45s, reset 0.7s linear forwards 3.7s;
}

.download-button.loading .circle .water {
    animation: fill 3s linear forwards 0.45s;
}

.download-button:active {
    transform: scale(0.92) translateZ(0);
}

@keyframes load {
    0% {
        stroke-dashoffset: 592.73;
        stroke-dasharray: 0 592.73 20 592.73;
    }
    42% {
        stroke-dasharray: 0 592.73 80 592.73;
    }
    85% {
        stroke-dashoffset: 80;
        stroke-dasharray: 0 592.73 32 592.73;
    }
    100% {
        stroke-dashoffset: 32;
        stroke-dasharray: 0 592.73 32 592.73;
    }
}

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

@keyframes movePath {
    70% {
        transform: translateY(-10px);
    }
}

@keyframes arrow {
    0% {
        background: rgba(255, 255, 255, 0.9);
        transform: rotate(34deg) translate(-2.5px, 2px);
    }
    40% {
        transform: rotate(-7deg) translate(0, 0);
    }
    99% {
        transform: rotate(0) translate(0, 0);
    }
    100% {
        background: rgba(255, 255, 255, 0.9);
    }
}

@keyframes arrowBCheck {
    0%, 20% {
        transform: rotate(-86deg) translateX(2px) translateY(1px) scaleY(0.714);
        opacity: 1;
    }
    100% {
        transform: rotate(-44deg) translateX(2px) scaleY(1) translateY(0);
        opacity: 1;
    }
}

@keyframes arrowACheck {
    0% {
        transform: rotate(0deg) translate(-1px, -1px);
        opacity: 1;
    }
    40% {
        transform: rotate(60deg) translate(-2px, 1px);
        opacity: 1;
    }
    100% {
        transform: rotate(44deg) translateX(-2px);
        opacity: 1;
    }
}

@keyframes arrowB {
    0% {
        transform: rotate(-44deg) translateX(2px);
    }
    60% {
        transform: rotate(-60deg) translateX(2px);
    }
    99% {
        transform: rotate(0deg) translateX(1px);
        opacity: 1;
    }
    100% {
        transform: rotate(0deg) translateX(1px);
        opacity: 0;
    }
}

@keyframes arrowA {
    0% {
        transform: rotate(44deg) translateX(-2px);
    }
    60% {
        transform: rotate(60deg) translateX(-2px);
    }
    99% {
        transform: rotate(0deg) translateX(-1px);
        opacity: 1;
    }
    100% {
        transform: rotate(0deg) translateX(-1px);
        opacity: 0;
    }
}

@keyframes fill {
    0% {
        transform: translateY(116%);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

@keyframes backward {
    100% {
        transform: translateX(-50%);
    }
}

@keyframes forward {
    100% {
        transform: translateX(50%);
    }
}

.rectangle-left {
    width: 600px;
    height: 600px;
    border-radius: 50%;
}

.rectangle-right {
    width: 900px;
}

/* Адаптивность для автоскейла */
@media (max-width: 1400px) {
    .rectangle-left {
        width: calc(600px * 0.8);
        height: calc(600px * 0.8);
    }
    
    .rectangle-right {
        width: calc(900px * 0.8);
    }
    
    .rectangle {
        height: calc(600px * 0.8);
    }
}

@media (max-width: 1200px) {
    .rectangles-container {
        flex-direction: column;
        gap: 25px;
    }
    
    .rectangle-left {
        width: min(600px, 90vw);
        height: min(600px, 90vw);
    }
    
    .rectangle-right {
        width: min(900px, 90vw);
    }
    
    .rectangle {
        height: min(600px, 90vw);
    }
}

@media (max-width: 768px) {
    .rectangle-left {
        width: min(500px, 85vw);
        height: min(500px, 85vw);
    }
    
    .rectangle-right {
        width: min(750px, 85vw);
    }
    
    .rectangle {
        height: min(500px, 85vw);
    }
}

@media (max-width: 480px) {
    .rectangle-left {
        width: min(400px, 90vw);
        height: min(400px, 90vw);
    }
    
    .rectangle-right {
        width: min(600px, 90vw);
    }
    
    .rectangle {
        height: min(400px, 90vw);
    }
    
    .rectangles-container {
        padding: 20px 10px;
    }
    
    .nav-title {
        font-size: 12px;
    }
    
    .navbar {
        padding: 12px 15px;
    }
    
    .nav-button span {
        display: none;
    }
    
    .nav-button:has(img[alt="GitHub"]) span {
        display: none;
    }
    
    .nav-button {
        padding: 8px;
    }
}

.copyright {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    background: transparent;
    z-index: 10;
}

.copyright p {
    margin: 0;
}
