/* ============================================================================
   XT-SHELL — header / footer-shell / preloader / lang-switcher / mobile menu

   Extracted from legacy styles.css + redesign.css (now dropped).
   Layered intentionally: structural rules first, themed overrides
   (body.xbot-home …) second — caskade order matters, do not reshuffle.

   Selectors kept legacy (`.header`, `.lang-switcher`, …) so HTML/JS doesn't
   need to change. Token-based theme via `var(--…)` from tokens.css.
   ============================================================================ */


/* ──────────────────────────────────────────────────────────────────────────
   1. Base (html / body / a)
   ────────────────────────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

body {
  box-sizing: border-box;
  font-family: "Onest", sans-serif;
  font-stretch: 100%;
  overflow-x: hidden;
  position: relative;
}

a {
  text-decoration: none;
}

body.xbot-home {
  background: var(--bg-base);
  color: var(--fg-secondary);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* ──────────────────────────────────────────────────────────────────────────
   2. Wrapper / Container
   ────────────────────────────────────────────────────────────────────────── */

.wrapper {
  overflow-x: hidden;
  background-color: #0c0c0e;
}

/* xbot-home: header is fixed → kill legacy padding-top, use token bg */
body.xbot-home .wrapper {
  background: var(--bg-base);
  padding-top: 0;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 15px;
}


/* ──────────────────────────────────────────────────────────────────────────
   3. Preloader (karambit spinner)
   ────────────────────────────────────────────────────────────────────────── */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preloader.preloader--hidden {
  opacity: 0;
  pointer-events: none;
}

body.xbot-home #preloader {
  background: var(--bg-base);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.xbot-home .preloader__spinner {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.7);
  -webkit-mask: url('../images/karambit.svg') center/contain no-repeat;
          mask: url('../images/karambit.svg') center/contain no-repeat;
  animation: xt-karambit-spin 0.9s linear infinite;
  will-change: transform;
}

@keyframes xt-karambit-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.xbot-home .preloader__spinner {
    animation: none;
  }
}


/* ──────────────────────────────────────────────────────────────────────────
   4. Header — structural baseline
   ────────────────────────────────────────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 10px 0;
  background-color: rgba(19, 20, 23, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
  overflow: visible;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.header--scrolled {
  border-bottom-color: rgba(0, 174, 228, 0.18);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.header__block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.header__logo img {
  height: 20px;
  width: auto;
  display: block;
}

.header__menu {
  margin-left: 0;
}

.header__menu ul {
  list-style-type: none;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0;
}

.header__menu ul a {
  font-family: "Onest", sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.2;
  position: relative;
  transition: color 0.2s ease;
}

.header__menu ul a:hover {
  color: #fff;
}

.header__menu ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background-color: rgba(0, 174, 228, 0.6);
  transition: width 0.25s ease;
}

.header__menu ul li a:hover::after {
  width: 100%;
}

.header__cabinet {
  margin-left: 16px;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.header__cabinet a {
  position: relative;
  display: inline-block;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Onest", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  overflow: hidden;
  z-index: 0;
  transition: border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.header__cabinet a::after {
  display: none !important;
}


/* ──────────────────────────────────────────────────────────────────────────
   4b. Header — themed overrides for body.xbot-home (token-driven)
   ────────────────────────────────────────────────────────────────────────── */

body.xbot-home .header {
  background: rgba(9, 9, 11, 0.65);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  /* высота уровня Linear / Vercel ≈ 64px (контент 28 + padding 18×2) */
  padding: 18px 0;
  transition: background var(--duration-base) var(--ease),
              border-color var(--duration-base) var(--ease);
}

body.xbot-home .header--scrolled {
  background: rgba(9, 9, 11, 0.85);
  border-bottom-color: var(--border-default);
}

body.xbot-home .header__logo img {
  height: 24px;
  width: auto;
  display: block;
}

