/* =================== ГЛАВНАЯ СТРАНИЦА И NAVIER-STOKES =================== */
:root {
    --ns-edge-width: 5px; /* ширина правого перехода */
    --ns-edge-blur: 0px; /* сила блюра */
    --ns-vertical-edge-height: 10px; /* высота верхнего и нижнего перехода */
    --ns-side-gap: 0px; /* отступ от левой границы на ПК */
    --ns-news-width: 330px;
    --ns-news-gap: 18px;
    --ns-animation-height: calc(100vh - 170px);
    --ns-animation-width: 50vw;
    --home-news-list-gap: 12px;
    --home-news-side-padding-y: var(--ns-news-gap);
    --home-news-card-padding: clamp(12px, 1.6vh, 64px);
    --home-news-card-column-gap: clamp(14px, 2vh, 72px);
    --home-news-card-row-gap: clamp(6px, .9vh, 32px);
    --home-news-date-size: clamp(13px, 1.45vh, 56px);
    --home-news-title-size: clamp(17px, 1.9vh, 72px);
    --home-news-button-height: clamp(46px, 4.2vh, 150px);
    --home-news-button-size: clamp(15px, 1.45vh, 54px);
    --home-news-card-height: calc((var(--ns-animation-height) - var(--home-news-side-padding-y) * 2 - var(--home-news-button-height) - var(--home-news-list-gap) * 3) / 3);
    --home-news-image-size: clamp(110px, calc(var(--home-news-card-height) - var(--home-news-card-padding) * 2), 760px);
}

@media (min-width: 1700px) and (min-height: 850px) {
    :root {
        --home-news-date-size: clamp(15px, calc(var(--home-news-card-height) * .055), 26px);
        --home-news-title-size: clamp(20px, calc(var(--home-news-card-height) * .075), 36px);
        --home-news-button-size: clamp(16px, calc(var(--home-news-card-height) * .055), 26px);
    }
}

@media (min-width: 2600px) and (min-height: 1300px) {
    :root {
        --home-news-date-size: clamp(20px, calc(var(--home-news-card-height) * .07), 42px);
        --home-news-title-size: clamp(26px, calc(var(--home-news-card-height) * .095), 58px);
        --home-news-button-size: clamp(20px, calc(var(--home-news-card-height) * .065), 38px);
    }
}

body.home, body.home #page, body.home .site, body.home .site-content, body.home main.site-content.site-content--navier { background: var(--topbar-bg) !important; }

body.home main.site-content.site-content--navier {
    flex: 1 1 auto;
    display: flex !important;
    align-items: center;
    width: 100%;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--topbar-bg) !important;
}

body.home .site-content--navier .ns-stage {
    display: grid;
    grid-template-columns: var(--ns-animation-width) minmax(var(--ns-news-width), 1fr);
    flex: 1 1 auto;
    align-items: stretch;
    justify-content: start;
    gap: var(--ns-news-gap);
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: var(--ns-side-gap);
    padding-right: var(--ns-news-gap);
    background: var(--topbar-bg);
}

body.home .site-content--navier .ns-section {
    position: relative;
    width: var(--ns-animation-width);
    height: var(--ns-animation-height);
    min-width: var(--ns-animation-width);
    min-height: var(--ns-animation-height);
    max-width: var(--ns-animation-width);
    max-height: var(--ns-animation-height);
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    isolation: isolate;
    border-radius: 0 !important;
    background:
        radial-gradient(circle at 20% 20%, rgba(54, 214, 150, .18), transparent 35%),
        radial-gradient(circle at 80% 30%, rgba(255, 121, 64, .16), transparent 35%),
        linear-gradient(180deg, #02160f 0%, #063423 55%, #0c4f38 100%);
    box-shadow: none !important;
}

body.home .site-content--navier .ns-section::before, body.home .site-content--navier .ns-section::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

body.home .site-content--navier .ns-section::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 174, 104, .5) 0,
            rgba(0, 174, 104, 0) 100%),
        linear-gradient(
            to top,
            rgba(0, 174, 104, .5) 0,
            rgba(0, 174, 104, 0) 100%);
    background-repeat: no-repeat;
    background-size:
        100% var(--ns-vertical-edge-height),
        100% var(--ns-vertical-edge-height);
    background-position: top left, bottom left;
}

