/* UClean: the phone layer (loaded last). The header bar on a phone (a language dropdown, call and Telegram icons),
   the menu sheet in frosted glass, and the footer folded into sections. From 1024 up nothing here shows. */

/* ---------- desktop: the phone-only parts stay out ---------- */
.lang-dd, .nav__icon, .nav__sheetfoot, .dfoot__toggle { display: none; }

@media (max-width: 1023px) {
  /* ---------- the bar: logo | language | call | Telegram | menu ---------- */
  /* language, call and Telegram sit right beside the menu button: only the group pushes right, the button follows it */
  header.nav .nav__bar > .nav__actions { gap: 6px; margin-left: auto; }
  header.nav .nav__bar > .nav__toggle, :root:has(> body > nav.actionbar) header.nav:not(.is-open) .nav__bar > .nav__toggle { margin-left: 0; }
  header.nav .nav__bar > .nav__actions > .nav__icon { display: inline-grid; }
  header.nav .nav__bar > .nav__actions > .lang-dd { display: block; }
  .nav__icon { place-items: center; width: 40px; height: 40px; flex: none; border-radius: 999px; background: rgb(118 118 128 / .12);
    color: var(--p-ink); -webkit-tap-highlight-color: transparent; transition: background-color .2s var(--lg-ease), scale .32s var(--lg-spring); }
  .nav__icon svg { width: 18px; height: 18px; }
  .nav__icon:active { scale: .92; transition-duration: .2s, 90ms; }
  .nav__icon:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; }

  /* the language: a pill with the current code; a glass list under it */
  .lang-dd { position: relative; }
  .lang-dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px 0 14px; border-radius: 999px;
    background: rgb(118 118 128 / .12); color: var(--p-ink); font-size: 14px; font-weight: 600; letter-spacing: .03em; cursor: pointer;
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
  .lang-dd > summary::-webkit-details-marker { display: none; }
  .lang-dd > summary svg { width: 12px; height: 12px; opacity: .7; transition: rotate .35s var(--lg-spring); }
  .lang-dd[open] > summary svg { rotate: 180deg; }
  .lang-dd > summary:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; }
  .lang-dd__menu { position: absolute; z-index: 70; top: calc(100% + 10px); left: 50%; translate: -50% 0; min-width: 196px; display: grid; padding: 6px; border-radius: 22px;
    background: rgb(255 255 255 / .82); border: 1px solid rgb(255 255 255 / .8);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), 0 18px 48px -18px rgb(0 0 0 / .35), 0 2px 8px -2px rgb(0 0 0 / .08);
    transform-origin: top center; animation: m-pop .32s var(--lg-spring) both; }
  .lang-dd__menu a { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px;
    border-radius: 16px; color: var(--p-ink); text-decoration: none; font-size: 16px; -webkit-tap-highlight-color: transparent; }
  .lang-dd__menu a small { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
  .lang-dd__menu a svg { width: 16px; height: 16px; grid-column: 3; }
  .lang-dd__menu a:is(:hover, :active) { background: rgb(118 118 128 / .12); }
  .lang-dd__menu a[aria-current] { font-weight: 600; }
  .lang-dd__menu a:focus-visible { outline: 2px solid var(--p-ink); outline-offset: -2px; }

  /* over a dark photograph the closed bar's controls turn light, like the bar itself */
  header.nav[data-over="dark"]:not(.is-open) .nav__actions > .nav__icon,
  header.nav[data-over="dark"]:not(.is-open) .lang-dd > summary { background: rgb(255 255 255 / .16); color: #fff; }

  /* ---------- the open sheet: the page stays under frosted glass, the menu and its foot float on it ---------- */
  header.nav.is-open { background: transparent; }
  header.nav.is-open::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: auto;
    background: rgb(242 242 246 / .55); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
    animation: m-fade .3s var(--lg-ease) both; }
  header.nav.is-open .nav__glass { display: block; }
  header.nav.is-open .nav__toggle { background: rgb(118 118 128 / .14); border-color: transparent; }
  /* the language and the icons stay in the bar (the kit would move them to a bottom strip) */
  header.nav.is-open .nav__bar > .nav__actions { position: static; display: flex !important; padding: 0; background: none; border: 0; z-index: auto; }

  header.nav.is-open .nav__links { --foot: 148px;
    position: fixed; top: calc(var(--nav) + 20px); left: 12px; right: 12px; bottom: auto;
    max-height: calc(100svh - var(--nav) - 20px - var(--foot) - 24px - env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 0; padding: 6px 20px; overflow-y: auto; overscroll-behavior: contain;
    background: rgb(255 255 255 / .62); border: 1px solid rgb(255 255 255 / .78); border-radius: 28px;
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), 0 28px 64px -30px rgb(0 0 0 / .3);
    transform-origin: top center; animation: m-sheet .55s var(--lg-spring) both; }
  header.nav.is-open .nav__item { border-bottom: 1px solid rgb(24 24 24 / .08); animation: m-item .5s var(--lg-spring) both; }
  header.nav.is-open .nav__item:last-of-type { border-bottom: 0; }
  header.nav.is-open .nav__item:nth-of-type(1) { animation-delay: 50ms; }
  header.nav.is-open .nav__item:nth-of-type(2) { animation-delay: 90ms; }
  header.nav.is-open .nav__item:nth-of-type(3) { animation-delay: 130ms; }
  header.nav.is-open .nav__item:nth-of-type(4) { animation-delay: 170ms; }
  header.nav.is-open .nav__item:nth-of-type(5) { animation-delay: 210ms; }
  header.nav.is-open .nav__link { height: 58px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--p-ink); }
  header.nav.is-open .nav__expand { width: 44px; height: 58px; color: var(--p-ink); }
  header.nav.is-open .nav__expand svg { width: 18px; height: 18px; transition: rotate .4s var(--lg-spring); }
  header.nav.is-open .nav__item.is-expanded .nav__expand svg { transform: none; rotate: 180deg; }
  /* an opened section: its links as a quiet list, the picture card as a small tile */
  header.nav.is-open .nav__item.is-expanded .nav__menu { animation: m-fade .3s var(--lg-ease) both; padding: 0 0 14px; }
  header.nav.is-open .nav__menu .grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; }
  header.nav.is-open .nav__menu .grid > * { grid-column: auto; }
  header.nav.is-open .nav__menu .t-label { margin: 0 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  header.nav.is-open .menu-col { display: grid; gap: 2px; }
  header.nav.is-open .menu-col a { display: grid; gap: 2px; padding: 8px 0; font-size: 16px; font-weight: 500; color: var(--p-ink); text-decoration: none; }
  header.nav.is-open .menu-col a span { font-size: 13px; font-weight: 400; color: var(--muted); }
  header.nav.is-open .menu-card { padding: 12px 14px; border-radius: 18px; background: rgb(255 255 255 / .7); text-decoration: none; color: var(--p-ink); }

  /* the foot: the main button, then call and Telegram */
  header.nav.is-open .nav__sheetfoot { display: grid; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 12px; border-radius: 28px; pointer-events: auto;
    background: rgb(255 255 255 / .62); border: 1px solid rgb(255 255 255 / .78);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), 0 24px 56px -28px rgb(0 0 0 / .3);
    animation: m-rise .55s var(--lg-spring) .08s both; }
  .nav__sheetfoot .btn { width: 100%; height: 52px; font-size: 16px; }
  .nav__sheetrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px; }
  .nav__pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 48px; padding: 0 16px; border-radius: 999px;
    background: rgb(118 118 128 / .12); color: var(--p-ink); font-size: 15px; font-weight: 500; white-space: nowrap; text-decoration: none;
    font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; transition: scale .32s var(--lg-spring); }
  .nav__pill svg { width: 18px; height: 18px; flex: none; }
  .nav__pill:active { scale: .97; transition-duration: 90ms; }
}

