@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TT Nooks Script';
    src: url('../fonts/TTNooksScript-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: var(--lh-heading);
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: var(--ls-tight);
}

h1 {
    font-size: var(--h1-size);
}

h2 {
    font-size: var(--h2-size);
}

h3 {
    font-size: var(--h3-size);
    margin-bottom: var(--space-sm);
}

/* Масштабирование заголовков управляется через clamp() в tokens.css */

p {
    line-height: var(--lh-body);
    margin-bottom: var(--space-md);
}


a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-wide {
    max-width: var(--container-wide-max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* UI Plates & Cards (Unified System) */
.ui-plate--glass {
    background: rgba(var(--color-white-rgb), 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--color-white-rgb), 0.2);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.ui-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.ui-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
    transform: translateY(-4px);
}

.ui-label {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
}

.ui-label--success {
    background-color: var(--color-success);
    color: white;
}

.ui-label--error {
    background-color: var(--color-error);
    color: white;
}

.ui-label--warning {
    background-color: var(--color-warning);
    color: white;
}

.ui-label--info {
    background-color: var(--color-info);
    color: white;
}

/* Grid System Utility Classes */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap);
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

.ui-card--horizontal {
    display: flex;
    align-items: center;
    gap: var(--space-3xl);
    text-align: left;
}

.ui-card--gradient {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05) 0%, rgba(var(--color-secondary-rgb), 0.05) 100%);
}

.ui-card--accent-left {
    border-left: 4px solid var(--color-primary);
}

@media (max-width: 768px) {
    .ui-card--horizontal {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xl);
    }
}

/* Spacing Utilities */
.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mt-2xl {
    margin-top: var(--space-2xl);
}

.mt-3xl {
    margin-top: var(--space-3xl);
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mb-3xl {
    margin-bottom: var(--space-3xl);
}

/* Typography Utilities */
.lead {
    font-size: var(--font-size-lg);
    line-height: var(--lh-body);
}

.font-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.color-secondary {
    color: var(--color-secondary);
}

.text-link {
    color: var(--color-primary);
    transition: all var(--transition-fast);
}

.underline-accent {
    border-bottom: 2px solid rgba(var(--color-primary-rgb), 0.3);
}

.underline-accent:hover {
    border-bottom-color: var(--color-primary);
}

/* Navbar */
/* Update top-ornament container */
.top-ornament {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    z-index: 1001;
    transition: all var(--transition-spring);
    pointer-events: none;
    /* Белый фон под SVG-маской — закрывает контент за прозрачными участками паттерна */
    background-color: var(--color-bg);
}

.top-ornament.is-scrolled {
    height: 16px;
    top: 0;
    /* Sticky to top */
    z-index: 999;
    /* Behind navbar */
    background-color: var(--color-white);
    border-bottom: 2px solid rgba(var(--color-primary-rgb), 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Soft shadow for the floating bar */
}

/* Lines base */
.ornament-line {
    position: absolute;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light), var(--color-primary), var(--color-primary-dark));
    -webkit-mask-image: url('../img/ornament_bw.svg');
    mask-image: url('../img/ornament_bw.svg');
    -webkit-mask-repeat: repeat;
    mask-repeat: repeat;
    transition: all var(--transition-spring);
}

/* Scrolled state opacity and animation */
.top-ornament.is-scrolled .ornament-line {
    opacity: 0.8;
    animation: top-ornament-belt 90s linear infinite;
}

/* -- TOP LINE -- */
.ornament-line--top {
    top: 0;
    left: -480px;
    /* Offset left so it can slide right without revealing edge */
    width: calc(100% + 480px);
    height: 32px;
    /* Extend width to allow for physical translation */
    -webkit-mask-size: auto 32px;
    mask-size: auto 32px;
    opacity: 1;
    /* Always visible initially */
    will-change: transform;
}

.top-ornament.is-scrolled .ornament-line--top {
    height: 16px;
    -webkit-mask-size: auto 16px;
    mask-size: auto 16px;
}

.top-ornament-spacer {
    height: calc(32px + var(--space-md));
    width: 100%;
}

