:root {
    --bg-dark: #d5e0d5; /* Light Metallic Green */
    --bg-panel: rgba(240, 250, 240, 0.9);
    
    --accent-primary: #006d80; /* Darker Cyan for contrast */
    --accent-secondary: #004a70; /* Darker Blue */
    --accent-alert: #cc0030; /* Darker Red */
    
    --text-primary: #0a1f0a; /* Dark Green/Black */
    --text-secondary: #3a4f3a; /* Dark Grey/Green */
    --text-dim: rgba(0, 100, 120, 0.4);
    
    --font-headers: 'Rajdhani', sans-serif; /* Less sci-fi, more industrial */
    --font-body: 'Rajdhani', sans-serif;
    
    --container-width: 1200px;
    --glow-text: 0 0 10px rgba(0, 100, 120, 0.3); /* Reduced glow */
    --glow-box: 0 0 20px rgba(0, 100, 120, 0.05);

    /* Global hero text tokens (used outside .hero too) */
    --hero-accent-text: #7ff3ef;
    --hero-heading-text: #f6f4dd;

    /* Landing header: lift distance for “label goes up, replacement appears” menus */
    --nav-lift: clamp(14px, 3vw, 38px);
}
.hero-title-maritime .hero__badge-upper,
.hero-title-split .hero__badge-upper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    padding: 0.65rem 1.05rem;
    box-sizing: border-box;
    perspective: 620px;
}

.hero__badge-upper-layer {
    /* Slightly darker than the main hero title text */
    opacity: 0.86;
    color: var(--hero-heading-text);
    padding: inherit;
    box-sizing: border-box;
}

.hero__badge-upper-measure {
    position: absolute;
    left: 0;
    top: 0;
    visibility: hidden;
    white-space: pre-line;
    pointer-events: none;
}

.hero__glyph {
    display: inline-block;
    transition: text-shadow 160ms ease, filter 160ms ease;
}

.hero__glyph.is-glyph-under {
    filter: brightness(1.28) saturate(1.14) contrast(1.05);
    text-shadow:
        0 0 16px color-mix(in srgb, var(--hero-accent-text) 42%, transparent),
        0 8px 20px rgba(0, 0, 0, 0.20);
}

.hero__badge-upper-moving {
    display: block;
    width: auto;
    will-change: transform, opacity, filter;
    transform-origin: 50% 100%;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

/* Hero actions: frosted glass (double blur) */
.hero__actions .hero__action-glass {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    background: rgba(5, 20, 5, 0.18);
}

.hero__actions .hero__action-glass::before,
.hero__actions .hero__action-glass::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.hero__actions .hero__action-glass::before {
    background: rgba(5, 20, 5, 0.18);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
}

.hero__actions .hero__action-glass::after {
    background: rgba(5, 20, 5, 0.20);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
}

.hero__actions .hero__action-text {
    position: relative;
    z-index: 1;
}

@supports (color: color-mix(in srgb, white 80%, black)) {
    .hero__badge-upper-layer {
        /* Add a hint of deep sea blue (uses existing tokens) */
        color: color-mix(in srgb, var(--hero-heading-text) 82%, var(--accent-secondary) 18%);
    }
}

.hero__title-neural {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.92;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.22));
}

.hero-title-maritime .hero-title-line,
.hero-title-split .hero-title-main,
.hero-title-split .hero-title-sub {
    position: relative;
    z-index: 3;
}

.hero-title-maritime .hero-title-line,
.hero-title-split .hero-title-main {
    transition: none;
}

.hero-title-split .hero-title-sub {
    transition: none;
}



* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: #d5e0d5;
    /* Removed “microchip” pattern per request */
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text-primary);
    line-height: 1.6;

}

/* Visually hidden but accessible (SEO/a11y-safe) */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(180deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: var(--glow-text);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.3rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    font-weight: 500;
}

.container {
    width: min(var(--container-width), 100% - 2rem);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 1.5rem 0;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(5, 20, 5, 0.95); /* Dark background for contrast */
    border-bottom: 1px solid rgba(0, 109, 128, 0.3);
    overflow: visible;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

@keyframes logoPulse {
    0% { text-shadow: 0 0 10px var(--accent-primary); transform: scale(1); }
    50% { text-shadow: 0 0 25px var(--accent-primary), 0 0 10px var(--accent-secondary); transform: scale(1.05); }
    100% { text-shadow: 0 0 10px var(--accent-primary); transform: scale(1); }
}

.header__logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-primary);
    animation: logoPulse 4s infinite ease-in-out;
}

.header__nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header__nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 10px;
    background: rgba(0, 243, 255, 0.05);
    color: var(--accent-primary);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.mobile-menu-toggle__bar {
    width: 22px;
    height: 2px;
    background: var(--accent-primary);
    display: block;
    border-radius: 2px;
}

.header__nav a {
    color: #e0f7fa; /* Light text for dark header */
    text-decoration: none;
    font-family: var(--font-headers);
    font-size: 0.8rem;
    transition: all 0.3s;
    position: relative;
}

.header__nav a:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 5px var(--accent-primary);
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.header__nav a:hover::after {
    width: 100%;
}

/* Header expander toggle is a <button>, make it look like a nav link */
.header__nav .nav-expander-toggle {
    color: #e0f7fa;
    font-family: var(--font-headers);
    font-size: 0.8rem;
    position: relative;
}

.header__nav .nav-expander-toggle:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 5px var(--accent-primary);
}

.header__cta {
    border: 1px solid var(--accent-primary);
    padding: 0.5rem 1.5rem;
    color: var(--accent-primary) !important;
    background: rgba(0, 243, 255, 0.05);
}

/* Landing header: contact CTA without frame */
.header__cta.header__cta--plain {
    border: none;
    background: transparent;
}

.header__cta:hover {
    background: var(--accent-primary);
    color: #000 !important;
    box-shadow: 0 0 20px var(--accent-primary);
}

/* Hero */
.hero {
    padding: 12rem 0 8rem;
    position: relative;
    /* Option 5 Background */
    background-color: transparent;
    overflow: hidden;

    /* Accent text color (matches “От трирем...” subtitle) */
    --hero-accent-text: #7ff3ef;

    /* Slightly muted version for hero headings/badge */
    --hero-heading-text: #f6f4dd;
}

.hero__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
}

@media (min-width: 993px) {
    .hero__content {
        align-items: stretch;
    }

    .hero__left {
        align-self: stretch;
    }

    .hero__left .hero-title-full.hero-title-maritime,
    .hero__left .hero-title-split {
        flex: 1 1 auto;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.hero__left {
    flex: 1.6; /* Increased width (approx 60%) */
    max-width: none; /* Remove 50% limit */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0; /* Prevent flex overflow */
    position: relative;
}

/* Keep hero title and badge aligned in width */
.hero__left .hero-title-full,
.hero__left .hero-title-split,
.hero__left .hero__badge-wrap {
    width: 100%;
    box-sizing: border-box;
}

.hero__right {
    flex: 1; /* Decreased width (approx 40%) */
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    position: relative;
    overflow: hidden; /* Contain the gallery */
    border-radius: 8px;
}

.hero-gallery-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: flex-start;
}

.hero-gallery-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    overflow: hidden;
    width: 100%;
    height: auto;
    gap: 0; /* No gap for seamless slider */
}

.hero-gallery-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.hero-gallery-item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 3.2s ease;
    --hero-media-opacity: 0.70;
    --hero-media-blur: 0px;
    --hero-media-mask: radial-gradient(ellipse at center, rgba(0,0,0,1) 45%, rgba(0,0,0,0.85) 62%, rgba(0,0,0,0) 92%);
}

.hero-gallery-item.is-active {
    opacity: 1;
    pointer-events: auto;
}

.hero-gallery-item:hover,
.hero-gallery-item:focus-within {
    --hero-media-opacity: 1;
    --hero-media-blur: 0px;
    --hero-media-mask: none;
}

