/* =====================================================================
   GTECH — основной стиль сайта (Dark Technology Theme)
   ===================================================================== */

:root {
    --color-bg:        #041525;
    --color-bg-rgb:    4, 21, 37;
    --color-surface:   #202B38;
    --color-surface-rgb: 32, 43, 56;
    --color-section-alt: #0E1F31;
    --color-footer-bg: #0C1D2D;
    --color-accent:    #16B4B3;
    --color-accent-rgb: 22, 180, 179;
    --color-accent-dark: #139998;
    --color-text:      #FFFFFF;
    --color-text-muted:#A1B0C0;
    --color-border:    #2A3746;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition-base: all 0.25s ease;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-muted);
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--color-accent-dark);
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-alt {
    background-color: var(--color-section-alt);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 14px;
}

.section-title .underline {
    width: 70px;
    height: 3px;
    background: var(--color-accent);
    margin: 0 auto 20px;
    border-radius: 3px;
}

.section-title p {
    max-width: 640px;
    margin: 0 auto;
    color: var(--color-text-muted);
}

/* Buttons */
.btn-accent {
    background-color: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #04211f;
    font-weight: 600;
    padding: 13px 30px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-accent:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-2px);
}

.btn-ghost {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--color-text);
    font-weight: 600;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(var(--color-bg-rgb), 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition-base);
}

.site-header .logo img {
    height: 42px;
    width: auto;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--color-border);
    border-radius: 30px;
    padding: 4px;
}

.lang-switcher a {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    transition: var(--transition-base);
}

.lang-switcher a.active,
.lang-switcher a:hover {
    background-color: var(--color-accent);
    color: #04211f;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 22px;
}

.header-contacts a.phone,
.header-contacts a.email {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.header-contacts a.phone i,
.header-contacts a.email i {
    color: var(--color-accent);
    margin-right: 6px;
}

.header-cta {
    background-color: var(--color-accent);
    color: #04211f !important;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 14px;
    white-space: nowrap;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-cta i {
    font-size: 16px;
}

.header-cta:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
}

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-video-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(var(--color-bg-rgb),0.85) 0%, rgba(var(--color-bg-rgb),0.55) 45%, rgba(var(--color-bg-rgb),0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: right;
    margin-left: auto;
    max-width: 640px;
    padding-top: 10px;
}

.hero-content h1 {
    font-size: clamp(32px, 5vw, 56px);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    color: var(--color-text-muted);
    margin-bottom: 34px;
}

.hero-content .btn-accent {
    font-size: 16px;
    padding: 16px 36px;
}

.hero-counters {
    position: relative;
    z-index: 1;
    background: rgba(var(--color-surface-rgb), 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    align-self: flex-end;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 30px 0;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    text-align: left;
}

.counter-item i {
    font-size: 30px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.counter-item span {
    color: var(--color-text);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
}

/* =====================================================================
   DIRECTIONS CARDS
   ===================================================================== */
.direction-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    transition: var(--transition-base);
    position: relative;
}

.direction-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-card);
}

.direction-card .direction-img {
    height: 170px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.direction-card .direction-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--color-bg-rgb),0) 0%, rgba(var(--color-bg-rgb),0.9) 100%);
}

.direction-card .direction-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 1px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 20px;
    bottom: -28px;
    z-index: 2;
    font-size: 22px;
    color: var(--color-accent);
}

.direction-card .direction-body {
    padding: 40px 22px 24px;
}

.direction-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.direction-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* =====================================================================
   WHY US
   ===================================================================== */
.whyus-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 34px 26px;
    height: 100%;
    transition: var(--transition-base);
}

.whyus-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
}

.whyus-card .whyus-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(var(--color-accent-rgb), 0.12);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 22px;
}

.whyus-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.whyus-card p {
    font-size: 14px;
    margin-bottom: 0;
}

/* =====================================================================
   PROJECTS
   ===================================================================== */
.project-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 320px;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background-size: cover;
    background-position: center;
    transition: var(--transition-base);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--color-bg-rgb),0.1) 20%, rgba(var(--color-bg-rgb),0.95) 100%);
}

.project-card .project-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    z-index: 1;
}

.project-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.project-card .view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-accent);
    font-weight: 600;
}

/* Project modal */
.modal-content.gtech-modal {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
}

.gtech-modal .modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 20px 28px;
}

.gtech-modal .modal-header .btn-close {
    filter: invert(1);
}

.gtech-modal .modal-body {
    padding: 28px 34px 34px;
}

.gtech-modal .modal-description {
    font-size: 15px;
    line-height: 1.8;
}

.gtech-modal .modal-img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

@media (max-width: 991.98px) {
    .gtech-modal .modal-img {
        min-height: 320px;
    }
}

@media (max-width: 767.98px) {
    .gtech-modal .modal-body {
        padding: 24px 20px 28px;
    }

    .gtech-modal .modal-img {
        min-height: 220px;
    }
}

/* =====================================================================
   LICENSES (accordion)
   ===================================================================== */
.licenses-accordion .accordion-item {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    margin-bottom: 16px;
}

.licenses-accordion .accordion-button {
    background-color: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    font-size: 16px;
    box-shadow: none;
}