.navbar {
    position: sticky;
    top: var(--space-md);
    width: calc(100% - 2 * var(--space-md));
    margin: 0 auto var(--space-xl);
    background: rgba(var(--color-white-rgb), 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.navbar__container {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1300px;
    /* Increased to prevent wrapping */
}

.navbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-family: var(--font-heading);
    color: var(--color-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.navbar__logo-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 52px;
}

.navbar__logo-icon {
    height: 100%;
    width: auto;
    transition: transform var(--transition-fast);
}

.navbar__logo:hover .navbar__logo-icon {
    transform: rotate(8deg) scale(1.05);
}

.navbar__logo-wordmark {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.navbar__logo-main {
    height: 20px;
    width: auto;
    /* Compensate for SVG internal top padding so baseline matches script font */
    margin-bottom: -2px;
}

.navbar__logo-intercom {
    font-family: var(--font-script);
    font-size: 1.65rem;
    color: var(--color-primary);
    line-height: 1;
    white-space: nowrap;
    padding-left: 2px;
    padding-top: 7px;
    transform: scaleY(1.1);
    transform-origin: center bottom;
}

/* Menu & Links */
.navbar__menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.navbar__links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
    margin-left: 1.5rem;
}

.navbar__links a {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.navbar__links a:hover,
.navbar__links a.active {
    color: var(--color-primary);
}

.navbar__links a.active {
    box-shadow: 0 2px 0 0 var(--color-primary);
}

.navbar__divider {
    width: 1px;
    height: 20px;
    background-color: var(--color-border);
    margin: 0 var(--space-sm);
}

.navbar__link-external {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-dark-blue) !important;
    /* Increased contrast from grey */
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background: rgba(var(--color-primary-rgb), 0.03);
}

.navbar__link-external:hover {
    background-color: rgba(var(--color-primary-rgb), 0.08);
    transform: translateY(-1px);
}

.navbar__external-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Hamburger Toggle - Hidden on desktop */
.navbar__toggle,
.navbar__toggle-input {
    display: none;
}

@media (max-width: 1280px) and (min-width: 1025px) {
    .navbar__container {
        gap: 0.5rem;
    }

    .navbar__links {
        gap: 0.8rem;
    }
}

@media (max-width: 1024px) {
    .navbar {
        width: calc(100% - 20px);
        top: 16px;
    }

    .navbar__toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
    }

    .navbar__toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background: var(--color-primary);
        transition: var(--transition-base);
    }

    .navbar__menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        height: 0;
        overflow: hidden;
        transition: var(--transition-reveal);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--color-border);
    }

    .navbar__toggle-input:checked~.navbar__menu {
        height: auto;
        padding: var(--space-lg) 0;
    }

    .navbar__links {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        gap: 0;
    }

    .navbar__links li {
        width: 100%;
        text-align: center;
    }

    .navbar__links a {
        display: block;
        padding: var(--space-md);
        font-size: var(--font-size-md);
    }

    .navbar__divider {
        width: 80%;
        height: 1px;
        margin: var(--space-md) auto;
    }

    /* Animate Hamburger */
    .navbar__toggle-input:checked~.navbar__toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .navbar__toggle-input:checked~.navbar__toggle span:nth-child(2) {
        opacity: 0;
    }

    .navbar__toggle-input:checked~.navbar__toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

.hero {
    min-height: 85vh;
    /* Increased back to avoid vertical cropping of the image subject */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: var(--color-primary);
    padding: var(--space-xl) 0;
}


.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--color-bg) 0%, transparent 100%);
    z-index: 6;
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    gap: var(--space-lg);
    color: white;
}

.hero__badge {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: var(--ls-wide);
    color: rgba(var(--color-white-rgb), 0.7);
    border: 1px solid rgba(var(--color-white-rgb), 0.25);
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-lg);
    text-transform: uppercase;
}

.hero__title {
    font-size: clamp(2.25rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 4px 12px rgba(var(--color-black-rgb), 0.4);
    color: white;
    margin: 0;
}

.hero__slogan {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.02em;
    color: rgba(var(--color-white-rgb), 0.95);
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(var(--color-black-rgb), 0.3);
    margin: 0;
}

.hero__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

@media (max-width: 768px) {
    .hero__content {
        gap: var(--space-md);
        padding: var(--space-2xl) var(--space-lg);
    }

    .hero__actions {
        flex-direction: column;
        align-items: center;
    }
}

.hero__bg {
    position: absolute;
    inset: -30px;
    /* Increased expansion to safely hide blur edges for original-feel scaling */
    z-index: 1;
}

.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: brightness(0.85) blur(4px);
    /* Base blur everywhere */
}

.hero__bg::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    /* Extra blur on the left, fading to 0 extra blur on the right */
    mask-image: linear-gradient(to right, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0%, transparent 100%);
    z-index: 2;
}

.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(var(--color-overlay-dark-rgb), 0.35) 0%, rgba(var(--color-overlay-dark-rgb), 0.05) 100%);
    z-index: 3;
}

.hero__description {
    font-size: var(--font-size-lg);
    color: rgba(var(--color-white-rgb), 0.85);
    margin: 0;
    font-weight: 400;
    text-align: center;
    max-width: 680px;
    line-height: var(--lh-body);
    text-shadow: 0 1px 4px rgba(var(--color-black-rgb), 0.3);
}

