:root {
    --accent:      #1DCFED;
    --accent-dark: #0292B6;
    --text:        #F8F9FA;
    --text-soft:   #E1E5E8;
    --nav-h:       67px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #080A16;
    color: var(--text);
    overflow-x: hidden;
}

/* ---- Matrix background (fixed, all pages) ---- */
.matrix-main-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.matrix-bg-el {
    position: absolute;
    border-radius: 0;
    pointer-events: none;
    /* Размеры и позиция задаются через JS */
}

.matrix-scene { position: absolute; }
.matrix-scene.sc-1 { left: 2vw;  top: 18vh; }
.matrix-scene.sc-2 { left: 5vw;  top: 52vh; }
.matrix-scene.sc-3 { right: 5vw; top: 22vh; }
.matrix-scene.sc-4 { right: 5vw; top: 60vh; }

.matrix-scene .binary {
    white-space: pre;
    overflow: hidden;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 13px;
    line-height: 103%;
    background: radial-gradient(191.61% 137.1% at 0% 0%,
    rgb(0,0,16) 0%, rgb(83,66,118) 19%, rgba(83,66,118,0.05) 29%,
    rgb(41,71,114) 45%, rgba(41,71,114,0.01) 55%,
    rgb(50,16,65) 63%, rgba(50,16,65,0.02) 74%,
    rgba(0,0,15,0.7) 98%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    padding: 0; margin: 0;
    background-size: 300% 300%;
}

.matrix-scene.sc-1 .binary { width: 28vw; max-width: 347px; animation: textShine 24s linear infinite alternate; }
.matrix-scene.sc-2 .binary { width: 36vw; max-width: 547px; animation: textShine 28s linear infinite alternate; }
.matrix-scene.sc-3 .binary { width: 24vw; max-width: 333px; animation: textShine 35s linear infinite alternate; }
.matrix-scene.sc-4 .binary { width: 20vw; max-width: 237px; animation: textShine 30s linear infinite alternate; }

/* Global horizontal padding for all pages */
.site-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Inner page content gets side padding */
.site-wrapper > main {
    padding-left: clamp(16px, 4vw, 60px);
    padding-right: clamp(16px, 4vw, 60px);
}

/* Presentation and home are full-width — no padding */
.page-template-page-presentation .site-wrapper > main,
.home .site-wrapper > main {
    padding-left: 0;
    padding-right: 0;
}

/* 404 — без паддингов и на всю ширину */
.page-template-page-404-new .site-wrapper > main,
.error404 .site-wrapper > main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Gallery mode — extra insurance */
.page-template-page-presentation .presentation-mode-gallery,
.page-template-page-presentation .presentation-gallery {
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.site-nav {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--nav-h);
    background: #00050a;
    display: flex;
    align-items: center;
    padding: 0 clamp(16px, 5vw, 80px);
    z-index: 100;
    box-sizing: border-box;
}

.site-nav .container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    /* Override Bootstrap container padding */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.navbar-brand,
.custom-logo-link {
    display: flex;
    align-items: center;
    height: 45px;
    flex-shrink: 0;
}

.custom-logo-link img {
    height: 42px;
    width: auto;
    display: block;
    transform: translateY(-7px);
}

.navbar-brand svg {
    width: 183px;
    height: 57px;
    display: block;
    transform: translateY(2px);
}

/* ---- Menu ---- */
.menu {
    display: flex;
    align-items: center;
    height: 27px;
}

/* Нейтрализуем Bootstrap a { color: blue } внутри хедера на всех страницах */
.site-nav a,
.site-nav a:hover,
.site-nav a:visited {
    color: white;
    text-decoration: none;
}

.menu-item {
    position: relative;
    z-index: 0; /* создаёт stacking context — ::before/::after z-index:-1 остаются внутри */
    display: flex;
    align-items: center;
    height: 27px;
    padding: 0 16px;
    font-size: 18px;
    line-height: 27px;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    overflow: visible;
}

/* Эллипс-свечение за текстом при active/hover */
.menu-item::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 14px;
    width: 100%;
    height: 3px;
    border-radius: 50%;
    background: #1DCFED;
    filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.2s ease;
}

/* Вертикальные линии 2px слева и справа + светящиеся эллипсы */
.menu-item::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 57px;
    background:
        radial-gradient(ellipse 100% 40% at 0% 50%, rgba(29,207,237,0.69) 0%, rgba(29,207,237,0) 100%) left  / 6px 100% no-repeat,
        radial-gradient(ellipse 100% 40% at 100% 50%, rgba(29,207,237,0.69) 0%, rgba(29,207,237,0) 100%) right / 6px 100% no-repeat;
    pointer-events: none;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.2s ease;
}

