/* --- 1. Variables & Reset --- */
:root {
--bg-dark: #0f1115;
--bg-darker: #050507;
--primary: #3b82f6; /* Blue default */
--accent: #60a5fa;
--text-main: #e2e8f0;
--text-muted: #94a3b8;
--glass: rgba(255, 255, 255, 0.03);
--glass-border: rgba(255, 255, 255, 0.08);
--font-sans: 'Inter', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
background-color: var(--bg-dark);
color: var(--text-main);
font-family: var(--font-sans);
overflow-x: hidden;
line-height: 1.6;
position: relative; /* Needed for runaway bot */
}
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Жестко обрезаем все, что вылазит по ширине */
    position: relative;
}

/* --- 2. Background FX --- */
.bg-mesh {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background:
radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
z-index: -2;
}
#matrix-canvas {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
z-index: -1;
opacity: 0.07;
}

/* --- 3. Layout Utilities --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 100px 0; }
.text-gradient {
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

/* --- 4. Navigation --- */
.glass-nav {
position: fixed;
top: 0; left: 0; width: 100%;
padding: 15px 0;
background: rgba(15, 17, 21, 0.7);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--glass-border);
z-index: 1000;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo {
font-family: var(--font-mono); font-weight: 700; font-size: 1.2rem;
color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.logo-box { width: 32px; height: 32px; background: var(--primary); display: grid; place-items: center; border-radius: 4px; color: #fff; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.nav-link:hover { color: #fff; }
.btn-outlined {
background: transparent; border: 1px solid var(--primary);
color: var(--primary); padding: 8px 16px; border-radius: 6px;
font-family: var(--font-mono); cursor: pointer; transition: 0.3s;
}
.btn-outlined:hover { background: rgba(59, 130, 246, 0.1); }

/* --- 5. Hero Section --- */
.hero { padding-top: 140px; padding-bottom: 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.badge {
display: inline-flex; align-items: center; gap: 8px;
padding: 6px 12px; border-radius: 20px;
background: rgba(16, 185, 129, 0.1); color: #10b981;
font-size: 0.8rem; font-weight: 600; margin-bottom: 20px;
border: 1px solid rgba(16, 185, 129, 0.2);
}
.pulse-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 10px #10b981; }
h1.glitch-title {
font-size: 3.5rem; line-height: 1.1; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px;
}
.subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; max-width: 500px; }
.subtitle strong { color: #fff; font-weight: 500; }

.tech-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.chip {
padding: 6px 12px; background: var(--glass); border: 1px solid var(--glass-border);
border-radius: 6px; font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px;
}

.cta-group { display: flex; gap: 20px; align-items: center; }
.btn-primary {
background: var(--primary); color: #fff; border: none;
padding: 14px 32px; border-radius: 8px; font-weight: 600; cursor: pointer;
font-size: 1rem; transition: 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4); }
.btn-text { color: #fff; text-decoration: none; font-weight: 500; }

/* Terminal Window */
.terminal-window {
background: #1e1e1e; border-radius: 12px; overflow: hidden;
box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 1px solid #333;
}
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.terminal-header {
background: #252526; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.filename { font-family: var(--font-mono); font-size: 0.8rem; color: #888; }
.terminal-body { padding: 20px; font-family: var(--font-mono); font-size: 0.9rem; color: #a9b7c6; min-height: 200px; }
.keyword { color: #cc7832; } .string { color: #6a8759; } .function { color: #ffc66d; }

/* --- 6. Stats --- */
.stats-glass-row {
display: flex; justify-content: space-between;
background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px);
border: 1px solid var(--glass-border); border-radius: 16px; padding: 30px 50px;
margin-bottom: 60px;
}
.stat-box { text-align: center; }
.stat-num { font-size: 2.5rem; font-weight: 800; color: #fff; margin-bottom: 5px; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; background: var(--glass-border); }

/* --- 7. Ticker --- */
.ticker-wrap { overflow: hidden; background: var(--primary); padding: 12px 0; transform: rotate(-2deg) scale(1.05); }
.ticker-track { display: flex; white-space: nowrap; animation: scroll 20s linear infinite; }
.ticker-content { display: flex; gap: 40px; padding-right: 40px; }
.ticker-content span { color: #fff; font-weight: 800; font-family: var(--font-mono); display: flex; align-items: center; gap: 10px; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* --- 8. Bento Grid (Services) --- */
.section-header { margin-bottom: 50px; }
.section-tag { font-family: var(--font-mono); color: var(--primary); font-size: 0.9rem; display: block; margin-bottom: 10px; }
.section-title { font-size: 2.5rem; color: #fff; text-transform: uppercase; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    grid-auto-rows: minmax(220px, auto);
}

.card {
    background: #13151a; border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 30px; position: relative; overflow: hidden;
    transition: 0.3s; display: flex; flex-direction: column; justify-content: space-between;
}
.card:hover { border-color: var(--primary); transform: translateY(-5px); }

.card-icon { width: 50px; height: 50px; background: rgba(255,255,255,0.05); border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; margin-bottom: 20px; }
.card h3 { color: #fff; margin-bottom: 10px; font-size: 1.25rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

/* Стандартные классы */
.card-large { grid-column: span 2; }
.card-wide { grid-column: span 3; display: flex; flex-direction: row; align-items: center; }

/* --- 🔥 ИСПРАВЛЕНИЕ СЕТКИ (THE FIX) 🔥 --- */
/* Делаем Cloud (5-я карточка) широкой, чтобы заполнить ряд */
.bento-grid .card:nth-child(5) {
    grid-column: span 2;
}
/* Делаем Parsing (последняя карточка) во всю ширину */
.bento-grid .card:nth-child(7) {
    grid-column: span 3;
}

/* Внутренности карточек */
.wide-content { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.visual-icon { font-size: 4rem; color: rgba(255,255,255,0.05); }
.card-tags { margin-top: 20px; display: flex; gap: 10px; }
.card-tags span { font-size: 0.8rem; padding: 4px 10px; background: rgba(59,130,246,0.1); color: var(--primary); border-radius: 4px; font-family: var(--font-mono); }

/* Адаптив (Mobile) */
@media (max-width: 900px) {
    .bento-grid { grid-template-columns: 1fr; }
    .card-large, .card-wide,
    .bento-grid .card:nth-child(5),
    .bento-grid .card:nth-child(7) {
        grid-column: span 1;
    }
}
/* --- 9. Bot Builder (Interactive) --- */
.alt-bg { background: rgba(255,255,255,0.02); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.builder-wrapper {
background: #0f1115; border: 1px solid #333; border-radius: 16px; overflow: hidden;
box-shadow: 0 0 50px rgba(0,0,0,0.5); display: flex; flex-direction: column;
}
.builder-header { background: #1a1d24; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; color: #666; font-family: var(--font-mono); font-size: 0.8rem; }
.builder-body { display: grid; grid-template-columns: 1fr 1fr; }

.bot-preview-area {
background: radial-gradient(circle, #1a1d24 0%, #0f1115 100%);
display: grid; place-items: center; position: relative; min-height: 400px;
overflow: hidden;
}
.grid-lines {
position: absolute; width: 200%; height: 200%;
background-image: linear-gradient(#333 1px, transparent 1px), linear-gradient(90deg, #333 1px, transparent 1px);
background-size: 40px 40px; opacity: 0.1;
}

/* --- NEW CSS ROBOT STYLES --- */
.robo-container {
position: relative; z-index: 10;
display: flex; flex-direction: column; align-items: center;
filter: drop-shadow(0 0 15px var(--bot-color));
transition: transform 0.3s ease;
}

/* Parts */
.robo-antenna {
width: 4px; height: 20px; background: var(--bot-color);
position: relative; top: 2px;
}
.robo-ball {
width: 12px; height: 12px; background: var(--bot-color);
border-radius: 50%; position: absolute; top: -10px; left: -4px;
box-shadow: 0 0 10px var(--bot-color);
}
.robo-head {
width: 80px; height: 50px; background: var(--bot-color);
border-radius: 12px 12px 4px 4px;
display: flex; justify-content: center; align-items: center;
border-bottom: 3px solid rgba(0,0,0,0.2);
position: relative;
}
.robo-eyes {
width: 50px; height: 16px; background: #000;
border-radius: 8px; position: relative;
}
.robo-eyes::after, .robo-eyes::before {
content: ''; position: absolute; top: 3px; width: 10px; height: 10px;
background: #fff; border-radius: 50%; animation: blink 4s infinite;
}
.robo-eyes::before { left: 8px; } .robo-eyes::after { right: 8px; }

.robo-body {
width: 100px; height: 90px; background: var(--bot-color);
border-radius: 8px 8px 16px 16px; margin-top: 4px;
display: grid; place-items: center; font-size: 2rem; color: rgba(0,0,0,0.3);
border-top: 2px solid rgba(255,255,255,0.1);
}

/* Animations */
@keyframes blink { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(0.1); } }
@keyframes roboRun { 0%, 100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes roboSpin { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(360deg) scale(1.2); } 100% { transform: rotate(720deg) scale(1); } }
@keyframes roboShock {
0% { transform: scale(1); }
10%, 30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); filter: drop-shadow(0 0 30px red); }
20%, 40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
100% { transform: scale(1) rotate(0); }
}


/* Builder Controls */
.bot-controls { padding: 40px; display: flex; flex-direction: column; gap: 30px; }
.control-group label { display: block; font-family: var(--font-mono); color: #888; font-size: 0.8rem; margin-bottom: 10px; }
.color-picker { display: flex; gap: 15px; }
.c-swatch { width: 40px; height: 40px; border-radius: 8px; background: var(--bg); cursor: pointer; transition: 0.2s; border: 2px solid transparent; }
.c-swatch.active { border-color: #fff; transform: scale(1.1); }

.model-btns { display: flex; gap: 10px; }
.m-btn {
flex: 1; padding: 10px; background: #1a1d24; border: 1px solid #333; color: #888;
border-radius: 6px; cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem;
transition: 0.2s;
}
.m-btn.active, .m-btn:hover { background: #252830; color: #fff; border-color: #555; }

.deploy-btn {
margin-top: auto; background: #fff; color: #000; border: none; padding: 15px;
font-family: var(--font-mono); font-weight: 700; cursor: pointer; border-radius: 6px;
display: flex; justify-content: center; align-items: center; gap: 10px;
transition: 0.3s;
}
.deploy-btn:hover { background: var(--primary); color: #fff; }

/* --- 10. Cases --- */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}
.case-item {
background: #13151a; border-radius: 16px; overflow: hidden; padding: 30px;
position: relative; height: 350px; display: flex; flex-direction: column; justify-content: flex-end;
border: 1px solid var(--glass-border); transition: 0.3s;
}
.case-item:hover { border-color: #666; }
.case-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--primary); margin-bottom: 10px; }
.case-link { color: #fff; text-decoration: none; font-size: 0.9rem; margin-top: 15px; display: inline-block; }

/* --- 11. Footer --- */
.main-footer { background: #050507; padding: 80px 0 30px; border-top: 1px solid #222; }
.footer-layout { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 60px; }
.f-logo { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; color: #fff; margin-bottom: 15px; }
.f-nav h4, .f-contact h4 { color: #fff; margin-bottom: 20px; font-size: 1rem; }
.f-nav a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; transition: 0.2s; }
.f-nav a:hover { color: var(--primary); }
.copyright { border-top: 1px solid #222; padding-top: 30px; color: #555; font-size: 0.9rem; text-align: center; }


/* --- THE RUNAWAY BOT STYLES --- */
.runaway-bot-container {
position: fixed;
z-index: 9999;
pointer-events: auto; /* Чтобы кликать */
cursor: pointer;
transition: top 1s cubic-bezier(0.25, 1, 0.5, 1), left 1s cubic-bezier(0.25, 1, 0.5, 1); /* Плавное перемещение */
}
/* Состояния робота в побеге */
.runaway-bot-container.running .robo-container { animation: roboRun 0.3s infinite alternate; }
.runaway-bot-container.spinning .robo-container { animation: roboSpin 1s ease-in-out forwards; }
.runaway-bot-container.shocked .robo-container { animation: roboShock 0.5s linear; }
/* Когда закрепился - висит вниз головой если сверху, или просто висит */
.runaway-bot-container.anchored-top .robo-container { transform: rotate(180deg); }
.runaway-bot-container.anchored-left .robo-container { transform: rotate(90deg); }
.runaway-bot-container.anchored-right .robo-container { transform: rotate(-90deg); }

/* Mobile Responsiveness */
@media (max-width: 768px) {
.hero-grid { grid-template-columns: 1fr; text-align: center; }
.hero-text { order: 2; } .hero-visual { order: 1; margin-bottom: 40px; }
.subtitle { margin: 0 auto 30px; }
.cta-group { justify-content: center; }
.stats-glass-row { flex-direction: column; gap: 30px; }
.stat-divider { display: none; }
.bento-grid { grid-template-columns: 1fr; }
.card-large, .card-wide { grid-column: auto; }
.footer-layout { grid-template-columns: 1fr; }
.builder-body { grid-template-columns: 1fr; }
}
/* --- СТИЛИ ФОРМЫ (Раз они понравились) --- */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.glass-form-container {
    background: rgba(19, 21, 26, 0.6); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 40px; position: relative; backdrop-filter: blur(10px);
}
.form-header { font-family: var(--font-mono); color: var(--primary); margin-bottom: 30px; letter-spacing: 2px; }
.cyber-form { display: flex; flex-direction: column; gap: 25px; }
/* --- Общие стили для инпутов --- */
.input-group {
    position: relative;
    margin-bottom: 25px; /* Немного отступа снизу */
}

/* Стили для обычных полей ввода */
.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    padding: 10px 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

/* --- FIX: Специфичные стили для TEXTAREA --- */
.input-group textarea {
    width: 100%;
    background-color: transparent !important; /* Принудительно убираем белый фон */
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    padding: 10px 0;
    font-family: var(--font-sans); /* Чтобы шрифт был таким же, как везде */
    font-size: 1rem;
    outline: none;
    resize: none; /* Убирает уродливый уголок справа внизу */
    min-height: 30px; /* Минимальная высота, чтобы не схлопывалось */
    vertical-align: bottom;
    transition: 0.3s;
}

/* Стили для лейбла (надписи) */
.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: #666;
    pointer-events: none;
    transition: 0.3s;
    font-size: 1rem;
}

/* Логика поднятия лейбла наверх при фокусе или вводе */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--primary);
}

/* Линия подчеркивания */
.input-group .line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: 0.4s;
}

.input-group input:focus ~ .line,
.input-group textarea:focus ~ .line {
    width: 100%;
}
.submit-btn {
    margin-top: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border);
    color: #fff; padding: 15px; cursor: pointer; font-family: var(--font-mono); transition: 0.3s;
}
.submit-btn:hover { background: var(--primary); }

/* Адаптив формы */
@media (max-width: 768px) { .contact-wrapper { grid-template-columns: 1fr; } }


/* --- АНИМАЦИЯ ОСМОТРА РОБОТА --- */
@keyframes roboLookAround {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(-25deg); } /* Поворот влево */
    40% { transform: rotate(-25deg); }
    50% { transform: rotate(0deg); }
    70% { transform: rotate(25deg); }  /* Поворот вправо */
    90% { transform: rotate(25deg); }
    100% { transform: rotate(0deg); }
}

/* Класс, который JS добавит голове для запуска анимации */
.robo-head.looking {
    animation: roboLookAround 1.5s ease-in-out;
}

/* --- PORTFOLIO GRID (INDEX) --- */
.case-card-link { text-decoration: none; display: block; }

.case-card {
    background: rgba(19, 21, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}

.case-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(19, 21, 26, 0.9);
}

.card-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 25px;
}
.folder-icon { font-size: 1.8rem; color: var(--text-muted); transition: 0.3s; }
.case-card:hover .folder-icon { color: var(--primary); }

.id-badge {
    font-family: var(--font-mono); font-size: 0.7rem; color: #555;
    border: 1px solid #333; padding: 4px 8px; border-radius: 4px;
}

.card-body { flex-grow: 1; }
.card-body h3 { font-size: 1.4rem; color: #fff; margin-bottom: 12px; line-height: 1.2; }
.card-body p { font-size: 0.95rem; color: #94a3b8; line-height: 1.6; }

.card-footer {
    margin-top: 30px; display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px;
}

.tech-pill {
    font-size: 0.75rem; font-family: var(--font-mono); color: var(--primary);
    background: rgba(59, 130, 246, 0.1); padding: 4px 10px; border-radius: 4px;
    margin-right: 6px; display: inline-block; margin-bottom: 4px;
}

.arrow-icon { color: #555; transition: 0.3s; }
.case-card:hover .arrow-icon { color: #fff; transform: translateX(5px); }


/* --- CASE DETAIL PAGE --- */
.page-case { background-color: #050507; min-height: 100vh; }
.case-wrapper { padding: 80px 0 100px; }

.back-link {
    display: flex; align-items: center; gap: 10px;
    color: #888; text-decoration: none; font-family: var(--font-mono);
    font-size: 0.9rem; transition: 0.3s;
}
.back-link:hover { color: var(--primary); }

.case-header { margin-bottom: 60px; border-bottom: 1px solid #222; padding-bottom: 40px; }
.meta-tags { margin-bottom: 20px; display: flex; gap: 15px; }
.meta-badge {
    font-family: var(--font-mono); font-size: 0.85rem; color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3); padding: 6px 12px; border-radius: 20px;
}
.badge-role { color: #fff; border-color: #fff; }

.case-title { font-size: 3.5rem; line-height: 1.1; color: #fff; margin-bottom: 15px; }
.case-client { font-family: var(--font-mono); color: #888; font-size: 1.1rem; }
.case-client .highlight { color: #fff; }

.case-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 80px; }

.detail-block { margin-bottom: 50px; }
.detail-block h3 {
    font-family: var(--font-mono); color: #666; font-size: 1rem;
    margin-bottom: 20px; letter-spacing: 1px; display: flex; align-items: center; gap: 10px;
}
.detail-block p { font-size: 1.15rem; color: #d1d5db; line-height: 1.8; }

.challenge-box {
    background: rgba(244, 63, 94, 0.08); border-left: 4px solid #f43f5e;
    padding: 25px; border-radius: 0 8px 8px 0; color: #ffdde4;
    font-size: 1.05rem; line-height: 1.7;
}

.case-sidebar { position: sticky; top: 100px; }
.tech-panel { background: #13151a; border: 1px solid #333; padding: 30px; border-radius: 12px; margin-bottom: 30px; }
.tech-panel h3 { font-family: var(--font-mono); color: #fff; font-size: 0.9rem; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }

.stack-item {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
    color: #aaa; font-size: 0.95rem; font-family: var(--font-mono);
}
.stack-item i { color: var(--primary); }

.cta-button {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--primary); color: #fff; padding: 16px 32px;
    border-radius: 6px; text-decoration: none; font-weight: 600;
    transition: 0.3s;
}
.cta-button:hover { background: #2563eb; transform: translateY(-2px); }

/* Mobile */
@media (max-width: 900px) {
    .case-title { font-size: 2.5rem; }
    .case-layout { grid-template-columns: 1fr; gap: 40px; }
    .case-sidebar { position: static; }
}

/* --- SYSTEM SEPARATOR --- */
.system-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 60px 0; /* Отступы сверху и снизу */
    opacity: 0.7;
    max-width: 1200px;
    margin: 0 auto;
}

.sep-line {
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    position: relative;
}

/* Добавляем точки на концах линий для красоты */
.sep-line::after {
    content: '';
    position: absolute;
    width: 4px; height: 4px;
    background: var(--primary);
    border-radius: 50%;
    top: -1.5px;
    box-shadow: 0 0 10px var(--primary);
}
.sep-line:first-child::after { right: 0; }
.sep-line:last-child::after { left: 0; }

.sep-content {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(59, 130, 246, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.blink { animation: blink 2s infinite; }

/* --- ЛОГИКА ДЛЯ 5 ЭЛЕМЕНТОВ --- */

/* Карточки 1 и 2: занимают по 3 колонки из 6 (то есть 50% ширины) */
.case-card-link:nth-child(1),
.case-card-link:nth-child(2) {
    grid-column: span 3;
}

/* Карточки 3, 4, 5: занимают по 2 колонки из 6 (то есть 33% ширины) */
.case-card-link:nth-child(n+3) {
    grid-column: span 2;
}

/* Делаем верхние карточки чуть более "важными" визуально */
.case-card-link:nth-child(1) .case-card,
.case-card-link:nth-child(2) .case-card {
    min-height: 360px; /* Чуть выше стандартных */
    background: linear-gradient(145deg, rgba(19, 21, 26, 0.8), rgba(19, 21, 26, 0.4));
}

/* --- АДАПТИВ (MOBILE) --- */
@media (max-width: 900px) {
    .cases-grid {
        grid-template-columns: 1fr; /* Одна колонка на телефонах */
    }

    /* Сбрасываем растягивание на мобильных */
    .case-card-link:nth-child(1),
    .case-card-link:nth-child(2),
    .case-card-link:nth-child(n+3) {
        grid-column: span 1;
    }
}

/* Новая кнопка в меню */
.nav-btn-primary {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn-primary:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.05);
}

.badge-icon { color: #10b981; font-size: 1.2rem; }
.badge-text { display: flex; flex-direction: column; }
.badge-text span { font-family: var(--font-mono); font-size: 0.8rem; color: #10b981; letter-spacing: 1px; }
.badge-text .sub { font-size: 0.65rem; color: #666; letter-spacing: 0; }

.copyright-inner { display: flex; justify-content: space-between; align-items: center; }
.system-status {
    font-family: var(--font-mono); font-size: 0.75rem; color: #666;
    display: flex; align-items: center; gap: 8px;
}
.status-dot {
    width: 6px; height: 6px; background: #10b981;
    border-radius: 50%; box-shadow: 0 0 5px #10b981;
    animation: blink 2s infinite;
}

/* Mobile fix */
@media (max-width: 768px) {
    .copyright-inner { flex-direction: column; gap: 10px; }
}

/* --- НОВЫЙ ВЫБОР КАНАЛОВ СВЯЗИ --- */
.communication-selector { margin-bottom: 25px; }
.selector-label {
    font-family: var(--font-mono); font-size: 0.75rem; color: #666;
    display: block; margin-bottom: 10px; letter-spacing: 1px;
}

.channel-options { display: flex; gap: 10px; }

.channel-btn {
    width: 45px; height: 45px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    display: grid; place-items: center;
    color: #666; cursor: pointer;
    transition: 0.3s;
    font-size: 1.2rem;
}

.channel-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Активное состояние */
.channel-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

/* Скрываем кнопку бургера на десктопе */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001; /* Поверх меню */
}

.burger-menu span {
    width: 25px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: 0.3s ease;
}

/* --- МОБИЛЬНЫЕ СТИЛИ --- */
@media (max-width: 768px) {

    /* Показываем бургер */
    .burger-menu {
        display: flex;
    }

    /* Превращаем навигацию в полноэкранное меню */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Скрыто за правым краем */
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 7, 0.95); /* --bg-darker с прозрачностью */
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    /* Состояние активного меню */
    .nav-links.active {
        right: 0;
    }

    /* Увеличиваем ссылки для пальцев */
    .nav-link {
        font-size: 1.5rem;
        font-weight: 600;
    }

    /* Анимация крестика бургера при открытии */
    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
        background-color: var(--primary);
    }
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
        background-color: var(--primary);
    }

    .ticker-wrap {
        width: 100vw; /* Строго ширина вьюпорта */
        max-width: 100%;
        margin-left: -20px; /* Компенсация паддинга контейнера, если он внутри */
    }

}

/* --- MOBILE FIXES (Responsive Text & Layout) --- */
@media (max-width: 768px) {

    /* 1. Уменьшаем огромный заголовок */
    h1.glitch-title {
        font-size: 2.2rem; /* Было 3.5rem, ставим меньше */
        line-height: 1.2;
        word-break: break-word; /* Если слово все равно длинное - перенести */
        padding: 0 10px; /* Небольшой отступ от краев */
    }

    /* 2. Подправляем подзаголовок */
    .subtitle {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 20px;
    }

    /* 3. Оптимизируем Терминал (чтобы не был слишком широким) */
    .terminal-window {
        width: 100%;
        max-width: 100%; /* Гарантия, что не вылезет */
        margin: 0 auto;  /* Строго по центру */
    }

    .terminal-body {
        padding: 15px; /* Чуть меньше отступов внутри */
        font-size: 0.8rem; /* Чуть уменьшим шрифт кода */
        overflow-x: auto; /* Если код длинный — пусть скроллится внутри окна */
    }

    /* 4. Выравнивание бейджика "Available..." */
    .badge {
        display: inline-flex;
        margin: 0 auto 20px auto; /* Центрируем бейдж */
    }

    /* 5. Кнопки в ряд (если влезут) или друг под другом */
    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .btn-primary, .btn-text {
        width: 100%; /* Кнопка во всю ширину - удобнее нажимать */
        justify-content: center;
    }
}
/* --- UPDATED BENTO GRID STYLES --- */

/* Фон-свечение при наведении */
.card-bg-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 60%);
    opacity: 0;
    transition: 0.4s ease;
    z-index: 0;
}
.card:hover .card-bg-glow { opacity: 1; }

/* Улучшенная типографика внутри карточек */
.card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
.card p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    position: relative; z-index: 1;
    flex-grow: 1; /* Чтобы список тегов всегда был снизу */
}

/* Иконки разных цветов для категорий */
.card-icon {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.4rem; color: #fff;
    margin-bottom: 20px;
    transition: 0.3s;
    position: relative; z-index: 1;
}

/* Цветовые акценты при наведении */
.card:hover .card-icon { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
.card:hover .icon-ai { background: #8b5cf6; border-color: #8b5cf6; box-shadow: 0 0 20px rgba(139, 92, 246, 0.4); }
.card:hover .icon-cloud { background: #10b981; border-color: #10b981; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
.card:hover .icon-tg { background: #0ea5e9; border-color: #0ea5e9; box-shadow: 0 0 20px rgba(14, 165, 233, 0.4); }

/* --- СПИСОК ТЕХНОЛОГИЙ (ВНИЗУ КАРТОЧКИ) --- */
.stack-mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative; z-index: 1;
    margin-top: auto; /* Прижимает к низу */
}

.s-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

.card:hover .s-tag {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* Улучшение для широкой карточки */
.wide-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
.text-content {
    flex: 1;
    padding-right: 20px;
    display: flex; flex-direction: column; height: 100%;
    align-items: flex-start;
}
.visual-art {
    font-size: 8rem;
    color: rgba(255,255,255,0.02);
    transform: rotate(-15deg) translate(20px, 20px);
    transition: 0.5s;
}
.card:hover .visual-art {
    color: rgba(59, 130, 246, 0.1);
    transform: rotate(0deg) scale(1.1);
}

/* Адаптив */
@media (max-width: 900px) {
    .wide-content { flex-direction: column; align-items: flex-start; }
    .visual-art { display: none; } /* Скрываем огромную иконку на мобильных */
}
/* --- НОВЫЕ ЦВЕТА ИКОНОК --- */
/* E-commerce: Оранжевый */
.card:hover .icon-shop { background: #f97316; border-color: #f97316; box-shadow: 0 0 20px rgba(249, 115, 22, 0.4); }

/* WordPress: Фирменный синий */
.card:hover .icon-wp { background: #21759b; border-color: #21759b; box-shadow: 0 0 20px rgba(33, 117, 155, 0.4); }

/* Design: Розовый/Маджента */
.card:hover .icon-design { background: #db2777; border-color: #db2777; box-shadow: 0 0 20px rgba(219, 39, 119, 0.4); }

/* Security: Красный/Кровавый */
.card:hover .icon-sec { background: #ef4444; border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }

/* Support: Желтый/Золотой */
.card:hover .icon-sla { background: #eab308; border-color: #eab308; box-shadow: 0 0 20px rgba(234, 179, 8, 0.4); }

/* --- ENHANCED FOOTER STYLES --- */
.main-footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--glass-border);
    padding: 100px 0 40px;
    position: relative;
}

.footer-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 1.5fr;
    gap: 60px;
    margin-bottom: 80px;
}

/* Brand Section */
.f-logo {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -1px;
}
.f-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 300px;
}
.f-location {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Nav & Stack Columns */
.f-nav h4, .f-contact h4 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.f-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 15px;
    transition: 0.3s;
}

.f-nav a i {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: 0.3s;
}

.f-nav a:hover {
    color: var(--primary);
    transform: translateX(5px);
}
.f-nav a:hover i {
    opacity: 1;
    transform: scale(1.2);
}

/* Contact Column */
.f-contact-item {
    margin-bottom: 20px;
    font-family: var(--font-mono);
}
.f-contact-item .label {
    display: block;
    font-size: 0.7rem;
    color: #444;
    margin-bottom: 5px;
}
.f-contact-item a {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
}
.f-contact-item a:hover {
    color: var(--primary);
}
.f-contact-item .status {
    color: #10b981;
    font-size: 0.85rem;
}

/* Copyright Area */
.copyright-area {
    border-top: 1px solid rgba(255,255,255,0.03);
    padding-top: 40px;
}
.copyright-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #444;
}
.legal {
    display: flex;
    align-items: center;
    gap: 15px;
}
.pipe { opacity: 0.2; }
.system-id { color: #333; }

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.03);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.05);
}
.status-text {
    color: #10b981;
    letter-spacing: 1px;
}

/* Mobile Fix */
@media (max-width: 992px) {
    .footer-layout {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}
@media (max-width: 600px) {
    .footer-layout {
        grid-template-columns: 1fr;
    }
    .copyright-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Принудительная сетка для выбора проекта */
.project-options {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* 2 в ряд на мобильных */
    gap: 10px !important;
    margin-top: 10px;
}

@media (min-width: 600px) {
    .project-options {
        grid-template-columns: repeat(4, 1fr) !important; /* 4 в ряд на десктопе */
    }
}

.project-btn {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 15px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative;
    z-index: 5; /* Чтобы клик точно проходил */
}

.project-btn i {
    font-size: 1.2rem !important;
    color: #666;
}

.project-btn span {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.65rem !important;
    color: #666;
    text-transform: uppercase;
}

/* Эффект при наведении */
.project-btn:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Активное состояние */
.project-btn.active {
    border-color: #3b82f6 !important; /* Твой синий цвет */
    background: rgba(59, 130, 246, 0.15) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

.project-btn.active i,
.project-btn.active span {
    color: #3b82f6 !important;
}