.hero__subtitle {
    font-size: var(--font-size-md);
    color: rgba(var(--color-white-rgb), 0.8);
    margin-bottom: var(--space-2xl);
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-ui);
    border: 1px solid transparent;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--color-primary-rgb), 0.2), 0 2px 4px -1px rgba(var(--color-primary-rgb), 0.1);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.35);
}

.btn--secondary {
    background-color: transparent;
    border: 1px solid var(--color-secondary-dark);
    color: var(--color-secondary-dark);
}

.btn--secondary:hover {
    background-color: var(--color-secondary-dark);
    color: white;
}


.btn--outline-white {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn--outline-white:hover {
    background-color: white;
    color: var(--color-primary);
}

/* Shared Layouts */
.section-padding {
    padding: var(--space-section) 0;
}

.page-header {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: white;
    padding: calc(var(--space-section) + 64px) 0 var(--space-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header--about,
.page-header--services,
.page-header--innovations,
.page-header--contacts {
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background: var(--color-primary);
    padding: 0;
}

.page-header--about .page-header__bg img {
    object-position: center 40%;
    filter: brightness(0.65) blur(2px);
}

.page-header--services .page-header__bg img {
    object-position: center 45%;
    filter: brightness(0.75) contrast(1.1) blur(3px);
}

.page-header--contacts .page-header__bg img {
    object-position: center;
    filter: brightness(0.7) contrast(1.05);
}

.page-header--innovations .page-header__bg img {
    object-position: 65% 35%;
    filter: brightness(0.8);
}

/* Ensure plates are flush with the bottom-left corner of the viewport */
.page-header--about .container,
.page-header--services .container,
.page-header--innovations .container,
.page-header--contacts .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Standard page-header logic is now unified above. Removed specialized overrides. */


.page-header__content {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Aligned to left */
}

.page-header__left-label {
    background: rgba(var(--color-overlay-dark-rgb), 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem 2.5rem;
    border-radius: 0 2rem 0 0;
    border: 1px solid rgba(var(--color-white-rgb), 0.15);
    border-left: none;
    border-bottom: none;
    box-shadow: 10px -10px 40px rgba(var(--color-black-rgb), 0.4);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 400px;
    margin-left: 0;
    margin-bottom: 0;
    animation: slide-in-left 0.8s var(--ease-out-expo);
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-header__left-label .emoji {
    font-size: 2.25rem;
    margin-bottom: 0px;
}

.page-header__left-label .text {
    font-family: var(--font-heading);
    font-weight: 800;
    color: white;
    font-size: 2.25rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.page-header__left-label .subtext {
    color: rgba(var(--color-white-rgb), 0.7);
    font-size: var(--font-size-md);
    font-weight: 400;
}

.page-header--contacts h1 {
    display: none;
}


@media (max-width: 768px) {
    .page-header__content {
        justify-content: center;
        padding: var(--space-md);
    }

    .page-header__left-label {
        margin-left: 0;
        padding: var(--space-xl);
        text-align: center;
        align-items: center;
    }
}






.page-header__bg {
    position: absolute;
    inset: 0;
    /* Removed negative inset to reduce zoom effect */
    z-index: 1;
}


.page-header__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.page-header__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(var(--color-overlay-dark-rgb), 0.3) 0%,
            rgba(var(--color-overlay-dark-rgb), 0.6) 100%);
    z-index: 2;
}

.page-header--about .container {
    position: relative;
    z-index: 5;
}

.page-header h1 {
    color: white;
    font-size: var(--h1-size);
    margin-bottom: var(--space-sm);
    text-shadow: 0 4px 12px rgba(var(--color-black-rgb), 0.5);
}

.subtitle {
    font-size: var(--font-size-xl);
    opacity: 0.95;
    text-shadow: 0 2px 8px rgba(var(--color-black-rgb), 0.5);
}


/* Grids and Containers */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-3xl);
}



.main-text h2,
.main-text h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.main-text h2:first-child {
    margin-top: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* Detailed Services */
.services-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: var(--space-2xl);
    margin-top: var(--space-3xl);
}

.service-detail-item {
    display: flex;
    gap: var(--space-xl);
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.service-detail-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.service-detail-item.wide {
    grid-column: 1 / -1;
}

.service-icon-wrapper {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-detail-icon {
    width: 100%;
    height: auto;
}

.service-detail-content h3 {
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}


.service-detail-content ul {
    margin-top: var(--space-sm);
    padding-left: var(--space-lg);
}

.service-detail-content li {
    margin-bottom: var(--space-xs);
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-md);
}

.tool-item h4 {
    font-size: var(--font-size-md);
    margin-bottom: var(--space-xs);
}

/* Ornament backgrounds */
.ornament-bg {
    background-image: url('../img/ornament_kalmyk.svg');
    background-repeat: repeat-x;
    background-size: auto 40px;
    height: 40px;
    width: 100%;
}

.ornament-divider {
    height: 48px;
    margin-bottom: 0;
    opacity: 1;
    position: relative;
    overflow: hidden;
}

.ornament-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -240px;
    width: calc(100% + 240px);
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light), var(--color-primary), var(--color-primary-dark));
    -webkit-mask-image: url('../img/ornament_bw.svg');
    mask-image: url('../img/ornament_bw.svg');
    -webkit-mask-size: 240px 48px;
    mask-size: 240px 48px;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    animation: ornament-slide-right 20s linear infinite;
    will-change: transform;
}