.menu-item.active::after,
.menu-item:hover::after,
.menu-item.active::before,
.menu-item:hover::before {
    opacity: 1;
}

.menu-item.active,
.menu-item:hover {
    color: #fff;
    text-shadow: 0 0 11px #1DCFED, 0 0 11px #1DCFED, 0 0 22px #1DCFED;
}


.language .flag {
    display: inline-flex;
    margin-right: 6px;
    vertical-align: middle;
}

/* ---- About dropdown ---- */
.about {
    height: 62px;
    padding-bottom: 35px;
    margin-bottom: -35px;
    justify-content: center;
}

/* Полоски для .about — позиционируем относительно хедера */
.about::before {
    top: -20px;
    transform: none;
    height: 67px;
}

.about-link {
    color: inherit;
    text-decoration: none;
}

.submenu {
    position: absolute;
    left: 50%;
    top: 27px;
    transform: translateX(-50%);
    width: max-content;
    min-width: 126px;
    max-width: 320px;
    padding: 6px 0;
    border-radius: 0 0 16px 16px;
    background: radial-gradient(31.2% 40.91% at 50% 151.14%, rgba(29,207,237,0.08) 0%, rgba(29,207,237,0) 100%),
    rgba(8,10,22,0.96);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 0 1px rgba(29,207,237,0.12), 0 12px 24px rgba(0,0,0,0.28);
    display: none;
    z-index: 40;
    overflow: hidden;
}

