/* Экран выбора языка francuz.dev
   Слева — чёрная панель с текстом, справа — бетонный интерьер с окном,
   поверх него три стеклянные карточки языков. */

:root {
    --ink: #050505;
    --text: #f4f4f2;
    --text-soft: #b9b9b6;
    --text-mute: #8b8b88;
    --panel-width: 46%;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--ink);
}

body {
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* пока уходим на сохранённый язык — ничего не показываем, чтобы не мигало */
.is-redirecting body { visibility: hidden; }

p,
h1,
ul { margin: 0; padding: 0; }

.entrance {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}

/* ---------- фон ---------- */
.entrance__scene {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--panel-width);
    z-index: -1;
    overflow: hidden;
    background: #1a1a1a;
}

.entrance__scene img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 38% 50%;
    animation: scene-in 2.2s var(--ease) backwards;
}

/* мягкая тень от чёрной панели на бетон */
.entrance__scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 16%);
    pointer-events: none;
}

/* ---------- левая панель ---------- */
.entrance__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--panel-width);
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(32px, 7vh, 72px) 7.5vw clamp(40px, 9vh, 96px);
    background: var(--ink);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.55em;
    text-transform: uppercase;
    animation: rise 1s 0.1s var(--ease) backwards;
}

.brand__name {
    font-size: clamp(18px, 1.55vw, 26px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.34em;
}

.brand__role {
    font-size: clamp(9px, 0.72vw, 12px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.42em;
    color: var(--text-mute);
}

.intro {
    margin: auto 0;
    padding-top: clamp(32px, 8vh, 96px);
}

.intro__eyebrow,
.intro__motto,
.entrance__tagline {
    font-size: clamp(10px, 0.78vw, 13px);
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.intro__eyebrow {
    color: var(--text-soft);
    animation: rise 1s 0.25s var(--ease) backwards;
}

.intro__title {
    margin-top: clamp(18px, 2.2vh, 28px);
    font-size: clamp(40px, 4.3vw, 76px);
    font-weight: 400;
    line-height: 1.14;
    letter-spacing: -0.012em;
    animation: rise 1.1s 0.35s var(--ease) backwards;
}

.intro__rule {
    display: block;
    width: clamp(36px, 3.4vw, 56px);
    height: 1px;
    margin: clamp(32px, 5vh, 56px) 0 clamp(30px, 4.6vh, 52px);
    background: var(--text-mute);
    transform-origin: left center;
    animation: draw 1s 0.65s var(--ease) backwards;
}

.intro__motto {
    line-height: 2;
    color: var(--text-mute);
    animation: rise 1s 0.75s var(--ease) backwards;
}

/* ---------- девиз справа вверху ---------- */
.entrance__tagline {
    position: absolute;
    top: clamp(20px, 3.2vh, 36px);
    right: clamp(24px, 3.4vw, 56px);
    display: flex;
    flex-direction: column;
    font-size: clamp(9px, 0.7vw, 11px);
    line-height: 1.75;
    color: rgba(244, 244, 242, 0.82);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    animation: fade 1.2s 0.9s ease backwards;
}

/* ---------- карточки языков ---------- */
.entrance__langs {
    position: absolute;
    top: 50%;
    left: 58%;
    width: clamp(300px, 31vw, 500px);
    transform: translateY(-50%);
}

.entrance__langs ul {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vh, 16px);
    list-style: none;
}

.entrance__langs li {
    animation: card-in 1s var(--ease) backwards;
}

.entrance__langs li:nth-child(1) { animation-delay: 0.45s; }
.entrance__langs li:nth-child(2) { animation-delay: 0.57s; }
.entrance__langs li:nth-child(3) { animation-delay: 0.69s; }

.lang-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(64px, 10.5vh, 100px);
    padding: 0 clamp(26px, 2.6vw, 44px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.07) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 18px 40px -18px rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
    backdrop-filter: blur(16px) saturate(115%);
    color: var(--text);
    font-size: clamp(16px, 1.3vw, 21px);
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
    transition:
        transform 0.5s var(--ease),
        border-color 0.4s ease,
        background-color 0.4s ease,
        box-shadow 0.5s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

/* мягкий блик, который проходит по стеклу при наведении */
.lang-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 50%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-18deg);
    opacity: 0;
    transition: left 0.9s var(--ease), opacity 0.4s ease;
    pointer-events: none;
}