@keyframes ornament-slide-right {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(240px);
    }
}

@keyframes top-ornament-belt {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(480px, 0, 0);
    }
}



.footer {
    background-color: #0A192F;
    /* Darker navy background for a premium look */
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.footer__container-top {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.footer__logo {
    margin-bottom: var(--space-lg);
}

.footer__description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer__bottom {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-3xl);
}


.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

/* Components */
.block-divider {
    margin: -32px 0;
    /* Align to the seam between sections */
    position: relative;
    overflow: visible;
    z-index: 20;
}

.block-divider__ornaments {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 0.75rem 0;
    width: 100%;
    background-color: #D3BEA3;
    /* Light Brown strip */
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.block-divider__dot {
    width: 6px;
    height: 6px;
    background-color: #0F4D75;
    /* Dark Blue dot */
    border-radius: 50%;
    opacity: 0.8;
    flex-shrink: 0;
}

.block-divider__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform var(--transition-spring);
}

.block-divider__icon:hover {
    transform: scale(1.3) rotate(360deg);
}

.block-divider__icon--1 {
    background-image: url('../img/uzor_1.svg');
}

.block-divider__icon--2 {
    background-image: url('../img/uzor_2.svg');
}

.block-divider__icon--3 {
    background-image: url('../img/uzor_3.svg');
}

.block-divider__icon--4 {
    background-image: url('../img/uzor_4.svg');
}

.block-divider__icon--5 {
    background-image: url('../img/uzor_5.svg');
}

.block-divider__icon--6 {
    background-image: url('../img/uzor_6.svg');
}



.card {
    background: var(--color-white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.card--sticky {
    position: sticky;
    top: calc(var(--space-xl) + 64px);
}

.legal-info-list {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
}

.legal-info-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-bg-alt);
    font-size: var(--font-size-sm);
}

.legal-info-list .label {
    font-weight: 600;
    color: var(--color-primary);
}


.legal-info-list .value {
    color: var(--color-text);
}

.service-card {
    background: var(--color-white);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    border-color: var(--color-primary);
}

.content-box {
    background: var(--color-white);
    padding: var(--space-3xl);
    border-radius: var(--radius-lg);
    border-top: 4px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.info-block {
    margin-bottom: var(--space-3xl);
}

.info-block h2 {
    margin-bottom: var(--space-md);
}

/* Why Us Section */
.why-us-section {
    background-color: var(--color-bg-alt);
}

.section-header {
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: var(--h2-size);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-black);
    /* Higher contrast than grey/muted */
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
    font-style: normal;
    /* Standardize away from default italics if any */
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
}

@media (max-width: 1280px) {
    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.why-us-card {
    background: var(--color-white);
    padding: var(--space-2xl) var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.why-us-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary);
}

.why-us-card__icon {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

.why-us-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.why-us-card h3 {
    font-size: var(--font-size-lg);
    margin: 0;
    color: var(--color-primary);
}

.why-us-card p {
    color: var(--color-black);
    opacity: 0.75;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin: 0;
}

/* Solutions Section - Advanced */
.solutions-section {
    background-color: white;
    padding: var(--space-section) 0;
}

.solutions-intro {
    margin-bottom: var(--space-3xl);
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    /* Increased gap for better breathing room */
    margin-top: var(--space-2xl);
}

@media (max-width: 1280px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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


/* Product Card Base */
.product-card {
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    min-height: 480px;
    /* Increased to accommodate content comfortably */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    border-color: var(--color-primary);
}

.product-card__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--color-bg-alt-purple-rgb), 0.4) 0%, rgba(var(--color-bg-alt-blue-rgb), 0.4) 100%);
    z-index: 0;
    opacity: 0.6;
    /* Base opacity for the gradient */
    overflow: hidden;
    transform: translateZ(0);
    /* Stabilize layering */
}

.product-card__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/vertical_ornament.svg');
    background-repeat: repeat;
    background-attachment: fixed;
    /* Restore the unified substrate effect */
    background-size: 8vw 45vh;
    /* Adjusted for higher density: ~2.4 units horizontally */
    opacity: 0.15;
    mix-blend-mode: multiply;
    z-index: 1;
    pointer-events: none;
    /* Stability fixes to stop 'jumping' on hover and mirroring the pattern */
    transform: scaleX(-1) translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Base style for all card grids to ensure no overflow issues with fixed backgrounds */
