/* --- 1. Змінні та Базові Налаштування --- */
:root {
    --bg-dark: #05070a;
    --bg-darker: #020305;
    --primary: #00f2ff; /* Неоновий блакитний */
    --secondary: #ff003c; /* Неоновий червоний/рожевий */
    --text-light: #ffffff;
    --text-dim: #8a94a8;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --section-spacing: 120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Ховаємо стандартний курсор */
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.text-center { text-align: center; }
.accent { color: var(--primary); }

/* --- 2. Кастомний Курсор --- */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s;
}

.cursor-follower {
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s, width 0.3s, height 0.3s;
    opacity: 0.6;
}

/* --- 3. Фон та Ефекти --- */
.cyber-grid-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: top;
    animation: gridMove 20s linear infinite;
    opacity: 0.4;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* Glitch Title Effect */
.glitch-title {
    font-size: clamp(40px, 8vw, 80px);
    position: relative;
    color: var(--text-light);
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-title::before {
    color: var(--secondary);
    z-index: -1;
    animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.glitch-title::after {
    color: var(--primary);
    z-index: -2;
    animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

/* --- 4. Навігація --- */
.navbar {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
}

.flex-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    color: var(--text-light);
    text-decoration: none;
    letter-spacing: 4px;
}

.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    padding: 5px 0;
    transition: 0.3s;
}

.nav-links a::before {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    color: var(--primary);
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease-in-out;
    white-space: nowrap;
}

.nav-links a:hover::before { width: 100%; }
.nav-links a:hover { color: transparent; }

/* --- 5. Hero Section --- */
.hero {
    padding: 180px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 150px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    z-index: -1;
}

.hero-subtitle {
    color: var(--primary);
    font-family: var(--font-heading);
    letter-spacing: 3px;
    margin-bottom: 20px;
    display: block;
}

.typing-text {
    font-size: 20px;
    color: var(--text-dim);
    margin: 30px 0 50px;
    max-width: 600px;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--primary); } }

.hero-btns { display: flex; gap: 20px; }

.btn {
    padding: 14px 32px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    position: relative;
    z-index: 1;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.btn-cyber {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--text-light);
    border: none;
}

.btn-cyber:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.5), 0 0 30px rgba(255, 0, 60, 0.5);
}

/* --- 6. Sections --- */
.section { padding: var(--section-spacing) 0; }
.section-title {
    font-size: 42px;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px; left: 0;
    width: 60px; height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
}

.cyber-frame {
    position: relative;
    padding: 10px;
    background: linear-gradient(45deg, var(--primary), transparent, var(--secondary));
    clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
}

.about-img {
    width: 100%;
    display: block;
    clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
    filter: grayscale(100%) contrast(1.2);
    transition: 0.5s;
}

.cyber-frame:hover .about-img { filter: grayscale(0%) contrast(1); }

.lead { font-size: 20px; color: var(--text-light); margin-bottom: 30px; }
.about-text p { color: var(--text-dim); margin-bottom: 20px; font-size: 17px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number { display: block; font-size: 48px; font-family: var(--font-heading); font-weight: 900; line-height: 1; margin-bottom: 10px; text-shadow: 0 0 15px rgba(0, 242, 255, 0.5); }
.stat-label { color: var(--text-dim); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }

/* Services Section */
.services-section { background-color: var(--bg-darker); position: relative; }
.services-section::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.service-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 50px;
    position: relative;
    overflow: hidden;
    transition: 0.5s;
    transform-style: preserve-3d; /* Для 3D ефекту */
}

.card-content {
    position: relative;
    z-index: 2;
    transform: translateZ(30px); /* Виштовхуємо контент вперед */
}

.service-icon {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 30px;
    display: block;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

.service-card h3 { font-size: 22px; margin-bottom: 20px; }
.service-card p { color: var(--text-dim); }

.card-border {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 1px solid rgba(0, 242, 255, 0.1);
    z-index: 1;
    transition: 0.5s;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.service-card:hover .card-border {
    border-color: var(--primary);
    box-shadow: inset 0 0 30px rgba(0, 242, 255, 0.2);
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}
.service-card:hover { background: rgba(0, 242, 255, 0.05); transform: scale(1.02); }

/* Footer */
.footer {
    background: var(--bg-darker);
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo p { color: var(--text-dim); margin-top: 20px; }
.footer h4 { margin-bottom: 30px; font-size: 18px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 15px; }
.footer ul a { color: var(--text-dim); text-decoration: none; transition: 0.3s; }
.footer ul a:hover { color: var(--primary); padding-left: 10px; }

.social-icons { display: flex; gap: 15px; }
.social-icon {
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s;
    clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
}

.social-icon:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
    transform: translateY(-5px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .about-image-wrapper { max-width: 500px; margin: 0 auto 60px; }
    .section-title::after { left: 50%; transform: translateX(-50%); }
    .stats-grid { border-top: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 30px; }
}

@media (max-width: 768px) {
    .nav-links, .btn-cyber { display: none; }
    .hero { padding-top: 120px; text-align: center; }
    .hero-btns { justify-content: center; }
    .typing-text { margin: 30px auto 50px; }
    .glitch-title { font-size: 48px; }
    .footer-content { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .social-icons { justify-content: center; }
}