/* ============================================================
   Header — плавающая «стеклянная» панель (общая для всех страниц)
   ============================================================ */

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

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

.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    padding: 16px 24px !important;
    background: transparent !important;
    color: #000000 !important;
}

.header-container {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: none !important;
    border-radius: 999px !important;
    background: none !important;
    backdrop-filter: none;
    border: none !important;
    box-shadow: none !important;
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease !important;
    animation: headerIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s backwards;
}

@keyframes headerIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.header.is-dark .header-container {
    background: rgba(18, 18, 18, 0.45) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.5) !important;
}

.logo-svg {
    height: 30px !important;
    width: auto !important;
    display: block;
    filter: brightness(0) invert(0) !important;
    transition: filter 0.45s ease, opacity 0.3s ease;
}

.logo a:hover .logo-svg {
    opacity: 0.75;
}

.header.is-dark .logo-svg {
    filter: brightness(0) invert(1) !important;
}

.nav {
    display: flex !important;
    align-items: center !important;
    gap: 32px !important;
}

.nav-link {
    position: relative;
    color: #121212 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    font-family: 'Gilroy', sans-serif !important;
    padding: 6px 2px !important;
    opacity: 0.8;
    transition: color 0.45s ease, opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.header.is-dark .nav-link {
    color: #ffffff !important;
}

.menu-toggle {
    display: none !important;
}

/* Бургер-кнопка */
.burger-menu {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #121212;
    transition: color 0.45s ease, transform 0.2s ease;
    z-index: 1002;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.burger-menu:hover {
    transform: scale(1.08);
}

.header.is-dark .burger-menu {
    color: #ffffff;
}

/* Контекстное меню (выпадающее) */
.context-menu {
    position: fixed;
    top: 84px;
    right: 24px;
    background: rgba(18, 18, 18, 0.9);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 10px 8px;
    min-width: 210px;
    width: auto;
    max-width: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1001;
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.context-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.context-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.context-menu-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 18px;
    border-bottom: none;
    border-radius: 12px;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: 'Gilroy', sans-serif;
    white-space: nowrap;
}

.context-menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

/* Адаптация */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px !important;
    }
    .header-container {
        padding: 8px 12px 8px 18px !important;
    }
    .nav {
        display: none !important;
    }
    .burger-menu {
        display: flex !important;
    }
    .context-menu {
        top: 72px;
        right: 16px;
        min-width: 190px;
    }
    .context-menu-link {
        font-size: 0.8rem;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .context-menu {
        right: 12px;
        min-width: 170px;
    }
    .context-menu-link {
        font-size: 0.75rem;
        padding: 9px 14px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .context-menu {
        right: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-container {
        animation: none;
    }
}


/* ===================== Language switcher ===================== */
.lang-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #121212;
    opacity: 0.85;
    padding: 7px 12px;
    border-radius: 999px;
    transition: background 0.3s ease, opacity 0.3s ease, color 0.45s ease;
}

.lang-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.lang-btn .lang-chev {
    width: 12px;
    height: 12px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-switch.open .lang-chev {
    transform: rotate(180deg);
}

.lang-btn:hover {
    opacity: 1;
    background: rgba(18, 18, 18, 0.07);
}

.header.is-dark .lang-btn {
    color: #ffffff;
}

.header.is-dark .lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: -6px;
    min-width: 190px;
    background: rgba(18, 18, 18, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 7px;
    box-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top left;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
    z-index: 1200;
}

.lang-switch.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.82);
    padding: 10px 13px;
    border-radius: 11px;
    text-align: left;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.lang-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(2px);
}

.lang-item.active {
    color: #ffffff;
    font-weight: 600;
}

.lang-item.active::after {
    content: '✓';
    font-size: 12px;
    opacity: 0.85;
    margin-left: 12px;
}

/* language grid inside the mobile burger menu */
.ctx-langs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.ctx-lang {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.ctx-lang:hover,
.ctx-lang.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ===================== milkinside-style text roll ===================== */
.roll-btn {
    text-decoration: none;
}

.roll {
    display: inline-block;
    position: relative;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.12em;
    margin-bottom: -0.12em;
}

.roll-t,
.roll-b {
    display: inline-block;
    white-space: nowrap;
    transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

.roll-b {
    position: absolute;
    left: 0;
    top: 0;
    transform: translateY(115%);
}

.roll-btn:hover .roll-t {
    transform: translateY(-115%);
}

.roll-btn:hover .roll-b {
    transform: translateY(0);
}