.solutions-grid {
    position: relative;
    z-index: 5;
}

.product-card__main {
    position: relative;
    z-index: 10;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    /* Allow main to fill available space */
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.product-card:hover .product-card__main {
    transform: translateY(-5px);
    opacity: 0.1;
    /* Fade out content slightly to focus on hover panel */
}

.product-card__icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--color-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    transition: transform var(--transition-base);
}

.product-card:hover .product-card__icon-wrap {
    transform: scale(1.1);
}

.product-card__icon-wrap img {
    width: 48px;
    height: 48px;
}

.product-card h3 {
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
    font-size: var(--font-size-xl);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-card__hook {
    font-size: var(--font-size-md);
    color: var(--color-secondary-dark);
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.product-card__desc {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    text-align: left;
}

.archetype-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border-radius: 20px;
    /* Specialized pill shape */
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.product-card .role-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
    text-align: left;
    width: 100%;
}

.product-card .role-list li {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.product-card .role-list li::before {
    content: '';
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background-image: url('../img/uzor_3.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.product-card .role-list li svg {
    display: none;
}

.product-card__cta {
    position: relative;
    z-index: 30;
    padding: var(--space-md) var(--space-xl) var(--space-md);
    width: 100%;
    margin-top: auto;
    /* Push to bottom */
    display: flex;
    flex-direction: row;
    /* Horizontal buttons */
    gap: var(--space-sm);
    background: transparent;
}

.product-card__cta .btn {
    flex: 1;
}

/* Configurator Footer */
.card-config-footer {
    background: rgba(var(--color-primary-rgb), 0.03);
    border-top: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
    font-size: 11px;
    text-align: left;
    z-index: 10;
}

.config-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 4px;
    opacity: 0.7;
}

.stack-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.stack-badge {
    background: white;
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.btn--small {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

.hover-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: rgba(var(--color-white-rgb), 0.96);
    backdrop-filter: blur(12px);
    z-index: 25;
    transition: all var(--transition-reveal);
    overflow: hidden;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.product-card:hover .hover-panel {
    height: calc(100% - 70px);
    /* Covers more content, leaves buttons visible */
    opacity: 1;
    padding: var(--space-xl);
    border-bottom: 2px solid var(--color-primary);
}

.hover-panel__content {
    opacity: 0;
    transition: opacity var(--transition-base);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--color-text);
}

.product-card:hover .hover-panel__content {
    opacity: 1;
}

.hover-panel h4 {
    font-size: var(--font-size-md);
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.hover-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hover-panel__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.hover-panel__list li::before {
    content: '';
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-image: url('../img/uzor_5.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.hover-panel ul {
    list-style: none;
    padding: 0;
}

.hover-panel li {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-xs);
}



/* Bottom gradient line */
.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 50;
}

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

    .product-card-long {
        grid-column: span 1;
    }

    .product-card-long .product-card__main {
        flex-direction: column;
        text-align: center;
    }

    .hover-panel {
        display: none;
    }
}

/* Touch-устройства: hover-панель всегда видна, т.к. hover недоступен */
@media (hover: none) {
    .hover-panel {
        display: flex;
        position: static;
        height: auto;
        opacity: 1;
        padding: var(--space-md) var(--space-xl);
        border-bottom: 2px solid var(--color-primary);
        background: rgba(var(--color-white-rgb), 0.96);
    }

    .hover-panel__content {
        opacity: 1;
    }

    /* Убираем fade-out основного контента без hover */
    .product-card .product-card__main {
        opacity: 1;
        transform: none;
    }
}

.form-group {
    margin-bottom: var(--space-lg);
}



.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}


.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}


.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--color-primary-light);
    border-color: var(--color-primary);
}



/* Footer Improvements */
.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: var(--space-3xl);
}

.footer__title {
    color: white;
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
    text-align: left;
}

.footer__contact-info {
    text-align: left;
}

.footer__contact-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: inherit;
    transition: color var(--transition-fast);
}

.footer__contact-link:hover {
    color: var(--color-primary-light);
}

.footer__contact-icon {
    font-size: 1.1rem;
}

.footer__links {
    list-style: none;
    padding: 0;
}

.footer__links li {
    margin-bottom: var(--space-sm);
}

.footer__links a:hover {
    color: var(--color-primary-light);
    padding-left: 4px;
}

@media (max-width: 1024px) {

    .content-grid,
    .contacts-grid,
    .footer__grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Modal Window
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--color-overlay-dark-rgb), 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    animation: modal-fade-in var(--duration-instant) ease-out;
}

.modal-content {
    background: var(--color-white);
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 32px 64px -12px rgba(var(--color-black-rgb), 0.35),
        0 0 0 1px rgba(var(--color-primary-rgb), 0.08);
    position: relative;
    animation: modal-scale-up var(--duration-instant) var(--ease-out-expo);
    display: flex;
    flex-direction: column;
}