body.xbot-home .header__menu ul a {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--fg-tertiary);
  letter-spacing: var(--tracking-tight);
  transition: color var(--duration-fast) var(--ease);
}

body.xbot-home .header__menu ul a:hover {
  color: var(--fg-primary);
}

body.xbot-home .header__menu ul a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease);
}

body.xbot-home .header__menu ul a:hover::after {
  width: 100%;
}

body.xbot-home .header__cabinet a {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-primary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  transition: all var(--duration-base) var(--ease);
}

body.xbot-home .header__cabinet a:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

body.xbot-home .header--scrolled .header__cabinet a {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: none;
}

body.xbot-home .header--scrolled .header__cabinet a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg-on);
}

body.xbot-home .header__cabinet a::after {
  display: none;
}


/* ──────────────────────────────────────────────────────────────────────────
   5. Lang switcher — premium token-driven version
   ────────────────────────────────────────────────────────────────────────── */

.lang-switcher {
  position: relative;
  display: inline-flex;
}

body.xbot-home .lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-tertiary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}

body.xbot-home .lang-switcher__trigger:hover,
body.xbot-home .lang-switcher--open .lang-switcher__trigger {
  color: var(--fg-primary);
  border-color: var(--border-strong);
  background: transparent;
}

body.xbot-home .lang-switcher__chevron {
  width: 9px;
  height: 9px;
  opacity: 0.7;
  transition: transform var(--duration-fast) var(--ease),
              opacity var(--duration-fast) var(--ease);
}

body.xbot-home .lang-switcher--open .lang-switcher__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

body.xbot-home .lang-switcher__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: var(--space-2);
  background: rgba(15, 15, 17, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
          backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  list-style: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32),
              0 0 0 1px rgba(255, 255, 255, 0.02);
  z-index: 110;
}

body.xbot-home .lang-switcher--open .lang-switcher__dropdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: xtLangDropIn var(--duration-base) var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  body.xbot-home .lang-switcher--open .lang-switcher__dropdown {
    animation: none;
  }
}

body.xbot-home .lang-switcher__option {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

body.xbot-home .lang-switcher__option:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.xbot-home .lang-switcher__option--active {
  background: var(--accent-soft);
  pointer-events: none;
}

body.xbot-home .lang-switcher__code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-quaternary);
  line-height: 1;
  text-align: left;
}

body.xbot-home .lang-switcher__option:hover .lang-switcher__code {
  color: var(--fg-secondary);
}

body.xbot-home .lang-switcher__option--active .lang-switcher__code {
  color: var(--accent);
}

body.xbot-home .lang-switcher__name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: var(--weight-normal);
  color: var(--fg-tertiary);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

body.xbot-home .lang-switcher__option:hover .lang-switcher__name {
  color: var(--fg-primary);
}

body.xbot-home .lang-switcher__option--active .lang-switcher__name {
  color: var(--fg-primary);
}


/* ──────────────────────────────────────────────────────────────────────────
   6. Header — responsive collapse (≤992px)
   --------------------------------------------------------------------------
   На лендинге xbot-home мобильный хедер не нужен:
   — основное действие закрыто sticky CTA снизу,
   — навигация дублируется в естественном flow страницы и в футере,
   — back-to-top возвращает к началу.
   Burger-overlay (раньше тут жил ~200 строк) выпилен целиком вместе
   с .menu-opener из HTML и JS — мёртвый код больше не грузим.
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .header__menu ul {
    gap: 16px;
  }
  .header__menu ul a {
    font-size: 13px;
  }
}

@media (max-width: 1100px) {
  .header__menu ul {
    gap: 12px;
  }
  .header__menu ul a {
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  .header__block {
    flex-wrap: nowrap;
    align-items: center;
  }
}

@media (max-width: 992px) {
  body.xbot-home .header {
    display: none;
  }
}


/* ──────────────────────────────────────────────────────────────────────────
   8. Mobile container padding (≤768)
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  body.xbot-home .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

@media (max-width: 480px) {
  body.xbot-home .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}