body.home .site-content--navier .ns-section::after {
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--ns-edge-width);
    background: linear-gradient(
        to left,
        rgba(240, 252, 246, .92) 0%,
        rgba(240, 252, 246, .36) 45%,
        rgba(240, 252, 246, 0) 100%);
    backdrop-filter: blur(var(--ns-edge-blur));
    -webkit-backdrop-filter: blur(var(--ns-edge-blur));
}

body.home #navierStokesCanvas {
    position: relative;
    z-index: 1;
    display: block;
    width: var(--ns-animation-width);
    height: var(--ns-animation-height);
    min-width: var(--ns-animation-width);
    min-height: var(--ns-animation-height);
    max-width: var(--ns-animation-width);
    max-height: var(--ns-animation-height);
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    cursor: crosshair;
}

.ns-model-title {
    position: absolute;
    top: 18px;
    left: 88px;
    right: 18px;
    z-index: 24;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    padding: 0 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(0, 0, 0, .28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: clamp(16px, 1.25vw, 22px);
    line-height: 1.08;
    font-weight: 1000;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    color: rgba(255, 255, 255, .96);
    text-shadow: 0 3px 12px rgba(0, 0, 0, .45);
    pointer-events: auto;
}

.ns-model-select {
    width: 100%;
    height: 100%;
    padding: 0 28px 0 12px;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-align: center;
    text-align-last: center;
    color: inherit;
    text-shadow: inherit;
    cursor: pointer;
    box-shadow: none !important;
    appearance: auto;
    -webkit-appearance: auto;
    -webkit-tap-highlight-color: transparent;
}

.ns-model-title, .ns-model-title:hover, .ns-model-title:focus-within, .ns-model-title:active { color: rgba(255, 255, 255, .96) !important; }

.ns-model-select, .ns-model-select:hover, .ns-model-select:focus, .ns-model-select:focus-visible, .ns-model-select:active {
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .96) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, .96) !important;
    box-shadow: none !important;
}

.ns-model-select::-ms-value { background: transparent !important; color: rgba(255, 255, 255, .96) !important; }
.ns-model-select option { background: #06150f; color: #ffffff; font-weight: 800; }
.ns-model-select option:checked { background: #06150f !important; color: #ffffff !important; }
.ns-model-select option:hover, .ns-model-select option:focus { background: rgba(255, 76, 0, .22) !important; color: #ffffff !important; }

.home-news {
    display: flex;
    flex-direction: column;
    gap: var(--home-news-list-gap);
    width: 100%;
    height: var(--ns-animation-height);
    min-height: var(--ns-animation-height);
    padding-top: var(--home-news-side-padding-y);
    padding-bottom: var(--home-news-side-padding-y);
}

.home-news-card, .home-news-card:link, .home-news-card:visited {
    display: grid;
    grid-template-columns: var(--home-news-image-size) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    gap: var(--home-news-card-row-gap) var(--home-news-card-column-gap);
    align-items: start;
    align-content: start;
    flex: 1 1 0;
    min-height: 0;
    padding: var(--home-news-card-padding);
    overflow: hidden;
    border: 1px solid rgba(20, 138, 99, .18);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
    color: var(--b) !important;
    text-decoration: none !important;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.home-news-card:hover, .home-news-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 76, 0, .34);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
    outline: none;
}

.home-news-card__image {
    grid-row: 1 / 4;
    align-self: start;
    width: var(--home-news-image-size);
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #e8f5ee;
}

.home-news-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}

.home-news-card:hover .home-news-card__image img, .home-news-card:focus-visible .home-news-card__image img { transform: scale(1.04); }

.home-news-card__date {
    display: block;
    align-self: start;
    font-size: var(--home-news-date-size);
    line-height: 1.2;
    font-weight: 900;
    color: var(--o1);
}

.home-news-card__title {
    align-self: start;
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: var(--home-news-title-size);
    line-height: 1.2;
    font-weight: 900;
    color: var(--b);
}

.home-news-all, .home-news-all:link, .home-news-all:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--home-news-button-height);
    padding: 12px 18px;
    border-radius: 16px;
    background: var(--o1) !important;
    color: var(--w) !important;
    font-size: var(--home-news-button-size);
    line-height: 1;
    font-weight: 1000;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 10px 18px rgba(255, 76, 0, .18);
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.home-news-all:hover, .home-news-all:focus-visible {
    transform: translateY(-1px);
    background: var(--o4) !important;
    color: var(--w) !important;
    box-shadow: 0 12px 22px rgba(255, 76, 0, .22);
    outline: none;
}

