/*
 * site.css — global overrides for the redesigned public website.
 *
 * The first redesign batches intentionally kept most visual CSS per page for
 * visual-fidelity review. Only shared interaction fixes that must apply across
 * every redesigned page belong here.
 */

body .masthead .right .lang {
  margin: -10px -10px -10px 0;
  padding: 10px 10px;
}

body .masthead .right .lang-trigger {
  min-height: 36px;
  padding: 8px 10px;
}

body .masthead .right .lang-menu {
  top: 100%;
  right: 0;
  min-width: 176px;
  padding: 4px 0;
}

body .masthead .right .lang-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

body .masthead .right .lang-menu a {
  min-height: 42px;
  padding: 11px 14px;
}

/* Mobile masthead navigation is shared by every redesigned public page. */
body .masthead-burger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 44px;
  min-width: 44px;
  height: 44px;
  flex: 0 0 44px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: inherit;
  /* display is controlled by the @media blocks at the bottom of this file */
  display: none;
}

body .masthead-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s var(--ease-spring), opacity 0.2s;
}

body .masthead-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body .masthead-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

body .masthead-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body .mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  /* Slide-from-right transition for native-feel on mobile. RTL slides from
     the same screen-side (right) because the burger sits on the right edge
     of the masthead regardless of locale direction (see rtl.css). */
  transform: translateX(100%);
  opacity: 1;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body .mobile-nav[hidden] {
  display: none;
}

body .mobile-nav.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

body .mobile-nav-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body .mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
}

body .mobile-nav-title,
body .mobile-nav-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--ink-mute);
}

body .mobile-nav-close {
  background: none;
  border: 0;
  padding: 4px 10px;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}

body .mobile-nav-section {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

body .mobile-nav-section > a {
  padding: 16px 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

body .mobile-nav-section > a:hover { color: var(--gold); }

body .mobile-nav-section > a.active {
  color: var(--gold);
}

body .mobile-nav-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 0 8px;
}

/* Language picker is secondary to page navigation. Render it as a compact
   chip-row so it does not compete with Features / Pricing / Security / FAQ. */
body .mobile-nav-section.mobile-nav-langs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 4px;
}

body .mobile-nav-langs > a {
  flex: 0 0 auto;
  padding: 6px 12px;
  min-height: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  justify-content: center;
}

body .mobile-nav-langs > a > span:first-child { display: none; }

body .mobile-nav-langs > a .code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  letter-spacing: inherit;
}

body .mobile-nav-langs > a.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

body .mobile-nav-langs > a.active .code { color: var(--paper); }

body .mobile-nav-cta {
  margin-top: 14px;
}

body .mobile-nav-cta .btn-solid {
  width: 100%;
  justify-content: center;
  padding: 16px 24px;
  min-height: 52px;
}

body.has-mobile-nav {
  overflow: hidden;
}

@media (max-width: 720px) {
  body .masthead .right > a:not(.cta) {
    display: none;
  }

  body .masthead .right > .lang {
    display: none;
  }

  body .masthead-burger {
    display: inline-flex;
  }

  /* Masthead CTA as a real tappable button on mobile (instead of the
     desktop text-with-gold-underline treatment). Affordance + 44px hit. */
  body .masthead .right > .cta {
    background: var(--ink);
    color: var(--paper);
    border-bottom: 0;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Keep the button on one line in all locales (DE "Bot öffnen →",
       UK "Відкрити бота →", RU "Открыть бота →" all wrap otherwise). */
    white-space: nowrap;
    flex-shrink: 0;
  }

  body .masthead .right .lang {
    margin-right: -8px;
  }

  body .masthead .right .lang-menu {
    right: -6px;
    min-width: 184px;
  }
}

/* Very narrow phones (iPhone SE / Mini at 360px or below): hide the
   brand wordmark to give the CTA and burger enough room to coexist.
   The brand-mark icon stays so the logo is still present. */
@media (max-width: 400px) {
  body .masthead .brand .wordmark { display: none; }
}

@media (min-width: 721px) {
  body .mobile-nav {
    display: none !important;
  }

  body .masthead-burger {
    display: none !important;
  }
}
