:root {
    --black: #000000;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
}

/* Автоматическое определение темы по системным настройкам */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-color: #000000;
        --text-color: #FFFFFF;
        --logo-color: #FFFFFF;
        --gray-light: #1A1A1A;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg-color: #FFFFFF;
        --text-color: #000000;
        --logo-color: #000000;
        --gray-light: #F5F5F5;
    }
}

/* Ручной выбор темы */
[data-theme="light"] {
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --logo-color: #000000;
    --gray-light: #F5F5F5;
}

[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #FFFFFF;
    --logo-color: #FFFFFF;
    --gray-light: #1A1A1A;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: clamp(16px, 1.5vw, 18px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    z-index: 1000;
    padding: 32px 0;
    margin-bottom: 64px;
    transition: background-color 0.3s ease;
}

.header-container {
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(20px, 3vw, 60px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 24px);
}

.logo-header {
    height: 32px;
    width: auto;
}

.logo-header a {
    display: block;
    height: 100%;
}

.logo-header svg {
    height: 100%;
    width: auto;
}

.logo-header svg path {
    fill: var(--logo-color);
    transition: fill 0.3s ease;
}

.logo-tagline {
    margin-top: -5px;
    padding-left: 5px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.3s ease;
}

nav {
    display: flex;
    align-items: center;
    gap: clamp(32px, 4vw, 64px);
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    margin-left: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.theme-toggle:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

nav a:hover {
    opacity: 0.5;
}

/* Main Content */
main {
    margin-top: 96px;
}

/* Hero Section */
.hero {
    width: 100%;
    max-width: 100%;
    padding: clamp(120px, 15vh, 200px) clamp(20px, 3vw, 60px) clamp(80px, 10vh, 160px);
    margin-bottom: clamp(120px, 15vh, 200px);
    box-sizing: border-box;
}

.hero-label {
    font-size: clamp(12px, 1.2vw, 14px);
    font-weight: 400;
    letter-spacing: clamp(2px, 0.3vw, 3px);
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: clamp(32px, 4vh, 48px);
    display: block;
}

h1 {
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.025em;
    margin-bottom: clamp(40px, 5vh, 64px);
    background: linear-gradient(135deg, var(--text-color) 0%, rgba(128, 128, 128, 0.6) 50%, var(--text-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    word-break: break-word;
    max-width: 100%;
}

.hero-description {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 300;
    line-height: 1.4;
    color: var(--text-color);
    max-width: min(1200px, 90vw);
}

/* Sections */
section {
    width: 100%;
    max-width: 100%;
    padding: clamp(80px, 12vh, 200px) clamp(20px, 3vw, 60px);
    margin-bottom: clamp(120px, 15vh, 200px);
    box-sizing: border-box;
}

section:last-child {
    margin-bottom: 0;
}

section#services {
    padding-left: 0;
    padding-right: 0;
    padding-top: clamp(80px, 12vh, 200px);
    padding-bottom: clamp(80px, 12vh, 200px);
    background: var(--gray-light);
    transition: background-color 0.3s ease;
    border-radius: clamp(40px, 5vw, 80px);
    overflow: hidden;
}

.section-label {
    font-size: clamp(12px, 1.2vw, 14px);
    font-weight: 400;
    letter-spacing: clamp(2px, 0.3vw, 3px);
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: clamp(32px, 4vh, 48px);
    display: block;
}

section#services .section-label,
section#services h2 {
    padding-left: clamp(20px, 3vw, 60px);
    padding-right: clamp(20px, 3vw, 60px);
}

h2 {
    font-size: clamp(36px, 5.5vw, 70px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.025em;
    margin-bottom: clamp(60px, 8vh, 120px);
    background: linear-gradient(135deg, var(--text-color) 0%, rgba(128, 128, 128, 0.6) 50%, var(--text-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    word-break: break-word;
    max-width: 100%;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 2vw, 24px);
    row-gap: clamp(16px, 2vw, 24px);
    background: transparent;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(20px, 3vw, 60px);
    box-sizing: border-box;
    align-items: start;
}

.service-card {
    background: var(--bg-color);
    padding: clamp(40px, 6vh, 80px) clamp(24px, 4vw, 60px);
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    min-height: clamp(400px, 50vh, 500px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    border-radius: clamp(12px, 1.5vw, 20px);
    border: none;
    margin-bottom: 0;
}

.service-card:last-child {
    margin-bottom: 0;
}

/* Первая колонка (нечетные карточки: 1, 3, 5, 7) - без смещения */
.service-card:nth-child(odd) {
    transform: translateY(0);
}

/* Вторая колонка (четные карточки: 2, 4, 6) - вся колонка смещена вниз */
.service-card:nth-child(even) {
    transform: translateY(clamp(120px, 15vh, 200px));
}

.service-card:hover {
    background: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Hover эффекты с учетом смещения колонок */
.service-card:nth-child(odd):hover {
    transform: translateY(-4px);
}

.service-card:nth-child(even):hover {
    transform: translateY(clamp(120px, 15vh, 200px)) translateY(-4px);
}

.service-image-placeholder {
    width: 100%;
    height: clamp(200px, 25vh, 300px);
    background: transparent;
    margin-bottom: clamp(24px, 3vh, 32px);
    border: 1px dashed var(--text-color);
    opacity: 0.2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.service-card:hover .service-image-placeholder {
    opacity: 0.4;
    border-color: var(--bg-color);
}

.service-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
}

.service-card:hover .service-number,
.service-card:hover .service-title,
.service-card:hover .service-description,
.service-card:hover .service-image-placeholder {
    color: var(--bg-color);
    border-color: var(--bg-color);
}

.service-number {
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: clamp(16px, 2vh, 24px);
    display: block;
    letter-spacing: clamp(1px, 0.2vw, 2px);
    transition: color 0.3s ease;
}

.service-title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: clamp(20px, 2.5vh, 28px);
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: -0.025em;
    word-break: break-word;
    transition: color 0.3s ease;
}

.service-description {
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.5;
    color: var(--text-color);
    font-weight: 300;
    transition: color 0.3s ease;
    margin-top: auto;
}

/* About Section */
.about-content {
    max-width: 100%;
}

.about-text {
    font-size: clamp(20px, 2.8vw, 32px);
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: clamp(40px, 5vh, 64px);
    font-weight: 300;
    max-width: min(1400px, 90vw);
    word-break: break-word;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* Content Section (for service pages) */
.content-section {
    width: 100%;
    max-width: 100%;
    padding: clamp(80px, 12vh, 200px) clamp(20px, 3vw, 60px);
    margin-bottom: clamp(120px, 15vh, 200px);
    box-sizing: border-box;
}

.content-text {
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: clamp(32px, 4vh, 48px);
    font-weight: 300;
    max-width: min(1000px, 90vw);
}

.content-text:last-child {
    margin-bottom: 0;
}

.back-link {
    display: inline-block;
    margin-top: clamp(48px, 6vh, 64px);
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.5;
}

/* Footer */
footer {
    width: 100%;
    max-width: 100%;
    padding: clamp(60px, 10vh, 120px) clamp(20px, 3vw, 60px) clamp(32px, 5vh, 60px);
    margin-top: clamp(120px, 15vh, 200px);
    box-sizing: border-box;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(40px, 6vw, 80px);
    margin-bottom: clamp(40px, 6vh, 80px);
}

.footer-section h3 {
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 400;
    letter-spacing: clamp(1.5px, 0.25vw, 2.5px);
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: clamp(20px, 3vh, 32px);
}

.footer-section p,
.footer-section a {
    font-size: clamp(14px, 1.8vw, 20px);
    line-height: 1.4;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    margin-bottom: clamp(12px, 1.5vh, 18px);
    font-weight: 300;
    word-break: break-word;
}

.footer-section a:hover {
    opacity: 0.5;
}

.footer-bottom {
    padding-top: clamp(24px, 4vh, 48px);
    margin-top: clamp(40px, 6vh, 80px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    font-size: clamp(11px, 1.1vw, 13px);
    color: var(--text-color);
    letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
}

/* Responsive */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(12px, 1.5vw, 20px);
        row-gap: clamp(12px, 1.5vw, 20px);
    }
    
    .service-card:nth-child(even) {
        transform: translateY(clamp(100px, 13vh, 180px));
    }
    
    .service-card:nth-child(even):hover {
        transform: translateY(clamp(100px, 13vh, 180px)) translateY(-4px);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(32px, 5vw, 60px);
    }
}

@media (max-width: 768px) {
    header {
        padding: clamp(20px, 3vh, 24px) 0;
    }
    
    nav a {
        display: none;
    }
    
    nav {
        display: flex;
        gap: 0;
    }
    
    .theme-toggle {
        margin-left: 0;
    }
    
    main {
        margin-top: clamp(70px, 10vh, 96px);
    }
    
    .logo-header {
        height: 28px;
    }
    
    .logo-wrapper {
        gap: clamp(12px, 1.5vw, 16px);
    }
    
    .logo-tagline {
        font-size: 11px;
        margin-top: -5px;
        padding-left: 5px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: clamp(12px, 1.5vh, 16px);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        row-gap: clamp(12px, 1.5vh, 16px);
    }
    
    .service-card {
        min-height: auto;
        padding: clamp(32px, 5vh, 48px) clamp(20px, 3vw, 32px);
        border-radius: clamp(10px, 1.2vw, 16px);
        transform: none !important;
    }
    
    .service-card:hover {
        transform: translateY(-4px) !important;
    }
    
    .service-image-placeholder {
        height: clamp(180px, 22vh, 240px);
        margin-bottom: clamp(20px, 2.5vh, 28px);
    }
    
    footer {
        padding-top: clamp(40px, 6vh, 60px);
        padding-bottom: clamp(24px, 4vh, 40px);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: clamp(24px, 4vh, 40px);
        margin-bottom: clamp(24px, 4vh, 40px);
    }
    
    .footer-section h3 {
        margin-bottom: clamp(16px, 2vh, 24px);
    }
    
    .footer-section p,
    .footer-section a {
        margin-bottom: clamp(10px, 1.2vh, 14px);
    }
    
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding-top: clamp(20px, 3vh, 32px);
        margin-top: clamp(24px, 4vh, 40px);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .logo-header {
        height: 24px;
    }
    
    h1 {
        font-size: clamp(32px, 10vw, 40px);
    }
    
    h2 {
        font-size: clamp(28px, 8vw, 36px);
    }
}