.hero__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 22px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    border: none;
    opacity: var(--hero-media-opacity, 0.70);
    filter: blur(var(--hero-media-blur, 0px));
    transform: translateZ(0);
    -webkit-mask-image: var(--hero-media-mask, none);
    mask-image: var(--hero-media-mask, none);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.hero-gallery-item video {
    border-radius: 22px;
    filter: blur(var(--hero-media-blur, 0px));
    transform: translateZ(0);
    -webkit-mask-image: var(--hero-media-mask, none);
    mask-image: var(--hero-media-mask, none);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

@media (prefers-reduced-motion: reduce) {
    .hero-gallery-item {
        transition: none;
    }
}

.hero-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(2, 12, 27, 0.7);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0; /* Hidden by default, shown on hover */
}

.hero__right:hover .hero-gallery-nav {
    opacity: 1;
}

.hero-gallery-nav:hover {
    background: var(--accent-primary);
    color: #000;
}

.hero-gallery-nav.prev {
    left: 10px;
}

.hero-gallery-nav.next {
    right: 10px;
}

.hero__subtitle {
    width: 100%;
    margin-top: 1rem;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px 5px rgba(5, 20, 5, 0.2);
    color: var(--hero-heading-text);
    font-size: 1.2rem;
    text-align: center;
    position: relative;
    z-index: 0;
    overflow: hidden;
    isolation: isolate;
}

.hero__subtitle .hero__subtitle-text {
    position: relative;
    z-index: 2;
    display: block;
}

.hero__subtitle-neural {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.70;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.18));
}

.hero__subtitle::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

.hero__subtitle::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

@media (min-width: 993px) {
    /* Keep left/right bottoms aligned; pin subtitle to the bottom of the right column */
    .hero__right {
        align-self: stretch;
    }

    .hero-gallery-wrapper {
        flex: 1 1 auto;
        min-height: 0;
    }

    .hero__subtitle {
        margin-top: auto;
        /* Stabilize height to avoid visual jerks when subtitle content changes */
        min-height: 5.2em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hero: clickable “volume” area inserted after the resilience anchor */
.resilience-cta-area {
    appearance: none;
    border: 1px solid rgba(0, 243, 255, 0.22);
    cursor: pointer;
    display: block;
    font-family: inherit;
    line-height: inherit;
    text-align: center;
    background: rgba(5, 20, 5, 0.34);
    backdrop-filter: blur(14px) saturate(140%);
    width: 100%;
    margin-top: 0.9rem;
    padding: 1.1rem 1.25rem;
    border-radius: 10px;
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(0, 243, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.resilience-cta-area::before {
    content: "";
    position: absolute;
    inset: -40% -30% auto -30%;
    height: 180%;
    background: radial-gradient(
        60% 40% at 50% 20%,
        rgba(0, 243, 255, 0.16),
        rgba(0, 243, 255, 0.00) 70%
    );
    pointer-events: none;
}

.resilience-cta-area:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 243, 255, 0.36);
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.55),
        0 0 22px rgba(0, 243, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.resilience-cta-area:active {
    transform: translateY(0);
}

.resilience-cta-area:focus-visible {
    outline: 2px solid rgba(0, 243, 255, 0.85);
    outline-offset: 4px;
}

.resilience-cta-area__text {
    position: relative;
    z-index: 1;
    color: var(--hero-heading-text);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .resilience-cta-area {
        transition: none;
    }
    .resilience-cta-area:hover {
        transform: none;
    }
}

.hero__image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px dashed var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-family: var(--font-headers);
}

.hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Admin-managed section backgrounds (cover full section width/height) */
.section-bg {
    --section-bg-image: none;
    --section-bg-image-set: none;
    --section-bg-image-set-mobile: none;
    --section-bg-opacity: 0;
    --section-blend-size: clamp(44px, 5.5vw, 120px);
    position: relative;
    background-color: transparent;
    overflow: hidden;
}

.section-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: var(--section-bg-opacity);
    background-image: var(--section-bg-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    image-orientation: none;
    z-index: 0;
    pointer-events: none;
    transition: opacity 420ms ease;
    will-change: opacity;

    /* Soft blend at section boundaries */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--section-blend-size),
        #000 calc(100% - var(--section-blend-size)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--section-blend-size),
        #000 calc(100% - var(--section-blend-size)),
        transparent 100%
    );
}

.section-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: calc(var(--section-bg-opacity) * 0.78);
    background-image: var(--section-bg-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    image-orientation: none;
    z-index: 0;
    pointer-events: none;
    transition: opacity 420ms ease;
    will-change: opacity;

    /* Add blur only at the top/bottom edge zones */
    filter: blur(18px) saturate(110%);
    transform: scale(1.05);

    -webkit-mask-image: linear-gradient(
        to bottom,
        #000 0,
        #000 calc(var(--section-blend-size) * 0.95),
        transparent calc(var(--section-blend-size) * 1.55),
        transparent calc(100% - (var(--section-blend-size) * 1.55)),
        #000 calc(100% - (var(--section-blend-size) * 0.95)),
        #000 100%
    );
    mask-image: linear-gradient(
        to bottom,
        #000 0,
        #000 calc(var(--section-blend-size) * 0.95),
        transparent calc(var(--section-blend-size) * 1.55),
        transparent calc(100% - (var(--section-blend-size) * 1.55)),
        #000 calc(100% - (var(--section-blend-size) * 0.95)),
        #000 100%
    );
}

@supports (background-image: image-set(url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==") 1x)) {
    .section-bg::before {
        background-image: var(--section-bg-image-set, var(--section-bg-image));
    }

    .section-bg::after {
        background-image: var(--section-bg-image-set, var(--section-bg-image));
    }
}

@media (max-width: 768px) {
    @supports (background-image: image-set(url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==") 1x)) {
        .section-bg::before {
            background-image: var(--section-bg-image-set-mobile, var(--section-bg-image-set, var(--section-bg-image)));
        }

        .section-bg::after {
            background-image: var(--section-bg-image-set-mobile, var(--section-bg-image-set, var(--section-bg-image)));
        }
    }
}

.section-bg .container {
    position: relative;
    z-index: 1;
}


.hero-title-split {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1rem;
}
.hero-title-main {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--accent-secondary) 45%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: url(#wavy) drop-shadow(0 0 10px rgba(0, 100, 120, 0.3)) brightness(var(--hero-title-line-brightness, 1));
    text-align: left;
    padding-right: 10px;
}
.hero-title-sub {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.2;
    color: var(--text-primary);
    text-align: center;
    margin-top: 0.5rem;
}

/* Brighten hero title lines when a banner moves underneath (JS toggles .is-banner-under) */
.hero-title-maritime .hero-prefix.is-banner-under,
.hero-title-maritime .hero-rest.is-banner-under,
.hero-title-maritime .hero-title-line.is-banner-under,
.hero-title-split .hero-title-sub.is-banner-under {
    filter: brightness(1.55) saturate(1.14);
    text-shadow:
        0 0 16px color-mix(in srgb, var(--hero-accent-text) 42%, transparent),
        0 10px 22px rgba(0, 0, 0, 0.18);
}

.hero-title-split .hero-title-main.is-banner-under {
    --hero-title-line-brightness: 1.55;
    text-shadow:
        0 0 16px color-mix(in srgb, var(--hero-accent-text) 42%, transparent),
        0 10px 22px rgba(0, 0, 0, 0.18);
}

/* Maritime-themed hero title styling */
.hero-title-maritime {
    margin-bottom: 1rem;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px 5px rgba(5, 20, 5, 0.2);
    color: var(--hero-heading-text);
    position: relative;
    z-index: 0;
    overflow: hidden;
    isolation: isolate;
}

.hero-title-maritime::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

.hero-title-maritime::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 20, 5, 0.2);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}