@media (max-width: 374px) {
  /* a small phone: the bar's parts tighten so logo, language, two icons and the menu fit 288px */
  header.nav .nav__bar { gap: 4px; }
  header.nav .nav__bar > .nav__actions { gap: 4px; }
  header.nav .nav__logo img { width: 74px; height: auto; }
  .nav__icon { width: 36px; height: 36px; }
  .lang-dd > summary { height: 36px; padding: 0 8px 0 11px; }
  /* Telegram as its icon alone, so the phone number keeps its line */
  .nav__sheetrow .nav__pill:last-child { padding: 0 14px; font-size: 0; gap: 0; }
}

/* ---------- the footer on a phone: the three link columns fold into sections ---------- */
@media (max-width: 639px) {
  .dfoot__lead h2 { font-size: clamp(30px, 8.6vw, 36px); }
  .dfoot__phone { margin-top: var(--s-2); font-size: 24px; }
  .mo-js .dfoot__cols { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid rgb(24 24 24 / .1); }
  .mo-js .dfoot__sec { border-bottom: 1px solid rgb(24 24 24 / .1); }
  .mo-js .dfoot__h { margin: 0; }
  .mo-js .dfoot__ht { display: none; }
  .mo-js .dfoot__toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px;
    font-size: 17px; font-weight: 500; color: var(--p-ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mo-js .dfoot__toggle:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; border-radius: 8px; }
  /* a plus that turns into a minus */
  .dfoot__toggle i { position: relative; width: 14px; height: 14px; flex: none; }
  .dfoot__toggle i::before, .dfoot__toggle i::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: currentColor;
    transition: rotate .4s var(--lg-spring), opacity .3s var(--lg-ease); }
  .dfoot__toggle i::after { rotate: 90deg; }
  .dfoot__sec.is-open .dfoot__toggle i::after { rotate: 0deg; opacity: 0; }
  .mo-js .dfoot__sec > ul { display: none; padding: 0 0 12px; }
  .mo-js .dfoot__sec.is-open > ul { display: grid; animation: m-fade .3s var(--lg-ease) both; }
  /* tighter on a phone: the parts closer, the legal line in one wrapped row of small words */
  .mo-js .dfoot__grid { gap: 28px; }
  .dfoot__lead { gap: var(--s-2); }
  .dfoot__legal { margin-top: var(--s-5); padding-top: var(--s-4); display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
  .dfoot__legal :is(a, span) { min-height: 32px; display: inline-flex; align-items: center; }
}

@keyframes m-fade { from { opacity: 0; } }
@keyframes m-pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes m-sheet { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes m-item { from { opacity: 0; transform: translateY(8px); } }
@keyframes m-rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- the phone sheet: a section's whole row opens it; its first line leads to the section's page ---------- */
.menu-all { display: none; }
@media (max-width: 1023px) {
  header.nav.is-open .nav__item:has(.nav__menu) { cursor: pointer; }
  header.nav.is-open .nav__item:has(.nav__menu) > .nav__link { -webkit-tap-highlight-color: transparent; }
  header.nav.is-open .nav__item:has(.nav__menu) > .nav__link:active { opacity: .6; }
  header.nav.is-open .nav__menu .menu-all { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 48px; padding: 0 16px; border-radius: 16px; background: var(--p-ink); color: #fff; font-size: 16px; font-weight: 500;
    text-decoration: none; -webkit-tap-highlight-color: transparent; transition: scale .32s var(--lg-spring); }
  header.nav.is-open .nav__menu .menu-all svg { width: 16px; height: 16px; flex: none; }
  header.nav.is-open .nav__menu .menu-all:active { scale: .98; transition-duration: 90ms; }
  header.nav.is-open .nav__menu .menu-all:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; }
}