.modal-overlay.modal-closing {
    animation: modal-fade-out var(--duration-instant) ease-in forwards;
}

.modal-overlay.modal-closing .modal-content {
    animation: modal-scale-down var(--duration-instant) ease-in forwards;
}

/* ---- Брендовый заголовок ---- */
.modal-header {
    background: linear-gradient(135deg,
            var(--color-primary-dark) 0%,
            var(--color-primary) 60%,
            var(--color-primary-light) 100%);
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/ornament_bw.svg');
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: bottom;
    opacity: 0.06;
    pointer-events: none;
}

.modal-header__icon {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.modal-title {
    font-size: var(--font-size-xl);
    color: white;
    margin-bottom: var(--space-md);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ---- Закрытие ---- */
.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---- Нумерованный индикатор шагов ---- */
.modal-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.modal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-step__num {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-step__label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-base);
}

.modal-step__line {
    width: 48px;
    height: 2px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 var(--space-sm);
    margin-bottom: 20px;
    /* компенсация высоты лейбла */
    transition: background var(--transition-base);
}

/* Активный шаг */
.modal-step--active .modal-step__num {
    background: white;
    border-color: white;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-step--active .modal-step__label {
    color: white;
    font-weight: 700;
}

/* Пройденный шаг */
.modal-step--done .modal-step__num {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.modal-step--done .modal-step__label {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Тело модалки ---- */
.modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

/* ---- Карточка телефонов ---- */
.modal-phone-card {
    background: rgba(var(--color-primary-rgb), 0.04);
    border: 1px solid rgba(var(--color-primary-rgb), 0.12);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.modal-phone-card__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-phone-card__numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.modal-phone-card__sep {
    color: var(--color-border);
    font-weight: 300;
}

/* ---- Форма внутри модалки ---- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: 0;
}

/* Вопросы-заголовки ("Как к вам обращаться?", "Как с вами связаться?") */
.form-question-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    display: block;
    margin-bottom: 0;
    line-height: 1.3;
}

.form-question-label--section {
    margin-top: var(--space-xs);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-primary);
}

/* Мелкие лейблы полей ("Телефон", "Email") */
.contact-form .form-group label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0;
}

.contact-form .form-group input,
.contact-form .form-group textarea {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    font-family: inherit;
    font-size: var(--font-size-md);
    transition: all var(--transition-fast);
    background: var(--color-bg-alt);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--color-text);
}

.contact-form .form-group textarea {
    resize: vertical;
    min-height: 88px;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.contact-form .form-group input::placeholder,
.contact-form .form-group textarea::placeholder {
    color: var(--color-grey);
}

.btn--full {
    width: 100%;
}

.form-privacy {
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-sm);
}

.form-privacy a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Animations */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modal-scale-up {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modal-scale-down {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

/* New Modal Sub-components */
.modal-quick-contacts {
    margin-top: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.phone-links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xs);
}

.phone-link {
    color: var(--color-secondary-dark);
    font-weight: 700;
    font-size: var(--font-size-md);
    transition: color var(--transition-fast);
}

.phone-link:hover {
    color: var(--color-primary);
}

.modal-survey-section {
    background: rgba(var(--color-accent-gold-rgb), 0.05);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border: 1px dashed var(--color-primary-light);
}

.modal-survey-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
    color: var(--color-secondary-dark);
    font-weight: 500;
}

.btn--survey {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--survey:hover {
    background-color: var(--color-primary);
    color: white;
}

.modal-divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.modal-divider span {
    padding: 0 var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-legend {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: var(--space-xs);
}

}

/* Form Refinements */
.form-section-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-secondary-dark);
    margin: var(--space-lg) 0 var(--space-sm);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-xs);
}

.input--required {
    border-left: 4px solid var(--color-primary) !important;
}

.input--choice {
    border-left: 4px solid var(--color-border) !important;
}

.input--choice:focus {
    border-left-color: var(--color-primary) !important;
}

.text-small {
    font-size: 11px;
    opacity: 0.9;
    line-height: 1.3;
}

.text-xsmall {
    font-size: 9.5px;
    /* Even smaller for single line fit */
    opacity: 0.85;
    line-height: 1.2;
}

.checkbox-wrapper {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: var(--space-md) 0;
}

.checkbox-container-simple {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    /* Small gap to keep them close */
    cursor: pointer;
    width: auto !important;
    user-select: none;
}

.checkbox-text {
    line-height: 1;
    white-space: nowrap !important;
}