.hero-title-maritime > :not(canvas.hero__title-neural):not(.hero__badge-upper) {
    position: relative;
    z-index: 2;
}
.hero-title-maritime .hero-title-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.hero-title-maritime .hero-prefix {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(1.2rem, 3.8vw, 2.4rem);
    color: var(--hero-heading-text);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    text-shadow: 0 0 10px rgba(0,0,0,0.06);
}
.hero-title-maritime .hero-rest {
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: clamp(1.6rem, 4.2vw, 3.2rem);
    line-height: 1.05;
    color: var(--hero-heading-text);
    text-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
/* Decorative icon removed — keeping header clean */

@media (max-width: 992px) {
    .hero-title-maritime .hero-prefix { font-size: 1.1rem; }
    .hero-title-maritime .hero-rest { font-size: 1.6rem; }
    .hero-title-maritime::before { width: 36px; height: 36px; }
}

.hero p:not(.hero__subtitle) {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

@media (max-width: 992px) {
    .hero__content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .hero__left {
        max-width: 100%;
        text-align: center;
    }
    
    .hero__right {
        align-items: center;
        width: 100%;
    }
    
    .hero__view-tile {
        text-align: center !important;
    }
    
    .hero p:not(.hero__subtitle) {
        margin-left: auto;
        margin-right: auto;
    }
}

.hero__badge {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0.5rem 1.5rem 1.25rem;
    color: var(--hero-heading-text);
    font-family: var(--font-headers);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    background-color: rgba(5, 20, 5, 0.2); /* Badge base (no image) */
    backdrop-filter: blur(5px); /* Blur effect */
    border-radius: 8px;
    box-shadow: 0 0 10px 5px rgba(5, 20, 5, 0.2); /* Blurred edges */
    overflow: hidden;
    isolation: isolate;

    /* Hero badge progress overlay (enabled via JS) */
    --hero-badge-progress: 0%;
    --hero-badge-duration: 5s;
    --hero-badge-fade: 1;
    --hero-badge-overlay-opacity: 0.85;
    --hero-badge-transition: opacity 0s linear;
    --hero-badge-text-fade: 520ms;
    --hero-badge-text-shift: 0.45em;
    --hero-badge-text-height: 3.2em;
    --hero-badge-text-crawl-duration: var(--hero-badge-duration, 5s);
    --hero-badge-upper-height: 2.8em;
    --hero-badge-upper-gap: 10px;
}

/* Hero badge wrapper allows an "upper window" outside badge overflow */
.hero__badge-wrap {
    position: relative;
    display: block;
    width: 100%;
    color: var(--hero-heading-text);
    font-family: var(--font-headers);
    font-size: 1.2rem;
}

/* Upper window for crawl text (visible above the badge) */
.hero__badge-upper {
    position: absolute;
    inset: 0;
    height: auto;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    perspective: 520px;
    transform-style: preserve-3d;
    color: var(--hero-heading-text);
    font-family: var(--font-headers);
    font-size: 1.2rem;
}

/* Ensure Hero Title text renders above the upper crawl window */
.hero-title-full,
.hero-title-split {
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.hero__badge-upper-layer {
    display: block;
    position: absolute;
    inset: 0;
    white-space: pre-line;
    text-align: center;
    transform-origin: 50% 100%;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: var(--hero-heading-text);
    will-change: transform, opacity, filter;
    pointer-events: none;
}

@supports (color: color-mix(in srgb, white 80%, black)) {
    .hero__badge-upper-layer {
        /* Hint of deep sea blue in the banner fill */
        color: color-mix(in srgb, var(--hero-heading-text) 80%, var(--accent-secondary) 20%);
        text-shadow: 0 0 14px color-mix(in srgb, var(--accent-secondary) 34%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__badge-upper {
        perspective: none;
        transform-style: flat;
    }

    .hero__badge-upper-layer {
        transform: none !important;
        filter: none !important;
    }
}

.hero__badge::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;

    /* Progress layer (enabled via JS) */
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.34));
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    box-shadow:
        inset 0 0 0 1px rgba(0, 243, 255, 0.12),
        0 0 18px rgba(0, 243, 255, 0.18);
    transition: var(--hero-badge-transition, opacity var(--hero-badge-duration, 5s) linear);
    opacity: calc(var(--hero-badge-fade, 1) * var(--hero-badge-overlay-opacity, 0.85));
}

.hero__badge-text {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: var(--hero-badge-text-height, 3.2em);
    overflow: hidden;
    perspective: 520px;
    transform-style: preserve-3d;
}

.hero__badge-text.hero__badge-text--no-transition .hero__badge-text-layer {
    transition: none !important;
}

/* While crawl animation runs, hide the static layer to avoid double text */
.hero__badge-text.is-crawling .hero__badge-text-layer--a {
    opacity: 0 !important;
}

.hero__badge-text.is-crawling .hero__badge-text-layer--b {
    opacity: 1;
}

.hero__badge-text-layer {
    display: block;
    position: absolute;
    inset: 0;
    white-space: pre-line;
    will-change: opacity, transform;
    transition:
        opacity var(--hero-badge-text-fade, 520ms) ease,
        transform var(--hero-badge-text-fade, 520ms) ease;
}

.hero__badge-text-layer--a {
    /* Keep layer A in normal flow to define the badge width. */
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: hidden;
    transform: translateY(0);
}

.hero__badge-text-layer--a.is-fade-out {
    opacity: 0;
    transform: translateY(calc(var(--hero-badge-text-shift, 0.45em) * -1));
}

.hero__badge-text-layer--b {
    opacity: 1;
    transform: none;
}

.hero__badge-text-layer--b.is-fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Star Wars-style crawl for Hero Badge Messages */
.hero__badge-text-layer.is-crawl {
    opacity: 1;
    transform-origin: 50% 100%;
    animation: heroBadgeCrawl var(--hero-badge-text-crawl-duration, 5s) linear both;
}

@keyframes heroBadgeCrawl {
    0% {
        opacity: 0;
        transform: translateY(110%) rotateX(22deg) scale(1);
        filter: blur(0);
    }
    8% {
        opacity: 1;
    }
    75% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-130%) rotateX(26deg) scale(0.62);
        filter: blur(0.6px);
    }
}

.hero__badge-nav {
    position: absolute;
    bottom: 0;
    transform: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: rgba(5, 20, 5, 0.10);
    backdrop-filter: blur(5px);
    color: rgba(0, 0, 0, 0.45);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    opacity: 0.22;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
    z-index: 3;
}

.hero__badge:hover .hero__badge-nav,
.hero__badge-nav:hover,
.hero__badge-nav:focus-visible {
    opacity: 0.95;
    background: rgba(5, 20, 5, 0.20);
    color: rgba(0, 0, 0, 0.85);
}

.hero__badge-nav:hover {
    transform: scale(1.05);
}

.hero__badge-nav:active {
    transform: scale(0.98);
}

.hero__badge-nav--prev {
    left: 0;
}

.hero__badge-nav--next {
    right: 0;
}

/* On touch devices there is no hover, so keep controls visible */
@media (hover: none), (pointer: coarse) {
    .hero__badge-nav {
        opacity: 0.75;
        background: rgba(5, 20, 5, 0.18);
        color: rgba(0, 0, 0, 0.80);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__badge {
        transition: none;
    }

    .hero__badge::before {
        transition: none;
    }

    .hero__badge-text-layer {
        transition: none;
        transform: none;
        animation: none !important;
    }

    /* Reduced motion: show the static layer A, hide animated layer B */
    .hero__badge-text-layer--a {
        opacity: 1 !important;
    }

    .hero__badge-text-layer--b {
        opacity: 0 !important;
    }

    .hero__badge-text-layer.is-crawl {
        animation: none !important;
    }
}

.hero__lead {
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1.5rem;
    text-align: left;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.05), transparent);
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 3rem;
}

