/* Mobile navigation: full at the top, compact while browsing the page. */
@media (max-width:900px) {
  html body #r-header {
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    width:100%!important;box-sizing:border-box!important;
    padding-top:calc(10px + env(safe-area-inset-top, 0px))!important;
    backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important;
    pointer-events:none!important;
  }
  html body #r-header .nav-shell {
    pointer-events:auto!important;
    margin-left:auto!important;margin-right:0!important;
    transition:width .36s ease, background-color .3s ease, box-shadow .3s ease!important;
  }
  html body #r-header .brand > span {
    display:inline-block;max-width:130px;opacity:1;overflow:hidden;
    transition:max-width .3s ease, opacity .2s ease!important;
  }
  html body #r-header .brand {transition:gap .3s ease!important;}
  html body #r-header .lang {
    max-width:110px;opacity:1;overflow:hidden;
    transition:max-width .3s ease, opacity .2s ease!important;
  }
  html body #r-header.mobile-compact .nav-shell {
    width:100%!important;
  }
  html body #r-header.mobile-compact .brand {gap:0!important;flex:0 0 auto!important;}
  html body #r-header.mobile-compact .brand > span,
  html body #r-header.mobile-compact .lang {
    max-width:0!important;opacity:0!important;pointer-events:none!important;
  }
  html body #r-header.mobile-compact .lang {margin:0!important;}
  html body #r-header.mobile-compact .r-mark {filter:brightness(0) invert(1)!important;}
  html body #r-header.mobile-compact {
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
  html body #r-header.mobile-compact .menu-btn {
    margin-left:auto!important;
    background:transparent!important;
    backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important;
    border-radius:14px!important;
  }
  html body #r-header.mobile-compact .main-nav {
    left:auto!important;right:0!important;width:min(280px,calc(100vw - 24px))!important;
  }
}
@media (min-width:901px) { .mobile-header-space {display:none!important;} }
@media (prefers-reduced-motion:reduce) {
  html body #r-header .nav-shell,html body #r-header .brand,
  html body #r-header .brand > span,html body #r-header .lang {transition:none!important;}
}

@media (max-width:900px) {
  html body #r-header.mobile-compact .main-nav .lang {
    display:flex!important;max-width:none!important;opacity:1!important;
    pointer-events:auto!important;overflow:visible!important;
    justify-content:center!important;gap:8px!important;
    margin:6px 4px 0!important;padding:10px 0 4px!important;
    border-top:1px solid rgba(255,255,255,.15)!important;
    align-self:stretch!important;
  }
  html body #r-header.mobile-compact .main-nav .lang button {
    min-width:44px!important;min-height:44px!important;
  }
}
/* Fade composited layers instead of resizing/reparenting flex children. */
html body #r-header .menu-language {display:none!important;}
@media (max-width:900px) {
  html body #r-header,
  html body #r-header.mobile-compact {
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
  html body #r-header::before {
    content:""!important;display:block!important;position:absolute!important;
    inset:0!important;z-index:-1!important;pointer-events:none!important;
    background:transparent!important;
    backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important;
    opacity:1!important;transition:opacity .3s ease!important;
  }
  html body #r-header.mobile-compact::before {opacity:0!important;}
  html body #r-header .brand,
  html body #r-header.mobile-compact .brand {gap:10px!important;}
  html body #r-header .brand > span,
  html body #r-header.mobile-compact .brand > span {
    max-width:130px!important;
    transition:opacity .3s ease,transform .3s ease!important;
    transform:translateY(0);
  }
  html body #r-header.mobile-compact .brand > span {transform:translateY(-6px);}
  html body #r-header .nav-shell > .lang,
  html body #r-header.mobile-compact .nav-shell > .lang {
    max-width:110px!important;margin-left:auto!important;
    transition:opacity .3s ease,transform .3s ease!important;
    transform:translateY(0);
  }
  html body #r-header.mobile-compact .nav-shell > .lang {transform:translateY(-6px);}
  html body #r-header .menu-btn,
  html body #r-header.mobile-compact .menu-btn {margin-left:0!important;}
  html body #r-header.mobile-compact .main-nav .menu-language {display:flex!important;}
  html body #r-header .r-mark {transition:filter .3s ease!important;}
}
@media (prefers-reduced-motion:reduce) {
  html body #r-header::before,html body #r-header .brand > span,
  html body #r-header .nav-shell > .lang,html body #r-header .r-mark {transition:none!important;}
}

/* Compact state: logo and hamburger share one glass tab on the right. */
@media (max-width:900px) {
  html body #r-header .nav-shell {
    transition:width .34s ease!important;
  }
  html body #r-header.mobile-compact .nav-shell {
    width:132px!important;
    backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important;
    background:transparent!important;
    gap:10px!important;
  }
  html body #r-header .brand > span,
  html body #r-header .nav-shell > .lang {
    transition:max-width .34s ease,opacity .22s ease,transform .3s ease!important;
  }
  html body #r-header.mobile-compact .brand {gap:0!important;}
  html body #r-header.mobile-compact .brand > span {
    max-width:0!important;
  }
  html body #r-header.mobile-compact .nav-shell > .lang {
    max-width:0!important;flex:0 0 0px!important;min-width:0!important;
    width:0!important;margin:0!important;gap:0!important;
  }
  html body #r-header.mobile-compact .menu-btn {
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
    margin-left:auto!important;
  }
}
@media (prefers-reduced-motion:reduce) {
  html body #r-header .nav-shell,html body #r-header .brand > span,
  html body #r-header .nav-shell > .lang {transition:none!important;}
}