.standard-checkbox {
    width: 14px;
    height: 14px;
    margin: 0 !important;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.text-link--blue {
    color: var(--color-link) !important;
    text-decoration: underline !important;
    font-weight: 500;
}

.text-link--blue:hover {
    color: var(--color-link-hover) !important;
}

/* Real-time Validation Styles */
input.is-valid,
textarea.is-valid {
    border-color: var(--color-success) !important;
    background-color: rgba(var(--color-success-rgb), 0.05) !important;
    box-shadow: 0 0 0 3px rgba(var(--color-success-rgb), 0.1) !important;
}

input.is-invalid,
textarea.is-invalid {
    border-color: var(--color-error) !important;
    background-color: rgba(255, 149, 144, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(159, 19, 20, 0.12) !important;
}

.field-error {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-error);
    font-weight: 500;
}

.btn:disabled {
    background-color: var(--color-border) !important;
    color: var(--color-text-muted) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus-visible: keyboard navigation ring */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

.navbar__links a:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.contact-form .form-group input:focus-visible,
.contact-form .form-group textarea:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 0;
}

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

    .phone-links {
        flex-direction: column;
        gap: var(--space-xs);
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: var(--space-lg) 0;
    background: rgba(var(--color-white-rgb), 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid var(--color-primary);
    box-shadow: 0 -8px 32px rgba(var(--color-black-rgb), 0.1);
}

.cookie-banner__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.cookie-banner__content p {
    font-size: var(--font-size-md);
    color: var(--color-text);
    margin: 0;
    line-height: var(--lh-body);
}

.cookie-banner__content a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
}

.cookie-banner__actions {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-banner__container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .cookie-banner__actions {
        align-self: stretch;
    }

    .cookie-banner__actions .btn {
        width: 100%;
    }
}

/* Footer Legal Links */
.footer__legal {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer__legal-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-xs);
}

.footer__legal-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.footer__legal-link:hover {
    color: white;
}

.footer__legal-divider {
    font-size: 0.85rem;
    color: var(--color-border);
}

/* Map Placeholder & Interactive Hover */
.contact-map-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    /* Fixed height is required for internal height: 100% elements */
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.map-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    /* Fill the wrapper */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


.map-placeholder--interactive {
    cursor: pointer;
}

.map-placeholder__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Show the full image instead of cropping */
    z-index: 1;
    transition: transform var(--transition-spring);
    background-color: var(--color-bg-alt);
    /* Match container background */
}

.map-placeholder:hover .map-placeholder__img {
    transform: scale(1.02);
    /* More subtle zoom */
}


.map-placeholder__overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(var(--color-overlay-dark-rgb), 0.4);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    transition: all var(--duration-slow) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.map-placeholder:hover .map-placeholder__overlay {
    opacity: 1;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(var(--color-overlay-dark-rgb), 0.6);
}

.map-placeholder__tooltip {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform var(--transition-reveal);
    max-width: 400px;
}

.map-placeholder:hover .map-placeholder__tooltip {
    transform: translateY(0);
}

.map-placeholder__tooltip-icon {
    font-size: 3rem;
    /* Larger icon */
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    animation: map-pulse 2s infinite;
}

.map-placeholder__tooltip-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes map-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

@media (max-width: 768px) {
    .map-placeholder__tooltip-icon {
        font-size: 2.5rem;
    }

    .map-placeholder__tooltip-text {
        font-size: 1.1rem;
    }

    .map-placeholder__overlay {
        opacity: 0.95;
        /* More visible on mobile */
        background: rgba(var(--color-overlay-dark-rgb), 0.5);
    }
}

/* =========================================
   Extracted from about.html
   ========================================= */

.about-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.experience-badge {
    width: 250px;
    height: 250px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
    border: 4px solid var(--color-bg-alt);
}

.experience-badge .number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.experience-badge .label {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.map-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    margin-top: var(--space-2xl);
}

.stat-item {
    margin-bottom: 2.5rem;
}

.stat-number {
    font-size: var(--h1-size);
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--color-text);
    opacity: 0.8;
}

.quote-box {
    border-left: 4px solid var(--color-secondary);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--color-primary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.it-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-top: var(--space-3xl);
}

.it-feature-card {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: all var(--transition-base);
}

.it-feature-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
}

.it-feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
}

.it-feature-icon img {
    width: 100%;
    height: auto;
}

.legal-notice-box {
    margin-top: var(--space-3xl);
    padding: var(--space-xl);
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    text-align: center;
}

.legal-info-flex {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.legal-item span {
    font-weight: 700;
    color: var(--color-primary);
    margin-right: 0.5rem;
}

.custom-map-wrapper {
    padding: 4rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.kalmap-svg {
    width: 100%;
    height: auto;
    transform: scaleY(1.3) scaleX(0.9);
    transform-origin: center center;
}

.map-district {
    cursor: pointer;
    transform-box: fill-box;
    transition: transform var(--transition-reveal), filter var(--transition-reveal), stroke var(--transition-base) !important;
}

.map-district:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
    stroke: var(--color-secondary) !important;
    stroke-width: 2px !important;
    z-index: 50;
}

#tooltip-content {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    transform: translate(15px, 15px);
}