.licenses-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(var(--color-accent-rgb), 0.1);
    color: var(--color-accent);
}

.licenses-accordion .accordion-button::after {
    filter: invert(69%) sepia(45%) saturate(519%) hue-rotate(126deg) brightness(90%) contrast(94%);
}

.licenses-accordion .accordion-body {
    background-color: var(--color-surface);
    padding-top: 10px;
}

.licenses-accordion .accordion-body a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* =====================================================================
   CONTACTS
   ===================================================================== */
.contact-info-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    height: 100%;
}

.contact-info-item {
    display: flex;
    gap: 18px;
    margin-bottom: 26px;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-item i {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(var(--color-accent-rgb), 0.12);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.contact-info-item strong {
    color: var(--color-text);
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    height: 100%;
    min-height: 340px;
    background-color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    text-align: center;
    padding: 20px;
}

/* =====================================================================
   ПЛАВАЮЩАЯ КНОПКА WHATSAPP
   ===================================================================== */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #04211f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 8px 24px rgba(var(--color-accent-rgb), 0.4);
    transition: var(--transition-base);
}

.whatsapp-float:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: #04211f;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(var(--color-accent-rgb), 0.5);
}

@media (max-width: 767.98px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    padding: 26px 0;
    text-align: center;
    font-size: 14px;
}

/* =====================================================================
   Уплотнение карточек направлений/проектов при раскладке в 5 колонок
   ===================================================================== */
@media (min-width: 1200px) {
    .direction-card .direction-img {
        height: 140px;
    }

    .direction-card .direction-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
        left: 16px;
        bottom: -24px;
    }

    .direction-card .direction-body {
        padding: 32px 16px 20px;
    }

    .direction-card h3 {
        font-size: 16px;
    }

    .direction-card p {
        font-size: 13px;
    }

    .project-card {
        height: 280px;
    }

    .project-card .project-overlay {
        padding: 18px;
    }

    .project-card h3 {
        font-size: 16px;
    }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 991.98px) {
    .header-contacts a.phone,
    .header-contacts a.email {
        display: none;
    }

    /* На планшетах/мобильных счётчики больше не позиционируются абсолютом
       поверх видео, а идут обычным блоком под контентом — поэтому убираем
       flex-центрирование у .hero, иначе .container и .hero-counters
       становятся flex-элементами в один ряд и "сжимаются" по ширине. */
    .hero {
        display: block;
        min-height: auto;
        padding: 130px 0 40px;
    }

    .hero-content {
        text-align: right;
        max-width: 100%;
    }

    .hero-counters {
        position: relative;
        margin-top: 40px;
    }
}

@media (max-width: 767.98px) {
    .section {
        padding: 70px 0;
    }

    .hero {
        padding: 110px 0 36px;
    }

    .hero-content {
        text-align: center;
        margin: 0 auto;
    }

    .counter-item {
        justify-content: flex-start;
        margin-bottom: 16px;
    }

    /* Шапка на узких экранах: логотип + переключатель языков + кнопка CTA
       не помещаются в один ряд на полную ширину — уменьшаем и уплотняем. */
    .site-header .logo img {
        height: 32px;
    }

    .header-inner {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .header-contacts {
        gap: 10px;
    }

    .lang-switcher a {
        padding: 5px 9px;
        font-size: 12px;
    }

    .header-cta {
        padding: 10px 14px;
    }

    .header-cta span {
        display: none;
    }
}

/* =====================================================================
   ЭФФЕКТ 1: Анимация заголовков H2
   Включается/выключается в админке (Настройки → «Анимация заголовков»).
   Работает через класс body.fx-headings, добавляемый на сервере.
   ===================================================================== */
body.fx-headings .section-title h2 {
    background: linear-gradient(100deg,
        var(--color-text) 0%,
        var(--color-text) 35%,
        var(--color-accent) 50%,
        var(--color-text) 65%,
        var(--color-text) 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
    body.fx-headings .section-title h2 {
        animation: gtech-heading-shine 5s linear infinite;
    }

    body.fx-headings .section-title .underline {
        animation: gtech-underline-glow 2.6s ease-in-out infinite;
    }

    /* Класс .js-ready добавляется скриптом effects.js сразу после запуска —
       если по какой-то причине JS не выполнится, заголовок останется видимым
       (без анимации появления), а не "спрячется" навсегда. */
    body.fx-headings.js-ready .section-title {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    body.fx-headings.js-ready .section-title.in-view {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gtech-heading-shine {
    0%   { background-position: 0% 50%; }
    100% { background-position: -220% 50%; }
}

@keyframes gtech-underline-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(var(--color-accent-rgb), 0); }
    50%      { box-shadow: 0 0 16px 1px rgba(var(--color-accent-rgb), 0.85); }
}

/* =====================================================================
   ЭФФЕКТ 2: Анимация частиц на фоне блоков
   Включается/выключается в админке (Настройки → «Анимация частиц»).
   Canvas добавляется скриптом effects.js первым потомком в каждую .section.
   ===================================================================== */
.section > .container {
    position: relative;
    z-index: 1;
}

.particles-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    pointer-events: none;
}