.hero__actions > * {
    flex: 1;
    min-width: 200px;
    text-align: center;
    justify-content: center;
}

/* Buttons - Tech Style */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    text-decoration: none;
    font-family: var(--font-headers);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    border: 1px solid transparent;
    cursor: pointer;
    overflow: hidden;
    white-space: normal;
    text-align: center;
}

/* Home hero CTA “cards”: match subtitle banner glass background */
.hero__actions .btn {
    border: none;
    background: rgba(5, 20, 5, 0.32);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.38),
        0 0 18px rgba(0, 243, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(10deg) rotateY(-6deg);
    will-change: transform, box-shadow;
}

.hero__actions .btn::before {
    content: "";
    position: absolute;
    inset: -40% -30% auto -30%;
    height: 180%;
    background: radial-gradient(
        60% 40% at 50% 20%,
        rgba(0, 243, 255, 0.16),
        rgba(0, 243, 255, 0.00) 70%
    );
    pointer-events: none;
    opacity: 0.9;
    transform: translateZ(-1px);
}

@keyframes heroCtaDepthIdle {
    0% { transform: perspective(900px) rotateX(10deg) rotateY(-6deg); }
    50% { transform: perspective(900px) rotateX(12deg) rotateY(4deg); }
    100% { transform: perspective(900px) rotateX(10deg) rotateY(-6deg); }
}

@media (prefers-reduced-motion: no-preference) {
    .hero__actions .btn:not(:hover):not(:focus-visible) {
        animation: heroCtaDepthIdle 6.5s ease-in-out infinite;
    }
}

.hero__actions .btn:hover,
.hero__actions .btn:focus-visible {
    transform: perspective(900px) scaleX(0.96) scaleY(1.06);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.48),
        0 0 22px rgba(0, 243, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.hero__actions .btn:active {
    transform: perspective(900px) scaleX(0.98) scaleY(1.02);
}

/* Primary: "Request Confidential Audit" */
.btn--primary {
    background: rgba(0, 109, 128, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 109, 128, 0.2);
}

.btn--primary:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 25px var(--accent-primary);
    text-shadow: none;
    transform: translateY(-2px);
}

/* Secondary: "Why Us" */
.btn--secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.btn--secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 109, 128, 0.05);
    box-shadow: 0 0 15px rgba(0, 109, 128, 0.2);
}

/* Outline: "Our View" */
.btn--outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px dashed var(--accent-primary);
}

.btn--outline:hover {
    background: rgba(0, 109, 128, 0.1);
    border-style: solid;
    box-shadow: 0 0 15px rgba(0, 109, 128, 0.3);
    transform: translateY(-2px);
}

/* Home hero CTA “cards”: match subtitle banner text color */
.hero__actions .btn.btn--primary,
.hero__actions .btn.btn--secondary,
.hero__actions .btn.btn--outline {
    color: var(--hero-heading-text);
    border: none;
}

/* Prevent generic button hover transforms from overriding the hero CTA hover geometry */
.hero__actions .btn.btn--primary:hover,
.hero__actions .btn.btn--secondary:hover,
.hero__actions .btn.btn--outline:hover {
    transform: perspective(900px) scaleX(0.96) scaleY(1.06);
}

/* Cards / HUD Elements */
.card, .service-item {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 243, 255, 0.1);
    padding: 2rem;
    position: relative;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.cyber-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cyber-title__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    opacity: 0.95;
}

.cyber-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cyber-title__text {
    min-width: 0;
}

.service-item {
    cursor: pointer;
    isolation: isolate;
}

/* Services cards: subtle glow overlay (no jitter) */
.service-item > * {
    position: relative;
    z-index: 1;
}

.service-item::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: rgba(240, 250, 240, 0.14);
    border: 1px solid rgba(0, 243, 255, 0.18);
    box-shadow:
        0 0 0 1px rgba(0, 243, 255, 0.18),
        0 28px 120px rgba(0, 0, 0, 0.24),
        0 0 130px rgba(0, 243, 255, 0.22),
        0 0 44px rgba(255, 255, 255, 0.14);
    filter: blur(0.6px);
    transform: translate3d(0, 0, 0) scale(1);
    mix-blend-mode: screen;
}

.service-item::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    background:
        radial-gradient(600px 140px at 25% 0%, rgba(0, 243, 255, 0.18), transparent 55%),
        radial-gradient(420px 180px at 85% 20%, rgba(0, 109, 128, 0.22), transparent 60%);
    mix-blend-mode: screen;
}

/* Expertise section heading: match hero heading color */
#expertise h2 {
    color: var(--hero-heading-text);
}

/* Services section heading: match Expertise heading color */
#services h2 {
    color: var(--hero-heading-text);
}

.card:hover, .service-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
}

.service-item:not(.expanded):hover {
    /* Remove jittery "vibrate"; keep a clean lift + glow */
    animation: none;
    transform: translateY(-6px) scale(1.01);
    cursor: pointer;
}

.service-item:not(.expanded):hover::after {
    opacity: 1;
    transform: translateY(-2px);
}

@keyframes services-card-phantom {
    0% {
        opacity: 0.62;
        transform: translate3d(-44px, 30px, 0) scale(0.975);
        filter: blur(0.5px);
    }
    38% {
        opacity: 0.30;
        transform: translate3d(-18px, 12px, 0) scale(0.988);
        filter: blur(2.2px);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(12px);
    }
}

.service-item:not(.expanded):hover::before,
.service-item--special:not(.expanded):hover::before {
    animation: services-card-phantom 3.8s ease-out both;
}

.service-item:not(.expanded):active::before {
    animation: services-card-phantom 3.8s ease-out both;
}

.service-item:not(.expanded):active {
    transform: translateY(-2px) scale(0.995);
}

/* Special Offer: use a gentle pulse instead of vibrate */
.service-item--special:not(.expanded):hover {
    animation: special-offer-pulse 1.4s ease-in-out infinite;
    transform: translateY(-5px) scale(1.02);
    cursor: pointer;
}

@keyframes special-offer-pulse {
    0% { transform: translateY(-5px) scale(1.02); }
    50% { transform: translateY(-5px) scale(1.035); }
    100% { transform: translateY(-5px) scale(1.02); }
}

@keyframes vibrate {
    0% { transform: translateY(-5px) translate(0); }
    20% { transform: translateY(-5px) translate(-1px, 1px); }
    40% { transform: translateY(-5px) translate(-1px, -1px); }
    60% { transform: translateY(-5px) translate(1px, 1px); }
    80% { transform: translateY(-5px) translate(1px, -1px); }
    100% { transform: translateY(-5px) translate(0); }
}

/* Expanded Card Logic */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Keep click-capture overlay transparent; visual blur/dim is provided by .services-backdrop */
    background: transparent;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.service-item.expanded {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 1000;
    width: 80% !important;
    max-width: 800px;
    height: auto !important;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    border: none;
    cursor: default;
    /* Expanded card should read like a modal panel: slightly translucent, no border */
    background: rgba(240, 250, 240, 0.62);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    overflow-x: hidden;
    margin: 0 !important;
}

/* Expanded cards: remove hover-glow layers that resemble borders */
.service-item.expanded::before,
.service-item.expanded::after {
    opacity: 0 !important;
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    font-size: 20px;
    line-height: 1;
    pointer-events: none;
}

.close-btn:hover {
    background: var(--accent-alert);
    color: white;
}

.service-item.expanded .close-btn {
    opacity: 1;
    pointer-events: all;
}

.service-item.expanded .service-short-desc {
    display: none;
}

.service-item.expanded .service-full-content {
    display: block !important;
    color: var(--text-primary); /* Dark text for light bg */
    line-height: 1.6;
}

.service-item.expanded h3 {
    font-size: 0.9rem; /* Reduced from 1.3rem */
}

