/* === Главная ACARO TRADE «Шлюз» ===
   Взята с главной ACAROXXX (resources/css/home.css, 2026-10-30): живое поле
   рынка-скринера (public/js/home-field.js), по центру — логотип //_CARO и
   под ним единственная кнопка входа, язык — в углу. Цвета — токены бренда
   (public/css/acaro-tokens.css, подключается отдельной ссылкой до этого
   файла). Шрифты: Martian Mono (служебные подписи) и Inter (кнопка). */


/* ── Шрифты ───────────────────────────────────────────────────────────────
   Inter — те же файлы и диапазоны, что в public.css. Martian Mono — с нашего
   домена, одна ширина (87,5 %) и вес 400–600 в одном файле на алфавит:
   кириллица 10 КБ, латиница 23 КБ. Лицензия шрифта — OFL. */

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-cyrillic-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-latin-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
        U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-cyrillic-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
        U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-cyrillic-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
        U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Inter Fallback';
    src: local('Helvetica Neue'), local('Arial'), local('Liberation Sans');
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Martian Mono';
    src: url('/fonts/martian-mono-cyrillic.woff2') format('woff2');
    font-weight: 400 600;
    font-stretch: 87.5%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Martian Mono';
    src: url('/fonts/martian-mono-latin.woff2') format('woff2');
    font-weight: 400 600;
    font-stretch: 87.5%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Радиус «чёрной дыры» перехода: зарегистрированное свойство можно плавно
   анимировать. */
@property --home-gr {
    syntax: '<length>';
    inherits: true;
    initial-value: 0px;
}

/* ── База ─────────────────────────────────────────────────────────────── */

:root {
    --home-mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --home-sans: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --home-pad: clamp(16px, 3.2vw, 44px);
    --home-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --home-ease-in: cubic-bezier(0.7, 0, 0.84, 0);

    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    background: var(--acaro-bg);
    color: var(--acaro-fg);
}

body {
    font-family: var(--home-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100svh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

img,
svg {
    display: block;
}

:focus-visible {
    outline: 2px solid var(--acaro-accent);
    outline-offset: 3px;
    border-radius: 8px;
}

kbd {
    font-family: var(--home-mono);
    font-size: 10px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid var(--acaro-border-strong);
    color: var(--acaro-fg-dim);
    background: var(--acaro-surface);
}

.home-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 80;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--acaro-accent);
    color: #03140a;
    font-weight: 600;
}

.home-skip:focus {
    top: 12px;
}

/* ── Поле и атмосфера ─────────────────────────────────────────────────── */

.home-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.home-atmo {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        /* тень под логотипом и кнопкой по центру — читаются поверх поля */
        radial-gradient(ellipse 34% 26% at 50% 50%, rgba(3, 3, 5, 0.78) 0%, rgba(3, 3, 5, 0.42) 50%, transparent 80%),
        /* свечение горизонта */
        radial-gradient(ellipse 70% 22% at 55% 50%, rgba(118, 255, 145, 0.07), transparent 70%),
        linear-gradient(180deg, rgba(3, 3, 5, 0.9) 0%, rgba(3, 3, 5, 0) 26%);
}

.home-atmo::after {
    /* зерно — материал вместо плоской заливки */
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Без WebGL — неподвижное свечение вместо поля. */
.no-webgl .home-atmo {
    background:
        radial-gradient(ellipse 80% 40% at 55% 62%, rgba(118, 255, 145, 0.16), transparent 70%),
        radial-gradient(ellipse 60% 30% at 70% 70%, rgba(53, 244, 212, 0.1), transparent 70%);
}

.home-corners {
    position: fixed;
    inset: 12px;
    z-index: 2;
    pointer-events: none;
}

.home-corners i {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--acaro-fg-faint);
}

.home-corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.home-corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.home-corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.home-corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }


/* ── Каркас экрана ────────────────────────────────────────────────────── */

/* По центру экрана — логотип и под ним кнопка; язык — в правом верхнем углу. */
.home {
    position: relative;
    z-index: 3;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 0 var(--home-pad);
}

.home-top {
    position: absolute;
    top: 0;
    right: var(--home-pad);
    padding: clamp(16px, 2.6vh, 26px) 0 0;
}

.home-hero {
    display: grid;
    justify-items: center;
    gap: clamp(28px, 5vh, 52px);
    padding: clamp(20px, 4vh, 48px) 0;
}

/* ── Логотип ──────────────────────────────────────────────────────────── */

.home-logo {
    margin: 0;
    line-height: 0;
    color: var(--acaro-fg);
}

.home-logo__svg {
    width: clamp(220px, 34vw, 460px);
    height: auto;
    filter: drop-shadow(0 0 32px rgba(118, 255, 145, 0.18));
}

/* подчёркивание мигает курсором — тот же знак, что в «шлюзе» */
.home-logo__caret {
    fill: var(--acaro-accent);
    animation: home-caret 1.1s steps(1) infinite;
}

@keyframes home-caret {
    50% { opacity: 0; }
}

/* ── Кнопка ───────────────────────────────────────────────────────────── */

.home-cta {
    display: flex;
    justify-content: center;
}

.home-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 56px;
    padding: 0 22px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    isolation: isolate;
    transition: transform 0.35s var(--home-ease-out), box-shadow 0.3s, border-color 0.2s, background 0.2s;
    will-change: transform;
}