#tooltip-content:not(:empty) {
    opacity: 1;
}

@media (max-width: 1024px) {

    .about-intro-grid,
    .map-layout,
    .it-features-grid {
        grid-template-columns: 1fr;
    }

    .about-intro-decoration {
        order: -1;
        margin-bottom: var(--space-xl);
    }

    .experience-badge {
        width: 180px;
        height: 180px;
    }

    .experience-badge .number {
        font-size: 3.5rem;
    }
}

/* =========================================
   Extracted from innovations.html
   ========================================= */

.bulletin-link-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 1.5rem;
}

.bulletin-fresh-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid rgba(var(--color-primary-rgb), 0.3);
    transition: all var(--transition-base);
}

.bulletin-fresh-link:hover {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.bulletin-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 0.75rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base) var(--ease-out-expo);
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.bulletin-link-wrapper:hover .bulletin-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bulletin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.bulletin-dropdown-item:hover {
    background: rgba(var(--color-primary-rgb), 0.05);
    color: var(--color-primary);
    padding-left: 1.75rem;
}

.bulletin-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 0.5rem 0;
}

/* =========================================
   Extracted from contact_modal.html
   ========================================= */

.consent-trigger {
    text-decoration: underline;
    cursor: pointer;
    color: var(--color-primary-light);
    transition: color var(--transition-fast);
}

.consent-trigger:hover {
    color: var(--color-primary);
}

.consent-expansion {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-in-out);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    margin-top: 5px;
}

.consent-expansion.is-open {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.consent-expansion__content {
    padding: 12px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

/* =========================================
   Extracted from contact-success.html
   ========================================= */

.success-message {
    padding: 2rem 1rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.success-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.success-text strong {
    color: var(--color-primary);
}

.success-actions {
    margin-top: 2rem;
}

.animate-fade-in {
    animation: successFadeIn var(--duration-enter) var(--ease-out-expo);
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =========================================
   Utility Classes (replacing inline styles)
   ========================================= */

.icon-emoji-lg {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.icon-emoji-xl {
    font-size: 5rem;
    flex-shrink: 0;
}

.bg-alt {
    background-color: var(--color-bg-alt);
}

.bg-warm {
    background-color: var(--color-light-brown);
}

.section--white {
    background-color: white;
}

/* Back-to-top button */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 1500;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease, background-color 200ms ease;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: var(--space-lg);
        right: var(--space-lg);
        /* Не перекрывает cookie-баннер */
        bottom: calc(var(--space-lg) + 80px);
    }
}

/* =========================================
   Двухшаговая форма
   ========================================= */

/* Шаги формы */
.form-step {
    animation: stepEnter var(--duration-slow) var(--ease-out-expo);
}

.form-step--hidden {
    display: none;
}

/* Переход вперёд */
.form-step--exit {
    animation: stepExitLeft var(--duration-fast) var(--ease-out-quart) forwards;
}

.form-step--enter {
    animation: stepEnterRight var(--duration-slow) var(--ease-out-expo);
}

/* Переход назад */
.form-step--exit-back {
    animation: stepExitRight var(--duration-fast) var(--ease-out-quart) forwards;
}

.form-step--enter-back {
    animation: stepEnterLeft var(--duration-slow) var(--ease-out-expo);
}

@keyframes stepExitLeft {
    to {
        opacity: 0;
        transform: translateX(-24px);
    }
}

@keyframes stepEnterRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stepExitRight {
    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

@keyframes stepEnterLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Кнопки действий формы */
.contact-form .form-actions {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Кнопка шага 1 — улучшенный disabled */
#step1-next:disabled {
    background-color: var(--color-bg-alt) !important;
    color: var(--color-text-muted) !important;
    border: 1.5px dashed var(--color-border) !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

#step1-next:not(:disabled) {
    animation: btnReady 0.3s var(--ease-out-expo);
}

@keyframes btnReady {
    from {
        transform: scale(0.97);
    }

    to {
        transform: scale(1);
    }
}

/* Подсказка под кнопкой */
.form-step-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
    transition: opacity var(--transition-base);
}

#step1-next:not(:disabled)~.form-step-hint {
    opacity: 0;
    pointer-events: none;
}

/* Кнопки нижней строки шага 2 */
.form-actions--row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-xl);
}

.btn--back {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-muted);
    padding: var(--space-sm) var(--space-md);
    flex-shrink: 0;
    transition: all var(--transition-ui);
}

.btn--back:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.form-actions--row .btn--primary {
    flex: 1;
}

/* Хинт у лейбла */
.form-label-hint {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: none;
    letter-spacing: 0;
}