.submenu::before {
    content: "";
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
    animation: sky-anim 2s linear infinite;
    opacity: .42;
    position: absolute;
    inset: 2px;
    -webkit-mask-image: radial-gradient(#fff 3%, #0000 3%), radial-gradient(rgba(255,255,255,.5) 3%, #0000 3%);
    mask-image: radial-gradient(#fff 3%, #0000 3%), radial-gradient(rgba(255,255,255,.5) 3%, #0000 3%);
    -webkit-mask-position: 0 0, 15px 15px;
    mask-position: 0 0, 15px 15px;
    -webkit-mask-size: 30px 30px;
    mask-size: 30px 30px;
    background: linear-gradient(180deg, rgba(29,207,237,0.48) 0%, rgba(29,207,237,0.10) 100%);
    filter: drop-shadow(0 0 14px rgba(29,207,237,0.9)) drop-shadow(0 0 26px rgba(29,207,237,0.58));
}

.submenu::after {
    content: "";
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle, 0deg), transparent 0%, rgba(29,207,237,0.12) 30%, rgba(29,207,237,0.92) 40%, rgba(29,207,237,0.65) 42%, transparent 48%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    animation: border-spin 14s linear infinite;
    opacity: .22;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.about:hover .submenu,
.about.is-open .submenu { display: block; }

.about:hover .submenu::after,
.about.is-open .submenu::after { opacity: .48; }

/* On desktop is-open is only for touch — disable it on hover-capable devices */
@media (hover: hover) {
    .about.is-open .submenu { display: block; }
}

.submenu-item {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 35px;
    color: #fff;
    font-size: 12px;
    line-height: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 14px;
    text-decoration: none;
}

.submenu-item + .submenu-item { border-top: 1px solid rgba(255,255,255,0.06); }

/* Сбросить унаследованное свечение от родителя .menu-item:hover */
.submenu { text-shadow: none; }
.submenu-item { text-shadow: none; }

.submenu-item.active,
.submenu-item:hover {
    color: #fff;
    text-shadow: 0 0 11px #1DCFED, 0 0 11px #1DCFED, 0 0 22px #1DCFED;
}

/* ---- Top border ---- */
.top-border {
    width: 100%;
    height: 1px;
    position: relative;
    z-index: 1;
    background: radial-gradient(
        ellipse 60% 100% at 50% 50%,
        rgba(29, 207, 237, 0.8) 0%,
        rgba(29, 207, 237, 0.4) 30%,
        rgba(29, 207, 237, 0) 100%
    );
}

/* ---- Footer ---- */
.site-footer {
    width: 100%;
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    padding: 20px;
    color: var(--text);
    position: relative;
    z-index: 1;
}

/* ---- Cursor glow ---- */
@media (min-width: 1025px) {
    #cursor-ring {
        position: fixed;
        top: 0; left: 0;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        width: 850px; height: 850px;
        opacity: .5;
        background: radial-gradient(49.77% 50% at 50.03% 50%, rgba(58,28,139,0.6) 0%, rgba(58,28,139,0) 100%);
    }
}

/* ---- Keyframes ---- */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes border-spin { to { --angle: 360deg; } }
@keyframes sky-anim {
    to { mask-position: 0 -15px, 15px -45px; -webkit-mask-position: 0 -15px, 15px -45px; }
}
@keyframes textShine {
    0%   { background-position: 0%   0%;   }
    25%  { background-position: 100% 0%;   }
    50%  { background-position: 100% 100%; }
    75%  { background-position: 0%   100%; }
    100% { background-position: 0%   0%;   }
}

/* =============================================
   NEW MOBILE MENU OVERLAY (fullscreen)
   Показывается только на мобилках ≤900px
   ============================================= */

.mobile-menu-overlay {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #00050a;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Blobs */
.mobile-menu-bg-blob {
    position: absolute;
    width: 563px; height: 563px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(58,28,139,0.6), transparent 70%);
    opacity: 0.5;
}

.blob-top    { top: -290px; left: 13px; }
.blob-bottom { top:  290px; left: 13px; }

/* Кольца (circles) в мобильном меню — позиция из Figma */
.mobile-menu-circles {
    position: absolute;
    left: -38px;
    top: 323px;
    width: 894px;
    height: 554px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.mobile-menu-circles svg {
    width: 100%;
    height: 100%;
}

/* Градиентная полоска в overlay — такая же как .top-border */
.mobile-menu-top-border {
    width: 100%;
    height: 1px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: radial-gradient(
        ellipse 80% 100% at 50% 50%,
        rgba(29, 207, 237, 0.8) 0%,
        rgba(29, 207, 237, 0.4) 30%,
        rgba(29, 207, 237, 0) 100%
    );
}

/* Header внутри overlay */
.mobile-menu-header {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.mobile-menu-header .custom-logo-link img {
    height: 18px;
    transform: none;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #f8f9fa;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.mobile-menu-close:hover { color: #1dcfed; }

/* Nav links */
.mobile-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 66px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

/* Переопределяем стили .menu-item внутри overlay */
.mobile-menu-nav .menu-item {
    width: auto;
    height: auto;
    padding: 15px 0;
    font-size: 24px;
    line-height: 1.3;
    border-bottom: none;
    color: #f8f9fa;
    display: block;
}

.mobile-menu-nav .menu-item::before,
.mobile-menu-nav .menu-item::after { display: none; }

.mobile-menu-nav .menu-item.active,
.mobile-menu-nav .menu-item.current-menu-item,
.mobile-menu-nav .menu-item.current_page_item,
.mobile-menu-nav .menu-item.current-menu-ancestor,
.mobile-menu-nav .menu-item:hover {
    color: #1DCFED;
    text-shadow: none;
}

/* Переопределяем цвет ссылок внутри overlay — нейтрализуем .site-nav a { color: white } */
.mobile-menu-overlay a,
.mobile-menu-overlay a:visited {
    color: #f8f9fa;
    text-decoration: none;
}

/* Активные и hover */
.mobile-menu-overlay a.menu-item.active,
.mobile-menu-overlay a.menu-item.current-menu-item,
.mobile-menu-overlay a.menu-item.current_page_item,
.mobile-menu-overlay a.menu-item:hover,
.mobile-menu-overlay .menu-item.about.active > .about-link,
.mobile-menu-overlay .menu-item.about.current-menu-item > .about-link,
.mobile-menu-overlay .menu-item.about.current-menu-ancestor > .about-link,
.mobile-menu-overlay .menu-item.about:hover > .about-link {
    color: #1DCFED !important;
}

/* Submenu внутри overlay — простой список */
.mobile-menu-nav .submenu {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    display: block;
    padding: 0 0 0 16px;
    border-left: 1px solid rgba(29,207,237,0.3);
    margin: 4px 0 10px;
}

.mobile-menu-nav .submenu::before,
.mobile-menu-nav .submenu::after { display: none; }

.mobile-menu-nav .submenu-item {
    font-size: 16px;
    padding: 8px 0;
    color: #f8f9fa;
    border-top: none;
    text-shadow: none;
}

.mobile-menu-nav .submenu-item.active,
.mobile-menu-nav .submenu-item:hover { color: #1dcfed; text-shadow: none; }

/* About item в overlay */
.mobile-menu-nav .about {
    height: auto;
    padding: 0;
    margin: 0;
    flex-direction: column;
    align-items: flex-start;
}

.mobile-menu-nav .about-link {
    display: block;
    padding: 15px 0;
    font-size: 24px;
    color: #f8f9fa;
}

.mobile-menu-nav .about:hover .submenu,
.mobile-menu-nav .about.is-open .submenu { display: block; }

/* Отключение подпунктов через параметр $mobile_hide_submenus = true */
.mobile-menu-nav.hide-submenus .submenu { display: none !important; }
.mobile-menu-nav.hide-submenus .about { flex-direction: row; }
.mobile-menu-nav.hide-submenus .about-link { padding: 15px 0; }

/* CTA кнопка внизу */
.mobile-menu-cta {
    margin: 20px 66px 60px;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #f8f9fa;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(192,212,237,0.85);
    border-radius: 8px;
    padding: 9px 0;
    background: linear-gradient(180deg, rgba(0,155,227,0.1), rgba(0,155,227,0));
    backdrop-filter: blur(2px);
    transition: background 0.2s;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.mobile-menu-cta:hover {
    background: linear-gradient(180deg, rgba(0,155,227,0.2), rgba(0,155,227,0.05));
    color: #f8f9fa;
}

/* Скрываем overlay на десктопе */
@media (min-width: 901px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

.burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 110;
    position: relative;
}

/* Обе SVG иконки абсолютно позиционированы в кнопке */
.burger-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Закрытое состояние: бургер виден, крестик скрыт */
.burger-open  {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
.burger-close {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-45deg) scale(0.7);
}

/* Открытое состояние: крестик виден, бургер скрыт */
.burger.is-open .burger-open {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.7);
}
.burger.is-open .burger-close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

@media (max-width: 900px) {
    :root { --nav-h: 36px; }

    .burger { display: flex; }

    .site-nav {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 0 18px;
        overflow: hidden;
    }

    .site-nav .container { height: 36px; }

    .custom-logo-link img {
        height: 18px;
        transform: none;
    }

    /* Убрать desktop glow-эффекты */
    .menu-item::before,
    .menu-item::after { display: none; }

    .menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        height: auto;
        width: 100%;
        padding: 8px 0 24px;
        border-top: 1px solid rgba(255,255,255,0.08);
        order: 3;
    }

    .menu.is-open { display: flex; }

    .menu-item {
        width: 100%;
        height: auto;
        padding: 14px 16px;
        font-size: 18px;
        line-height: 1.3;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    /* .about is also .menu-item — remove its own padding, link inside handles it */
    .menu-item.about {
        padding: 0;
    }

    /* pll-parent-menu-item: language switcher with img+span direct children */
    .pll-parent-menu-item {
        padding: 14px 16px !important;
        text-align: left;
    }

    .pll-lang-label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .pll-lang-label > span {
        margin-left: 0 !important;
    }

    .pll-parent-menu-item > .submenu {
        width: 100%;
    }

    .menu-item:last-child { border-bottom: none; }

    .about {
        height: auto;
        padding-bottom: 0;
        margin-bottom: 0;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .about-link {
        width: 100%;
        padding: 14px 16px;
        font-size: 18px;
        display: block;
    }

    /* Fix Polylang flag inline image alignment */
    .menu-item.language {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 14px 16px;
    }

    .menu-item.language img,
    .submenu-item.language img {
        display: inline-block !important;
        vertical-align: middle !important;
        flex-shrink: 0;
    }

    .menu-item.language span,
    .submenu-item.language span {
        margin-left: 0 !important;
        vertical-align: middle !important;
    }

    .submenu {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        background: rgba(255,255,255,0.03);
        box-shadow: none;
        backdrop-filter: none;
        display: block;
        padding: 0;
        border-left: 2px solid rgba(29,207,237,0.3);
        margin-left: 16px;
    }

    .submenu::before,
    .submenu::after { display: none; }

    .submenu-item {
        font-size: 14px;
        padding: 10px 16px;
        border-top: 1px solid rgba(255,255,255,0.04);
    }

    .submenu-item:first-child { border-top: none; }

    .site-nav.is-open {
        height: 36px;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .site-nav.is-open .container {
        flex-wrap: nowrap;
        align-items: center;
    }
}