.service-item.expanded strong, 
.service-item.expanded b {
    font-weight: 900;
    color: var(--text-primary);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

/* Services: first special offer card spans full width */
.services .grid--2 .service-item--special {
    grid-column: 1 / -1;
    cursor: pointer;
}

/* AI Glow Element */
.ai-glow {
    animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
}

/* Footer */
footer {
    border-top: 1px solid rgba(0, 243, 255, 0.1);
    color: var(--text-dim);
    font-family: var(--font-headers);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --nav-lift: 18px;
    }

    body {
        font-size: 16px;
    }

    body.mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .header {
        padding: 1rem 0;
        background: rgba(5,5,5,0.95);
        position: fixed;
        z-index: 1200;
    }

    .header__logo {
        font-size: 1.4rem;
    }

    .header__nav {
        display: flex;
        gap: 0.5rem;
        position: relative;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header__nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        width: min(360px, 92vw);
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
        background: rgba(5, 20, 5, 0.98);
        border: 1px solid rgba(0, 243, 255, 0.18);
        border-radius: 14px;
        z-index: 1201;
        max-height: calc(100vh - 84px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body.mobile-menu-open .header__nav-links {
        display: flex;
    }

    /* Fallback: show menu even if body class isn't applied for some reason */
    .header__nav-links.is-open {
        display: flex;
    }

    .header__nav-links a::after {
        display: none;
    }

    .header__nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.85rem 0.75rem;
        border: 1px solid rgba(0, 243, 255, 0.12);
        background: rgba(0, 243, 255, 0.03);
        border-radius: 12px;
    }

    .header__nav-links a.header__cta {
        justify-content: center;
        margin-left: 0;
    }

    .header__nav-links a.header__cta.header__cta--plain {
        border: none;
        background: transparent;
    }

    .header__nav-links .nav-item-dropdown {
        width: 100%;
    }

    /* Expander toggle should match other mobile menu items (it's a button) */
    .header__nav-links .nav-item-dropdown--expander .nav-link-dropdown-toggle {
        width: 100%;
        text-align: center;
        padding: 0.85rem 0.75rem;
        border: 1px solid rgba(0, 243, 255, 0.12);
        background: rgba(0, 243, 255, 0.03);
        border-radius: 12px;
    }

    .header__nav-links .nav-dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        margin-top: 0.5rem;
        width: 100%;
        background: transparent;
        border: none;
        padding: 0;
    }

    .header__nav-links #siteAppExpanderMenu::before {
        display: none;
    }

    /* The revealed line must be plain: no frame, no different background */
    .header__nav-links .nav-dropdown-menu--app a,
    .header__nav-links #siteAppExpanderMenu a {
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .header__nav-links .nav-item-dropdown:hover .nav-dropdown-menu,
    .header__nav-links .nav-item-dropdown.is-open .nav-dropdown-menu {
        display: flex;
    }

    /* App expander submenu is now a sibling of the toggle */
    .header__nav-links #siteAppExpander.is-open ~ #siteAppExpanderMenu {
        display: flex;
    }

    .lang-switch {
        margin-left: 0.5rem;
        gap: 0.5rem;
    }
    
    .header__cta {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .hero h1 { 
        font-size: 2.0rem; 
        line-height: 1.2;
    }
    
    .hero__lead { 
        font-size: 1.1rem;
        border-left: none; 
        padding-left: 0; 
        text-align: center; 
        background: none; 
        margin-bottom: 2rem;
    }

    .hero__actions {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .hero__actions > * {
        min-width: 0;
    }

    .btn {
        width: 100%;
        margin-left: 0;
        padding: 0.8rem 1rem;
    }

    .hero__image {
        width: 100%;
        height: auto;
    }

    .hero__subtitle {
        padding: 1rem;
        font-size: 1.05rem;
    }

    .grid--2, .grid--3 { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }
    
    .card, .service-item {
        padding: 1.5rem;
    }
    
    h2 {
        font-size: 1.6rem;
        text-align: center;
        display: block;
        border-bottom: none;
    }
    
    h2::after {
        content: '';
        display: block;
        width: 50px;
        height: 2px;
        background: var(--accent-primary);
        margin: 0.5rem auto 0;
    }
}

/* Content tables: make mobile-friendly cards (applied via JS by adding .rt-stack) */
@media (max-width: 768px) {
    .detail-body table,
    .detail-content table,
    .service-full-content table,
    .modal-body table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.rt-stack,
    table.rt-stack tbody,
    table.rt-stack tr,
    table.rt-stack td,
    table.rt-stack th {
        display: block;
        width: 100%;
    }

    table.rt-stack thead {
        display: none;
    }

    table.rt-stack {
        border-collapse: separate;
        border-spacing: 0;
    }

    table.rt-stack tr {
        margin: 0 0 0.9rem 0;
        padding: 0.85rem;
        border-radius: 14px;
        background: rgba(240, 250, 240, 0.65);
        border: 1px solid rgba(0, 109, 128, 0.2);
        box-shadow: var(--glow-box);
    }

    table.rt-stack td {
        display: flex;
        gap: 0.75rem;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.35rem 0;
        border-bottom: 1px dashed rgba(0, 109, 128, 0.18);
        color: var(--text-primary);
    }

    table.rt-stack td:last-child {
        border-bottom: 0;
    }

    table.rt-stack td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 46%;
        font-weight: 900;
        color: var(--accent-primary);
        text-align: left;
    }
}

/* On touch devices there is no hover, so keep hero gallery arrows visible */
@media (hover: none), (pointer: coarse) {
    .hero-gallery-nav {
        opacity: 1;
        width: 44px;
        height: 44px;
    }
}

/* Language Switcher */
.lang-switch {
    display: none; /* Hidden by default, toggled via JS */
    position: absolute;
    top: calc(100% + 36px);
    right: 0;
    background: rgba(2, 12, 27, 0.3);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(0, 243, 255, 0.1);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
    /* Keep above mobile dropdown panel */
    z-index: 1105;
    min-width: 60px;
    border-radius: 8px;
}

/* Landing header: language chooser lives inside the main nav row */
.lang-switch-container {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    position: relative;
}

.lang-switch.active {
    display: flex;
}

/* Language switcher: раскрытие внутри области хедера (горизонтальный список языков) */
.lang-switch-container.lang-switch-container--inheader {
    margin-left: 0.25rem;
    position: relative;
    width: 112px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lang-switch-container.lang-switch-container--inheader .lang-toggle {
    position: absolute;
    inset: 0;
    z-index: 1;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
}

.lang-switch-container.lang-switch-container--inheader .lang-toggle:hover {
    transform: none;
}

.lang-toggle__text {
    font-family: var(--font-headers);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.25s ease, font-size 0.25s ease, opacity 0.25s ease;
}

.lang-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.lang-switch-container.lang-switch-container--inheader .lang-toggle.active .lang-toggle__text {
    font-size: 0.62rem;
    transform: translateY(-12px);
    opacity: 0.85;
}

.lang-switch-container.lang-switch-container--inheader .lang-toggle.active .lang-toggle__icon {
    transform: translateY(-12px) scale(0.92);
    opacity: 0.85;
}

.lang-switch-container.lang-switch-container--inheader #lang-switch-menu {
    top: 0;
    right: auto;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    gap: 0.4rem;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    z-index: 2;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}

.lang-switch-container.lang-switch-container--inheader #lang-switch-menu a {
    width: auto;
    padding: 0.25rem 0.45rem;
    font-size: 0.78rem;
    line-height: 1;
}

