/* Shared language controls. The existing English typeface and palette stay intact.
   Manrope supplies Cyrillic glyphs that Plus Jakarta Sans does not contain. */
@font-face {
  font-family: 'Manrope Cyrillic';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/manrope-cyrillic-variable.ttf') format('truetype');
  unicode-range: U+0400-052F, U+2DE0-2DFF, U+A640-A69F;
}
html:lang(ru) {
  --font: 'Plus Jakarta Sans', 'Manrope Cyrillic', sans-serif;
}
html:lang(ru) body { font-family: var(--font); }
html:lang(ru) svg text { font-family: var(--font); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border, #DADAD7);
  border-radius: var(--r-pill, 100px);
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .01em;
}
.lang-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 40px;
  border-radius: inherit;
  font-weight: 600;
  color: var(--text-mid, #5E625B);
  text-decoration: none;
  transition: color .16s, background-color .16s;
}
.lang-switch a:hover { color: var(--text, #1D201C); background: var(--bg, #F3F3F1); }
.lang-switch a[aria-current] {
  color: var(--text-inv, #FAFAF9);
  background: var(--text, #1D201C);
}
.lang-switch a:focus-visible { outline: 2px solid var(--accent, #2D641E); outline-offset: 3px; }
.nav { gap: 12px; }
.nav-logo { flex: none; }
.nav-links { position: static; transform: none; margin-inline: auto; }
.nav .cmdk-hintbtn { margin: 0; }
.nav:focus-within { transform: translateY(0); }
.nav .nav-cta { padding-inline: 18px; }
.flow-language { position: fixed; top: 12px; right: 16px; z-index: 100; }
.flow-language .lang-switch { background: var(--background-canvas, #FAFAF9); }
body:has(.notfound) .nav { --glass-nav: rgba(245,248,241,.94); }

/* Copy length is allowed to change. No fixed text heights or clipped headings. */
html:lang(ru) .hero-title { font-size: clamp(42px, 5.7vw, 82px); line-height: 1.06; }
html:lang(ru) .hero-domain { font-size: clamp(24px, 3vw, 40px); line-height: 1.2; }
html:lang(ru) .hero-inner { max-width: min(74%, 900px); }
html:lang(ru) .case-title { overflow-wrap: normal; hyphens: auto; }
html:lang(ru) .case-toc { max-width: 188px; }
html:lang(ru) .case-toc a { line-height: 1.35; }
html:lang(ru) .cta-email::after { content: 'Скопировано ✓'; white-space: nowrap; }
html:lang(ru) .work-stats, html:lang(ru) .case-meta-row { overflow-wrap: anywhere; }
html:lang(ru) .post-title { text-wrap: balance; }

@media (max-width: 1100px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    background: var(--bg-page, #FAFAF9);
    border: 1px solid var(--border, #DADAD7);
    border-radius: 16px;
    max-height: calc(100svh - 112px);
    overflow-y: auto;
  }
  .nav-links.nav-links--open { display: flex; }
  .nav-links a { text-align: center; padding: 16px 12px; font-size: 18px; }
  .nav .nav-cta { display: none; }
  .nav .nav-hamburger { display: flex; }
  .nav .lang-switch { margin-left: auto; }
  html:lang(ru) .hero-inner { max-width: 90%; }
}
@media (max-width: 768px) {
  .nav { gap: 6px; padding-inline: 12px; }
  .lang-switch { gap: 0; padding: 0; }
  .lang-switch a { width: 36px; min-height: 44px; }
  .nav .cmdk-hintbtn { min-width: 40px; }
  .nav-hamburger { width: 40px; }
  html:lang(ru) .hero-inner { max-width: 100%; }
  html:lang(ru) .hero-title { font-size: clamp(38px, 9.5vw, 64px); }
  html:lang(ru) .hero-domain { font-size: 24px; }
  html:lang(ru) .hero-available { align-items: flex-start; line-height: 1.5; }
  html:lang(ru) .hero-available .dot-pulse { margin-top: .45em; flex: none; }
  html:lang(ru) .hero-ctas { flex-wrap: wrap; }
  html:lang(ru) .hero-ctas .btn { padding-inline: 18px; }
  html:lang(ru) .case-hero h1 { overflow-wrap: normal; hyphens: auto; }
  .flow-language { right: 12px; }
}
@media (max-width: 380px) {
  .nav { gap: 4px; padding-inline: 8px; }
  .nav-logo { font-size: 14px; }
  html:lang(ru) .case-hero h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-switch a { transition: none; }
}
@media (forced-colors: active) {
  .lang-switch a[aria-current] { outline: 2px solid Highlight; }
}