.lang-card:hover,
.lang-card:focus-visible {
    transform: translateX(8px);
    border-color: rgba(255, 255, 255, 0.62);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 24px 50px -20px rgba(0, 0, 0, 0.7);
}

.lang-card:hover::before,
.lang-card:focus-visible::before {
    left: 120%;
    opacity: 1;
}

.lang-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.lang-card:active { transform: translateX(8px) scale(0.99); }

/* ---------- уход в выбранную версию ---------- */
.entrance::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #0b0b0e;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease 0.08s;
}

.is-leaving .entrance::after { opacity: 1; }

.is-leaving .entrance__scene img {
    transform: scale(1.04);
    transition: transform 0.6s var(--ease);
}

.is-leaving .brand,
.is-leaving .intro,
.is-leaving .entrance__tagline,
.is-leaving .lang-card:not(.is-chosen) {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.is-leaving .lang-card.is-chosen {
    transform: translateX(14px);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ---------- анимации появления ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes card-in {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes draw {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scene-in {
    from { opacity: 0; transform: scale(1.06); }
    to { opacity: 1; transform: none; }
}

/* ---------- ноутбуки с невысоким экраном ---------- */
@media (min-width: 901px) and (max-height: 620px) {
    .intro__title { font-size: clamp(34px, 3.6vw, 56px); }
    .intro__rule { margin: 22px 0; }
    .lang-card { min-height: 56px; }
}

/* ---------- планшеты в портрете и телефоны: всё в одну колонку ---------- */
@media (max-width: 900px), (max-aspect-ratio: 4/5) {
    :root { --panel-width: 100%; }

    .entrance {
        display: flex;
        flex-direction: column;
    }

    .entrance__scene { left: 0; }

    .entrance__scene img { object-position: 50% 60%; }

    /* сверху чёрный, ниже проступает интерьер */
    .entrance__scene::after {
        background: linear-gradient(180deg,
            var(--ink) 0%,
            var(--ink) 34%,
            rgba(5, 5, 5, 0.72) 52%,
            rgba(5, 5, 5, 0.25) 78%,
            rgba(5, 5, 5, 0.45) 100%);
    }

    .entrance__panel {
        width: 100%;
        min-height: 0;
        padding: max(28px, env(safe-area-inset-top)) 24px 0;
        background: transparent;
    }

    .intro {
        margin: 0;
        padding-top: clamp(48px, 9vh, 110px);
    }

    .intro__title { font-size: clamp(38px, 10.5vw, 72px); }

    .intro__eyebrow,
    .intro__motto { font-size: clamp(10px, 2.6vw, 14px); }

    .brand__name { font-size: clamp(17px, 4.4vw, 26px); }

    .brand__role { font-size: clamp(9px, 2.3vw, 12px); }

    .intro__rule { margin: clamp(24px, 3.4vh, 40px) 0; }

    .entrance__tagline {
        top: max(26px, env(safe-area-inset-top));
        right: 24px;
        font-size: clamp(8px, 2.1vw, 11px);
    }

    .entrance__langs {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        margin: auto 24px 0;
        padding: clamp(36px, 6vh, 72px) 0 max(32px, env(safe-area-inset-bottom));
        transform: none;
    }

    .lang-card {
        min-height: clamp(62px, 8.5vh, 88px);
        font-size: clamp(17px, 4.4vw, 22px);
    }

    .lang-card:hover,
    .lang-card:focus-visible { transform: translateX(4px); }
}

@media (min-width: 601px) and (max-width: 900px), (min-width: 601px) and (max-aspect-ratio: 4/5) {
    .entrance__panel,
    .entrance__langs { padding-left: 8vw; padding-right: 8vw; }

    .entrance__langs { margin: auto 0 0; }

    .entrance__tagline { right: 8vw; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