/* App switcher: раскрытие внутри области хедера */
.app-switch-container {
    margin-left: 0.25rem;
    position: relative;
    width: 190px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-toggle {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.app-toggle__text {
    font-family: var(--font-headers);
    font-size: 0.8rem;
    letter-spacing: normal;
    text-transform: none;
    transition: transform 0.25s ease, font-size 0.25s ease, opacity 0.25s ease;
}

.app-toggle.active .app-toggle__text {
    font-size: 0.62rem;
    transform: translateY(-12px);
    opacity: 0.85;
}

.lang-switch.app-switch {
    top: 0;
    right: auto;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    gap: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    z-index: 2;
    align-items: center;
    justify-content: center;
}

.lang-switch.app-switch a {
    width: auto;
    padding: 0 0.5rem;
    text-align: center;
    font-size: 0.74rem;
    line-height: 1.15;
    white-space: normal;
    max-width: 190px;
}

.lang-switch a {
    display: block;
    padding: 0.5rem;
    text-align: center;
    width: 100%;
    color: #e0f7fa; /* Light text for dark dropdown */
    text-decoration: none;
    font-family: var(--font-headers);
    font-size: 0.9rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--accent-primary);
    text-shadow: var(--glow-text);
}


/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 65000 !important;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Services backdrop (dim + blur) shown BEHIND service modals/cards */
.services-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 997;
    opacity: 0;
    transition: opacity 220ms ease;

    /* Always provide visible dimming (works everywhere) */
    background: rgba(0, 0, 0, 0.22);

    /* Blur only where supported */
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
}

.services-backdrop.is-active {
    opacity: 1;
}

/* AI neural web overlay (shown behind Services modals; background stays unchanged) */
.ai-neural-web-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* Default: Services card expansion (behind the expanded card) */
    z-index: 998;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 0;
    transition: opacity 220ms ease;
}

/* Services modals live at z-index: 65000; keep the web behind the modal */
.ai-neural-web-layer.ai-neural-web-layer--modals {
    z-index: 64990;
    /* In modal mode, blur/dim is provided by .services-backdrop. */
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.ai-neural-web-layer.is-active {
    opacity: 1;
}

.ai-neural-web-layer canvas {
    width: 100%;
    height: 100%;
    display: block;
    /* Makes lines look more like “light” on top of the scene */
    mix-blend-mode: screen;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-panel);
    border: none;
    width: 90%;
    max-width: 1100px;
    height: 80vh;
    position: relative;
    padding: 2rem;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Prevent horizontal scrolling inside modals (keep intentional inner scrollers like galleries). */
.modal-body,
.detail-container {
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Cybersecurity view modal (site): match hero subtitle panel */
#cybersecurity-view-modal.modal-overlay {
    /* Lighter overlay so background doesn't feel "dark" */
    background: rgba(0, 0, 0, 0.25);
}

#cybersecurity-view-modal .modal-content {
    /* Muted, semi-transparent panel ("мутный"), not a solid dark card */
    background: rgba(240, 250, 240, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 243, 255, 0.12);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 10px 5px rgba(5, 20, 5, 0.12),
        0 0 50px rgba(0, 243, 255, 0.1);
}

/* Cybersecurity view: admin-provided HTML may include its own “white card” blocks.
   Neutralize them inside this modal only to avoid white backgrounds in RU content. */
#cybersecurity-view-modal .cyber-doc-container,
#cybersecurity-view-modal .cyber-doc-container * {
    background-color: transparent !important;
}

#cybersecurity-view-modal .cd-card,
#cybersecurity-view-modal .cd-note,
#cybersecurity-view-modal .card,
#cybersecurity-view-modal .panel,
#cybersecurity-view-modal .content-card,
#cybersecurity-view-modal .content-panel {
    background: transparent !important;
    box-shadow: none !important;
}

/* Catch common inline white backgrounds (style="background: #fff" etc.) */
#cybersecurity-view-modal .modal-body [style*="background:#fff"],
#cybersecurity-view-modal .modal-body [style*="background: #fff"],
#cybersecurity-view-modal .modal-body [style*="background-color:#fff"],
#cybersecurity-view-modal .modal-body [style*="background-color: #fff"],
#cybersecurity-view-modal .modal-body [style*="background:white"],
#cybersecurity-view-modal .modal-body [style*="background: white"],
#cybersecurity-view-modal .modal-body [style*="background-color:white"],
#cybersecurity-view-modal .modal-body [style*="background-color: white"] {
    background: transparent !important;
    background-color: transparent !important;
}

/* Tables sometimes carry white cell backgrounds in WYSIWYG content */
#cybersecurity-view-modal .modal-body table,
#cybersecurity-view-modal .modal-body thead,
#cybersecurity-view-modal .modal-body tbody,
#cybersecurity-view-modal .modal-body tr,
#cybersecurity-view-modal .modal-body th,
#cybersecurity-view-modal .modal-body td {
    background: transparent !important;
    background-color: transparent !important;
}

/* Passport modal: keep default overlay; make panel slightly translucent */
#passport-modal .modal-content {
    background: rgba(240, 250, 240, 0.68);
    position: relative;
    z-index: 2;
}

/* Expertise modal: rounded + translucent; overlay without darkening */
#expertise-modal.modal-overlay {
    background: rgba(0, 0, 0, 0.06);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

#expertise-modal .modal-content {
    background: rgba(240, 250, 240, 0.62);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(0, 243, 255, 0.14);
    border-radius: 18px;
    overflow: hidden;
}

/* Commercial proposal modal: slightly dark + blurred backdrop, translucent panel */
#commercial-proposal-modal.modal-overlay {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

#commercial-proposal-full-modal.modal-overlay {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Passport modal is part of Services; keep background unchanged too */
#passport-modal.modal-overlay {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

#commercial-proposal-modal .modal-content {
    background: rgba(240, 250, 240, 0.68);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

#commercial-proposal-full-modal .modal-content {
    /* Special offer: avoid a solid white panel, but keep readable default text */
    background: rgba(240, 250, 240, 0.68);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Services modals: phantom trail on open (replaces perceived "jitter" with a smooth ghost) */
#commercial-proposal-modal .modal-content,
#commercial-proposal-full-modal .modal-content {
    transform-origin: 50% 50%;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

#commercial-proposal-modal .modal-header,
#commercial-proposal-modal .modal-body,
#commercial-proposal-full-modal .modal-header,
#commercial-proposal-full-modal .modal-body {
    position: relative;
    z-index: 1;
}

#commercial-proposal-modal .modal-content::before,
#commercial-proposal-modal .modal-content::after,
#commercial-proposal-full-modal .modal-content::before,
#commercial-proposal-full-modal .modal-content::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: rgba(240, 250, 240, 0.16);
    border: none;
    box-shadow:
        0 18px 70px rgba(0, 0, 0, 0.22),
        0 0 90px rgba(0, 243, 255, 0.18),
        0 0 26px rgba(255, 255, 255, 0.08);
    mix-blend-mode: screen;
}

@keyframes services-modal-phantom {
    0% {
        opacity: 0.66;
        transform: translate3d(-54px, 38px, 0) scale(0.970);
        filter: blur(0.5px);
    }
    35% {
        opacity: 0.34;
        transform: translate3d(-22px, 16px, 0) scale(0.988);
        filter: blur(2.4px);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(12px);
    }
}

@keyframes services-modal-phantom-2 {
    0% {
        opacity: 0.44;
        transform: translate3d(46px, -34px, 0) scale(0.980);
        filter: blur(0.5px);
    }
    45% {
        opacity: 0.26;
        transform: translate3d(18px, -13px, 0) scale(0.994);
        filter: blur(2.4px);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(13px);
    }
}

#commercial-proposal-modal.active .modal-content::before,
#commercial-proposal-full-modal.active .modal-content::before {
    animation: services-modal-phantom 3.6s ease-out both;
}

#commercial-proposal-modal.active .modal-content::after,
#commercial-proposal-full-modal.active .modal-content::after {
    animation: services-modal-phantom-2 3.9s ease-out both;
    animation-delay: 0.14s;
}