body.home .footer { margin-top: 0 !important; }
.ns-mobile-toggle { display: none; }

.home-news.home-news--count-1 .home-news-card {
    flex: 0 0 calc((var(--ns-animation-height) - var(--ns-news-gap) * 2 - 24px) / 3) !important;
    height: calc((var(--ns-animation-height) - var(--ns-news-gap) * 2 - 24px) / 3) !important;
}

.ns-controls {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: min(320px, calc(100vw - 36px));
}

.ns-controls-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 16px;
    background: rgba(0, 0, 0, .28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.ns-controls-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
}

.ns-controls-toggle:hover, .ns-controls[data-open="true"] .ns-controls-toggle, .ns-controls-toggle:focus, .ns-controls-toggle:focus-visible, .ns-controls-toggle:active {
    background: rgba(255, 76, 0, .22) !important;
    border-color: rgba(255, 255, 255, .26) !important;
    outline: none !important;
}

.ns-controls-toggle:focus, .ns-controls-toggle:focus-visible, .ns-controls-toggle:active { box-shadow: none !important; }
.ns-controls-toggle:active { transform: scale(.98); }

.ns-controls-panel {
    width: min(320px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(0, 0, 0, .34);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ns-controls-title {
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 900;
    color: var(--w);
}

.ns-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ns-control + .ns-control { margin-top: 14px; }

.ns-control__label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 255, 255, .92);
    white-space: nowrap;
}

.ns-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    margin: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}

.ns-control input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}

.ns-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -8px;
    border: 0;
    border-radius: 50%;
    background: var(--o1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    cursor: pointer;
}

.ns-control input[type="range"]::-moz-range-track {
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}

.ns-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: var(--o1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    cursor: pointer;
}

.ns-control input[type="range"]::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
}


/* =================== АДАПТАЦИЯ ГЛАВНОЙ СТРАНИЦЫ И NAVIER-STOKES =================== */
@media (pointer: coarse) {
    body.home #navierStokesCanvas { touch-action: pan-y; }
    body.home #navierStokesCanvas.is-interactive { touch-action: none; }
    .ns-mobile-toggle {
        position: absolute;
        left: 50%;
        bottom: 14px;
        z-index: 20;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 132px;
        height: 46px;
        padding: 0 18px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 999px;
        background: rgba(0, 0, 0, .28);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        cursor: pointer;
        transform: translateX(-50%);
        transition: transform .15s ease, background .15s ease, border-color .15s ease;
        font-size: 14px;
        font-weight: 900;
        letter-spacing: .2px;
        color: rgba(255, 255, 255, .95);
    }
    .ns-mobile-toggle:active { transform: translateX(-50%) scale(.98); }
    .ns-mobile-toggle.is-active { background: rgba(255, 76, 0, .22); border-color: rgba(255, 255, 255, .26); }
}

