:root {
    --black: #0B0B0B;
    --white: #FFFFFF;
    --gold: #D4AF37;
    --gold-rgb: 212, 175, 55;
    --gold-dark: #B5922B;
    --gold-light: #F3E5AB;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --font-main: 'Inter', 'Noto Sans', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans KR', 'Noto Sans Arabic', 'Noto Sans Thai', 'Noto Sans Devanagari', 'Noto Sans Hebrew', 'Noto Sans Armenian', 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- ADA / WCAG 2.2 Requirements --- */
.skip-link { position: absolute; top: -100%; left: 1rem; padding: 1rem; background: var(--gold); color: var(--black); z-index: 1000; font-weight: bold; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.visually-hidden:not(:focus):not(:active) { position: absolute; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; white-space: nowrap; clip-path: inset(100%); clip: rect(0 0 0 0); overflow: hidden; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 2px; }

#kintsugiCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.gold-text { color: var(--gold); background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 300; letter-spacing: -0.02em; margin-bottom: 1rem; color: #121212; }
.expertise-section h2, .infrastructure-section h2, .contact-section h2, .hero-section h1 { color: #ffffff; }

/* --- Buttons --- */
.btn { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; color: var(--white); background-color: transparent; border: 1px solid var(--gold); position: relative; transition: var(--transition); cursor: pointer; text-align: center; font-family: inherit; min-height: 44px; padding: 0.8rem 2rem; font-size: clamp(1rem, 1.2vw, 1.2rem); border-radius: 4px; }
.btn::after { content: ''; position: absolute; inset: 0; background: var(--gold); opacity: 0; transition: var(--transition); border-radius: 4px; }
.btn:hover { color: var(--black); transform: translateY(-2px); box-shadow: 0 0 20px var(--gold-glow); }
.btn:hover::after { opacity: 1; }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2.5rem; }

/* --- Navbar --- */
.navbar { position: fixed; top: 0; width: 100%; padding: 0.8rem 0; background: rgba(11, 11, 11, 0.85); backdrop-filter: blur(12px); z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.05); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { font-weight: 800; font-size: 1.5rem; color: var(--gold); }
.logo-text { font-weight: 300; letter-spacing: 0.1em; font-size: clamp(0.8rem, 2vw, 1.1rem); }
.nav-links { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 2.5rem); flex-wrap: wrap; }
.nav-links a { color: var(--white); text-decoration: none; opacity: 0.85; transition: all 0.3s ease; font-size: 0.95rem; padding: 0.4rem 0; position: relative; }
.nav-links a:hover, .nav-links a:focus-visible { opacity: 1; color: var(--gold); border-bottom: 2px solid var(--gold); }

/* --- Hero --- */
.hero-section { min-height: 100dvh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6rem 0; }
.hero-section .subtitle { letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem; color: #bfa15a; margin-bottom: 1.5rem; }
.hero-section h1 { font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 200; line-height: 1.1; margin-bottom: 1.5rem; }
.hero-desc { max-width: 600px; margin: 0 auto 2rem; font-size: clamp(1rem, 1.2vw, 1.2rem); color: rgba(255,255,255,0.85); font-weight: 300; }

/* --- About --- */
.about-section { background: #f5f5f5; color: #121212; padding: 5rem 0; }
.about-text { max-width: 800px; }
.about-section h2 { color: #121212; margin-bottom: 1rem; } 
.about-text p { color: #333; font-weight: 400; line-height: 1.8; }
.about-stats { display: flex; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; align-items: flex-start; }
.stat-num { font-size: 2rem; font-weight: 600; color: #b5912b; }
.stat-item span:last-child { font-size: 0.9rem; color: #555; margin-top: 0.25rem; }

/* --- Expertise (С подключенной картинкой bg.jpg) --- */
.expertise-section { 
    padding: 5rem 0; 
    position: relative; 
    /* Подключаем картинку, накладываем поверх темный слой, чтобы текст читался */
    background: rgba(11, 11, 11, 0.85) url('pic/bg.jpg') center center / cover no-repeat; 
    background-blend-mode: multiply; 
}
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header p { color: rgba(255,255,255,0.8); }
.expertise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1.5rem; }
.expertise-card { background: rgba(11, 11, 11, 0.7); border: 1px solid rgba(255,255,255,0.05); padding: 1.8rem; transition: var(--transition); border-radius: 12px; min-height: 180px; cursor: pointer; backdrop-filter: blur(4px); /* Стекло для читаемости фона */ }
.expertise-card:hover { transform: translateY(-5px); border-color: var(--gold); background: rgba(11, 11, 11, 0.8); }
.expertise-card h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--white); }
.expertise-card p { font-size: 0.95rem; color: rgba(255,255,255,0.7); }

/* --- Infrastructure --- */
.infrastructure-section { padding: 5rem 0; }
.infrastructure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.5rem; }
.service-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 2rem; transition: var(--transition); cursor: pointer; height: 100%; }
.service-card:hover { transform: translateY(-5px); border-color: var(--gold); background: rgba(255,255,255,0.06); }
.service-icon { margin-bottom: 1.2rem; }
.service-icon svg { width: 40px; height: 40px; color: var(--gold); }
.service-card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.8rem; color: var(--gold); }
.service-card p { font-size: 0.95rem; color: rgba(255,255,255,0.85); line-height: 1.7; }

/* --- Stack --- */
.stack-section { background: #f5f5f5; color: #121212; padding: 3.5rem 0; }
.stack-wrapper { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
.stack-wrapper h2 { margin: 0; font-size: 1.8rem; color: #121212; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.stack-chips span { background: #e0e0e0; padding: 0.5rem 1.2rem; border-radius: 30px; font-size: 0.9rem; font-weight: 500; color: #222; }

/* --- Contact Form & CCPA Toggle --- */
.contact-section { padding: 5rem 0; }
.contact-wrapper { max-width: 700px; margin: 0 auto; text-align: center; }
#contactForm { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group-triple { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group input, .form-group textarea { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); padding: 1rem; color: var(--white); font-family: inherit; font-size: 1rem; outline: none; transition: var(--transition); border-radius: 8px; min-width: 150px; min-height: 50px; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3); }
.form-group textarea { width: 100%; resize: vertical; min-height: 100px; }

/* --- Toggle Switch Design --- */
.ccpa-consent { 
    text-align: left; 
    margin: 0.5rem 0; 
    padding: 0.8rem 1.2rem; 
    background: rgba(255,255,255,0.03); 
    border-radius: 8px; 
    border-left: 3px solid var(--gold);
    display: flex;
    justify-content: flex-start;
}
.toggle-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.toggle-text {
    font-size: 0.9rem; 
    color: rgba(255,255,255,0.85); 
    line-height: 1.5;
    margin-top: 2px;
}
.toggle-text a { color: var(--gold); text-decoration: underline; }

/* Стилизация самого свитча */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
input:checked + .slider:before { transform: translateX(20px); }
input:focus-visible + .slider { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- Кастомный скролл и стили для списка языков --- */
#langSwitcher option {
    background-color: #1a1a1a; /* Темный фон для пунктов */
    color: #ffffff;
    padding: 8px 12px;
}

#langSwitcher {
    /* Чтобы выпадающий список имел тот же стиль */
    scrollbar-width: thin;
    scrollbar-color: #D4AF37 #1a1a1a; /* Золотой ползунок, темная дорожка */
}

/* Для Chrome/Safari/Edge */
#langSwitcher::-webkit-scrollbar {
    width: 6px;
}
#langSwitcher::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}
#langSwitcher::-webkit-scrollbar-thumb {
    background-color: #D4AF37;
    border-radius: 10px;
    border: 1px solid #1a1a1a;
}

/* --- Validation Hint --- */
.form-validation-hint { display: none; background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; color: #fff; font-size: 1rem; text-align: center; animation: slideDownHint 0.4s ease; }
.form-validation-hint.active { display: block; }

/* --- Footer --- */
.footer { border-top: 1px solid rgba(255,255,255,0.05); padding: 2rem 0; text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.4); }

/* --- Responsive --- */
@media (max-width: 820px) {
    .form-group-triple { flex-direction: column; gap: 1rem; }
    .form-group-triple input { width: 100%; min-width: auto; }
    .infrastructure-grid { grid-template-columns: 1fr; }
    .nav-links a:not(.btn) { font-size: 0.8rem; }
}
@media (max-width: 480px) {
    .expertise-grid { grid-template-columns: 1fr; }
    .hero-section { padding: 5rem 0; }
    .navbar .container { flex-direction: column; align-items: center; gap: 0.5rem; }
    .toggle-wrapper { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* --- Error Modal --- */
.error-modal { position: fixed; inset: 0; background: rgba(11, 11, 11, 0.95); backdrop-filter: blur(15px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.error-modal.active { opacity: 1; pointer-events: auto; }
.error-modal-content { text-align: center; padding: 3rem; background: rgba(255,255,255,0.02); border: 1px solid rgba(212,175,55,0.2); border-radius: 16px; max-width: 90%; width: 500px; position: relative; overflow: hidden; transform: scale(0.95); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.error-modal.active .error-modal-content { transform: scale(1); }
.error-title { font-size: 1.2rem; letter-spacing: 0.2em; color: var(--gold); margin-bottom: 0.5rem; }
.error-code { font-size: clamp(6rem, 15vw, 10rem); font-weight: 800; color: white; text-shadow: 0 0 30px rgba(212,175,55,0.3); line-height: 1; }
.error-message { margin: 1rem 0 2rem; color: rgba(255,255,255,0.8); font-size: 1.1rem; }

@keyframes slideDownHint { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }

/* --- Custom Language Selector --- */
#langSwitcher {
    /* Убираем стандартный вид браузера */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Стили под дизайн сайта */
    background-color: rgba(11, 11, 11, 0.9); /* Почти черный с прозрачностью */
    border: 1px solid var(--gold);
    border-radius: 4px;
    color: var(--white);
    font-family: var(--font-main); /* Используем Inter */
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0.5rem 2.5rem 0.5rem 1rem; /* Большой отступ справа для стрелки */
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
    min-height: 44px; /* Для доступности (ADA) */
    min-width: 80px;
}

/* Ховер и фокус */
#langSwitcher:hover, #langSwitcher:focus-visible {
    border-color: var(--gold-light);
    box-shadow: 0 0 10px var(--gold-glow);
    background-color: var(--black);
}

/* --- Кастомная стрелка (золотая) --- */
#langSwitcher-wrapper {
    position: relative;
    display: inline-block;
}

#langSwitcher-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gold); /* Золотая стрелка вниз */
    pointer-events: none;
}

/* --- Стили для выпадающих пунктов (Options) --- */
#langSwitcher option {
    background-color: #1a1a1a; /* Темный фон для списка */
    color: var(--white);
    font-family: var(--font-main);
    padding: 10px;
}

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    max-width: 400px;
    width: calc(100% - 40px);
    background: rgba(11, 11, 11, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transform: translateY(120%);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-banner.active {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-content p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    margin: 0;
}

.cookie-content a {
    color: var(--gold);
    text-decoration: underline;
}

.cookie-content .btn {
    align-self: flex-end;
    padding: 0.4rem 1.5rem;
    font-size: 0.9rem;
    min-height: 36px;
}

/* Mobile adjustment */
@media (max-width: 480px) {
    .cookie-banner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
}

/* --- Bash Console Modal --- */
.bash-modal .error-modal-content {
    border-color: var(--gold); /* Золотая рамка */
    background: #0d0d0d;
    text-align: left;
    min-height: 380px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    animation: goldNeonPulse 4s ease-in-out infinite alternate;
}


.bash-modal .bash-output {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #00ff00; 
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 15px;
    border-radius: 6px;
    min-height: 80px;
    white-space: pre-wrap;

}

.bash-modal .bash-header {
    color: #00ff00;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.bash-header .bash-dots {
    display: flex;
    gap: 6px;
}
.bash-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.bash-dots span:nth-child(1) { background: #ff5f56; }
.bash-dots span:nth-child(2) { background: #ffbd2e; }
.bash-dots span:nth-child(3) { background: #27c93f; }

.bash-modal .btn {
    margin-top: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

@keyframes goldNeonPulse {
    0% {
        box-shadow: 0 0 5px rgba(var(--gold-rgb), 0.1), 0 0 10px rgba(var(--gold-rgb), 0.05);
    }
    50% {
        box-shadow: 0 0 25px rgba(var(--gold-rgb), 0.6), 0 0 50px rgba(var(--gold-rgb), 0.3), inset 0 0 15px rgba(var(--gold-rgb), 0.05);
    }
    100% {
        box-shadow: 0 0 15px rgba(var(--gold-rgb), 0.2), 0 0 30px rgba(var(--gold-rgb), 0.1);
    }
}