/* Special offer: admin-provided HTML may include its own “white card” blocks.
   Force them transparent inside this modal only. */
#commercial-proposal-full-modal .cyber-doc-container,
#commercial-proposal-full-modal .cyber-doc-container * {
    background-color: transparent !important;
}

#commercial-proposal-full-modal .cd-card,
#commercial-proposal-full-modal .cd-note {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.modal-close:hover {
    text-shadow: 0 0 10px var(--accent-primary);
}

.modal-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--accent-primary);
    font-family: var(--font-headers);
    font-size: 1.5rem; /* Reduced from default h2 size */
}

.gallery-container {
    flex: 1;
    overflow-x: scroll;
    overflow-y: hidden;
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-container.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.detail-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.detail-container.active {
    opacity: 1 !important;
    transform: scale(1);
}

/* Force left alignment for headers in modals and detail views */
.modal-content h1, .modal-content h2, .modal-content h3, .modal-content h4, .modal-content h5, .modal-content h6,
.detail-container h1, .detail-container h2, .detail-container h3, .detail-container h4, .detail-container h5, .detail-container h6,
.service-item.expanded h1, .service-item.expanded h2, .service-item.expanded h3, .service-item.expanded h4, .service-item.expanded h5, .service-item.expanded h6,
.detail-page h1, .detail-page h2, .detail-page h3, .detail-page h4, .detail-page h5, .detail-page h6 {
    text-align: left !important;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    font-family: var(--font-headers);
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
}

.gallery-container::-webkit-scrollbar {
    height: 8px;
}

.gallery-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.gallery-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 4px;
}

/* Custom (always visible) scrollbar for Expertise gallery inside modal */
.gallery-scrollbar {
    display: none;
    margin-top: 0.75rem;
}

/* Hide native scrollbar in the Expertise modal gallery (keep scroll functional) */
#expertise-modal .gallery-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

#expertise-modal .gallery-container::-webkit-scrollbar {
    height: 0;
}

.gallery-scrollbar__track {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(0, 243, 255, 0.14);
    cursor: pointer;
}

.gallery-scrollbar__thumb {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    width: 80px;
    transform: translateY(-50%);
    border-radius: 9999px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.12);
    cursor: grab;
}

.gallery-scrollbar__thumb:active {
    cursor: grabbing;
}

.gallery-card {
    min-width: 350px;
    max-width: 350px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 243, 255, 0.1);
    padding: 1.5rem;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 100%;
}

.gallery-card::-webkit-scrollbar {
    width: 4px;
}

.gallery-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.gallery-card::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 2px;
}

.gallery-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.gallery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.gallery-card h3 {
    color: var(--text-primary);
    margin-top: 0;
    font-size: 1.2rem;
}

.gallery-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}


/* Mobile Only / Desktop Only Utilities */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .mobile-only { display: block; }
    .desktop-only { display: none !important; }
}

/* =========================
   Mobile Styles (<= 768px)
   Keep desktop untouched.
   ========================= */

/* Home: layout overrides (including sections with inline padding) */
@media (max-width: 768px) {
    .expertise,
    .process,
    .contact {
        padding: 4rem 0 !important;
    }
}

/* Contact: Google Maps (2 blocks under disclaimer) */
.contact__maps {
    margin-top: 2rem;
}

.contact__map-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.contact__map-card {
    background: rgba(240, 250, 240, 0.65);
    border: 1px solid rgba(0, 109, 128, 0.2);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--glow-box);
    text-align: left;
}

.contact__map-title {
    margin: 0 0 0.75rem 0;
}

.contact__map-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(0, 109, 128, 0.2);
}

.contact__map-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    .contact__map-grid {
        grid-template-columns: 1fr;
    }
}

/* Modals: tighter layout on mobile */
@media (max-width: 768px) {
    .modal-content {
        width: calc(100% - 24px);
        height: 85vh;
        padding: 1rem;
    }

    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.75rem;
    }

    .gallery-container {
        gap: 1rem;
    }

    .gallery-card {
        min-width: 78vw;
        max-width: 78vw;
        padding: 1rem;
    }

    .gallery-card img {
        height: 160px;
    }

    .detail-container {
        padding: 0.75rem;
    }

    .service-item.expanded {
        width: calc(100% - 24px) !important;
        max-height: 85vh;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

/* Tabs: wrap and reduce on mobile */
@media (max-width: 768px) {
    .media-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .media-tab-btn {
        flex: 1 1 auto;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile Expertise Section (mobile-only module) */
@media (max-width: 768px) {
    .mobile-expertise-section {
        padding: 3rem 0;
        background: rgba(5, 5, 5, 0.8);
        border-top: 1px solid rgba(0, 243, 255, 0.1);
    }

    .mobile-expertise-menu {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.25rem;
    }

    .mobile-expertise-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-decoration: none;
        padding: 1rem 1rem;
        border-radius: 14px;
        background: rgba(0, 243, 255, 0.03);
        border: 1px solid rgba(0, 243, 255, 0.16);
        color: var(--text-secondary);
        font-family: var(--font-headers);
        line-height: 1.2;
        transition: all 0.2s ease;
    }

    .mobile-expertise-item__title {
        font-size: 1rem;
        color: #e0f7fa;
    }

    .mobile-expertise-item:active {
        transform: translateY(1px);
    }

    .mobile-expertise-item:hover {
        border-color: rgba(0, 243, 255, 0.35);
        box-shadow: 0 0 14px rgba(0, 243, 255, 0.12);
        color: #fff;
    }
}

/* Language Switcher Mobile Styles */
.lang-switch-container {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-toggle {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    color: #fff;
    filter: drop-shadow(0 0 5px var(--accent-primary));
}

/* Avoid hover transform overriding the “lift” open state */
.lang-switch-container:not(.is-open) .lang-toggle:hover {
    transform: scale(1.1);
}

.globe-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* Removed .lang-toggle .arrow styles as arrow is removed */

@media (max-width: 768px) {
    .lang-switch {
        left: auto; 
        right: 0;
        margin-left: 0;
    }

    /* Header Mobile Layout Overrides (hamburger handles nav links) */
    .header__nav {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .nav-link-training {
        order: 4;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        padding: 0.8rem;
        border: 1px solid rgba(0, 243, 255, 0.1);
        background: rgba(255, 255, 255, 0.02);
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(2, 12, 27, 0.95);
    border-top: 1px solid var(--accent-primary);
    padding: 1.5rem;
    z-index: 10000;
    display: none; /* Hidden by default, shown by JS */
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 212, 255, 0.1);
}

.cookie-banner__content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-banner__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cookie-banner__text a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.cookie-banner__text a:hover {
    border-color: var(--accent-primary);
}

.cookie-banner__actions {
    display: flex;
    gap: 1rem;
}

/* Language Suggestion Toast */
.lang-toast {
    position: fixed;
    top: 100px; /* Below header */
    right: 20px;
    background: rgba(2, 12, 27, 0.95);
    border: 1px solid var(--accent-primary);
    padding: 0.4rem 0.7rem 0.4rem 0.7rem;
    border-radius: 7px;
    z-index: 9999;
    display: none; /* Hidden by default */
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.lang-toast__content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-family: var(--font-headers);
    font-size: 0.85rem;
    white-space: nowrap;
}

.lang-toast__content label {
        color: #fff;
    margin: 0 0.2em 0 0;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
}

.lang-toast__buttons {
    display: flex;
    gap: 0.5rem;
}

.lang-toast__buttons button {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-headers);
    font-weight: bold;
}

.lang-toast__buttons button:hover {
    background: var(--accent-primary);
    color: #000;
}

.lang-toast__close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 0.2rem;
    line-height: 1;
    padding: 0;
}

.lang-toast__close:hover {
    color: var(--accent-alert);
}

@media (max-width: 768px) {
    .lang-toast {
        top: auto;
        bottom: 80px; /* Above cookie banner */
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .lang-toast__content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .cookie-banner__content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-banner__actions {
        width: 100%;
        justify-content: center;
    }
}

/* Gallery Section */
.gallery-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(0, 0, 0, 0.3);
}

.gallery-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.gallery-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 4px;
}

.gallery-track {
    display: flex;
    gap: 2rem;
    width: max-content; /* Ensure track is wide enough */
}

.gallery-item {
    position: relative;
    min-width: 300px;
    max-width: 500px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 243, 255, 0.2);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    border-color: var(--accent-primary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    font-family: var(--font-headers);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Scroll Scale Effect */
.scroll-effect {
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.95);
    opacity: 0.6;
}

.scroll-effect.active {
    transform: scale(1);
    opacity: 1;
}

/* Home: Why Us description (LandingContent.why_us_description) */
.why__title {
    color: var(--hero-heading-text);
    border-bottom-color: rgba(246, 244, 221, 0.35);
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Don't wash out the Why Us title while scrolling */
.why__title.scroll-effect {
    opacity: 1;
    transform: none;
}

.why__description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--hero-heading-text);
    font-family: var(--font-headers);
    font-weight: 700;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Don't wash out this key text while scrolling */
.why__description.scroll-effect {
    opacity: 1;
    transform: none;
}


/* Nav Dropdown */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

/* Landing header: App expander (click-to-open) */
.nav-item-dropdown--expander {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-item-dropdown--expander .nav-link-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.nav-expander-toggle {
    appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-expander-toggle__top {
    display: inline-block;
}

.nav-expander-toggle__caret {
    display: inline-block;
    transform: translateY(1px);
    opacity: 0.9;
}

/* Default (desktop layout only): keep landing header nav on one row */
@media (min-width: 769px) {
    .header__nav-links {
        flex-wrap: nowrap;
        align-items: center;
        position: relative;
        overflow: visible;
    }
}

/* App: lift the label and show the replacement link in its place (ALL breakpoints) */
#siteAppExpander {
    position: relative;
}

/* For the App expander we want click-to-open (not hover-to-open) */
#siteAppExpander:hover #siteAppExpanderMenu {
    display: none;
}

#siteAppExpander.is-open .nav-expander-toggle {
    position: relative;
    z-index: 3;
    transform: translate3d(0, calc(-1 * var(--nav-lift)), 0);
    filter: drop-shadow(0 0 6px rgba(0, 243, 255, 0.35));
}