@media (max-width: 740px) {
    :root {
		--ns-edge-width: 12px;
		--ns-edge-blur: 2px;
		--ns-side-gap: 14px;
		--ns-animation-size: calc(100vh - 130px);
	}

	body.home main.site-content.site-content--navier, body.home .site-content--navier .ns-stage, body.home .site-content--navier .ns-section, body.home #navierStokesCanvas {
		width: 100vw !important;
		min-width: 100vw !important;
		max-width: 100vw !important;
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 0 !important;
	}

	body.home .site-content--navier .ns-stage {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		background: transparent !important;
	}

	body.home main.site-content.site-content--navier {
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		background: transparent !important;
	}

	body.home .site-content--navier .ns-section, body.home #navierStokesCanvas {
		height: calc(100vh - 130px);
		min-height: calc(100vh - 130px);
		box-shadow: none !important;
		backdrop-filter: none !important;
		-webkit-backdrop-filter: none !important;
	}

	.home-news {
		width: 100vw;
		height: auto !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 16px 14px 24px !important;
		background: var(--topbar-bg);
	}

	.home-news-card, .home-news-card:link, .home-news-card:visited { grid-template-columns: 110px minmax(0, 1fr); min-height: 128px; flex: 0 0 auto; }
	.home-news-card__image { width: 110px; aspect-ratio: 1 / 1; height: auto; min-height: 0; }
	.home-news-card__title { font-size: 16px; -webkit-line-clamp: 3; }

	body.home .site-content--navier .ns-stage::before, body.home .site-content--navier .ns-stage::after, body.home .site-content--navier .ns-section::before, body.home .site-content--navier .ns-section::after { display: none !important; }

    .ns-mobile-toggle {
        bottom: 12px;
        min-width: 124px;
        height: 42px;
        font-size: 13px;
    }

    .ns-controls { top: 12px; left: 12px; max-width: calc(100vw - 24px); }

    .ns-controls-panel { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
	
	.ns-model-title {
		top: 12px;
		left: 76px;
		right: 12px;
		height: 52px;
		min-height: 52px;
		max-height: 52px;
		padding: 0 10px;
		border-radius: 16px;
		font-size: 11px;
		line-height: 1.1;
	}

    body.home .site-content--navier .ns-stage { min-height: 0 !important; height: auto !important; }
    body.home main.site-content.site-content--navier { min-height: 0 !important; height: auto !important; }
}

@media (max-width: 640px) {
    .ns-controls { top: 12px; left: 12px; max-width: calc(100vw - 24px); }
    .ns-controls-panel { width: calc(100vw - 24px); max-width: 320px; padding: 14px; }
}

@media (min-width: 741px) and (max-height: 820px), (min-width: 741px) and (max-width: 1200px) {
    :root {
        --ns-animation-height: 520px;
        --home-news-list-gap: 10px;
        --home-news-side-padding-y: 12px;
        --home-news-card-padding: clamp(10px, 1.35vh, 48px);
        --home-news-card-column-gap: clamp(12px, 1.7vh, 56px);
        --home-news-card-row-gap: clamp(6px, .75vh, 24px);
        --home-news-date-size: clamp(12px, 1.25vh, 44px);
        --home-news-title-size: clamp(15px, 1.65vh, 58px);
        --home-news-button-height: clamp(44px, 3.6vh, 120px);
        --home-news-button-size: clamp(15px, 1.25vh, 42px);
        --home-news-card-height: calc((var(--ns-animation-height) - var(--home-news-side-padding-y) * 2 - var(--home-news-button-height) - var(--home-news-list-gap) * 3) / 3);
        --home-news-image-size: clamp(90px, calc(var(--home-news-card-height) - var(--home-news-card-padding) * 2), 620px);
    }

    body.home main.site-content.site-content--navier { align-items: flex-start; }
    body.home .site-content--navier .ns-stage { align-items: stretch; }
    body.home .site-content--navier .ns-section, body.home #navierStokesCanvas {
        height: var(--ns-animation-height);
        min-height: var(--ns-animation-height);
        max-height: none;
    }

    .home-news {
        height: var(--ns-animation-height);
        min-height: var(--ns-animation-height);
        padding-top: var(--home-news-side-padding-y);
        padding-bottom: var(--home-news-side-padding-y);
        gap: var(--home-news-list-gap);
    }

    .home-news-card, .home-news-card:link, .home-news-card:visited {
        grid-template-columns: var(--home-news-image-size) minmax(0, 1fr);
        grid-template-rows: auto auto 1fr;
        gap: var(--home-news-card-row-gap) var(--home-news-card-column-gap);
        align-items: start;
        align-content: start;
        flex: 1 1 0;
        min-height: 0;
        padding: var(--home-news-card-padding);
    }

    .home-news-card__image {
        grid-row: 1 / 4;
        align-self: start;
        width: var(--home-news-image-size);
        aspect-ratio: 1 / 1;
        height: auto;
        min-height: 0;
    }

    .home-news-card__date {
        align-self: start;
        font-size: var(--home-news-date-size);
        line-height: 1.15;
    }

    .home-news-card__title {
        align-self: start;
        font-size: var(--home-news-title-size);
        line-height: 1.16;
        -webkit-line-clamp: 2;
    }

    .home-news-all, .home-news-all:link, .home-news-all:visited {
        flex: 0 0 auto;
        min-height: var(--home-news-button-height);
        font-size: var(--home-news-button-size);
    }
}