.home-btn--primary {
    color: #03140a;
    background: var(--acaro-accent-grad-wc);
    box-shadow:
        0 0 0 1px rgba(118, 255, 145, 0.55),
        0 14px 50px -12px rgba(118, 255, 145, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    padding-right: 10px;
    overflow: hidden;
}

.home-btn--primary::before {
    /* блик, пробегающий по кнопке */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
    transform: translateX(-120%);
    animation: home-sheen 5.5s var(--home-ease-out) 3.2s infinite;
}

@keyframes home-sheen {
    0% { transform: translateX(-120%); }
    22%, 100% { transform: translateX(120%); }
}

.home-btn--primary:hover {
    box-shadow:
        0 0 0 1px rgba(118, 255, 145, 0.9),
        0 18px 70px -10px rgba(118, 255, 145, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.home-btn__arrow {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #03140a;
    color: var(--acaro-accent);
    transition: transform 0.35s var(--home-ease-out);
}

.home-btn--primary:hover .home-btn__arrow {
    transform: translateX(3px) rotate(-45deg);
}
/* ── Язык ─────────────────────────────────────────────────────────────── */

/* RU / EN — та же «стеклянная» плашка, что кнопка меню на главной ACAROXXX. */
.home-lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 40px;
    padding: 0 4px;
    border-radius: 12px;
    border: 1px solid var(--acaro-border-strong);
    background: rgba(7, 7, 11, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: var(--home-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.home-lang a {
    display: inline-grid;
    place-items: center;
    height: 30px;
    min-width: 38px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--acaro-fg-dim);
    transition: color 0.2s, background 0.2s;
}

.home-lang a:hover {
    color: var(--acaro-fg);
}

.home-lang a[aria-current] {
    color: var(--acaro-accent);
    background: var(--acaro-accent-faint);
}

/* ── Появление ────────────────────────────────────────────────────────── */

.js [data-in] {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(8px);
}

.js.is-ready [data-in] {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
        opacity 0.9s var(--home-ease-out) var(--d, 0s),
        transform 1.1s var(--home-ease-out) var(--d, 0s),
        filter 0.9s var(--home-ease-out) var(--d, 0s);
}

/* ── Шлюз: переход в кабинет ──────────────────────────────────────────── */

.home-gate {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    visibility: hidden;
    --home-gr: 0px;
}

.is-gating .home-gate {
    visibility: visible;
    pointer-events: auto;
    cursor: progress;
}

.home-gate__void {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(
        circle at var(--ox, 50%) var(--oy, 50%),
        var(--acaro-bg) 0 var(--home-gr),
        rgba(190, 255, 205, 0.95) calc(var(--home-gr) + 1px),
        rgba(118, 255, 145, 0.55) calc(var(--home-gr) + 6px),
        rgba(53, 244, 212, 0.16) calc(var(--home-gr) + 60px),
        transparent calc(var(--home-gr) + 220px)
    );
}

.is-gating .home-gate__void {
    opacity: 1;
    --home-gr: 170vmax;
    transition:
        --home-gr var(--void-dur) var(--home-ease-in) var(--void-delay),
        opacity 0.01s linear var(--void-delay);
}

.home-gate__core {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 22px;
    opacity: 0;
    transform: scale(0.94);
}

.is-gating .home-gate__core {
    opacity: 1;
    transform: none;
    transition: opacity 0.35s ease var(--core-delay), transform 0.8s var(--home-ease-out) var(--core-delay);
}

.home-gate__mark {
    width: clamp(84px, 9vw, 120px);
    height: auto;
    fill: var(--acaro-fg);
    filter: drop-shadow(0 0 22px rgba(118, 255, 145, 0.55));
}

.home-gate__under {
    fill: var(--acaro-accent);
    animation: home-caret 0.5s steps(1) infinite;
}

.home-gate__line {
    margin: 0;
    min-height: 1.5em;
    font-family: var(--home-mono);
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--acaro-accent);
    white-space: pre;
}

.home-gate__bar {
    width: 220px;
    height: 3px;
    border-radius: 3px;
    background: rgba(247, 251, 250, 0.08);
    overflow: hidden;
}

.home-gate__bar i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--acaro-accent-grad-wc);
    box-shadow: 0 0 12px var(--acaro-accent-glow);
    transform: scaleX(0);
    transform-origin: left;
}

.is-gating .home-gate__bar i {
    transform: scaleX(1);
    transition: transform var(--bar-dur) cubic-bezier(0.65, 0, 0.35, 1) var(--core-delay);
}

.home-gate__path {
    margin: 0;
    font-family: var(--home-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--acaro-fg-dim);
}

/* длинный ритуал — «Вход в закрытый контур», короткий — про запас */
.gate-long {
    --out-dur: 0.5s;
    --void-delay: 0.42s;
    --void-dur: 0.7s;
    --core-delay: 0.95s;
    --bar-dur: 0.75s;
}

.gate-short {
    --out-dur: 0.25s;
    --void-delay: 0.1s;
    --void-dur: 0.42s;
    --core-delay: 0.38s;
    --bar-dur: 0.4s;
}

/* уход интерфейса: блоки растворяются по очереди */
.is-gating [data-in] {
    opacity: 0 !important;
    filter: blur(10px) !important;
    transform: translateY(-10px) scale(0.985) !important;
    transition:
        opacity var(--out-dur) ease calc(var(--o, 0) * 0.06s),
        filter var(--out-dur) ease calc(var(--o, 0) * 0.06s),
        transform var(--out-dur) var(--home-ease-in) calc(var(--o, 0) * 0.06s) !important;
}

/* ── Телефон ──────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .home-btn {
        height: 52px;
    }

    .home-atmo {
        background:
            radial-gradient(ellipse 70% 30% at 50% 50%, rgba(3, 3, 5, 0.8) 0%, rgba(3, 3, 5, 0.4) 55%, transparent 85%),
            linear-gradient(180deg, rgba(3, 3, 5, 0.9) 0%, rgba(3, 3, 5, 0) 22%);
    }
}

/* ── Меньше движения ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        transition-delay: 0s !important;
    }
}