#siteAppExpander.is-open .nav-expander-toggle:hover {
    transform: translate3d(0, calc(-1 * var(--nav-lift)), 0) scale(1.03);
}

.header__nav-links #siteAppExpanderMenu {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    z-index: 1;
}

.header__nav-links #siteAppExpander.is-open #siteAppExpanderMenu {
    display: flex;
    align-items: center;
    justify-content: center;
}

#siteAppExpanderMenu::before {
    display: none;
}

#siteAppExpanderMenu a {
    padding: 0.15rem 0.25rem;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    white-space: normal;
}

#siteAppExpanderMenu a:hover {
    background: transparent;
    color: var(--accent-primary);
    text-shadow: 0 0 6px rgba(0, 243, 255, 0.35);
}

/* Lang: lift the globe and show plain language links in its place (ALL breakpoints) */
.lang-switch-container.is-open .lang-toggle {
    position: relative;
    z-index: 3;
    transform: translate3d(0, calc(-1 * var(--nav-lift)), 0);
    filter: drop-shadow(0 0 6px rgba(0, 243, 255, 0.35));
}

.lang-switch-container.is-open .lang-toggle:hover {
    transform: translate3d(0, calc(-1 * var(--nav-lift)), 0) scale(1.03);
}

.header__nav-links .lang-switch {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 0;
    min-width: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
}

.header__nav-links .lang-switch.active {
    display: flex;
}

.header__nav-links .lang-switch a {
    padding: 0;
    width: auto;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Ensure it's hidden by default */
.nav-dropdown-menu {
    display: none;
}

/* Bridge the gap between button and menu */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 0;
    width: 100%;
    height: 1rem;
    background: transparent;
}

.nav-item-dropdown:hover .nav-dropdown-menu {
    display: block;
}

/* Click-open support (used by landing header expander + mobile) */
.nav-item-dropdown.is-open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: #e0f7fa; /* Light text for dark dropdown */
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.3s;
    text-align: center;
}

.nav-dropdown-menu a:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
}

.nav-dropdown-menu a::after {
    display: none; /* Remove the underline effect from main nav links */
}


/* Fade Out Dissolve Effect for Modal Close */
@keyframes fade-out-dissolve {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        filter: blur(0px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.05);
        filter: blur(10px);
    }
}

.service-item.fade-out-card {
    animation: fade-out-dissolve 0.8s ease-out forwards;
    pointer-events: none; /* Prevent clicks during animation */
}

/* Detail View Styles in Modal */
#detail-content-placeholder {
    /* По умолчанию — светлый текст для тёмной модалки,
       но не ломаем стили HTML-контента карточек. */
    color: var(--text-primary);
}

#detail-content-placeholder .detail-body {
    color: inherit;
}

#detail-content-placeholder .detail-body strong,
#detail-content-placeholder .detail-body b {
    font-weight: 900 !important;
}

#detail-content-placeholder .detail-body,
#detail-content-placeholder .detail-body p,
#detail-content-placeholder .detail-body div,
#detail-content-placeholder .detail-body li {
    text-align: justify !important;
}

/* Detail Page (Separate Window) Styles */
.detail-content,
.detail-content p,
.detail-content div,
.detail-content li,
.detail-content ul,
.detail-content ol {
    text-align: justify !important;
}

.back-link.close-style {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.back-link.close-style:hover {
    background: var(--accent-primary);
    color: #000;
    transform: rotate(90deg);
}

.back-link.close-style svg {
    width: 24px;
    height: 24px;
}

/* =========================
   Mobile UX polish
   ========================= */

/* Disable hover-only animations on touch devices (mobile browsers often emulate hover) */
@media (hover: none), (pointer: coarse) {
    .card:hover,
    .service-item:hover {
        transform: none;
    }

    .service-item:not(.expanded):hover,
    .service-item--special:not(.expanded):hover {
        animation: none;
        transform: none;
    }

    .back-link.close-style:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    /* Slightly tighter side padding on very small screens */
    .container {
        width: min(var(--container-width), 100% - 1.25rem);
    }

    /* Tap targets: aim for >= 44px */
    .btn,
    .header__nav-links a,
    .header__nav-links .nav-item-dropdown--expander .nav-link-dropdown-toggle,
    .lang-toggle,
    .mobile-menu-toggle,
    .modal-close {
        min-height: 44px;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
    }

    /* Hero gallery: ensure good height on mobile and avoid tiny media */
    .hero__right {
        border-radius: 12px;
    }

    .hero-gallery-wrapper {
        aspect-ratio: 16 / 9;
        align-items: stretch;
    }

    .hero-gallery-container,
    .hero-gallery-item {
        height: 100%;
        align-items: stretch;
    }

    .hero__image,
    .hero-gallery-item video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }

    .hero-gallery-nav.prev { left: 8px; }
    .hero-gallery-nav.next { right: 8px; }

    .hero__subtitle {
        border-radius: 12px;
    }

    /* Modals: full-screen on mobile (override inline styles too) */
    .modal-overlay.active {
        padding: calc(env(safe-area-inset-top, 0px) + 12px)
                 12px
                 calc(env(safe-area-inset-bottom, 0px) + 12px)
                 12px;
        align-items: stretch;
    }

    .modal-content {
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 1rem !important;
        border-radius: 16px !important;
        transform: none !important;
    }

    .modal-overlay.active .modal-content {
        transform: none !important;
    }

    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

